Beispiel #1
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);
            }
        }
Beispiel #2
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);
                }
            }
        }
Beispiel #3
0
        public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            ShenFuObjects shenFuObjects;

            if (this._shenFuTriggerPool.TryGetValue(trigger.ID, ref shenFuObjects))
            {
                if (shenFuObjects.ShenFu != null)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(shenFuObjects.ShenFu);
                }
                this._shenFuTriggerPool.Remove(trigger.ID);
            }
            this.OnShenFuEffect(actor, shenFuId);
        }
Beispiel #4
0
        public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            ShenFuObjects objects;

            if (this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects) && (objects.ShenFu != null))
            {
                objects.ShenFu.CustomSetActive(false);
            }
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey != null)
            {
                BufConsumer consumer = new BufConsumer(dataByKey.iBufId, actor, actor);
                if (consumer.Use())
                {
                }
            }
        }
Beispiel #5
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);
            }
        }
Beispiel #6
0
        public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            ShenFuObjects objects;

            if (this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects))
            {
                if (objects.ShenFu != null)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(objects.ShenFu);
                }
                this._shenFuTriggerPool.Remove(trigger.ID);
            }
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey != null)
            {
                BufConsumer consumer = new BufConsumer(dataByKey.iBufId, actor, actor);
                if (consumer.Use())
                {
                }
            }
        }
