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); }
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); } }
override protected void Awake() { base.Awake(); m_UIComponentManager = GetComponent <UIComponentManager>(); App.Switchboard.ToolChanged += OnToolChanged; App.Switchboard.SelectionChanged += OnSelectionChanged; }
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; }
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; }
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); }
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(); }
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>(); }