// 进入游戏 public void OnEnter(GameObject obj) { //PlayerPrefs.GetString("UserName"); User.Singleton.UserLogin(); HideWindow(); return; // 如果有记录 if (PlayerPrefs.HasKey("XUserName")) { // 登陆 //User.Singleton.UserLogin(); MiniServer.Singleton.user_login(PlayerPrefs.GetString("XUserName"), PlayerPrefs.GetString("XPassword")); Loading.Singleton.SetLoadingTips(); } // 否则 则进入注册或者用账号登陆界面 else { UIGameStart.GetInstance().ShowWindow(); } HideWindow(); }
// 像服务器 请求初始卡牌 public void OnAskInitCard(int newPlayer) { Debug.Log("OnAskInitCard:"); // 如果不是新手 if (newPlayer != 0) { // 请求数据 MiniServer.Singleton.user_ask_playerData(); return; } // 如果没有选卡 if (m_curCardId == 0) { Loading.Singleton.Hide(); // 如果当前状态是登陆状态 if (MainGame.Singleton.CurrentState is StateLogin) { // 如果没有显示 则显示 if (!UIGameStart.GetInstance().IsVisiable() && !UIChooseCard.GetInstance().IsVisiable()) { ShowChooseCard(); } } } }
public void MoveParabola(Vector3 targetPosition, float parabolaH, float bulletSpeed) { Vector3[] path = new Vector3[3]; path[0] = transform.position; path[1] = Vector3.Lerp(targetPosition, transform.position, 0.5f) + Vector3.up * parabolaH; path[2] = targetPosition; transform .DOPath(path, bulletSpeed, PathType.CatmullRom) .SetEase(Ease.Linear) .OnComplete(() => { Destroy(gameObject); handler_Effect.PlayEffect(EffectInfo.BULLET_BLOW, transform.position, bulletSpeed); //屏幕震动 UIGameStart uiGameStart = manager_UI.GetUI <UIGameStart>(UIEnum.GameStart); uiGameStart.AnimForShakeUI(); }); SphereCollider bulletCollider = GetComponent <SphereCollider>(); //友方敌方攻击范围颜色 string effectData = ""; if (characterType == CharacterTypeEnum.Player) { effectData = EffectInfo.FIRE_RANGE_BLUE; } else if (characterType == CharacterTypeEnum.Enemy) { effectData = EffectInfo.FIRE_RANGE_RED; } handler_Effect.PlayEffect(effectData, targetPosition, bulletSpeed, Vector3.one * bulletCollider.radius * 0.3f); }
static public UIGameStart GetInstance() { UIGameStart self = UIManager.Singleton.GetUIWithoutLoad <UIGameStart>(); if (self != null) { return(self); } self = UIManager.Singleton.LoadUI <UIGameStart>("UI/UIGameStart", UIManager.Anchor.Center); return(self); }
public void AnimForGoldShow() { Vector3 startPosition = transform.InverseTransformPoint(btSubmit.transform.position); UIGameStart uiGameStart = manager_UI.GetUI <UIGameStart>(UIEnum.GameStart); Vector3 endPostion = uiGameStart.GetGoldIconUIRootPos(); uiGameStart.AnimForPunchIvGold(timeForDelayGold); for (int i = 0; i < 50; i++) { MsgForGoldEffectView msgForGoldEffect = manager_Msg.ShowMsg <MsgForGoldEffectView>(MsgEnum.GoldEffect, "", startPosition + new Vector3(Random.Range(-300, 300), Random.Range(-100, 100))); msgForGoldEffect.SetTargetPosition(endPostion); msgForGoldEffect.SetAnimTime(timeForDelayGold); } }
public IEnumerator CoroutineForFireCD(float time) { canFire = false; float maxTime = time; //修改UI UIGameStart uiGameStart = manager_UI.GetUI <UIGameStart>(UIEnum.GameStart); while (time > 0) { if (uiGameStart != null) { uiGameStart.SetFireCD(maxTime, time); } yield return(new WaitForSeconds(0.02f)); time -= 0.02f; } if (uiGameStart != null) { uiGameStart.SetFireCD(0, 0); } canFire = true; }
// 返回 public void OnReturn(object sender, EventArgs e) { HideWindow(); UIGameStart.GetInstance().ShowWindow(); }