Example #1
0
 public void OnInit(UIActorController actor)
 {
     if (actor == null)
     {
         global::Debug.Log(new object[]
         {
             "actor == null"
         });
         return;
     }
     this.uiActor = actor;
 }
 private void ClearModel()
 {
     if (this.asyncEntiry != null)
     {
         ActorManager.CancelCreateUIActorAsync(this.asyncEntiry);
         this.asyncEntiry = null;
     }
     if (this.mModelTmp != null)
     {
         this.mUIActorController = null;
         UnityEngine.Object.DestroyImmediate(this.mModelTmp);
         this.mModelTmp = null;
     }
 }
Example #3
0
 public void ClearModel()
 {
     if (this.asyncEntity != null)
     {
         ActorManager.CancelCreateUIActorAsync(this.asyncEntity);
         this.asyncEntity = null;
     }
     if (this.mModel != null)
     {
         this.mActor = null;
         UnityEngine.Object.Destroy(this.mModel);
         this.mModel = null;
     }
 }
 public void CreateModel()
 {
     this.ClearModel();
     ItemSubSystem itemSystem = Globals.Instance.Player.ItemSystem;
     this.mShiZhuangItemData = this.mGUIShiZhuangItemTable.GetCurSelectData();
     if (itemSystem != null && this.mShiZhuangItemData != null && this.mShiZhuangItemData.mFashionInfo != null)
     {
         if (itemSystem.HasFashion(this.mShiZhuangItemData.mFashionInfo.ID) && itemSystem.IsShiXiaoFashion(this.mShiZhuangItemData.mFashionInfo))
         {
             this.mFashionTimeTip.gameObject.SetActive(true);
             if (itemSystem.IsFashionGuoqi(this.mShiZhuangItemData.mFashionInfo.ID))
             {
                 this.mFashionTimeTip.text = Singleton<StringManager>.Instance.GetString("shiZhuangTxt3");
             }
             else
             {
                 int num = itemSystem.GetFashionTime(this.mShiZhuangItemData.mFashionInfo.ID) - Globals.Instance.Player.GetTimeStamp();
                 int num2 = Mathf.Max(num / 86400, 1);
                 this.mFashionTimeTip.text = Singleton<StringManager>.Instance.GetString("shiZhuangTxt4", new object[]
                 {
                     num2
                 });
             }
         }
         else
         {
             this.mFashionTimeTip.gameObject.SetActive(false);
         }
         this.asyncEntiry = ActorManager.CreateUIFashion(this.mShiZhuangItemData.mFashionInfo, 51, true, true, this.mCardModel, 1f, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModelTmp = go;
             if (this.mModelTmp != null)
             {
                 this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 this.mUIActorController.PlayIdleAnimationAndVoice();
                 this.mModelTmp.transform.localPosition = new Vector3(0f, 0f, -500f);
                 Tools.SetMeshRenderQueue(this.mModelTmp, 3900);
             }
         });
     }
 }
 public void OnInit(UIActorController actor)
 {
     if (actor == null)
     {
         global::Debug.Log(new object[]
         {
             "actor == null"
         });
         return;
     }
     this.uiActor = actor;
     if (!string.IsNullOrEmpty(this.Anim))
     {
         if (this.DelayPlayAnimtion > 0f)
         {
             base.Invoke("PlayAnimation", this.DelayPlayAnimtion);
         }
         else
         {
             this.PlayAnimation();
         }
     }
 }
 public void OnInit(UIActorController actor)
 {
     if (actor == null)
     {
         global::Debug.Log(new object[]
         {
             "actor == null"
         });
         return;
     }
     this.uiActor = actor;
     if (this.Prefab != null)
     {
         if (this.DelayTime > 0f)
         {
             base.Invoke("DoInstantiate", this.DelayTime);
         }
         else
         {
             this.DoInstantiate();
         }
     }
 }
