/// <summary> /// Assume referenced panel has been built at this stage /// </summary> protected new void Start() { base.Start(); // There's probably a better way to do this UIToolboxContainer toolboxContainer = GameObject.FindObjectOfType <UIToolboxContainer>(); Assert.IsNotNull(toolboxContainer); string referencedName = UIToolboxPanel.NAME_PREFIX + this.SimpleName; this.ReferencedPanel = toolboxContainer.Panels.Find(p => p.name == referencedName); Assert.IsNotNull(this.ReferencedPanel); }
/// <summary> /// Assign behaviour in Unity inspector because it's easier /// </summary> public void ClickBackButton() { UIToolboxContainer toolbox = GameObject.FindObjectOfType <UIToolboxContainer>(); toolbox.CurrentPanel = toolbox.MainPanel; }