Пример #1
0
        private void DoTriggeringImpl(CTriggerMatch match, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker)
        {
            ListView <TriggerActionBase> values = this.TriggerActionMultiMap.GetValues((uint)match.ActType, true);

            for (int i = 0; i < values.get_Count(); i++)
            {
                TriggerActionBase triggerActionBase = values.get_Item(i);
                if (triggerActionBase != null)
                {
                    triggerActionBase.AppendRefObj(match.Listeners);
                    triggerActionBase.TriggerEnter(src, atker, this);
                }
            }
            if (match.ActionList != null && match.ActionList.Length > 0)
            {
                int num = match.ActionList.Length;
                for (int j = 0; j < num; j++)
                {
                    TriggerActionWrapper triggerActionWrapper = match.ActionList[j];
                    if (triggerActionWrapper != null)
                    {
                        TriggerActionBase actionInternal = triggerActionWrapper.GetActionInternal();
                        if (actionInternal == null)
                        {
                            triggerActionWrapper.Init(0);
                            actionInternal = triggerActionWrapper.GetActionInternal();
                            DebugHelper.Assert(actionInternal != null);
                        }
                        actionInternal.AppendRefObj(match.Listeners);
                        actionInternal.TriggerEnter(src, atker, this);
                    }
                }
            }
        }
Пример #2
0
 private void DoTriggeringImpl(CTriggerMatch match, PoolObjHandle<ActorRoot> src, PoolObjHandle<ActorRoot> atker, object param)
 {
     ListView<TriggerActionBase> values = this.TriggerActionMultiMap.GetValues((uint) match.ActType, true);
     for (int i = 0; i < values.Count; i++)
     {
         TriggerActionBase base2 = values[i];
         if (base2 != null)
         {
             base2.AppendRefObj(match.Listeners);
             base2.TriggerEnter(src, atker, this, param);
         }
     }
     if ((match.ActionList != null) && (match.ActionList.Length > 0))
     {
         int length = match.ActionList.Length;
         for (int j = 0; j < length; j++)
         {
             TriggerActionWrapper wrapper = match.ActionList[j];
             if (wrapper != null)
             {
                 TriggerActionBase actionInternal = wrapper.GetActionInternal();
                 if (actionInternal == null)
                 {
                     wrapper.Init();
                     actionInternal = wrapper.GetActionInternal();
                     DebugHelper.Assert(actionInternal != null);
                 }
                 actionInternal.AppendRefObj(match.Listeners);
                 actionInternal.TriggerEnter(src, atker, this, param);
             }
         }
     }
 }
