/// <summary> /// 复活 /// </summary> public void Resurgence() { if (MyKeys.Diamond_Value > MyKeys.ResurgenceCost) { Is_Resurgence = true; MyAudio.PlayAudio(StaticParameter.s_UI_OK, false, StaticParameter.s_UI_OK_Volume); MyKeys.Diamond_Value -= MyKeys.ResurgenceCost; GameUITool.Instance.SetTheActive(GameUI.GameUI_Seconds); UMManager.Event(EventID.State_Resurgence, MyKeys.MissionName.ToString()); } HumanManager.Nature.ColliderManager.SetActive(true); }
/// <summary> /// 开始前购买道具 /// </summary> /// <param name="x"></param> public void BuyItems(int x) { Items temp = (Items)x; if (Judge(temp)) { //加入购买的道具 BuyTheItems.AddItems = temp; //购买后按键的变化 MainUITool.Instance.ItemsButton(EventSystem.current.currentSelectedGameObject); //友盟统计数据 UMManager.BuyItem(temp.ToString(), 1, 0); UMManager.Event(EventID.BuyItem, temp + " " + MyKeys.MissionName); } }
/// <summary> /// 购买护盾 /// </summary> public void BuyProtect() { MyAudio.PlayAudio(StaticParameter.s_UI_OK, false, StaticParameter.s_UI_OK_Volume); if (MyKeys.Diamond_Value > MyKeys.BuyProtectCost) { MyKeys.Diamond_Value -= MyKeys.BuyProtectCost; HumanManager.Nature.HumanManager_Script.ItemState = ItemState.Protect; UMManager.Event(EventID.InGame_Protect); } else { MyKeys.Pause_Game = true; GameUITool.Instance.SetTheActive(GameUI.GameUI_ShopDiamond); //EventSystem.current.currentSelectedGameObject.GetComponent<Image>().raycastTarget = false; MyAudio.PlayAudio(StaticParameter.s_Buy, false, StaticParameter.s_Buy_Volume); } }
/// <summary> /// 交易函数,0:购买钻石,1:购买金币,2:购买体力 /// </summary> /// <param name="x"></param> public void Business(int x) { switch (x) { case 0: break; case 1: //使用钻石购买金币 if (MyKeys.Diamond_Value > 6) { MyKeys.Diamond_Value -= 6; MyKeys.Gold_Value += 60; } else { UIManager.ActiveWindow(WindowID.WindowID_ShopDiamond); } break; case 2: //使用钻石购买体力 if (MyKeys.Diamond_Value >= MyKeys.BuyPhysicalPowerCost) { MyKeys.Diamond_Value -= MyKeys.BuyPhysicalPowerCost; MyKeys.Physical_Power_Value += 1; UMManager.Event(EventID.Buy_Power); } else { //UIManager.ActiveWindow(WindowID.WindowID_ShopZuanShi); MyAudio.PlayAudio(StaticParameter.s_No, false, StaticParameter.s_No_Volume); } break; default: Debug.Log("购买行为标记错误"); break; } }
void StatisticsSteps() { int num = Window_Ingame.Steps / 50; UMManager.Event(EventID.UnitOne_StateDead, MyKeys.MissionName + " Step:" + (num + 1) * 50); }