Exemplo n.º 1
0
        public override void onTriggerHanlde()
        {
            bool flag = GameEventTrigger.EVENT_CON == null;

            if (flag)
            {
                GameObject gameObject = new GameObject();
                GameEventTrigger.EVENT_CON = gameObject.transform;
                gameObject.name            = "currentEventListener";
            }
            bool flag2 = this.type == 1;

            if (flag2)
            {
                bool flag3 = this.paramInts.Count < 2;
                if (!flag3)
                {
                    this.targetId = this.paramInts[0];
                    this.maxNum   = this.paramInts[1];
                    MonsterMgr._inst.addEventListener(MonsterMgr.EVENT_MONSTER_REMOVED, new Action <GameEvent>(this.onMonsterRemoved));
                    base.transform.SetParent(GameEventTrigger.EVENT_CON);
                    GameEventTrigger.add(this);
                }
            }
            else
            {
                bool flag4 = this.type == 2;
                if (flag4)
                {
                    MonsterMgr._inst.addEventListener(MonsterMgr.EVENT_ROLE_BORN, new Action <GameEvent>(this.onRoleBorn));
                    base.transform.SetParent(GameEventTrigger.EVENT_CON);
                    GameEventTrigger.add(this);
                }
                else
                {
                    bool flag5 = this.type == 3;
                    if (flag5)
                    {
                        bool flag6 = this.paramFloat.Count < 1;
                        if (!flag6)
                        {
                            base.Invoke("ontimeout", this.paramFloat[0]);
                            base.transform.SetParent(GameEventTrigger.EVENT_CON);
                            GameEventTrigger.add(this);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void onMonsterRemoved(GameEvent e)
        {
            MonsterRole monsterRole = (MonsterRole)e.orgdata;
            bool        flag        = this.targetId == 0 || this.targetId == monsterRole.monsterid;

            if (flag)
            {
                this.curNum++;
                bool flag2 = this.curNum >= this.maxNum;
                if (flag2)
                {
                    this.doit();
                    GameEventTrigger.remove(this);
                }
            }
        }
 public static void remove(GameEventTrigger listener)
 {
     listener.dispose();
     dListeners.Remove(listener);
 }
 public static void add(GameEventTrigger listener)
 {
     dListeners[listener] = 1;
 }
Exemplo n.º 5
0
        public void REV_RES_LIST_OK()
        {
            if (GameRoomMgr.getInstance().curRoom != null)
            {
                GameRoomMgr.getInstance().curRoom.clear();
            }
            //MediaClient.instance.clearMusic();
            NpcMgr.instance.clear();
            MonsterMgr._inst.clear();
            OtherPlayerMgr._inst.clear();
            if (tragethead.instance != null)
            {
                tragethead.instance.resetTragethead();
            }


            //LoaderBehavior.ms_HasAllLoaded = false;

            //if (m_map == null)
            //{
            //    setGraphImpl(g_mgr.createGraphMap(m_nCurMapSceneSettingID.ToString()));
            //    //_map = m_mgr.createGraphMap( mapid ) as IGRMap;
            //}
            //  m_map.loadConfig(m_CurLocalConf);

            //  Application.LoadLevelAdditive("p" + 101);


            if (m_curAssetBundleScene != null)
            {
                m_curAssetBundleScene.Unload(false);
                m_curAssetBundleScene = null;
            }


            //Application.LoadLevel(curSvrConf["name"]._str);


            //URLReqImpl urlreq_localver = new URLReqImpl();
            //urlreq_localver.dataFormat = "assetbundle";
            //urlreq_localver.url = "scene/" + curLocalConf["Mesh"]._arr[0]["asset"]._arr[0]["file"] + ".unity";
            //urlreq_localver.load((IURLReq local_r, object local_ret) =>
            //{
            //    //debug.Log("加载A3地图成功:" + local_r.url);
            //    //m_curAssetBundleScene = local_ret as AssetBundle;
            //    //if (initedDontDestory == false)
            //    //{
            //    //    UnityEngine.Object[] initsObjects = GameObject.FindObjectsOfType(typeof(GameObject));
            //    //    foreach (UnityEngine.Object go in initsObjects)
            //    //    {
            //    //        Application.DontDestroyOnLoad(go);
            //    //    }
            //    //    initedDontDestory = true;
            //    //}

            //    //Application.LoadLevel(m_nCurMapID.ToString());
            //},
            //  null,
            //  (IURLReq local_r, string err) =>
            //  {
            //    debug.Log("加载A3地图失败:" + err);
            //MediaClient.instance.clearMusic();
            DontDestroyBaseGameObject();
            GameEventTrigger.clear();
            debug.Log("开始加载地图");

            SceneFXMgr.StartLoadScene(curSvrConf["name"]._str);

            //SceneManager.LoadScene(curSvrConf["name"]._str);
            //GAMEAPI.Unload_Asset(curSvrConf["name"] + ".assetbundle");

            //if (debug.instance != null)
            //{
            //    debug.instance.LoadScene(curSvrConf["name"]._str);
            //}

            if (BaseRoomItem.instance != null)
            {
                BaseRoomItem.instance.clear();
            }

            if (a3_RollItem.single != null)
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_ROLL_ITEM);
            }

            //   });
            //if (login.instance == null)
            //    refreshLightMap();

            //m_nCurMapSceneSettingID = 0;
            //m_CurLocalConf = null;
        }
Exemplo n.º 6
0
 private void onRoleBorn(GameEvent e)
 {
     this.doit();
     GameEventTrigger.remove(this);
 }
Exemplo n.º 7
0
 private void ontimeout()
 {
     base.CancelInvoke("ontimeout");
     this.doit();
     GameEventTrigger.remove(this);
 }