Пример #3
0
        private void OnDestroy()
        {
            if (Singleton <GameEventSys> .get_instance() != null)
            {
                Singleton <GameEventSys> .get_instance().RmvEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.onActorDead));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <SGroupDeadEventParam>(GameEventDef.Event_SpawnGroupDead, new RefAction <SGroupDeadEventParam>(this.onSpawnGroupDone));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightPrepare, new RefAction <DefaultGameEventParam>(this.onFightPrepare));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <HurtEventResultInfo>(GameEventDef.Event_ActorDamage, new RefAction <HurtEventResultInfo>(this.onActorDamage));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightStart, new RefAction <DefaultGameEventParam>(this.onFightStart));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <PoolObjHandle <ActorRoot> >(GameEventDef.Event_ActorInit, new RefAction <PoolObjHandle <ActorRoot> >(this.onActorInit));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorEnterCombat, new RefAction <DefaultGameEventParam>(this.onEnterCombat));

                Singleton <GameEventSys> .get_instance().RmvEventHandler <TalentLevelChangeParam>(GameEventDef.Event_TalentLevelChange, new RefAction <TalentLevelChangeParam>(this.onTalentLevelChange));
            }
            if (Singleton <GameSkillEventSys> .get_instance() != null)
            {
                Singleton <GameSkillEventSys> .get_instance().RmvEventHandler <ActorSkillEventParam>(GameSkillEventDef.AllEvent_UseSkill, new GameSkillEvent <ActorSkillEventParam>(this.onUseSkill));

                Singleton <GameSkillEventSys> .get_instance().RmvEventHandler <DefaultSkillEventParam>(GameSkillEventDef.Event_UseCanceled, new GameSkillEvent <DefaultSkillEventParam>(this.onUseSkillCanceled));
            }
            Singleton <EventRouter> .GetInstance().RemoveEventHandler <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", new Action <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >(this.OnActorBattleCoinChanged));

            this.ClearDelayTimers();
            TriggerActionWrapper[] actionList = this.ActionList;
            for (int i = 0; i < actionList.Length; i++)
            {
                TriggerActionWrapper triggerActionWrapper = actionList[i];
                if (triggerActionWrapper != null)
                {
                    triggerActionWrapper.Destroy();
                }
            }
            CTriggerMatch[] triggerMatches = this.TriggerMatches;
            for (int j = 0; j < triggerMatches.Length; j++)
            {
                CTriggerMatch cTriggerMatch = triggerMatches[j];
                if (cTriggerMatch != null)
                {
                    TriggerActionWrapper[] actionList2 = cTriggerMatch.ActionList;
                    for (int k = 0; k < actionList2.Length; k++)
                    {
                        TriggerActionWrapper triggerActionWrapper2 = actionList2[k];
                        if (triggerActionWrapper2 != null)
                        {
                            triggerActionWrapper2.Destroy();
                        }
                    }
                }
            }
        }
 protected void DoActorUpdateShared(ref PoolObjHandle <ActorRoot> inActor)
 {
     TriggerActionWrapper[] internalActList = this.m_internalActList;
     for (int i = 0; i < internalActList.Length; i++)
     {
         TriggerActionWrapper triggerActionWrapper = internalActList[i];
         if (triggerActionWrapper != null)
         {
             triggerActionWrapper.TriggerUpdate(inActor, this.thisActor, this);
         }
     }
 }
 protected void OnTriggerStart()
 {
     TriggerActionWrapper[] internalActList = this.m_internalActList;
     for (int i = 0; i < internalActList.Length; i++)
     {
         TriggerActionWrapper triggerActionWrapper = internalActList[i];
         if (triggerActionWrapper != null)
         {
             triggerActionWrapper.OnTriggerStart(this);
         }
     }
 }
        private void OnDestroy()
        {
            Singleton <GameEventSys> .instance.RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDestroy, new RefAction <DefaultGameEventParam>(this.onActorDestroy));

            this._inActorsCache = null;
            TriggerActionWrapper[] internalActList = this.m_internalActList;
            for (int i = 0; i < internalActList.Length; i++)
            {
                TriggerActionWrapper triggerActionWrapper = internalActList[i];
                if (triggerActionWrapper != null)
                {
                    triggerActionWrapper.Destroy();
                }
            }
        }
        public override void Stop()
        {
            Singleton <GameEventSys> .instance.RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDestroy, new RefAction <DefaultGameEventParam>(this.onActorDestroy));

            base.Stop();
            int num = this.m_internalActList.Length;

            for (int i = 0; i < num; i++)
            {
                TriggerActionWrapper triggerActionWrapper = this.m_internalActList[i];
                if (triggerActionWrapper != null)
                {
                    triggerActionWrapper.Stop();
                }
            }
        }
Пример #8
0
 public TriggerActionBase(TriggerActionWrapper inWrapper)
 {
     this.RefObjList         = inWrapper.RefObjList;
     this.TimingActionsInter = inWrapper.TimingActionsInter;
     this.EnterUniqueId      = inWrapper.EnterUniqueId;
     this.LeaveUniqueId      = inWrapper.LeaveUniqueId;
     this.UpdateUniqueId     = inWrapper.UpdateUniqueId;
     this.bEnable            = inWrapper.bEnable;
     this.bStopWhenLeaving   = inWrapper.bStopWhenLeaving;
     this.bSrc       = inWrapper.bSrc;
     this.bAtker     = inWrapper.bAtker;
     this.TotalTime  = inWrapper.TotalTime;
     this.ActiveTime = inWrapper.ActiveTime;
     this.Offset_x   = inWrapper.Offset_x;
     this.Offset_y   = inWrapper.Offset_y;
 }
        protected DictionaryView <TriggerActionBase, RefParamOperator> DoActorEnterShared(ref PoolObjHandle <ActorRoot> inActor)
        {
            DictionaryView <TriggerActionBase, RefParamOperator> dictionaryView = new DictionaryView <TriggerActionBase, RefParamOperator>();

            TriggerActionWrapper[] internalActList = this.m_internalActList;
            for (int i = 0; i < internalActList.Length; i++)
            {
                TriggerActionWrapper triggerActionWrapper = internalActList[i];
                if (triggerActionWrapper != null)
                {
                    RefParamOperator refParamOperator = triggerActionWrapper.TriggerEnter(inActor, this.thisActor, this);
                    if (refParamOperator != null)
                    {
                        dictionaryView.Add(triggerActionWrapper.GetActionInternal(), refParamOperator);
                    }
                }
            }
            return(dictionaryView);
        }
 private void BuildInternalWrappers()
 {
     if (this.PresetActWrapper != null)
     {
         this.m_internalActList = AreaEventTrigger.AddElement <TriggerActionWrapper>(this.m_internalActList, this.PresetActWrapper);
     }
     if (this.TriggerActions.Length > 0)
     {
         this.m_internalActList = AreaEventTrigger.AppendElements <TriggerActionWrapper>(this.m_internalActList, this.TriggerActions);
     }
     TriggerActionWrapper[] internalActList = this.m_internalActList;
     for (int i = 0; i < internalActList.Length; i++)
     {
         TriggerActionWrapper triggerActionWrapper = internalActList[i];
         if (triggerActionWrapper != null && triggerActionWrapper.GetActionInternal() == null)
         {
             triggerActionWrapper.Init(this.ID);
         }
     }
 }
