Hey everybody,
I undertook the great tutorial Chris put up about how to set a resolution setting into your options menu, but he also mentioned that the 'same method' could be used to create a full screen toggle.
I'm guessing that he means you have to use a script that does something along the lines of this:
But I'm not sure exactly what. Has anyone made an Action that does this? I know how to set it up in the Menu and all that, just unsure of the script.
Thanks!
Comments
Where do I find the tutorial mentioned above? EDIT: Found it
Trying to follow the tutorial but getting tripped up on script, i have this so far:
Getting this error:
Assets/TMOWM/Scripts/CustomActions/ActionApplyResolution.cs(45,2): error CS1513: } expected
Add a "}" character to the end.
added an extra one and now get this error:
Assets/AdventureCreator/Scripts/Actions/ActionApplyResolution.cs(25,26): error CS0115: 'ActionApplyResolution.Title': no suitable method found to override
What is your AC version?
v1.74.2
so i get no error now but it is not showing up in my custom actions
What did you change to remove the error?
Share the script - properly formatted - as well as its filename and location.
The path is here, with my other custom action scripts that do show up in actions menu:
Assets/Sleepytime Village/Scripts/CustomActions
I am using v1.74
Does it appear in the Actions Manager?
It should be listed in the "Engine" category - not "Custom".
ah yes it does... my bad!
So, it seems to be almost working now, however, should there be choices available when clicking on the screen resolution element in play? there is no resolutions to cycle through? See screenshots:
https://www.dropbox.com/sh/6hwh6w4ipju5ezl/AAALQVKPqPsKoDCfnuomSpA8a?dl=0
The resolutions are set by the tutorial's SetupOptionsMenu script - not by the Action. You can place Debug.Log statements inside the GenerateResolutionCycleOptions function to check what's running.
Though, the behaviour will vary between builds and Editor. If logs show in the Editor, what is the behaviour in a build?
ok thanks!
In regards to this code:
MenuCycle resolutionCycle = PlayerMenus.GetElementWithName ("Options1", "ScreenResolution") as AC.MenuCycle;
How would I modify this code if I wanted the script to affect 2 Options menu one called Options and one called Options1
Thanks!
Plus, I am still only presented with one option in build, see screenshot:
https://www.dropbox.com/s/bhuw7kf6wnhxp81/screenResOptionsInBuild.png?dl=0
The cycle element populates itself from Unity's Screen.resolutions array. What options are presented will be based on your platform, hardware, and project settings - AC is not involved in what exact options are presented.
ok thanks, any reason why it has the (0) at the end of the screen resolution in play?
That ought to represent the refresh rate. You can remove it by replacing:
with: