Exemple #1
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (Cube.isCubeStop())
         {
             if (transform.eulerAngles.y < 5 || 355 < transform.eulerAngles.y)
             {
                 Cube.State2UpSlide();
             }
             else if (85 < transform.eulerAngles.y && transform.eulerAngles.y < 95)
             {
                 Cube.State2RightSlide();
             }
             else if (175 < transform.eulerAngles.y && transform.eulerAngles.y < 185)
             {
                 Cube.State2DownSlide();
             }
             else if (265 < transform.eulerAngles.y && transform.eulerAngles.y < 275)
             {
                 Cube.State2LeftSlide();
             }
             SlideSE.Play();
         }
     }
 }
Exemple #2
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (ControllCube.isCubeStop())
         {
             ControllCube.State2Transport(Partner_x, Partner_z);
             TransportSE.Play();
         }
     }
 }
Exemple #3
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (ControllCube.isCubeStop())
         {
             ControllCube.State2Spin();
             SpinSE.Play();
         }
     }
 }
Exemple #4
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (ControllCube.isCubeStop())
         {
             ControllCube.CubeBack();
             BackSE.Play();
         }
     }
 }
Exemple #5
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (ControllCube.isCubeStop())
         {
             ControllCube.State2Freeze();
             ClearText.SetActive(true);
             FlashScreen.SetActive(true);
             FlashScreen.GetComponent <FlashScreen>().ScreenDark(0.4f, 3);
             ClearSE.Play();
         }
     }
 }
Exemple #6
0
 void OnCollisionStay(Collision collision)
 {
     if (collision.gameObject.tag == "Cube")
     {
         if (Cube.isCubeStop())
         {
             if (transform.eulerAngles.y < 5 || 355 < transform.eulerAngles.y)
             {
                 Cube.State2Up();
                 point = new Vector3(transform.position.x, transform.position.y, transform.position.z + 0.45f);
                 axis  = Vector3.right;
                 state = STATE.force;
             }
             else if (85 < transform.eulerAngles.y && transform.eulerAngles.y < 95)
             {
                 Cube.State2Right();
                 point = new Vector3(transform.position.x + 0.45f, transform.position.y, transform.position.z);
                 axis  = Vector3.back;
                 state = STATE.force;
             }
             else if (175 < transform.eulerAngles.y && transform.eulerAngles.y < 185)
             {
                 Cube.State2Down();
                 point = new Vector3(transform.position.x, transform.position.y, transform.position.z - 0.45f);
                 axis  = Vector3.left;
                 state = STATE.force;
             }
             else if (265 < transform.eulerAngles.y && transform.eulerAngles.y < 275)
             {
                 Cube.State2Left();
                 point = new Vector3(transform.position.x - 0.45f, transform.position.y, transform.position.z);
                 axis  = Vector3.forward;
                 state = STATE.force;
             }
             ForceSE.Play();
             Invoke("DisableCollision", 1 * Time.deltaTime);
         }
     }
 }
Exemple #7
0
    void Update()
    {
        switch (FlickScript.Direction)
        {
        case "up":
            if (355 < Camera.transform.eulerAngles.y || Camera.transform.eulerAngles.y < 5)
            {
                if (Mathf.Abs(ControllCube.transform.position.z + 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Up();
                }
                FlickScript.Direction = "";
            }
            else if (85 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 95)
            {
                if (Mathf.Abs(ControllCube.transform.position.x + 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Right();
                }
                FlickScript.Direction = "";
            }
            else if (175 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 185)
            {
                if (Mathf.Abs(ControllCube.transform.position.z - 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Down();
                }
                FlickScript.Direction = "";
            }
            else if (265 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 275)
            {
                if (Mathf.Abs(ControllCube.transform.position.x - 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Left();
                }
                FlickScript.Direction = "";
            }
            break;

        case "down":
            if (355 < Camera.transform.eulerAngles.y || Camera.transform.eulerAngles.y < 5)
            {
                if (Mathf.Abs(ControllCube.transform.position.z - 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Down();
                }
                FlickScript.Direction = "";
            }
            else if (85 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 95)
            {
                if (Mathf.Abs(ControllCube.transform.position.x - 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Left();
                }
                FlickScript.Direction = "";
            }
            else if (175 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 185)
            {
                if (Mathf.Abs(ControllCube.transform.position.z + 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Up();
                }
                FlickScript.Direction = "";
            }
            else if (265 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 275)
            {
                if (Mathf.Abs(ControllCube.transform.position.x + 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Right();
                }
                FlickScript.Direction = "";
            }
            break;

        case "right":
            if (355 < Camera.transform.eulerAngles.y || Camera.transform.eulerAngles.y < 5)
            {
                if (Mathf.Abs(ControllCube.transform.position.x + 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Right();
                }
                FlickScript.Direction = "";
            }
            else if (85 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 95)
            {
                if (Mathf.Abs(ControllCube.transform.position.z - 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Down();
                }
                FlickScript.Direction = "";
            }
            else if (175 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 185)
            {
                if (Mathf.Abs(ControllCube.transform.position.x - 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Left();
                }
                FlickScript.Direction = "";
            }
            else if (265 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 275)
            {
                if (Mathf.Abs(ControllCube.transform.position.z + 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Up();
                }
                FlickScript.Direction = "";
            }
            break;

        case "left":
            if (355 < Camera.transform.eulerAngles.y || Camera.transform.eulerAngles.y < 5)
            {
                if (Mathf.Abs(ControllCube.transform.position.x - 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Left();
                }
                FlickScript.Direction = "";
            }
            else if (85 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 95)
            {
                if (Mathf.Abs(ControllCube.transform.position.z + 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Up();
                }
                FlickScript.Direction = "";
            }
            else if (175 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 185)
            {
                if (Mathf.Abs(ControllCube.transform.position.x + 1) < nStageWidth / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Right();
                }
                FlickScript.Direction = "";
            }
            else if (265 < Camera.transform.eulerAngles.y && Camera.transform.eulerAngles.y < 275)
            {
                if (Mathf.Abs(ControllCube.transform.position.z - 1) < nStageHeight / 2.0f)
                {
                    if (CubeScript.isCubeStop())
                    {
                        nFlickText.GetComponent <nFlickText>().FlickCount();
                        Invoke("SoundPlay", 4 * Time.deltaTime);
                    }
                    CubeScript.State2Down();
                }
                FlickScript.Direction = "";
            }
            break;
        }
    }