private int BuildSummmonInfo(ESceneType type = ESceneType.EScene_World) { int num = 1; for (int i = 0; i < 5; i++) { ActorController actor = Globals.Instance.ActorMgr.GetActor(i + 1); if (!(actor == null)) { CombatMainHeroSummonLayer.SummmonInfo summmonInfo = new CombatMainHeroSummonLayer.SummmonInfo(); summmonInfo.InfoRoot = base.transform.Find(string.Format("pet{0}", num)).gameObject; summmonInfo.Icon = summmonInfo.InfoRoot.transform.Find("pet_pic").GetComponent<UISprite>(); if (type == ESceneType.EScene_Arena || type == ESceneType.EScene_OrePillage || type == ESceneType.EScene_GuildPvp) { UIEventListener expr_A3 = UIEventListener.Get(summmonInfo.Icon.gameObject); expr_A3.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_A3.onClick, new UIEventListener.VoidDelegate(summmonInfo.OnIconClick)); } summmonInfo.Icon.spriteName = actor.petInfo.Icon; summmonInfo.BuffGrid = summmonInfo.InfoRoot.transform.Find("petbuff").GetComponent<UIGrid>(); summmonInfo.OriginalBuffItem = summmonInfo.BuffGrid.transform.Find("buffItem").gameObject; summmonInfo.OriginalBuffItem.SetActive(false); summmonInfo.HPBar = summmonInfo.InfoRoot.transform.Find("pet_pic/hp").GetComponent<UISlider>(); summmonInfo.HPBar.value = 1f; summmonInfo.MaskImage = summmonInfo.InfoRoot.transform.Find("death_mask").GetComponent<UISprite>(); summmonInfo.MaskImage.gameObject.SetActive(false); summmonInfo.Countdown = summmonInfo.InfoRoot.transform.Find("Countdown").GetComponent<UILabel>(); if (type == ESceneType.EScene_MemoryGear) { summmonInfo.Countdown.gameObject.SetActive(true); summmonInfo.Countdown.enabled = false; } else { summmonInfo.Countdown.gameObject.SetActive(false); } summmonInfo.RiskMask = summmonInfo.InfoRoot.transform.Find("riskMask").GetComponent<UISprite>(); summmonInfo.Quality = summmonInfo.InfoRoot.GetComponent<UISprite>(); summmonInfo.Quality.spriteName = Tools.GetItemQualityIcon(actor.petInfo.Quality); summmonInfo.Actor = actor; summmonInfo.SummonName = actor.GetName(); this.actorUIInfos[i + 1] = summmonInfo; num++; } } return num; }
public void SetSummonDeath(int slot, bool bDeath) { if (slot < 1 || slot >= 5 || this.actorUIInfos[slot] == null) { return; } this.tempInfo = (CombatMainHeroSummonLayer.SummmonInfo)this.actorUIInfos[slot]; if (bDeath && !this.tempInfo.MaskImage.gameObject.activeInHierarchy) { GameUIManager.mInstance.ShowGameNewPopUp(Singleton<StringManager>.Instance.GetString("summonKilledNew", new object[] { this.tempInfo.SummonName }), 1f, 50f, 0.25f); if (this.mCurSceneType == ESceneType.EScene_MemoryGear) { this.tempInfo.ResurrectTime = 20; this.tempInfo.Countdown.enabled = true; } } if (this.tempInfo.MaskImage.gameObject.activeInHierarchy != bDeath) { this.tempInfo.MaskImage.gameObject.SetActive(bDeath); if (this.mCurSceneType == ESceneType.EScene_MemoryGear) { if (Globals.Instance.ActorMgr.Actors[0].IsDead) { this.tempInfo.Countdown.enabled = false; } else { this.tempInfo.Countdown.enabled = bDeath; } } } if (bDeath) { this.tempInfo.RiskMask.gameObject.SetActive(false); } }