示例#1
0
        public override void OnAwake()
        {
            BaseMonoAnimatorEntity component = base.GetComponent <BaseMonoAnimatorEntity>();

            if (component is BaseMonoAvatar)
            {
                this._aiEntity = (BaseMonoAvatar)component;
            }
            else if (component is BaseMonoMonster)
            {
                this._aiEntity = (BaseMonoMonster)component;
            }
            this._aiController  = this._aiEntity.GetActiveAIController();
            this._abilityEntity = component;
            this._levelAIPlugin = Singleton <LevelManager> .Instance.levelActor.GetPlugin <LevelAIPlugin>();
        }
示例#2
0
        public override void Init(BaseMonoEntity entity)
        {
            this.levelEntity  = (MonoLevelEntity)entity;
            base.commonConfig = this.levelEntity.commonConfig;
            base.Init(entity);
            base.runtimeID     = 0x21800001;
            this.levelState    = LevelState.LevelLoaded;
            this._damagePlugin = new LevelDamageStasticsPlugin(this);
            if (Singleton <LevelScoreManager> .Instance.collectAntiCheatData)
            {
                this.antiCheatPlugin = new LevelAntiCheatPlugin(this._damagePlugin);
                base.AddPlugin(this.antiCheatPlugin);
            }
            this._frameHitSet = new HashSet <KeyValuePair <int, string> >();
            this._frameIndex  = 0;
            LevelChallengeHelperPlugin plugin = new LevelChallengeHelperPlugin(this);

            base.AddPlugin(plugin);
            int levelId = Singleton <LevelScoreManager> .Instance.LevelId;

            if ((levelId != 0) && (Singleton <LevelTutorialModule> .Instance.GetUnFinishedTutorialIDList(levelId).Count > 0))
            {
                LevelTutorialHelperPlugin plugin2 = new LevelTutorialHelperPlugin(this);
                base.AddPlugin(plugin2);
            }
            this._levelMissionStatisticsPlugin = new LevelMissionStatisticsPlugin(this);
            base.AddPlugin(this._levelMissionStatisticsPlugin);
            this._levelMonsterAIPlugin = new LevelAIPlugin(this);
            base.AddPlugin(this._levelMonsterAIPlugin);
            this.InitAdditionalLevelActorPlugins();
            Singleton <EventManager> .Instance.RegisterEventListener <EvtKilled>(base.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtBeingHit>(base.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtAvatarSwapOutStart>(base.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtAttackStart>(base.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtAttackLanded>(base.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtReviveAvatar>(base.runtimeID);

            AvatarManager instance = Singleton <AvatarManager> .Instance;

            instance.onLocalAvatarChanged = (Action <BaseMonoAvatar, BaseMonoAvatar>)Delegate.Combine(instance.onLocalAvatarChanged, new Action <BaseMonoAvatar, BaseMonoAvatar>(this.OnLocalAvatarChanged));
        }
示例#3
0
 public override void OnAwake()
 {
     this._monster       = base.GetComponent <BaseMonoMonster>();
     this._controller    = this._monster.GetActiveAIController();
     this._levelAIPlugin = Singleton <LevelManager> .Instance.levelActor.GetPlugin <LevelAIPlugin>();
 }
示例#4
0
 public override void OnAwake()
 {
     this.monster        = base.GetComponent <BaseMonoMonster>();
     this._aiEntity      = this.monster;
     this._levelAIPlugin = Singleton <LevelManager> .Instance.levelActor.GetPlugin <LevelAIPlugin>();
 }