void ClickStartBtEvent(ButtonState val)
    {
        //ScreenLog.Log("Jixuyouxi::ClickStartBtEvent -> val " + val);
        if (val == ButtonState.DOWN)
        {
            return;
        }

        if (GlobalScript.GetInstance().player.IsGameOver || GlobalScript.GetInstance().player.Life > 0)
        {
            return;
        }

        if (GlobalData.GetInstance().Icon >= GlobalData.GetInstance().XUTOUBI ||
            GlobalData.GetInstance().IsFreeMode)
        {
            AudioManager.Instance.PlaySFX(StartBtAudio);
            GlobalData.GetInstance().Icon -= GlobalData.GetInstance().XUTOUBI;
            if (pcvr.GetInstance() != null)
            {
                pcvr.GetInstance().SubPlayerCoin(GlobalData.GetInstance().XUTOUBI);
            }
            GlobalScript.GetInstance().player.AddLife(GlobalData.GetInstance().GAMETIME);
            start.SetActive(false);
            qingtoubi.SetActive(false);
            pcvr.StartLightStateP1 = LedState.Mie;
            pcvr.OpenGameDongGan();
            GlobalScript.GetInstance().player.Energy = (float)BufferKind.Dianchi;
            GuidanceImg.OpenYouMenUI();
        }
    }
 // Use this for initialization
 void Start()
 {
     _Instance         = this;
     wangqiuUI         = WangqiuGuidance.GetComponent <UISprite>();
     wangqiuUI.enabled = false;
     dianchiUI         = DianchiGuidance.GetComponent <UISprite>();
     dianchiUI.enabled = false;
     GlobalScript.GetInstance().player.showDianchiGuidanceEvent += showDianchiGuidanceEvent;
     GlobalScript.GetInstance().player.showWangqiuGuidanceEvent += showWangqiuGuidanceEvent;
 }
Beispiel #3
0
    public IEnumerator Gogo()
    {
        if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode &&
            NetworkServerScript != null &&
            NetworkServerScript.GetIsServer())
        {
            yield break;
        }

        if (netCtrlScript != null)
        {
            ScreenLog.Log("Gogo -> PlayerIntoGameCount " + netCtrlScript.PlayerIntoGameCount
                          + ", CountLinkPlayer " + NetCtrl.CountLinkPlayer);
            if (netCtrlScript.PlayerIntoGameCount < NetCtrl.CountLinkPlayer)
            {
                yield return(new WaitForSeconds(1.0f));

                yield return(Gogo());
            }
        }

        Invoke("playAudioTime", 0.5f);
        ui.spriteName = "go3";
        PlayTween();
        yield return(new WaitForSeconds(1));

        Invoke("playAudioTime", 0.5f);
        ui.spriteName = "go2";
        PlayTween();
        yield return(new WaitForSeconds(1));

        Invoke("playAudioTime", 0.5f);
        ui.spriteName = "go1";
        PlayTween();
        BikeCamera.bIsAimPlayer = true;
        yield return(new WaitForSeconds(1));

        Invoke("playAudioTime", 0.5f);
        ui.spriteName = "go";
        PlayTween();
        //这里添加代码自行车开始可以控制.
        GlobalScript.GetInstance().player.StartGame();
        yield return(new WaitForSeconds(1));

        gameObject.SetActive(false);
        pcvr.OpenGameDongGan();
        GuidanceImg.OpenYouMenUI();
    }