Пример #11
0
        private void Awake()
        {
            if (Singleton <GameEventSys> .get_instance() != null)
            {
                Singleton <GameEventSys> .get_instance().AddEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.onActorDead));

                Singleton <GameEventSys> .get_instance().AddEventHandler <SGroupDeadEventParam>(GameEventDef.Event_SpawnGroupDead, new RefAction <SGroupDeadEventParam>(this.onSpawnGroupDone));

                Singleton <GameEventSys> .get_instance().AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightPrepare, new RefAction <DefaultGameEventParam>(this.onFightPrepare));

                Singleton <GameEventSys> .get_instance().AddEventHandler <HurtEventResultInfo>(GameEventDef.Event_ActorDamage, new RefAction <HurtEventResultInfo>(this.onActorDamage));

                Singleton <GameEventSys> .get_instance().AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightStart, new RefAction <DefaultGameEventParam>(this.onFightStart));

                Singleton <GameEventSys> .get_instance().AddEventHandler <PoolObjHandle <ActorRoot> >(GameEventDef.Event_ActorInit, new RefAction <PoolObjHandle <ActorRoot> >(this.onActorInit));

                Singleton <GameEventSys> .get_instance().AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorEnterCombat, new RefAction <DefaultGameEventParam>(this.onEnterCombat));

                Singleton <GameEventSys> .get_instance().AddEventHandler <TalentLevelChangeParam>(GameEventDef.Event_TalentLevelChange, new RefAction <TalentLevelChangeParam>(this.onTalentLevelChange));
            }
            if (Singleton <GameSkillEventSys> .get_instance() != null)
            {
                Singleton <GameSkillEventSys> .get_instance().AddEventHandler <ActorSkillEventParam>(GameSkillEventDef.AllEvent_UseSkill, new GameSkillEvent <ActorSkillEventParam>(this.onUseSkill));
            }
            Singleton <EventRouter> .GetInstance().AddEventHandler <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", new Action <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >(this.OnActorBattleCoinChanged));

            TriggerActionWrapper[] actionList = this.ActionList;
            for (int i = 0; i < actionList.Length; i++)
            {
                TriggerActionWrapper triggerActionWrapper = actionList[i];
                if (triggerActionWrapper != null)
                {
                    EGlobalTriggerAct triggerType = triggerActionWrapper.TriggerType;
                    triggerActionWrapper.Init(0);
                    TriggerActionBase actionInternal = triggerActionWrapper.GetActionInternal();
                    DebugHelper.Assert(actionInternal != null);
                    this.TriggerActionMultiMap.Add((uint)triggerType, actionInternal);
                }
            }
        }
Пример #12
0
 public TriggerActionBuff(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Пример #13
0
 public TriggerActionSkillHud(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer      = -1;
     this.startTimer = -1;
 }
Пример #14
0
 public TriggerActionShenFu(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
 public TriggerActionShowToggleAuto(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
 public TriggerActionPauseGame(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
 public TriggerActionTextBubble(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
     Singleton <GameEventSys> .get_instance().AddEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.onActorDead));
 }
 public TriggerActionGuideTip(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #19
0
 public TriggerActionDialogue(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Пример #20
0
 public TriggerActionSetGlobalVariable(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #21
0
 public TriggerActionShenFu(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
 public TriggerActionAgeWithMobaLevel(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #23
0
 public TriggerActionPauseGame(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer = -1;
 }
Пример #24
0
 public TriggerActionAge(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #25
0
 public TriggerActionSoldierLine(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #26
0
 public TriggerActionJungle(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
     this._deadActors = new HashSet <uint>();
 }
Пример #27
0
 public TriggerActionActivator(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Пример #28
0
 public TriggerActionShowToggleAuto(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #29
0
 public TriggerActionSkillHud(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Пример #30
0
 public TriggerActionGuideTip(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer = -1;
 }