public static HeroPreview Instance() { if (mSingleton == null) { mSingleton = new HeroPreview(); } return(mSingleton); }
/// <summary> /// 显示装备 /// </summary> public void ShowEquip(HeroData HD) { if (HD.equipSite.Count != 0) { EquipData ed; ItemEquip ie; ItemNodeState item; for (int i = 1; i <= itemEquipDicI.Count; i++) { HD.equipSite.TryGetValue(i, out ed); itemEquipDicI.TryGetValue(i, out ie); if (ed != null) { if (GameLibrary.Instance().ItemStateList.TryGetValue(ed.id, out item)) { ie.Init(i, item); } } } if (UI_HeroDetail.equipItemState == 0) { if (null != ItemEquiplist[0]) { if (EquipOperation.Instance() != null) { EquipOperation.Instance().RefreshUI(1, ItemEquiplist[0]); } } } if (UI_HeroDetail.equipItemState == 3) { if (null != ItemEquiplist[0]) { if (EquipOperation.Instance() != null) { EquipOperation.Instance().RefreshUI(1, ItemEquiplist[0]); } } } } //英雄进阶成功刷新一下进阶界面信息 HeroPreview.Instance().Show(); if (jinjieEffect != null) { if (jinjieEffect.gameObject.activeSelf) { jinjieEffect.gameObject.SetActive(false); } } }
protected override void PageSwitchSetting(bool initalize) { base.PageSwitchSetting(initalize); //-------------------------------- // オブジェクトの取得 //-------------------------------- m_HeroPreview = m_CanvasObj.GetComponentInChildren <HeroPreview>(); m_HeroPreview.SetSizeParfect(new Vector2(0, -254)); m_HeroPreview.OnClickViewAction = OnClickPreview; int currentHeroID = 0; if (UserDataAdmin.Instance.m_StructHeroList.Length > MainMenuParam.m_HeroCurrentInex) { PacketStructHero heroData = UserDataAdmin.Instance.m_StructHeroList[MainMenuParam.m_HeroCurrentInex]; currentHeroID = heroData.hero_id; } // アセットバンドルの読み込み LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE); AssetBundler.Create(). Set(string.Format("hero_{0:D4}", currentHeroID), (o) => { Sprite[] sprites = o.AssetBundle.LoadAssetWithSubAssets <Sprite>(string.Format("tex_hero_stand_l_{0:D4}", currentHeroID)); Texture maskTextue = o.GetTexture(string.Format("tex_hero_stand_l_{0:D4}_mask", currentHeroID), TextureWrapMode.Clamp); m_HeroPreview.UnitImage = ImageUtil.GetSprite(sprites, "body"); m_HeroPreview.UnitImage_mask = maskTextue; // インジケーターを閉じる LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); }, (str) => { // インジケーターを閉じる LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); }). Load(); }
public HeroPreview() { mSingleton = this; }