public void Init(Transform t) { UIWidget component = base.GetComponent<UIWidget>(); component.SetAnchor(t); base.transform.parent = t; base.transform.localScale = Vector3.one; this.CreateObjects(); this.scene = Globals.Instance.ActorMgr.MemoryGearScene; if (this.scene != null) { this.maxHP = this.scene.MaxDamageCount; this.maxWave = this.scene.MaxWave; this.SetHP(this.maxHP); this.SetWave(1); } this.mNextWaveCD.transform.parent.gameObject.SetActive(false); MemoryGearScene expr_A6 = this.scene; expr_A6.GearDamageEvent = (MemoryGearScene.VoidCallback)Delegate.Combine(expr_A6.GearDamageEvent, new MemoryGearScene.VoidCallback(this.OnGearDamageEvent)); MemoryGearScene expr_CD = this.scene; expr_CD.WaveUpdateEvent = (MemoryGearScene.VoidCallback)Delegate.Combine(expr_CD.WaveUpdateEvent, new MemoryGearScene.VoidCallback(this.OnWaveUpdateEvent)); MemoryGearScene expr_F4 = this.scene; expr_F4.PlayerDeadEvent = (MemoryGearScene.VoidCallback)Delegate.Combine(expr_F4.PlayerDeadEvent, new MemoryGearScene.VoidCallback(this.OnPlayerDeadEvent)); MemoryGearScene expr_11B = this.scene; expr_11B.CombatEvent = (MemoryGearScene.ValueCallback)Delegate.Combine(expr_11B.CombatEvent, new MemoryGearScene.ValueCallback(this.OnCombatEvent)); }
private void InitScene() { switch (this.senceInfo.Type) { case 0: if (GameConst.GetInt32(110) == this.senceInfo.ID) { this.baseScene = new StartScene(this); } else if (this.senceInfo.SubType == 0) { if (this.worldScene == null) { this.worldScene = new WorldScene(this); } this.baseScene = this.worldScene; } else { if (this.defenseScene == null) { this.defenseScene = new DefenseScene(this); } this.baseScene = this.defenseScene; } break; case 1: if (this.trialScene == null) { this.trialScene = new TrialScene(this); } this.baseScene = this.trialScene; break; case 2: if (this.arenaScene == null) { this.arenaScene = new ArenaScene(this); } this.baseScene = this.arenaScene; break; case 3: if (this.worldBossScene == null) { this.worldBossScene = new WorldBossScene(this); } this.baseScene = this.worldBossScene; break; case 4: if (this.pillageScene == null) { this.pillageScene = new PillageScene(this); } this.baseScene = this.pillageScene; break; case 5: if (this.guildBossScene == null) { this.guildBossScene = new GuildBossScene(this); } this.baseScene = this.guildBossScene; break; case 6: if (this.senceInfo.SubType == 0 || this.senceInfo.SubType == 1) { this.baseScene = new KingRewardScene1(this); } else { this.baseScene = new KingRewardScene2(this); } break; case 7: if (this.memoryGearScene == null) { this.memoryGearScene = new MemoryGearScene(this); } this.baseScene = this.memoryGearScene; break; case 8: if (this.orePillageScene == null) { this.orePillageScene = new OrePillageScene(this); } this.baseScene = this.orePillageScene; break; case 9: if (this.guildPvpScene == null) { this.guildPvpScene = new GuildPvpScene(this); } this.baseScene = this.guildPvpScene; break; default: global::Debug.LogErrorFormat("senceInfo type error, type = {0}", new object[] { this.senceInfo.Type }); break; } if (this.baseScene == null) { global::Debug.LogError(new object[] { "baseScene is null" }); return; } this.baseScene.SetSceneInfo(this.senceInfo); this.baseScene.Init(); this.LoadRespawnInfo(); this.InitEnvironment(); }