Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 12
0
 public TriggerActionBuff(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Ejemplo n.º 13
0
 public TriggerActionSkillHud(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer      = -1;
     this.startTimer = -1;
 }
Ejemplo n.º 14
0
 public TriggerActionShenFu(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
 public TriggerActionShowToggleAuto(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Ejemplo n.º 16
0
 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)
 {
 }
Ejemplo n.º 19
0
 public TriggerActionDialogue(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Ejemplo n.º 20
0
 public TriggerActionSetGlobalVariable(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 21
0
 public TriggerActionShenFu(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
 public TriggerActionAgeWithMobaLevel(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 23
0
 public TriggerActionPauseGame(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer = -1;
 }
Ejemplo n.º 24
0
 public TriggerActionAge(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 25
0
 public TriggerActionSoldierLine(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 26
0
 public TriggerActionJungle(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
     this._deadActors = new HashSet <uint>();
 }
Ejemplo n.º 27
0
 public TriggerActionActivator(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
 }
Ejemplo n.º 28
0
 public TriggerActionShowToggleAuto(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 29
0
 public TriggerActionSkillHud(TriggerActionWrapper inWrapper, int inTriggerId) : base(inWrapper, inTriggerId)
 {
 }
Ejemplo n.º 30
0
 public TriggerActionGuideTip(TriggerActionWrapper inWrapper) : base(inWrapper)
 {
     this.timer = -1;
 }