Exemple #1
0
        private IEnumerator Action4()
        {
            SystemManager.GetInstance().sceneTouchEnabled = false;

            UserManager.GetInstance().OpenFunction(FunctionType.Weapon);
            UserManager.GetInstance().OpenFunction(FunctionType.Dungeon);

            FunctionData functionData = UserManager.GetInstance().GetFunction(FunctionType.Dungeon);

            EventBox.Send(CustomEvent.HOME_SHOW_FUNCTION, functionData);

            EventBox.EventBoxHandler OnWindowOpen = null;
            OnWindowOpen = delegate(object data)
            {
                if (data == typeof(DungeonSelectWindow))
                {
                    EventBox.Remove(CustomEvent.WINDOW_OPEN, OnWindowOpen);

                    SystemManager.GetInstance().sceneTouchEnabled = true;
                    GuideManager.GetInstance().FinishGuide(GuideScriptID.G01);

                    task.Stop();
                }
            };

            EventBox.Add(CustomEvent.WINDOW_OPEN, OnWindowOpen);

            yield return(new WaitForSeconds(1.0f));

            GirlEntity2D girl = GameObject.FindGameObjectWithTag(TagDefines.TAG_GIRL).GetComponent <GirlEntity2D>();

            girl.weaponLauncher.Unload();

            girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Amaze.ToString().ToLower());
        }
Exemple #2
0
        private IEnumerator Action3()
        {
            yield return(new WaitForSeconds(1.0f));

            SystemManager.GetInstance().sceneTouchEnabled = true;

            EventBox.EventBoxHandler OnWindowClose = null;
            OnWindowClose = delegate(object data)
            {
                if (data == typeof(WeaponWindow))
                {
                    WeaponData weaponData = UserManager.GetInstance().user.GetActiveWeapon();

                    if (weaponData != null)
                    {
                        EventBox.Remove(CustomEvent.WINDOW_CLOSE, OnWindowClose);

                        task.Stop();

                        task = new Task(Action4());
                    }
                }
            };

            EventBox.Add(CustomEvent.WINDOW_CLOSE, OnWindowClose);
        }
        public void Add(string type, EventBox.EventBoxHandler handler)
        {
            KeyValuePair <string, EventBox.EventBoxHandler> item = new KeyValuePair <string, EventBox.EventBoxHandler>(type, handler);

            if (handlers.Contains(item) == false)
            {
                handlers.Add(item);
            }
        }
        public void Remove(string type, EventBox.EventBoxHandler handler)
        {
            KeyValuePair <string, EventBox.EventBoxHandler> item = new KeyValuePair <string, EventBox.EventBoxHandler>(type, handler);

            handlers.Remove(item);
        }