Example #7
0
 public void OnInit(UIActorController actor)
 {
     if (actor == null)
     {
         global::Debug.Log(new object[]
         {
             "actor == null"
         });
         return;
     }
     this.uiActor = actor;
     if (!string.IsNullOrEmpty(this.SoundName))
     {
         if (this.DelayTime > 0f)
         {
             base.Invoke("DoPlaySound", this.DelayTime);
         }
         else
         {
             this.DoPlaySound();
         }
     }
 }
 private void CreateModel()
 {
     PetDataEx pet = this.mModelData.mSocketDataEx.GetPet();
     if (this.mModelData != null && this.mModelData.mSocketDataEx != null && pet != null)
     {
         this.ClearModel();
         if (this.mBaseScene.IsLocalPlayer)
         {
             this.asyncEntiry = ActorManager.CreateLocalUIActor(this.mModelData.mSocketSlotIndex, 0, true, false, this.mModelPos, 1.1f, delegate(GameObject go)
             {
                 this.asyncEntiry = null;
                 this.mModelTmp = go;
                 if (this.mModelTmp != null)
                 {
                     this.mModelTmp.transform.localPosition = new Vector3(0f, 0f, 500f);
                     Tools.SetMeshRenderQueue(this.mModelTmp, 3900);
                     this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 }
             });
         }
         else
         {
             this.asyncEntiry = ActorManager.CreateRemoteUIActor(this.mModelData.mSocketSlotIndex, 0, true, false, this.mModelPos, 1.1f, delegate(GameObject go)
             {
                 this.asyncEntiry = null;
                 this.mModelTmp = go;
                 if (this.mModelTmp != null)
                 {
                     this.mModelTmp.transform.localPosition = new Vector3(0f, 0f, 500f);
                     Tools.SetMeshRenderQueue(this.mModelTmp, 3900);
                     this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 }
             });
         }
     }
 }
 private void CreateModel()
 {
     this.ClearModel();
     if (this.mCurPetDataEx.GetSocketSlot() == 0)
     {
         this.asyncEntiry = ActorManager.CreateLocalUIActor(0, 450, true, true, this.mCardModel, 1.15f, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModelTmp = go;
             if (this.mModelTmp != null)
             {
                 this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 Tools.SetMeshRenderQueue(this.mModelTmp, 5500);
             }
         });
     }
     else
     {
         this.asyncEntiry = ActorManager.CreateUIPet(this.mCurPetDataEx.Info.ID, 450, true, true, this.mCardModel, 1.15f, 2, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModelTmp = go;
             if (this.mModelTmp != null)
             {
                 this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 Tools.SetMeshRenderQueue(this.mModelTmp, 5500);
             }
         });
     }
 }
Example #10
0
 private void CreateModel()
 {
     this.ClearModel();
     if (this.mCurPetDataEx != null)
     {
         if (this.mCurPetDataEx.GetSocketSlot() == 0)
         {
             this.asyncEntiry = ActorManager.CreateLocalUIActor(0, 450, true, true, this.mCardModel, 1.15f, delegate(GameObject go)
             {
                 this.asyncEntiry = null;
                 this.mModelTmp = go;
                 if (this.mModelTmp != null)
                 {
                     this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                     this.mUIActorController.PlayIdleAnimationAndVoice();
                     this.mModelTmp.transform.localPosition = new Vector3(0f, 0f, -500f);
                     Tools.SetMeshRenderQueue(this.mModelTmp, 3500);
                 }
             });
         }
         else
         {
             this.asyncEntiry = ActorManager.CreateUIPet(this.mCurPetDataEx.Info.ID, 450, true, true, this.mCardModel, 1.15f, 2, delegate(GameObject go)
             {
                 this.mModelTmp = go;
                 if (this.mModelTmp != null)
                 {
                     this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                     this.mUIActorController.PlayIdleAnimationAndVoice();
                     this.mModelTmp.transform.localPosition = new Vector3(0f, 0f, -500f);
                     Tools.SetMeshRenderQueue(this.mModelTmp, 3500);
                 }
             });
         }
     }
     else if (this.mCurLopetDataEx != null)
     {
         this.asyncEntiry = ActorManager.CreateUILopet(this.mCurLopetDataEx.Info, 0, true, true, this.mCardModel, 1f, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModelTmp = go;
             if (this.mModelTmp != null)
             {
                 Vector3 localPosition = this.mModelTmp.transform.localPosition;
                 localPosition.z -= 500f;
                 this.mModelTmp.transform.localPosition = localPosition;
                 Tools.SetMeshRenderQueue(this.mModelTmp, 3900);
                 this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
             }
         });
     }
 }
