示例#1
0
        private void OnGUI()
        {
            bool open = GUILayout.Button("Open UI");

            if (open)
            {
                UI_PowerTerminal.Open(null);
            }
        }
示例#2
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            foreach (var thing in base.GetGizmos())
            {
                yield return(thing);
            }

            var openUI = new Command_Action();

            openUI.defaultLabel = "PC.OpenTerminalUI".Translate();
            openUI.defaultDesc  = "PC.OpenTerminalUIDesc".Translate();
            openUI.action       = () =>
            {
                // Clicked! Open the UI. This will automatically open a new window or focus an existing one.
                UI_PowerTerminal.Open(this);
            };

            yield return(openUI);
        }