Beispiel #7
0
 public void OnShenfuHalt(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
 {
 }
Beispiel #8
0
 public void BuildActionTrigger(ref ActorPreloadTab loadInfo)
 {
     AreaEventTrigger[] triggerArray = UnityEngine.Object.FindObjectsOfType <AreaEventTrigger>();
     if ((triggerArray != null) && (triggerArray.Length > 0))
     {
         for (int i = 0; i < triggerArray.Length; i++)
         {
             AreaEventTrigger trigger = triggerArray[i];
             for (int j = 0; j < trigger.TriggerActions.Length; j++)
             {
                 TriggerActionWrapper triggerActionWrapper = trigger.TriggerActions[j];
                 if ((triggerActionWrapper != null) && (triggerActionWrapper.TimingActionsInter != null))
                 {
                     for (int k = 0; k < triggerActionWrapper.TimingActionsInter.Length; k++)
                     {
                         if (!string.IsNullOrEmpty(triggerActionWrapper.TimingActionsInter[k].ActionName) && !this.ageCheckerSet.ContainsKey(triggerActionWrapper.TimingActionsInter[k].ActionName))
                         {
                             AssetLoadBase item = new AssetLoadBase {
                                 assetPath = triggerActionWrapper.TimingActionsInter[k].ActionName
                             };
                             loadInfo.ageActions.Add(item);
                             this.ageCheckerSet.Add(triggerActionWrapper.TimingActionsInter[k].ActionName, true);
                         }
                     }
                 }
                 if ((triggerActionWrapper != null) && (triggerActionWrapper.TriggerType == EGlobalTriggerAct.TriggerShenFu))
                 {
                     Singleton <ShenFuSystem> .instance.PreLoadResource(triggerActionWrapper, ref loadInfo, this);
                 }
             }
             if ((trigger.PresetActWrapper != null) && (trigger.PresetActWrapper.TimingActionsInter != null))
             {
                 for (int m = 0; m < trigger.PresetActWrapper.TimingActionsInter.Length; m++)
                 {
                     if (!string.IsNullOrEmpty(trigger.PresetActWrapper.TimingActionsInter[m].ActionName) && !this.ageCheckerSet.ContainsKey(trigger.PresetActWrapper.TimingActionsInter[m].ActionName))
                     {
                         AssetLoadBase base3 = new AssetLoadBase {
                             assetPath = trigger.PresetActWrapper.TimingActionsInter[m].ActionName
                         };
                         loadInfo.ageActions.Add(base3);
                         this.ageCheckerSet.Add(trigger.PresetActWrapper.TimingActionsInter[m].ActionName, true);
                     }
                 }
             }
         }
     }
     GlobalTrigger[] triggerArray2 = UnityEngine.Object.FindObjectsOfType <GlobalTrigger>();
     if ((triggerArray2 != null) && (triggerArray2.Length > 0))
     {
         for (int n = 0; n < triggerArray2.Length; n++)
         {
             GlobalTrigger trigger2 = triggerArray2[n];
             if ((trigger2.TriggerMatches != null) && (trigger2.TriggerMatches.Length > 0))
             {
                 for (int num6 = 0; num6 < trigger2.TriggerMatches.Length; num6++)
                 {
                     CTriggerMatch match = trigger2.TriggerMatches[num6];
                     if (((match != null) && (match.ActionList != null)) && (match.ActionList.Length > 0))
                     {
                         for (int num7 = 0; num7 < match.ActionList.Length; num7++)
                         {
                             TriggerActionWrapper wrapper2 = match.ActionList[num7];
                             if ((wrapper2 != null) && (wrapper2.TimingActionsInter != null))
                             {
                                 for (int num8 = 0; num8 < wrapper2.TimingActionsInter.Length; num8++)
                                 {
                                     if (!string.IsNullOrEmpty(wrapper2.TimingActionsInter[num8].ActionName) && !this.ageCheckerSet.ContainsKey(wrapper2.TimingActionsInter[num8].ActionName))
                                     {
                                         AssetLoadBase base4 = new AssetLoadBase {
                                             assetPath = wrapper2.TimingActionsInter[num8].ActionName
                                         };
                                         loadInfo.ageActions.Add(base4);
                                         this.ageCheckerSet.Add(wrapper2.TimingActionsInter[num8].ActionName, true);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             if ((trigger2.ActionList != null) && (trigger2.ActionList.Length > 0))
             {
                 for (int num9 = 0; num9 < trigger2.ActionList.Length; num9++)
                 {
                     TriggerActionWrapper wrapper3 = trigger2.ActionList[num9];
                     if ((wrapper3 != null) && (wrapper3.TimingActionsInter != null))
                     {
                         for (int num10 = 0; num10 < wrapper3.TimingActionsInter.Length; num10++)
                         {
                             if (!string.IsNullOrEmpty(wrapper3.TimingActionsInter[num10].ActionName) && !this.ageCheckerSet.ContainsKey(wrapper3.TimingActionsInter[num10].ActionName))
                             {
                                 AssetLoadBase base5 = new AssetLoadBase {
                                     assetPath = wrapper3.TimingActionsInter[num10].ActionName
                                 };
                                 loadInfo.ageActions.Add(base5);
                                 this.ageCheckerSet.Add(wrapper3.TimingActionsInter[num10].ActionName, true);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #9
0
 public void BuildActionTrigger(ref ActorPreloadTab loadInfo)
 {
     AreaEventTrigger[] array = Object.FindObjectsOfType <AreaEventTrigger>();
     if (array != null && array.Length > 0)
     {
         for (int i = 0; i < array.Length; i++)
         {
             AreaEventTrigger areaEventTrigger = array[i];
             for (int j = 0; j < areaEventTrigger.TriggerActions.Length; j++)
             {
                 TriggerActionWrapper triggerActionWrapper = areaEventTrigger.TriggerActions[j];
                 if (triggerActionWrapper != null)
                 {
                     triggerActionWrapper.PreLoadResource(ref loadInfo, this.ageCheckerSet, this);
                 }
                 if (triggerActionWrapper != null && triggerActionWrapper.TriggerType == EGlobalTriggerAct.TriggerShenFu)
                 {
                     Singleton <ShenFuSystem> .instance.PreLoadResource(triggerActionWrapper, ref loadInfo, this);
                 }
             }
             if (areaEventTrigger.PresetActWrapper != null)
             {
                 areaEventTrigger.PresetActWrapper.PreLoadResource(ref loadInfo, this.ageCheckerSet, this);
             }
         }
     }
     GlobalTrigger[] array2 = Object.FindObjectsOfType <GlobalTrigger>();
     if (array2 != null && array2.Length > 0)
     {
         for (int k = 0; k < array2.Length; k++)
         {
             GlobalTrigger globalTrigger = array2[k];
             if (globalTrigger.TriggerMatches != null && globalTrigger.TriggerMatches.Length > 0)
             {
                 for (int l = 0; l < globalTrigger.TriggerMatches.Length; l++)
                 {
                     CTriggerMatch cTriggerMatch = globalTrigger.TriggerMatches[l];
                     if (cTriggerMatch != null && cTriggerMatch.ActionList != null && cTriggerMatch.ActionList.Length > 0)
                     {
                         for (int m = 0; m < cTriggerMatch.ActionList.Length; m++)
                         {
                             TriggerActionWrapper triggerActionWrapper2 = cTriggerMatch.ActionList[m];
                             if (triggerActionWrapper2 != null)
                             {
                                 triggerActionWrapper2.PreLoadResource(ref loadInfo, this.ageCheckerSet, this);
                             }
                         }
                     }
                 }
             }
             if (globalTrigger.ActionList != null && globalTrigger.ActionList.Length > 0)
             {
                 for (int n = 0; n < globalTrigger.ActionList.Length; n++)
                 {
                     TriggerActionWrapper triggerActionWrapper3 = globalTrigger.ActionList[n];
                     if (triggerActionWrapper3 != null)
                     {
                         triggerActionWrapper3.PreLoadResource(ref loadInfo, this.ageCheckerSet, this);
                     }
                 }
             }
         }
     }
 }