コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (DanceStartedREF == true)
        {
            DanceToCopy.enabled = true;
        }
        else
        {
            DanceToCopy.enabled = false;
        }

        DanceStartedREF = PlayerREF.GetComponent <playercontrol>().DanceStarted;
        if (GameisOver == true)
        {
            if (Input.anyKeyDown)
            {
                SceneManager.LoadScene(0);
            }
        }

        FailText.text  = FailTick.ToString();
        ScoreText.text = ScoreTick.ToString();
        if (FailTick >= 3)
        {
            GameOverPanel.SetActive(true);

            GameisOver = true;
        }
        if (DanceStartedREF == false)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                SpacePressed = true;
                StartCoroutine(SpaceDelay());

                if (CurrentDance == CPUDance)
                {
                    CompareText.text = "Correct";
                    ScoreTick       += 10;
                    // Debug.Log("Correct");
                }
                else
                {
                    CompareText.text = "Fail";
                    FailTick++;
                    //Debug.Log("Fail");
                }
            }
        }

        Vignette.color = alphacolor;
    }
コード例 #2
0
        public void OnYesBtnClick()
        {
            controller.transform.localScale = Vector3.zero;
            NationManager.Instance.SureEvent(delegate(Hashtable result)
            {
                UITweener[] tweeners = controller.transform.GetComponents <UITweener>();
                if (result != null)
                {
                    Hotfix_LT.Data.NationSpecialEventTemplate tpl = Hotfix_LT.Data.EventTemplateManager.Instance.GetNationSpecialEventTpl(mEventId);
                    if (tpl != null)
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.desc);
                    }
                    int eventResult = EB.Dot.Integer("nation.eventResult", result, -1);
                    if (eventResult == 0) //成功
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.result_desc1);
                        TipsLabel.color = LT.Hotfix.Utility.ColorUtility.GreenColor;
                        FusionAudio.PostEvent("UI/New/GuoZhanHao", true);
                        SuccessTick.CustomSetActive(true);
                        FailTick.CustomSetActive(false);
                    }
                    else if (eventResult == 1)
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.result_desc2);
                        TipsLabel.color = LT.Hotfix.Utility.ColorUtility.RedColor;
                        FusionAudio.PostEvent("UI/New/GuoZhanHuai", true);
                        SuccessTick.CustomSetActive(false);
                        FailTick.CustomSetActive(true);
                    }
                    else
                    {
                        EB.Debug.LogError("nation.eventResult error : result={0}", eventResult);
                    }

                    YesBtnGO.CustomSetActive(false);
                    NOBtnGO.CustomSetActive(false);
                    SureBtnGO.CustomSetActive(true);
                }

                for (int j = 0; j < tweeners.Length; ++j)
                {
                    tweeners[j].tweenFactor = 0;
                    tweeners[j].PlayForward();
                }
            });
        }