//进行一次收费 public void PayMoney(PayMoneyData paydata, GuiUiSceneBase callui) { //检测钱够不够 if (playerdata.playerMoney < paydata.money) { //激活收费框 GuiExtendButtonGroup buttonGroup = callui.GetComponent <GuiExtendButtonGroup>(); if (buttonGroup != null) { buttonGroup.IsWorkDo = false; } #if _GameType_BaoYue UiSceneNotEnoughMoney em = callui.LoadResource_UIPrefabs("notenougmoney.prefab").GetComponent <UiSceneNotEnoughMoney>(); em.Initialization(paydata, callui); #else UiSceneRechargeAsk recharge = callui.LoadResource_UIPrefabs("rechargeask.prefab").GetComponent <UiSceneRechargeAsk>(); recharge.Initialization(paydata, callui); #endif // _GameType_BaoYue return; } //扣除钱 playerdata.playerMoney -= paydata.money; //回调扣钱成功的函数 paydata.callbackFun(paydata, true); }
//一个子UI删除 public override void OnChildUIRelease(GuiUiSceneBase ui) { if (ui is UiSceneCharacterLevelSale) { IntoGame(); } }
//这里的场景初始化只是做场景的构造,对场景的配置不应该放在这里 public override void Initialization() { base.Initialization(); //开始音乐播放 MusicPlayer.Stop(true); MusicPlayer.workMode = MusicPlayer.MusicPlayerWorkMode.Mode_Normal; //MusicPlayer.Play("game.mp3", true); //设置环境参数 IGamerProfile.Instance.gameEviroment.fireCount = 0; IGamerProfile.Instance.gameEviroment.killCount = 0; IGamerProfile.Instance.gameEviroment.useTime = (float)IGamerProfile.gameLevel.mapData[IGamerProfile.Instance.gameEviroment.mapIndex]. levelData[IGamerProfile.Instance.gameEviroment.mapLevelIndex].time; //加载游戏主UI //UiSceneUICamera.Instance.CreateAloneScene(UiSceneUICamera.UISceneId.Id_UIGameMain); //载入完成了去掉加载界面 GuiUiSceneBase loading = UiSceneUICamera.Instance.FindPoolingScene((int)UiSceneUICamera.UISceneId.Id_UIGameLoading); if (loading != null) { UiSceneUICamera.Instance.RemovePoolingScene((int)UiSceneUICamera.UISceneId.Id_UIGameLoading); ((IUniGameBootFace1)loading.gameObject.GetComponent <IUniGameBootFace1>()).CloseGameBootFace(); } //首先在延迟时间后调整枪的角度 Invoke("AujstGunZoom", 2.0f); }
protected override void Start() { base.Start(); if (selectObject == null) { GuiUiSceneBase uiscene = GetComponent <GuiUiSceneBase>(); if (uiscene != null) { selectObject = uiscene.AllocSelectFlag(); if (selectObject != null) { selectObject.transform.parent = transform; } } } if (isAutoWork) { IsWorkDo = true; } else { CurrentSelectButtonIndex = CurrentSelectButtonIndex; } #if PLATFORM_CYBER IsUseButtonOkUp = true; #endif }
//一个子UI删除 public override void OnChildUIRelease(GuiUiSceneBase ui) { if (ui is UiSceneGameBack) { //重新开始工作 IsStartWork = true; } }
//一个子UI删除 public override void OnChildUIRelease(GuiUiSceneBase ui) { if (ui is UiSceneRechargeAsk) { //重新设置会光标 buttonGroup.IsWorkDo = true; } }
public void Initialization(IGamerProfile.PayMoneyData paydata, GuiUiSceneBase callui) { currentPayMoneyData = paydata; currentCallui = callui; //获取使用的充值ID rechargeId = IGamerProfile.Instance.CheckDefBuyItemId(currentPayMoneyData); rmbNumber.Text = IGamerProfile.gameBaseDefine.jewelData.buyJewelList[rechargeId].rmb.ToString(); moneyNumber.Text = IGamerProfile.gameBaseDefine.jewelData.buyJewelList[rechargeId].jewel.ToString(); }
public void ReleasePoolingScene(int id) { GuiUiSceneBase p = FindPoolingScene(id); if (p != null) { PoolingSceneList.Remove(id); UnityEngine.Object.DestroyObject(p.gameObject); } }
public GuiUiSceneBase FindPoolingScene(int id) { GuiUiSceneBase ret = null; if (!PoolingSceneList.TryGetValue(id, out ret)) { return(null); } return(ret); }
//构造一个选择对象 public virtual GuiSelectFlag AllocSelectFlag() { GuiUiSceneBase ptr = UICamreaPtr; if (ptr == null) { return(null); } return(ptr.AllocSelectFlag()); }
protected override void OnDestroy() { base.OnDestroy(); if (transform.parent != null) { GuiUiSceneBase parent = transform.parent.GetComponent <GuiUiSceneBase>(); if (parent != null) { parent.OnChildUIRelease(this); } } }
//一个子UI删除 public override void OnChildUIRelease(GuiUiSceneBase ui) { if (ui is UiSceneGameHelp) { //重新设置会光标 buttonGroup.IsWorkDo = true; } else if (ui is UiSceneGameClose) { //重新设置会光标 buttonGroup.IsWorkDo = true; } else if (ui is UiSceneLoginAward) { IntoGame(); } }
public GuiUiSceneBase ActiveAloneUiScene(string prefabsName, params object[] args) { if (AloneScene != null) { UnityEngine.Object.DestroyObject(AloneScene.gameObject); AloneScene = null; } if (prefabsName != "") { AloneScene = LoadResource_UIPrefabs(prefabsName).GetComponent <GuiUiSceneBase>(); if (AloneScene != null) { AloneScene.SetTransferParameter(args); } } return(AloneScene); }
public GuiUiSceneBase ActivePoolingScene(string prefabsName, params object[] args) { if (prefabsName == "") { return(null); } GuiUiSceneBase s = LoadResource_UIPrefabs(prefabsName).GetComponent <GuiUiSceneBase>(); if (s == null) { return(null); } if (PoolingSceneList.ContainsKey(s.uiSceneId)) { UnityEngine.Object.DestroyObject(s.gameObject); return(null); } PoolingSceneList.Add(s.uiSceneId, s); s.SetTransferParameter(args); return(s); }
public void Initialization(IGamerProfile.PayMoneyData paydata, GuiUiSceneBase callui) { currentPayMoneyData = paydata; currentCallui = callui; }
//一个子UI删除 public virtual void OnChildUIRelease(GuiUiSceneBase ui) { }