Example #11
0
 private void Init(LopetDataEx lopetData, GUILopetInfoScene.EType type)
 {
     Transform transform = base.transform.Find("UIMiddle");
     this.mCardModel = transform.Find("modelPos").gameObject;
     this.mGUIPetTitleInfo = transform.Find("topInfoPanel/lopetTopInfo").gameObject.AddComponent<GUILopetTitleInfo>();
     this.mGUIPetTitleInfo.Refresh(lopetData);
     GameObject gameObject = transform.Find("closeBtn").gameObject;
     UIEventListener expr_65 = UIEventListener.Get(gameObject);
     expr_65.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_65.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClick));
     UITable component = GameUITools.FindGameObject("rightInfo/rightInfoPanel/content", transform.gameObject).GetComponent<UITable>();
     GameUITools.FindGameObject("a", component.gameObject).AddComponent<GUIAttributeValue>().Refresh(lopetData);
     LopetInfoSkillLayer lopetInfoSkillLayer = GameUITools.FindGameObject("b", component.gameObject).AddComponent<LopetInfoSkillLayer>();
     lopetInfoSkillLayer.Init();
     lopetInfoSkillLayer.Refresh(lopetData);
     UISprite component2 = GameUITools.FindGameObject("e", component.gameObject).GetComponent<UISprite>();
     UILabel uILabel = GameUITools.FindUILabel("desc", component2.gameObject);
     uILabel.text = lopetData.Info.Desc;
     component2.height = 50 + Mathf.RoundToInt(uILabel.printedSize.y);
     component.repositionNow = true;
     SourceItemUITable sourceItemUITable = GameUITools.FindGameObject("rightInfo/rightInfoPanel2/content", transform.gameObject).AddComponent<SourceItemUITable>();
     UILabel uILabel2 = GameUITools.FindUILabel("rightInfo/rightInfoPanel2/txt0", transform.gameObject);
     sourceItemUITable.maxPerLine = 1;
     sourceItemUITable.arrangement = UICustomGrid.Arrangement.Vertical;
     sourceItemUITable.cellWidth = 360f;
     sourceItemUITable.cellHeight = 76f;
     sourceItemUITable.gapHeight = 4f;
     sourceItemUITable.gapWidth = 0f;
     sourceItemUITable.ClearData();
     ItemInfo fragmentInfo = LopetFragment.GetFragmentInfo(lopetData.Info.ID);
     GUIHowGetPetItemPopUp.InitSourceItems(fragmentInfo, sourceItemUITable);
     if (sourceItemUITable.mDatas.Count > 0)
     {
         uILabel2.gameObject.SetActive(false);
     }
     else
     {
         uILabel2.gameObject.SetActive(true);
     }
     UIEventListener expr_210 = UIEventListener.Get(GameUITools.FindGameObject("rightInfo/Tabs/0", transform.gameObject));
     expr_210.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_210.onClick, new UIEventListener.VoidDelegate(this.OnTabClick));
     UIEventListener expr_246 = UIEventListener.Get(GameUITools.FindGameObject("rightInfo/Tabs/1", transform.gameObject));
     expr_246.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_246.onClick, new UIEventListener.VoidDelegate(this.OnTabClick));
     this.mState1Go = transform.Find("state1").gameObject;
     if (type != GUILopetInfoScene.EType.EType_Info)
     {
         if (type == GUILopetInfoScene.EType.EType_Fragment)
         {
             this.mState1Go.gameObject.SetActive(true);
         }
     }
     else
     {
         this.mState1Go.gameObject.SetActive(false);
     }
     Transform transform2 = this.mState1Go.transform;
     UISlider component3 = transform2.Find("expBar").GetComponent<UISlider>();
     UILabel component4 = component3.transform.Find("num").GetComponent<UILabel>();
     int itemCount = Globals.Instance.Player.ItemSystem.GetItemCount(fragmentInfo.ID);
     component4.text = this.mSb.Remove(0, this.mSb.Length).Append(itemCount).Append("/").Append(fragmentInfo.Value1).ToString();
     component3.value = ((fragmentInfo.Value1 == 0) ? 0f : Mathf.Clamp01((float)itemCount / (float)fragmentInfo.Value1));
     this.ClearModel();
     this.asyncEntiry = ActorManager.CreateUILopet(lopetData.Info, 450, true, true, this.mCardModel, 1f, delegate(GameObject go)
     {
         this.asyncEntiry = null;
         this.mModelTmp = go;
         if (this.mModelTmp != null)
         {
             this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
             if (this.mUIActorController != null)
             {
                 this.mUIActorController.PlayIdleAnimationAndVoice();
             }
             Tools.SetMeshRenderQueue(this.mModelTmp, 5390);
         }
     });
 }
Example #12
0
 public void Refresh(int petInfoID, bool playWand = false)
 {
     NGUITools.SetActive(this.mUI73, false);
     if (this.petInfo != null && this.petInfo.ID == petInfoID)
     {
         return;
     }
     this.ClearModel();
     if (petInfoID != 0)
     {
         this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(petInfoID);
         this.asyncEntity = ActorManager.CreateUIPet(petInfoID, 0, true, false, this.mSlot, 1f, 0, delegate(GameObject go)
         {
             this.asyncEntity = null;
             this.mModel = go;
             if (go == null)
             {
                 global::Debug.Log(new object[]
                 {
                     "CreateUIPlayer error"
                 });
             }
             else
             {
                 NGUITools.SetLayer(go, LayerDefine.MonsterLayer);
                 Tools.SetMeshRenderQueue(go, 3002);
                 go.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
                 this.mActor = go.GetComponent<UIActorController>();
                 if (this.mActor == null)
                 {
                     this.mActor = go.AddComponent<UIActorController>();
                 }
                 this.mActor.IsPlayer = false;
                 this.mSkinnedRenderers = go.GetComponentsInChildren<Renderer>(true);
                 if (playWand)
                 {
                     this.PlayWandEffect();
                 }
                 this.SetDark(this.colorValue);
                 this.ResetRotation();
             }
         });
     }
     if (this.mUnknow != null)
     {
         this.mUnknow.enabled = (petInfoID == 0);
     }
     this.ResetRotation();
 }
