コード例 #1
0
        private void Update()
        {
            currentTime = Time.time;
            clickTime  += Time.deltaTime;
            if (Input.GetMouseButtonDown(0) && !GameManager.isPlayerDead &&
#if UNITY_EDITOR
                !EventSystem.current.IsPointerOverGameObject())
#else
                !EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
#endif
            {
                //델리게이트 여쭤보기
                if (currentTime > lastClickTime + jumpDealay)
                {
                    sound.PlaySound(jumpClick);
                    cliTime = currentTime;
                    //     Debug.Log("Speed   : " + "   Click  calcu : " + (currentTime - landTime));
                    prevClick     = cliTime;
                    lastClickTime = currentTime;

                    // rigbady의 혹시 모를 힘을 죽인다.
                    rd.velocity        = Vector3.zero;
                    rd.angularVelocity = Vector3.zero;
                    rd.Sleep();
                    rd.AddForce(Vector3.up * force);
                    clickTime = 0f;
                }
                //isDown = true;
                //StartCoroutine(GuageProgressDown());
            }
コード例 #2
0
        public void ColorDataCheck(string color)
        {
            if (colorData[colorCheckCnt] == color)
            {
                Debug.Log("Correct Color!!!");

                characterSound.PlaySound(clickSound);

                mySelectColor[colorCheckCnt].sprite = GetComponent <ColorSetting>().panelImageList[colorCheckCnt].sprite;

                colorCheckCnt++;

                GetComponent <ColorGameUIManager>().CorrectEffectPlay(color);

                if (colorCheckCnt >= mySelectColor.Count)
                {
                    int calculatedCnt = colorCheckCnt - wrongCnt - 1;
                    GetComponent <ColorScoreManager>().CreateStar(calculatedCnt);
                    GetComponent <ColorGameUIManager>().SetText(calculatedCnt);
                    CorrectPerfect();
                    InitGame();
                }
            }
            else
            {
                wrongCnt++;
                StartCoroutine(PointerEnterResetCoroutine());
            }
        }
コード例 #3
0
 public void PlayerJump()
 {
     if (player == null)
     {
         player = CreatePlayer.player;
     }
     characterSound.PlaySound(jumpSound);
     StartCoroutine(PlayerJumpCoroutine());
 }
コード例 #4
0
 public void PlayBoxSound()
 {
     characterSound.PlaySound(boxSound);
 }