static public void teamCallMemberBack() { for (int i = 0; i < _MyTeamInfo.members_.Length; i++) { if (_MyTeamInfo.members_[i].instId_ != GamePlayer.Instance.InstId) { continue; } if (!_MyTeamInfo.members_[i].isBattle_) { if (!GlobalValue.isBattleScene(StageMgr.Scene_name)) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("zhaohuan"), () => { NetConnection.Instance.backTeam(); Prebattle.Instance.ChangeWalkEff(Prebattle.WalkState.WS_Normal); }, false, () => { NetConnection.Instance.refuseBackTeam(); }); } else { isBattleOpen = true; } } else { isBattleOpen = true; } } }
private void OnenterBtn(ButtonScript obj, object args, int param1, int param2) { if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { PopText.Instance.Show(LanguageManager.instance.GetValue("zhanoougoumai"), PopText.WarningType.WT_Warning, true); } else { if (GamePlayer.Instance.isFund_) { PopText.Instance.Show(LanguageManager.instance.GetValue("yijinggoumaiguo")); return; } int growFund = 0; GlobalValue.Get(Constant.C_GrowFundShopID, out growFund); gameHandler.PayProduct(growFund); //StoreUI.SwithShowMe(2); } // MessageBoxUI.ShowMe (LanguageManager.instance.GetValue("querengoumaishuijing"), () => { // if(GamePlayer.Instance.GetIprop(PropertyType.PT_MagicCurrency)<openFund) // { // MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("notEnoughMagicCurrency"), delegate // { // StoreUI.SwithShowMe(1); // }); // return ; // } // NetConnection.Instance.buyFund (0); // }); }
public static bool SceneLoadedFinish() { if (wait4LoadQue_.Count > 0) { WaitLoadInfo wli = wait4LoadQue_.Dequeue(); LoadingAsyncScene(wli.name_, wli.type_, wli.withUI_, wli.withDynRes_, wli.manualClose_, wli.resetLocker_); if (GlobalValue.isBattleScene(wli.name_)) { return(true); } } else if (GameManager.Instance.nextBattle_ != null) { Battle.Instance.ComboBattle(); GameManager.Instance.nextBattle_ = null; return(true); } else// if (!GamePlayer.Instance.isInBattle) { if (Prebattle.Instance.ExcuteNextScene() == false) { if (Scene_name.Equals(GlobalValue.StageName_piantoudonghuaf) || Scene_name.Equals("Village01")) { ApplicationEntry.Instance.PlaceCinema(); } } } return(false); }
void Start() { InitUIText(); // RefreshstrengthenOk = Refresh; // RefreshGstrengthenOk = Refresh; // RefreshGstrengthenlevelOk = RefreshGstrengthenlevel; if (GamePlayer.Instance.babies_list_.Count != 0) { Refresh(MainbabyProperty.idss[0]); HeadIconLoader.Instance.LoadIcon(ItemData.GetData(itemID()).icon_, icon); numLabel.text = BagSystem.instance.GetItemMaxNum((uint)itemID()) + "/" + itemCount().ToString(); } else { ClearText(); } BagSystem.instance.DelItemInstEvent += updateUI; UIManager.SetButtonEventHandler(enterBtn.gameObject, EnumButtonEvent.OnClick, OnClickbtn, 0, 0); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
void OnEnable() { RefreshstrengthenOk = Refresh; RefreshGstrengthenOk = Refresh; RefreshGstrengthenlevelOk = RefreshGstrengthenlevel; //Refresh (BabyData.babyReId); if (GamePlayer.Instance.babies_list_.Count != 0) { Refresh(MainbabyProperty.idss[0]); if (BabyData.babyReId != 0 && BabyData.intensifyLevel != 0) { RefreshGstrengthenlevels(BabyData.babyReId, BabyData.intensifyLevel); } HeadIconLoader.Instance.LoadIcon(ItemData.GetData(itemID()).icon_, icon); numLabel.text = BagSystem.instance.GetItemMaxNum((uint)itemID()) + "/" + itemCount().ToString(); } else { ClearText(); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
void OnEnable() { MainbabyReform(); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
public static void ExcuteAllLoadedEvent() { ApplicationEntry.Instance.switchSceneMask_.SetActive(false); GameManager.Instance.EnableDelayCheck(true); if (GlobalValue.isBattleScene(Application.loadedLevelName)) { StageMgr.SceneLoadedFinish(); } }
static public void inviteJoinTeamOk(uint teamid, string myName) { if (!GlobalValue.isBattleScene(StageMgr.Scene_name)) { NetConnection.Instance.jointLobby(); } isYqEnd = true; isYQ = true; isHanHua = false; myname = myName; TeamSystem.hTeamid = (int)teamid; }
void ActorAssetLoaded(AssetBundle asset, ParamData data) { CallBackPack pack = loadedPack_[data.iParam]; pack.actorObj_ = (GameObject)GameObject.Instantiate(asset.mainAsset) as GameObject; //PlayerAsseMgr.DeleteAsset(asset, false); //不忽略武器更新 if (!data.bParam) { UpdateEquiptListener ueListener = pack.actorObj_.AddComponent <UpdateEquiptListener>(); ueListener.data_ = pack.data_ == null ? null : pack.data_.Clone(); if (pack.data_ != null && pack.data_.bParam) { ueListener.data_.iParam = 0; } if (pack.hasDress_) { ueListener.dressAssId_ = (int)pack.playerAssetId_; } ueListener.layerName_ = pack.layerName_; ueListener.SetWeapon(pack.weaponObj_, ueListener.data_, pack.layerName_); if (!GlobalValue.isBattleScene(StageMgr.Scene_name)) { GamePlayer.Instance.WearEquipEvent += new WearEquipEventHandler(ueListener.UpdateHandler); GamePlayer.Instance.DelEquipEvent += new DelEquipEventHandler(ueListener.RemoveWeaponHandler); } } Transform shadow = pack.actorObj_.transform.FindChild("Plane01"); if (shadow != null) { shadow.gameObject.SetActive(pack.layerName_.Equals("Default")); } if (!pack.hasWeapon_) { NGUITools.SetLayer(pack.actorObj_, LayerMask.NameToLayer(pack.layerName_)); NGUITools.SetChildLayer(pack.actorObj_.transform, LayerMask.NameToLayer(pack.layerName_)); if (pack.actorCallBack_ != null) { pack.actorCallBack_(pack.actorObj_, pack.data_); } loadedPack_.Remove(pack.uid_); } else { pack.actorObj_.SetActive(false); WeaponAssetMgr.LoadAsset(pack.hasDress_? pack.playerAssetId_: (ENTITY_ID)0, pack.weaponAssetId_, WeaponAssetLoaded, new ParamData(pack.uid_)); } }
public override void Destroyobj() { //AssetInfoMgr.Instance.DecRefCount(subUiResPath, true); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { if (AttaclEvent.getInstance.OnSetPanelActive != null) { AttaclEvent.getInstance.OnSetPanelActive(true); } } hasDestroy_ = true; GameManager.Instance.UpdatePlayermake -= UpdatePlayermakeOk; }
void Start() { playerInst = GamePlayer.Instance; //SetPlayerTitleOk = SetTitle; front = playerInst.GetIprop(PropertyType.PT_Front); nameLabel.text = playerInst.InstName; SetPlayerInfo(); //SetPlayerInfo ("无", /*PlayerData.GetData(playerInst.Properties [(int)PropertyType.PT_TableId]).Race_*/"", playerInst.Properties [(int)PropertyType.PT_Level], playerInst.Properties [(int)PropertyType.PT_Reputation], 0, "无", playerInst.Properties [(int)PropertyType.], playerInst.Properties [(int)PropertyType.PT_HpCurr], playerInst.Properties [(int)PropertyType.PT_MpCurr], playerInst.Properties [(int)PropertyType.PT_Land], playerInst.Properties [(int)PropertyType.PT_Water], playerInst.Properties [(int)PropertyType.PT_Fire], playerInst.Properties [(int)PropertyType.PT_Wind]); //raceIcon.spriteName = PlayerData.GetData (playerInst.GetIprop(PropertyType.PT_TableId)).RaceIcon_; InitPlayerFront(); UpdateInfo(); //GamePlayer.Instance.OnIPropUpdate += UpdateInfo; //SetTitle (); GamePlayer.Instance.OnUpdateConvertExp = UpdateConvertExp; UIManager.SetButtonEventHandler(frontBtn.gameObject, EnumButtonEvent.OnClick, OnClickfront, 0, 0); UIManager.SetButtonEventHandler(BackRowBtn.gameObject, EnumButtonEvent.OnClick, OnClickBackRow, 0, 0); UIManager.SetButtonEventHandler(genggaiBtn.gameObject, EnumButtonEvent.OnClick, OnClickgenggai, 0, 0); UIManager.SetButtonEventHandler(chucunBtn.gameObject, EnumButtonEvent.OnClick, OnClickchucunBtn, 0, 0); UIManager.SetButtonEventHandler(chucunCloseBtn.gameObject, EnumButtonEvent.OnClick, OnClickchucunCloseBtn, 0, 0); if (GamePlayer.Instance.titleHide_) { zhandouliLable.text = ""; } else { TitleData tData = TitleData.GetTitleData(GamePlayer.Instance.GetIprop(PropertyType.PT_Title)); if (tData == null) { zhandouliLable.text = ""; } else { zhandouliLable.text = tData.desc_; } } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { frontBtn.gameObject.SetActive(false); BackRowBtn.gameObject.SetActive(false); } GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_PlayerUIStatusSwitch); GameManager.Instance.UpdatePlayermake += UpdatePlayerTitle; }
void Start() { GlobalValue.Get(Constant.C_ResetBabyPay, out itemid); InitUIText(); RefreshGrowingUpOk = RefreshGrowingUp; RefreshGrowingUpHanOk = Refresh; HeadIconLoader.Instance.LoadIcon(ItemData.GetData(itemid).icon_, itemIcon); miaoshuLabel.text = ItemData.GetData(itemid).name_ /*LanguageManager.instance.GetValue ("babyxiaohao").Replace ("{n}",ItemData.GetData(itemid).name_)*/; UIManager.SetButtonEventHandler(enterBtn.gameObject, EnumButtonEvent.OnClick, OnClickhuanyuanBtn, 0, 0); numlabel.text = BagSystem.instance.GetItemMaxNum((uint)itemid) + "/1"; BagSystem.instance.ItemChanged += updateUI; BagSystem.instance.UpdateItemEvent += updateUI; BagSystem.instance.DelItemEvent += updateUI; hasDestroyed = false; if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
void OnEnable() { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(); } else { Uid = MainbabyProperty.idss[0]; Inst = GamePlayer.Instance.GetBabyInst(Uid); BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); type = bdata._Tpye; int Magic = bdata._BIG_Magic - Inst.gear_[(int)BabyInitGear.BIG_Magic]; int Stama = bdata._BIG_Stama - Inst.gear_[(int)BabyInitGear.BIG_Stama]; int Speed = bdata._BIG_Speed - Inst.gear_[(int)BabyInitGear.BIG_Speed]; int Power = bdata._BIG_Power - Inst.gear_[(int)BabyInitGear.BIG_Power]; int Strength = bdata._BIG_Strength - Inst.gear_[(int)BabyInitGear.BIG_Strength]; int num = Magic + Stama + Speed + Power + Strength; onesp.spriteName = BabyData.GetBabyLeveSp(num) + "_big"; oldBdata = bdata; mofaLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Magic].ToString() + "/" + bdata._BIG_Magic; tiliLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Stama].ToString() + "/" + bdata._BIG_Stama; suduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Speed].ToString() + "/" + bdata._BIG_Speed; qiangduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Power].ToString() + "/" + bdata._BIG_Power; liLiangLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Strength].ToString() + "/" + bdata._BIG_Strength; tiliSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Stama] * 1f) / (bdata._BIG_Stama * 1f); liliangSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Strength] * 1f) / (bdata._BIG_Strength * 1f); qiangduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Power] * 1f) / (bdata._BIG_Power * 1f); suduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Speed] * 1f) / (bdata._BIG_Speed * 1f); mofaSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Magic] * 1f) / (bdata._BIG_Magic * 1f); int dd = Inst.gear_[(int)BabyInitGear.BIG_Magic] + Inst.gear_[(int)BabyInitGear.BIG_Stama] + Inst.gear_[(int)BabyInitGear.BIG_Speed] + Inst.gear_[(int)BabyInitGear.BIG_Power] + Inst.gear_[(int)BabyInitGear.BIG_Strength]; dangshuLable.text = dd.ToString(); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
public static void ExcuteLoadedEvent() { Transform trans = null; if (ApplicationEntry.Instance != null) { for (int i = 0; i < ApplicationEntry.Instance.uiRoot.transform.childCount; ++i) { trans = ApplicationEntry.Instance.uiRoot.transform.GetChild(i); if (trans.gameObject.name.Equals("NameLabel")) { GameObject.Destroy(trans.gameObject); } } } Loading = false; if (OnSceneLoaded != null) { OnSceneLoaded(Scene_name); } SceneData sd = SceneData.GetData(GameManager.SceneID); if (sd == null) { return; } MusicAssetsData mdata = MusicAssetsData.GetData(sd.M_ID); if (!GlobalValue.isBattleScene(Scene_name)) { SoundTools.PlayMusic((MUSIC_ID)mdata.id_); } if (!BagSystem.instance.IsInit && !Scene_name.Equals("LoginScene") && !Scene_name.Equals("CreateRoleScene")) { NetConnection.Instance.requestBag(); } }
void OnDestroy() { btns.Clear(); UIManager.RemoveButtonEventHandler(stateBtn.gameObject, EnumButtonEvent.OnClick); UIManager.RemoveButtonEventHandler(PropertyBtn.gameObject, EnumButtonEvent.OnClick); UIManager.RemoveButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick); GuideManager.Instance.RemoveGuideAim(GuideAimType.GAT_MainBabyStatusBtn); GuideManager.Instance.RemoveGuideAim(GuideAimType.GAT_MainBabyPropertyBtn); GuideManager.Instance.RemoveGuideAim(GuideAimType.GAT_MainBabyClose); GamePlayer.Instance.OnBabyUpdate -= Babypdate; MainbabyListUI.RefreshBabyListOk -= SetBabyInfoState; MainbabyListUI.UpdateBabyMarkOnOk -= ClearText; GamePlayer.Instance.babyUpdateIpropEvent -= markBabyOn; if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { if (AttaclEvent.getInstance.OnSetPanelActive != null) { AttaclEvent.getInstance.OnSetPanelActive(true); } } }
public static void LoadSceneUI(string uiName, UIFactory.SceneUICallBack callback) { if (GlobalValue.isFBScene(uiName)) { UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_MainPanel, callback); } //else if (uiName == GlobalValue.StageName_piantoudonghuaf) //{ // UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_EmptyPanel, callback); //} else if (uiName == GlobalValue.StageName_groupScene) { //TeamUIPanel.SwithShowMe(); //UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_TeamPanel, callback); } else if (uiName == GlobalValue.StageName_CreateRoleScene) { UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_PanelXuan, callback); } else if (uiName == GlobalValue.StageName_ReLoginScene) { UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_LoginPanel, callback); } else if (GlobalValue.isBattleScene(uiName)) { UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_AttackPanel, callback); } else if (!string.IsNullOrEmpty(uiName)) { //UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_PrebattlePanel, callback); UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_MainPanel, callback); } else { if (callback != null) { callback(); } } }
// Use this for initializationitemid void Start() { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(0); } UIManager.SetButtonEventHandler(daimingBtn.gameObject, EnumButtonEvent.OnClick, OnClickDM, 0, 0); UIManager.SetButtonEventHandler(chuzhanBtn.gameObject, EnumButtonEvent.OnClick, OnClickCZ, 0, 0); GlobalValue.Get(Constant.C_BabyExpItem, out itemid); UIManager.SetButtonEventHandler(babyBank.gameObject, EnumButtonEvent.OnClick, OnClickbabyBank, 0, 0); UIManager.SetButtonEventHandler(babyDel.gameObject, EnumButtonEvent.OnClick, OnClickbabyDel, 0, 0); UIManager.SetButtonEventHandler(kjBtn.gameObject, EnumButtonEvent.OnClick, OnClickbabykjBtn, 0, 0); //UIManager.SetButtonEventHandler (babyHuiS.gameObject, EnumButtonEvent.OnClick, OnClickbabyHuiS,0, 0); UIManager.SetButtonEventHandler(changeNameBtn.gameObject, EnumButtonEvent.OnClick, OnClickchangeName, 0, 0); UIManager.SetButtonEventHandler(zhanshiBtn.gameObject, EnumButtonEvent.OnClick, OnClickzhanshiBtn, 0, 0); UIManager.SetButtonEventHandler(suodingBtn.gameObject, EnumButtonEvent.OnClick, OnClicksuodingBtn, 0, 0); UIManager.SetButtonEventHandler(shouhuiBtn.gameObject, EnumButtonEvent.OnClick, OnClickshouhuiBtn, 0, 0); UIManager.SetButtonEventHandler(jiesuoBtn.gameObject, EnumButtonEvent.OnClick, OnClickjiesuoBtn, 0, 0); ShowBabyNewName = ChangeBabyName; SetKJBtnstateEventOk = SetKJBtnstate; babyInfo = BabyInfoShow; MainbabyListUI.RefreshBabyListOk += ClearText; shouhuiBtn.gameObject.SetActive(binst.isShow_); zhanshiBtn.gameObject.SetActive(!binst.isShow_); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void Start() { item.SetActive(false); InitUIText(); UIManager.SetButtonEventHandler(selectBtn.gameObject, EnumButtonEvent.OnClick, OnClickselect, 0, 0); UIManager.SetButtonEventHandler(enterBtn.gameObject, EnumButtonEvent.OnClick, OnClickenter, 0, 0); UIManager.SetButtonEventHandler(iconObj, EnumButtonEvent.OnClick, OnClickshowTip, 0, 0); UIManager.SetButtonEventHandler(oldiconObj, EnumButtonEvent.OnClick, OnClickshowoldTip, 0, 0); //ShowbabyInfoOk = RefreshBabyData; RefreshbabyInfoOk = showNewBaby; //MainbabyUI.UpdateBabyInfoOk = UpdeateItem; // Baby inset = GamePlayer.Instance.GetBabyInst (MainbabyProperty.idss [0]); // enterBtn //BagSystem.instance.ItemChanged += UpdeateItem; //BagSystem.instance.UpdateItemEvent += updateUI; // BagSystem.instance.DelItemEvent += UpdeateItem; //enterBtn.isEnabled = false; if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
public void OpenUI(string sceneName, menuTypes type) { if (sceneName.Equals("")) { return; } UIASSETS_ID id = (UIASSETS_ID)0; switch (sceneName) { case GlobalValue.StageName_LoginScene: case GlobalValue.StageName_ReLoginScene: id = UIASSETS_ID.UIASSETS_LoginPanel; break; case GlobalValue.StageName_CreateRoleScene: id = UIASSETS_ID.UIASSETS_PanelXuan; break; //case GlobalValue.StageName_AttackScene: //case GlobalValue.StageName_AttackScene_Maze: // break; case GlobalValue.StageName_groupScene: id = UIASSETS_ID.UIASSETS_TeamPanel; break; default: if (GlobalValue.isBattleScene(sceneName)) { id = UIASSETS_ID.UIASSETS_AttackPanel; } else { id = UIASSETS_ID.UIASSETS_MainPanel; } break; } OpenUI(id, type); }
void OnEnable() { babyInfo = BabyInfoShow; ResBabyInfoOk = UpDateBabyInfo; GamePlayer.Instance.babyUpdateIpropEvent += UpDateBabyInfo; if (MainbabyProperty.idss != null) { UpDateBabyInfo(MainbabyProperty.idss[0]); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void UpdateUI(int id = 0) { tiliSim.text = ""; liliangSim.text = ""; QiangduSim.text = ""; suduSim.text = ""; mofaSim.text = ""; gongjiSim.text = ""; fangyuSim.text = ""; minjieSim.text = ""; jingshenSim.text = ""; huifuSim.text = ""; if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(); } else { if (id != 0) { Inst = GamePlayer.Instance.GetBabyInst(id); } else { Inst = GamePlayer.Instance.GetBabyInst(idss[0]); } curDian = Inst.GetIprop(PropertyType.PT_Free); propList.Clear(); SetBtnState(); ShowBabyProperty(); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { SetattackBtnState(false); } }
void Start() { InitUIText(); UpdateUI(); BabyProperty = UpdateUI; Attributes.Add(tili); Attributes.Add(liliang); Attributes.Add(Qiangdu); Attributes.Add(sudu); Attributes.Add(mofa); GamePlayer.Instance.babyUpdateIpropEvent += new RequestEventHandler <int>(UpdateUI); if (Inst != null) { if (Inst.GetIprop(PropertyType.PT_Free) == 0) { tuijian.gameObject.SetActive(false); } else { tuijian.gameObject.SetActive(true); } for (int i = 0; i < Attributes.Count; i++) { if (i == BabyData.StrongestAttribute(Inst.GetIprop(PropertyType.PT_TableId))) { tuijian.transform.position = new Vector3(tuijian.transform.position.x, Attributes[i].transform.position.y, tuijian.transform.position.z); } } } else { tuijian.gameObject.SetActive(false); } jiaBtns.Add(tiliJa, PropertyType.PT_Stama); jiaBtns.Add(liliangJa, PropertyType.PT_Strength); jiaBtns.Add(QiangduJa, PropertyType.PT_Power); jiaBtns.Add(suduJa, PropertyType.PT_Speed); jiaBtns.Add(mofaJa, PropertyType.PT_Magic); jianBtns.Add(tiliJan, PropertyType.PT_Stama); jianBtns.Add(liliangJan, PropertyType.PT_Strength); jianBtns.Add(QiangduJan, PropertyType.PT_Power); jianBtns.Add(suduJan, PropertyType.PT_Speed); jianBtns.Add(mofaJan, PropertyType.PT_Magic); foreach (UIButton bt in jiaBtns.Keys) { UIEventListener.Get(bt.gameObject).onPress = myonPress; } foreach (UIButton bt in jianBtns.Keys) { UIEventListener.Get(bt.gameObject).onPress = myonPressJian; } UIManager.SetButtonEventHandler(queding.gameObject, EnumButtonEvent.OnClick, OnClickqueding, 0, 0); UIManager.SetButtonEventHandler(tiliJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Stama, 0); // UIManager.SetButtonEventHandler (tiliJa.gameObject, EnumButtonEvent.TouchDown, OnClickTouchDown, (int)PropertyType.PT_Stama, 0); UIManager.SetButtonEventHandler(tiliJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Stama, 0); UIManager.SetButtonEventHandler(liliangJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Strength, 0); UIManager.SetButtonEventHandler(liliangJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Strength, 0); UIManager.SetButtonEventHandler(QiangduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Power, 0); UIManager.SetButtonEventHandler(QiangduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Power, 0); UIManager.SetButtonEventHandler(suduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Speed, 0); UIManager.SetButtonEventHandler(suduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Speed, 0); UIManager.SetButtonEventHandler(mofaJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Magic, 0); UIManager.SetButtonEventHandler(mofaJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Magic, 0); //UIManager.SetButtonEventHandler (GrowingUpBtn.gameObject, EnumButtonEvent.OnClick, OnClickGrowingUp,0, 0); queding.gameObject.SetActive(false); UIManager.SetButtonEventHandler(shuxingBtn.gameObject, EnumButtonEvent.OnClick, OnClickshuxingBtn, 0, 0); UIManager.SetButtonEventHandler(shuxingClose.gameObject, EnumButtonEvent.OnClick, OnClickshuxingClose, 0, 0); GuideManager.Instance.RegistGuideAim(propertyContainer, GuideAimType.GAT_MainBabyPropertyContainer); GuideManager.Instance.RegistGuideAim(queding.gameObject, GuideAimType.GAT_MainBabyPropertyConfirm); GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_BabyUIPropertySwitch); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { SetattackBtnState(false); } }
public static void LoadingAsyncScene(string name, SwitchScenEffect type = SwitchScenEffect.LoadingBar, bool withUI = true, bool withDynRes = false, bool manualClose = false, bool resetLocker = false) { if (GlobalValue.isBattleScene(name)) { GamePlayer.Instance.isInBattle = true; } else { GamePlayer.Instance.isInBattle = false; } GameManager.Instance.EnableDelayCheck(false); GuideManager.Instance.ClearMask(); GlobalInstanceFunction.Instance.ClearInvokeRepeat(); PlayerAsseMgr.ClearAll(); EffectAssetMgr.ClearAll(); Resources.UnloadUnusedAssets(); if (Loading || ScenePreloader.Instance.DiffSceneLoad(name)) { wait4LoadQue_.Clear(); WaitLoadInfo wli = new WaitLoadInfo(); wli.name_ = name; wli.type_ = type; wli.withUI_ = withUI; wli.withDynRes_ = withDynRes; wli.manualClose_ = manualClose; wli.resetLocker_ = resetLocker; wait4LoadQue_.Enqueue(wli); return; } Loading = true; if (resetLocker) { GameManager.Instance.reconnectionLocker_ = false; } ApplicationEntry.Instance.switchSceneMask_.SetActive(true); if (OnSceneBeginLoad != null) { OnSceneBeginLoad(); } UIManager.Instance.DoDeActive(); withUI_ = withUI; withDynRes_ = withDynRes; manualClose_ = manualClose; preScene_ = Scene_name; Scene_name = name; Loadtype = type; if (Scene_name.Equals(GlobalValue.StageName_ReLoginScene)) { GameManager.Instance.ClearCurrentState(); } if (type == SwitchScenEffect.LoadingBar) { UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_LoadingPanel, () => { UIFactory.Instance.CloseCurrentUI(); UIFactory.Instance.OpenUI(UIASSETS_ID.UIASSETS_LoadingPanel, menuTypes.Popup); ApplicationEntry.Instance.switchSceneMask_.SetActive(false); }); } else { GlobalInstanceFunction.LoadSceneUI(Scene_name, () => { ShowGame.Instance.ShowScenEffect(type); }); } Prebattle.Instance.ClearAssetLoadCount(); sendSceneLoaded_ = false; }
public void UpDateBabyInfo(int id) { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(0); } else { Baby inst = GamePlayer.Instance.GetBabyInst(id); if (inst == null) { return; } binst = inst; SetBabyInfo(inst); if (binst.isForBattle_) { chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(true); } else { chuzhanBtn.gameObject.SetActive(true); daimingBtn.gameObject.SetActive(false); } if (binst.GetInst().isShow_) { shouhuiBtn.gameObject.SetActive(true); zhanshiBtn.gameObject.SetActive(false); } else { shouhuiBtn.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(true); } if (binst.GetInst().isLock_) { jiesuoBtn.gameObject.SetActive(true); suodingBtn.gameObject.SetActive(false); } else { jiesuoBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(true); } } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void BabyInfoShow(int [] ids) { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(0); } else { changeNameBtn.gameObject.SetActive(true); babyDel.isEnabled = true; kjBtn.gameObject.SetActive(true); int uId = ids[0]; int assId = ids [1]; skillDatas.Clear(); Baby Inst = GamePlayer.Instance.GetBabyInst(uId); if (Inst == null) { return; } if (Inst.isForBattle_) { kjBtn.gameObject.SetActive(true); } else { kjBtn.gameObject.SetActive(false); } binst = Inst; SetBabyInfo(Inst); babyInId = uId; if (binst.isForBattle_) { chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(true); } else { chuzhanBtn.gameObject.SetActive(true); daimingBtn.gameObject.SetActive(false); } if (binst.GetInst().isShow_) { shouhuiBtn.gameObject.SetActive(true); zhanshiBtn.gameObject.SetActive(false); } else { shouhuiBtn.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(true); } if (binst.GetInst().isLock_) { jiesuoBtn.gameObject.SetActive(true); suodingBtn.gameObject.SetActive(false); } else { jiesuoBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(true); } } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void CheckReconnection(string sceneName) { if (ScenePreloader.Instance.isPreLoading) { Debug.Log("CheckReconnection : ScenePreloader.Instance.isPreLoading"); return; } StageMgr.OnSceneLoaded -= CheckReconnection; GlobalInstanceFunction.Instance.Invoke(() => { //if(AppPauseBeforeScene.Equals(StageMgr.Scene_name)) // return; if (!Application.loadedLevelName.Equals("LoginScene") && !Application.loadedLevelName.Equals("ReturnScene")) { if (NetConnection.Instance.IsShutDown) { Debug.Log("SocketHandler"); SocketHandler(555666); } else { if (AppPauseBeforeScene.Equals(StageMgr.Scene_name) && GlobalValue.isFBScene(StageMgr.Scene_name)) { return; } bool needSync = NetConnection.Instance.discard() || (isLoadingScene && GlobalValue.isBattleScene(StageMgr.Scene_name)); if (needSync) { //NetConnection.Instance.discard(); Debug.Log("requestPhoto"); ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("dataSyncing")); GameManager.Instance.ClearCurrentState(); NetConnection.Instance.requestPhoto(); } } } }, 1); }
void Start() { InitUIText(); hasDestroyed_ = false; playerInst = GamePlayer.Instance; GlobalValue.Get(Constant.C_ResetPlayerPay, out itemid); UpdateUI(); if (playerInst.GetIprop(PropertyType.PT_Free) == 0) { for (int i = 0; i < tuijianSp.Length; i++) { tuijianSp[i].gameObject.SetActive(false); } } else { for (int i = 0; i < tuijianSp.Length; i++) { tuijianSp[i].gameObject.SetActive(false); } } initFree(); jiaBtns.Add(tiliJa, PropertyType.PT_Stama); jiaBtns.Add(liliangJa, PropertyType.PT_Strength); jiaBtns.Add(QiangduJa, PropertyType.PT_Power); jiaBtns.Add(suduJa, PropertyType.PT_Speed); jiaBtns.Add(mofaJa, PropertyType.PT_Magic); jianBtns.Add(tiliJan, PropertyType.PT_Stama); jianBtns.Add(liliangJan, PropertyType.PT_Strength); jianBtns.Add(QiangduJan, PropertyType.PT_Power); jianBtns.Add(suduJan, PropertyType.PT_Speed); jianBtns.Add(mofaJan, PropertyType.PT_Magic); foreach (UIButton bt in jiaBtns.Keys) { UIEventListener.Get(bt.gameObject).onPress = myonPress; } foreach (UIButton bt in jianBtns.Keys) { UIEventListener.Get(bt.gameObject).onPress = myonPressJian; } // nameLabel.text = GamePlayer.Instance.InstName; // zhiyeLabel.text = Profession.get ((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)).jobName_; // GamePlayer.Instance.OnIPropUpdate += UpdateUI; UIManager.SetButtonEventHandler(queding.gameObject, EnumButtonEvent.OnClick, OnClickqueding, 0, 0); UIManager.SetButtonEventHandler(yijianBtn.gameObject, EnumButtonEvent.OnClick, OnClickyijian, 0, 0); if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) >= 20) { XidianBtn.gameObject.SetActive(true); UIManager.SetButtonEventHandler(XidianBtn.gameObject, EnumButtonEvent.OnClick, OnClicXidian, 0, 0); } else { XidianBtn.gameObject.SetActive(false); } UIManager.SetButtonEventHandler(tiliJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Stama, 0); UIManager.SetButtonEventHandler(tiliJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Stama, 0); UIManager.SetButtonEventHandler(liliangJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Strength, 0); UIManager.SetButtonEventHandler(liliangJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Strength, 0); UIManager.SetButtonEventHandler(QiangduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Power, 0); UIManager.SetButtonEventHandler(QiangduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Power, 0); UIManager.SetButtonEventHandler(suduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Speed, 0); UIManager.SetButtonEventHandler(suduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Speed, 0); UIManager.SetButtonEventHandler(mofaJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Magic, 0); UIManager.SetButtonEventHandler(mofaJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Magic, 0); //GameManager.Instance.GetActorClone((ENTITY_ID)playerInst.Properties[(int)PropertyType.PT_AssetId], (ENTITY_ID)playerInst.WeaponAssetID, AssetLoadCallBack, new ParamData(playerInst.InstId,playerInst.GetIprop(PropertyType.PT_AssetId)), "UI"); GuideManager.Instance.RegistGuideAim(ContainerPanel, GuideAimType.GAT_MainPlayerInfoPropertyContainer); GuideManager.Instance.RegistGuideAim(queding.gameObject, GuideAimType.GAT_MainPlayerInfoPropertyConfirm); GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_PlayerUIPropertySwitch); if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { SetBtnState(false); } }