Beispiel #1
0
    void Update()
    {
        if (x.activeSelf == true) //1.5f초동안 같은 자리이면 안보이게 하기
        {
            GameTime2 -= Time.deltaTime;
            if ((int)GameTime2 == 0)
            {
                x.gameObject.SetActive(false);
            }
        }


        if ((int)GameTime == 0)
        {
            nsp = FindObjectOfType <NextStagePanel>();
            nsp.NextPanel();
        }
        else if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) //터치가 감지되면
        {
            x.gameObject.SetActive(true);
            c.setCount();
            GameTime = 6;
        }
        else
        {
            GameTime -= Time.deltaTime;
        }
    }
Beispiel #2
0
    private void Update()
    {
        aud.GetData(samples, 0);
        float sum = 0;

        for (int i = 0; i < samples.Length; i++)
        {
            sum += samples[i] * samples[i];
        }
        rmsValue    = Mathf.Sqrt(sum / samples.Length);
        rmsValue    = rmsValue * modulate;
        rmsValue    = Mathf.Clamp(rmsValue, 0, 500);
        resultValue = Mathf.RoundToInt(rmsValue);

        string str = resultValue.ToString();

        txt.text = str;
        if (resultValue >= 300 && resultValue <= 499)
        {
            txt.text = "조금만 더 힘내세요!";
        }
        else if (resultValue >= 500)
        {
            nsp = FindObjectOfType <NextStagePanel>();
            nsp.NextPanel();
        }
    }
Beispiel #3
0
 private void buttonCallBack(Button buttonPressed)
 {
     if (buttonPressed == button1)
     {
         nsp = FindObjectOfType <NextStagePanel>();
         nsp.NextPanel();
     }
 }
Beispiel #4
0
    void Update()
    {
        acclerationDir = Input.acceleration;

        if (acclerationDir.sqrMagnitude >= 5f)
        {
            bosuck.gameObject.GetComponent <Rigidbody2D>().isKinematic = false;
            nsp = FindObjectOfType <NextStagePanel>();
            nsp.NextPanel();
        }
    }
Beispiel #5
0
    private void OnMouseDrag()
    {
        Vector3 mousePosition
            = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10);

        //마우스 좌표를 스크린 투 월드로 바꾸고 이 객체의 위치로 설정해 준다.
        this.transform.position = Camera.main.ScreenToWorldPoint(mousePosition);

        if (this.transform.position.x >= -1.8 && this.transform.position.x <= -1.7 &&
            this.transform.position.y >= -1.7 && this.transform.position.y <= -1.5)
        {
            nsp = FindObjectOfType <NextStagePanel>();
            nsp.NextPanel();
        }
    }
Beispiel #6
0
 // Update is called once per frame
 private void Update()
 {
     if (Input.touchCount == 2) // Touch Point Count : over 2
     {
         if (Vector2.Distance(Input.GetTouch(0).position, Input.GetTouch(1).position) < initTouchDist)
         {
             if (transform.localScale != new Vector3(0.5f, 0.5f, 1))
             {
                 transform.localScale = new Vector3(transform.localScale.x - 0.05f, transform.localScale.y - 0.05f, transform.localScale.z);
             }
         }
         initTouchDist = Vector2.Distance(Input.GetTouch(0).position, Input.GetTouch(1).position);
     }
     if (transform.localScale == new Vector3(0.5f, 0.5f, 1))
     {
         if (transform.localPosition.y > 2)
         {
             nsp = FindObjectOfType <NextStagePanel>();
             nsp.NextPanel();
         }
     }
 }
Beispiel #7
0
 public void CoinClick()
 {
     nsp = FindObjectOfType <NextStagePanel>();
     nsp.NextPanel();
 }