示例#1
0
        public BasePanel GetPanelForPopUps()
        {
            // If m_PopUpPanel hasn't been set, recursively walk up and look for a panel.
            if (m_PopUpPanel == null)
            {
                UIComponentManager manager = this;
                while (manager != null)
                {
                    m_PopUpPanel = GetPanelFromManager(manager);
                    if (m_PopUpPanel == null)
                    {
                        manager = manager.ParentManager;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (m_PopUpPanel == null)
            {
                Debug.LogWarning("UIComponentManager requested panel for popups and nothing was found.");
            }
            return(m_PopUpPanel);
        }
示例#2
0
        virtual public void Init(GameObject rParent, string sText)
        {
            if (m_CurrentState == State.Uninitialized)
            {
                m_WindowCollider = GetComponent <BoxCollider>();
                if (m_WindowText && sText != null)
                {
                    m_WindowText.text = sText;
                }

                CreateAutoPlaceButtons();
                m_BaseScale = transform.localScale;
            }

            Debug.Assert(rParent != null, "Why is the popup's parent null?");
            m_ParentPanel = rParent.GetComponent <BasePanel>();

            m_UIComponentManager = GetComponent <UIComponentManager>();
            m_UIComponentManager.SetColor(Color.white);

            m_CurrentState    = State.Opening;
            m_TransitionValue = -m_OpenDelay;
            UpdateOpening();

            if (m_AudioOnOpen)
            {
                AudioManager.m_Instance.PlayPopUpSound(transform.position);
            }
        }
示例#3
0
 override protected void Awake()
 {
     base.Awake();
     m_UIComponentManager              = GetComponent <UIComponentManager>();
     App.Switchboard.ToolChanged      += OnToolChanged;
     App.Switchboard.SelectionChanged += OnSelectionChanged;
 }
示例#4
0
 override protected void Awake()
 {
     base.Awake();
     m_UIComponentManager       = GetComponent <UIComponentManager>();
     WarningVisible             = false;
     m_DynamicUvScale           = Vector2.one;
     m_DynamicUvOffset          = Vector2.zero;
     m_DynamicUvTransitionValue = 0.0f;
 }
  override protected void Awake() {
    base.Awake();

    m_UIComponentManager = GetComponent<UIComponentManager>();

    for (int i = 0; i < m_Buttons.Length; ++i) {
      m_Buttons[i].SetStorageIndex(i);
    }
    m_TrashButtonLocalZ = m_TrashButton.transform.localPosition.z;
  }
示例#6
0
 override protected void Awake()
 {
     base.Awake();
     m_UIComponentManager = GetComponent <UIComponentManager>();
     App.Switchboard.CameraPathCreated        += RefreshButtonsVisibility;
     App.Switchboard.CameraPathDeleted        += RefreshButtonsVisibility;
     App.Switchboard.AllWidgetsDestroyed      += RefreshButtonsVisibility;
     App.Switchboard.CameraPathKnotChanged    += RefreshButtonsVisibility;
     App.Switchboard.CurrentCameraPathChanged += RefreshButtonsVisibility;
     App.Switchboard.ToolChanged           += RefreshButtonsVisibility;
     App.Switchboard.VideoRecordingStopped += RefreshButtonsVisibility;
 }
示例#7
0
        BasePanel GetPanelFromManager(UIComponentManager manager)
        {
            BasePanel panel = manager.GetComponent <BasePanel>();

            if (panel == null)
            {
                PopUpWindow popup = manager.GetComponent <PopUpWindow>();
                if (popup != null)
                {
                    return(popup.GetParentPanel());
                }
            }
            return(panel);
        }
示例#8
0
    public void RegisterComponent() {
      // If we're already registered, clean that up.
      UnregisterComponent();

      // Register with our manager.
      if (transform.parent != null) {
        m_Manager = transform.parent.GetComponentInParent<UIComponentManager>();
        if (m_Manager != null) {
          m_Manager.RegisterUIComponent(this);
        }
      }

      OnRegisterComponent();
    }
示例#9
0
        override protected void Awake()
        {
            base.Awake();

            m_UIComponentManager = GetComponent <UIComponentManager>();

            BrushCatalog.m_Instance.BrushCatalogChanged  += OnBrushCatalogChanged;
            BrushController.m_Instance.BrushChanged      += OnBrushChanged;
            BrushController.m_Instance.BrushSetToDefault += OnBrushSetToDefault;
            BrushController.m_Instance.StrokeSelected    += OnStrokeSelected;
            App.Switchboard.AudioReactiveStateChanged    += OnAudioReactiveStateChanged;

            // Cache brush buttons.
            m_BrushButtons = GetComponentsInChildren <BrushTypeButton>();
        }