Author Topic: useMouse on secondary camera is overwritten by uneditable editor values  (Read 4039 times)

Disastercake

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 87
  • www.disastercake.com
    • View Profile
    • Disastercake
My scene has a couple different UI cameras in it, and I'm sending out a message to disable or enable their mouse input.  It's possible to go through each manually through script to disable mouse events by simply switching the usemouse boolean value, however if the first ui camera is destroyed then the second camera's settings won't inherent from the first.  I even tried altering the second camera while the first one is around ,but it won't change it's default values. 

It would be ideal if altering secondary cameras (while there is a first) would actually change their settings.

The following code is attached to my 2 camera game objects located on different roots.
  1. UICamera mycamera = null;
  2.  
  3. void Start ()
  4. {
  5.         mycamera = GetComponent<UICamera>();
  6.         Messenger.AddListener( Messages.SettingsChanged, ApplySettings );
  7. }
  8.  
  9. void ApplySettings()
  10. {
  11.         mycamera.useMouse = false; mycamera.useTouch = false; mycamera.useKeyboard = true; mycamera.useController = true;
  12. }
  13.  
  14.  


The scenario I have is:
  • The main menu scene has the main menu UI Root and the Game Menu UI Root.
  • The Game Menu UI Root is marked as DONOTDESTROY
  • When starting the game, the main menu UI root is destroyed on scene change since it is not permanent.
  • The Game Menu UI Root is left, but it does not retain any settings that had been passed to it, nor does it even pay attention to what the last first camera had for settings.

The most ideal outcome would be that the camera retains all of it's own settings that were made while it was secondary, and will apply those settings to the input when it becomes the first UI camera again.
« Last Edit: January 19, 2014, 02:43:29 AM by Disastercake »
Creator of Soul Saga.
http://www.disastercake.com