Ejemplo n.º 1
0
        public static void OpenAsWindow()
        {
            var window = EditorWindow.GetWindow <SwitchesWindow>();

            window.Show();
            window.editor = Editor.CreateEditor(IsoSwitchesManager.getInstance().getIsoSwitches());
        }
Ejemplo n.º 2
0
        private void Init(Rect buttonRect, IsoSwitches switches)
        {
            buttonRect.position = GUIUtility.GUIToScreenPoint(buttonRect.position);
            float   y          = 305f;
            Vector2 windowSize = new Vector2(300f, y);

            base.ShowAsDropDown(buttonRect, windowSize);
            editor = Editor.CreateEditor(switches == null ? IsoSwitchesManager.getInstance().getIsoSwitches() : switches);
        }
Ejemplo n.º 3
0
        public override void ReceiveEvent(IGameEvent ev)
        {
            if (ev.Name == "ChangeSwitch")
            {
                object p       = ev.getParameter("value");
                string iswitch = (string)ev.getParameter("switch");

                // When there is a sequence we try to save it as local var but if not, we save it as global
                if (Sequence.current != null &&
                    (Sequence.current.ContainsVariable(iswitch) || !IsoSwitchesManager.getInstance().getIsoSwitches().containsSwitch(iswitch)))
                {
                    // Save as local
                    Sequence.current.SetVariable(iswitch, p);
                }
                else
                {
                    // Save as global
                    IsoSwitchesManager.getInstance().getIsoSwitches().getSwitch(iswitch).State = p;
                }
            }
        }
Ejemplo n.º 4
0
        void Awake()
        {
            if (awakened)
            {
                return;
            }
            awakened = true;

            if (Game.main != this)
            {
                if (shouldReplacePreviousGame)
                {
                    GameObject.DestroyImmediate(Game.main.gameObject);
                }
                else
                {
                    if (Game.main != null)
                    {
                        GameObject.DestroyImmediate(this.gameObject);
                        return;
                    }
                }
            }

            Game.m = this;
            if (Application.isPlaying)
            {
                GameObject.DontDestroyOnLoad(this.gameObject);
            }

            // Event Queue
            events = new Queue <IGameEvent>();

            IsoSwitchesManager.getInstance().getIsoSwitches();

            // Event Managers Creation
            eventManagers = new List <EventManager> ();
        }