Example #13
0
 private void CreateModel()
 {
     if (this.mCurLopet != null)
     {
         this.mModelPos = GameUITools.FindGameObject("modelPos", base.gameObject);
         this.ClearModel();
         this.asyncEntiry = ActorManager.CreateUILopet(this.mBaseScene.IsLocalPlayer, 0, true, true, this.mModelPos, 1f, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModelTmp = go;
             if (this.mModelTmp != null)
             {
                 Tools.SetMeshRenderQueue(this.mModelTmp, 3900);
                 this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
                 UIActorController expr_46 = this.mUIActorController;
                 expr_46.ClickEvent = (UIActorController.VoidCallBack)Delegate.Combine(expr_46.ClickEvent, new UIActorController.VoidCallBack(this.OnGameModelClick));
             }
         });
     }
 }
Example #14
0
 private void CreateModel()
 {
     this.ClearModel();
     this.isCreating = true;
     this.asyncEntiry = ActorManager.CreateUIMonster(this.mBaseScene.ModelMonsterInfoID, 0, true, false, base.gameObject, 1f, delegate(GameObject go)
     {
         this.asyncEntiry = null;
         if (go == null)
         {
             global::Debug.Log(new object[]
             {
                 "CreateUIMonster error"
             });
         }
         else
         {
             this.mActor = go.GetComponent<UIActorController>();
             this.mActor.transform.localPosition = this.mBaseScene.ModelStandPosition;
             this.mActor.transform.localScale = this.mBaseScene.ModelScale;
             this.isCreating = false;
             go.GetComponent<ParticleScaler>().renderQueue = 0;
             GameObject original = Res.Load<GameObject>("Skill/pet/pet_0034_3a", false);
             this.mFire = (GameObject)UnityEngine.Object.Instantiate(original);
             this.mFire.SetActive(false);
             Tools.SetParticleRQWithUIScale(this.mFire, 4400);
             GameUITools.AddChild(go, this.mFire);
             NGUITools.SetChildLayer(this.mFire.transform, this.mFire.layer);
         }
     });
 }
Example #15
0
 private void ClearModel()
 {
     if (this.asyncEntiry != null)
     {
         ActorManager.CancelCreateUIActorAsync(this.asyncEntiry);
         this.asyncEntiry = null;
     }
     if (this.mActor != null)
     {
         UnityEngine.Object.DestroyImmediate(this.mActor.gameObject);
         this.mActor = null;
     }
 }
Example #16
0
 private void CreateModel()
 {
     this.ClearModel();
     int id = 0;
     for (int i = 0; i < 7; i++)
     {
         MiscInfo info = Globals.Instance.AttDB.MiscDict.GetInfo(i + 1);
         if (info != null)
         {
             int num = 0;
             while (num < 5 && num < info.Day7RewardType.Count)
             {
                 if (info.Day7RewardType[num] == 4)
                 {
                     id = info.Day7RewardValue1[num];
                     break;
                 }
                 num++;
             }
         }
     }
     PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(id);
     if (info2 != null)
     {
         this.asyncEntiry = ActorManager.CreateUIPet(info2, this.mInfoBg.depth + 1, true, true, this.mSlot, 1f, 0, delegate(GameObject go)
         {
             this.asyncEntiry = null;
             this.mModel = go;
             this.mUIActorController = this.mModel.GetComponent<UIActorController>();
             if (this.mUIActorController == null)
             {
                 this.mUIActorController = this.mModel.AddComponent<UIActorController>();
             }
             this.mUIActorController.Invoke("OnClick", 0.5f);
         });
     }
 }
 private void CreateModel()
 {
     this.ClearModel();
     this.asyncEntiry = ActorManager.CreateUILopet(this.mCurPetDataEx.Info, 450, true, true, this.mCardModel, 1f, delegate(GameObject go)
     {
         this.asyncEntiry = null;
         this.mModelTmp = go;
         if (this.mModelTmp != null)
         {
             this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
             Tools.SetMeshRenderQueue(this.mModelTmp, 5500);
         }
     });
 }
Example #18
0
 private void ClearModel()
 {
     if (this.mCurPetData != null)
     {
         this.mCurPetData = null;
     }
     if (this.asyncEntity != null)
     {
         ActorManager.CancelCreateUIActorAsync(this.asyncEntity);
         this.asyncEntity = null;
     }
     if (this.petModel != null)
     {
         this.actorController = null;
         UnityEngine.Object.Destroy(this.petModel);
         this.petModel = null;
     }
 }