public void InitStageEffectSettings() { AvatarManager instance = Singleton <AvatarManager> .Instance; instance.onLocalAvatarChanged = (Action <BaseMonoAvatar, BaseMonoAvatar>)Delegate.Combine(instance.onLocalAvatarChanged, new Action <BaseMonoAvatar, BaseMonoAvatar>(this.OnLocalAvatarChanged)); this._stageEffectSettingStack = new FixedStack <ConfigStageEffectSetting>(7, new Action <ConfigStageEffectSetting, int, ConfigStageEffectSetting, int>(this.OnStageEffectSettingChanged)); this._stageEffectSettingStack.Push(ConfigStageEffectSetting.EMPTY, true); }
private void Start() { this._renderer = base.GetComponent <Renderer>(); this._mpb = new MaterialPropertyBlock(); this._renderer.GetPropertyBlock(this._mpb); AvatarManager instance = Singleton <AvatarManager> .Instance; instance.onLocalAvatarChanged = (Action <BaseMonoAvatar, BaseMonoAvatar>)Delegate.Combine(instance.onLocalAvatarChanged, new Action <BaseMonoAvatar, BaseMonoAvatar>(this.OnLocalAvatarChanged)); }
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)); }
public override void OnRemoved() { if (this._warningFieldState > WarningFieldState.None) { Singleton <EventManager> .Instance.RemoveEventListener <EvtFieldEnter>(this._owner.runtimeID); Singleton <EventManager> .Instance.RemoveEventListener <EvtFieldExit>(this._owner.runtimeID); this._warningFieldActor.Kill(); this._warningFieldState = WarningFieldState.None; } if (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Single) { AvatarManager instance = Singleton <AvatarManager> .Instance; instance.onLocalAvatarChanged = (Action <BaseMonoAvatar, BaseMonoAvatar>)Delegate.Remove(instance.onLocalAvatarChanged, new Action <BaseMonoAvatar, BaseMonoAvatar>(this.OnLocalAvatarChanged)); } this._owner.onAbilityStateAdd = (Action <AbilityState, bool>)Delegate.Remove(this._owner.onAbilityStateAdd, new Action <AbilityState, bool>(this.OnAbilityStateAdd)); this._owner.onAbilityStateRemove = (Action <AbilityState>)Delegate.Remove(this._owner.onAbilityStateRemove, new Action <AbilityState>(this.OnAbilityStateRemove)); this._owner.monster.onHitStateChanged = (Action <BaseMonoMonster, bool, bool>)Delegate.Remove(this._owner.monster.onHitStateChanged, new Action <BaseMonoMonster, bool, bool>(this.OnHitStateChanged)); }
public override void OnAdded() { if (this._levelActor.levelState == LevelActor.LevelState.LevelRunning) { this.Preparation(); } else { Singleton <EventManager> .Instance.RegisterEventListener <EvtStageReady>(this._owner.runtimeID); } Singleton <EventManager> .Instance.RegisterEventListener <EvtKilled>(this._owner.runtimeID); if (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Single) { AvatarManager instance = Singleton <AvatarManager> .Instance; instance.onLocalAvatarChanged = (Action <BaseMonoAvatar, BaseMonoAvatar>)Delegate.Combine(instance.onLocalAvatarChanged, new Action <BaseMonoAvatar, BaseMonoAvatar>(this.OnLocalAvatarChanged)); } this._owner.onAbilityStateAdd = (Action <AbilityState, bool>)Delegate.Combine(this._owner.onAbilityStateAdd, new Action <AbilityState, bool>(this.OnAbilityStateAdd)); this._owner.onAbilityStateRemove = (Action <AbilityState>)Delegate.Combine(this._owner.onAbilityStateRemove, new Action <AbilityState>(this.OnAbilityStateRemove)); this._owner.monster.onHitStateChanged = (Action <BaseMonoMonster, bool, bool>)Delegate.Combine(this._owner.monster.onHitStateChanged, new Action <BaseMonoMonster, bool, bool>(this.OnHitStateChanged)); }