Esempio n. 1
0
        public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            if ((trigger != null) && (shenFu != null))
            {
                ShenFuObjects objects = new ShenFuObjects();
                if (this._shenFuTriggerPool.ContainsKey(trigger.ID))
                {
                    this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects);
                }
                else
                {
                    ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);
                    if (dataByKey == null)
                    {
                        return;
                    }
                    trigger.Radius = (int)dataByKey.dwGetRadius;
                    string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath);
                    objects.ShenFu = MonoSingleton <SceneMgr> .instance.InstantiateLOD(prefabName, false, SceneObjType.ActionRes, trigger.gameObject.transform.position);

                    this._shenFuTriggerPool.Add(trigger.ID, objects);
                }
                if (objects.ShenFu != null)
                {
                    objects.ShenFu.CustomSetActive(true);
                }
            }
        }
Esempio n. 2
0
        public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            if (trigger == null || shenFu == null)
            {
                return;
            }
            ShenFuObjects shenFuObjects = default(ShenFuObjects);
            ShenFuInfo    dataByKey     = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey == null)
            {
                return;
            }
            trigger.Radius = (int)dataByKey.dwGetRadius;
            string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath);

            shenFuObjects.ShenFu = MonoSingleton <SceneMgr> .get_instance().InstantiateLOD(prefabName, false, SceneObjType.ActionRes, trigger.gameObject.transform.position);

            this._shenFuTriggerPool.Add(trigger.ID, shenFuObjects);
            if (FogOfWar.enable)
            {
                COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp;

                GameFowCollector.SetObjVisibleByFow(shenFuObjects.ShenFu, Singleton <GameFowManager> .get_instance(), playerCamp);
            }
        }
Esempio n. 3
0
 public void ClearAll()
 {
     Dictionary <int, ShenFuObjects> .Enumerator enumerator = this._shenFuTriggerPool.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <int, ShenFuObjects> current = enumerator.get_Current();
         ShenFuObjects value = current.get_Value();
         if (value.ShenFu != null)
         {
             Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(value.ShenFu);
         }
     }
     this._shenFuTriggerPool.Clear();
     while (this.m_charmList.get_Count() > 0)
     {
         this.m_charmList.get_Item(0).handle.DoClearing();
     }
     for (int i = 0; i < this._shenFuMonsterPool.get_Count(); i++)
     {
         if (this._shenFuMonsterPool.get_Item(i).ShenFu != null)
         {
             Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this._shenFuMonsterPool.get_Item(i).ShenFu);
         }
     }
     this._shenFuMonsterPool.Clear();
 }
Esempio n. 4
0
        public void UpdateLogic(int inDelta)
        {
            if (this.m_charmList.get_Count() > 0)
            {
                int count = this.m_charmList.get_Count();
                for (int i = count - 1; i >= 0; i--)
                {
                    this.m_charmList.get_Item(i).handle.UpdateLogic(inDelta);
                }
            }
            int j = 0;

            while (j < this._shenFuMonsterPool.get_Count())
            {
                ShenFuObjects shenFuObjects = this._shenFuMonsterPool.get_Item(j);
                shenFuObjects.PickTick -= inDelta;
                if (shenFuObjects.PickTick > 0)
                {
                    this._shenFuMonsterPool.set_Item(j, shenFuObjects);
                    j++;
                }
                else
                {
                    uint num = shenFuObjects.PickUpRange * shenFuObjects.PickUpRange;
                    List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .GetInstance().HeroActors;

                    int  count2 = heroActors.get_Count();
                    bool flag   = false;
                    for (int k = 0; k < count2; k++)
                    {
                        VInt3 location = heroActors.get_Item(k).handle.location;
                        if ((location - (VInt3)shenFuObjects.ShenFu.transform.position).sqrMagnitude <= num)
                        {
                            this.OnShenFuEffect(heroActors.get_Item(k), shenFuObjects.ShenFuId);
                            flag = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        if (shenFuObjects.ShenFu != null)
                        {
                            Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(shenFuObjects.ShenFu);
                        }
                        this._shenFuMonsterPool.RemoveAt(j);
                    }
                    else
                    {
                        j++;
                    }
                }
            }
        }
Esempio n. 5
0
        public void CreateShenFuOnMonsterDead(PoolObjHandle <ActorRoot> monster, uint shenFuId)
        {
            if (!monster)
            {
                return;
            }
            ShenFuObjects shenFuObjects = default(ShenFuObjects);

            if (this.CreateShenFu(shenFuId, (Vector3)monster.handle.location, ref shenFuObjects, 2000))
            {
                this._shenFuMonsterPool.Add(shenFuObjects);
            }
        }
Esempio n. 6
0
 public void ClearAll()
 {
     Dictionary <int, ShenFuObjects> .Enumerator enumerator = this._shenFuTriggerPool.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <int, ShenFuObjects> current = enumerator.Current;
         ShenFuObjects objects = current.Value;
         if (objects.ShenFu != null)
         {
             Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(objects.ShenFu);
         }
     }
     this._shenFuTriggerPool.Clear();
     while (this.m_charmList.Count > 0)
     {
         PoolObjHandle <CTailsman> handle = this.m_charmList[0];
         handle.handle.DoClearing();
     }
 }
Esempio n. 7
0
        public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            if (trigger == null || shenFu == null)
            {
                return;
            }
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey == null)
            {
                return;
            }
            trigger.Radius = (int)dataByKey.dwGetRadius;
            ShenFuObjects shenFuObjects = default(ShenFuObjects);

            if (this.CreateShenFu(shenFuId, trigger.gameObject.transform.position, ref shenFuObjects, 0))
            {
                this._shenFuTriggerPool.Add(trigger.ID, shenFuObjects);
            }
        }
Esempio n. 8
0
        public bool CreateShenFu(uint shenFuId, Vector3 createPosition, ref ShenFuObjects shenFuObj, int pickTick = 0)
        {
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey == null)
            {
                return(false);
            }
            string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath);

            shenFuObj.ShenFuId = shenFuId;
            shenFuObj.ShenFu   = MonoSingleton <SceneMgr> .instance.InstantiateLOD(prefabName, false, SceneObjType.ActionRes, createPosition);

            shenFuObj.PickUpRange = dataByKey.dwGetRadius;
            shenFuObj.PickTick    = pickTick;
            if (FogOfWar.enable)
            {
                COM_PLAYERCAMP horizonCamp = Singleton <WatchController> .instance.HorizonCamp;
                GameFowCollector.SetObjVisibleByFow(new PoolObjHandle <ActorRoot>(null), shenFuObj.ShenFu, Singleton <GameFowManager> .instance, horizonCamp);
            }
            return(true);
        }