Example #1
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;



        if (pop == true)
        {
            GameObject.FindGameObjectWithTag("p1").GetComponent <p1>().enabled = false;
            GameObject.FindGameObjectWithTag("p2").GetComponent <p2>().enabled = false;
            if (js.stick == "i")
            {
                GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupSystem>().ClosePopup();       //팝업닫기
                pop = false;

                GameObject.FindGameObjectWithTag("p1").transform.rotation = Quaternion.Euler(new Vector3(0, -90, 0));
                GameObject.FindGameObjectWithTag("p2").transform.rotation = Quaternion.Euler(new Vector3(0, -90, 0));

                if (pop == false)
                {
                    GameObject.FindGameObjectWithTag("p1").GetComponent <p1>().enabled = true;
                    GameObject.FindGameObjectWithTag("p2").GetComponent <p2>().enabled = true;
                }
            }
        }
    }
Example #2
0
File: p1.cs Project: joosehwan/-
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;

        float angle_p1 = GameObject.FindGameObjectWithTag("p1").transform.eulerAngles.z;
        float angle_p2 = GameObject.FindGameObjectWithTag("p2").transform.eulerAngles.z;
        float angle_pc = GameObject.FindGameObjectWithTag("pCenter").transform.eulerAngles.y;

        if (angle_p1 >= 180f)
        {
            angle_p1 -= 360f;
        }
        if (angle_p2 >= 180f)
        {
            angle_p2 -= 360f;
        }
        if (angle_pc >= 180f)
        {
            angle_pc -= 360f;
        }
        angle_p1Text.text = "관절1 각도 :" + angle_p1.ToString();
        angle_p2Text.text = "관절2 각도 :" + angle_p2.ToString();
        angle_pcText.text = " 기둥각도 :" + angle_pc.ToString();

        Play();
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        if (dontpop == 1)
        {
            GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupScript>().Popup_explane();   //로딩암 설명창 먼저 띄우고
            if (js.stick == "i")
            {
                close();                    //팝업닫기
                dontpop = 2;                //딜레이 시간동안 popup_explane이 다시 시작 못하게.
                Invoke("dontpopinvoke", 1); //2초후 튜토리얼 시작하게 함.
                js.stick = "x";
            }
        }
        else if (dontpop == 3)      //튜토리얼 시작.
        {
            getpopup_1();
            if (js.stick == "i")
            {
                close();                        // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
                dontpop  = 4;
                js.stick = "x";
            }
        }
        else if (dontpop == 4)
        {
            Invoke("startp1", 1);  //튜토리얼 조종 시작

            GameObject.FindGameObjectWithTag("popupSys").GetComponent <popup_description>().enabled = false;
        }
    }
Example #4
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        if (js.stick == "g")

        {
            ++nNowCam;



            if (nNowCam >= nCamCount)

            {
                nNowCam = 0;
            }



            for (int i = 0; i < arrCam.Length; ++i)

            {
                arrCam[i].enabled = (i == nNowCam);
                js.stick          = "h";
            }
        }
    }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;

        inputLeft();
        inputRight();
        defaultKey();
    }
Example #6
0
    // Update is called once per frame
    public void Update()

    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;

        //30도 이상이 움직이면 튜토리얼 1이 시작된다.
        float angle = GameObject.FindGameObjectWithTag("pCenter").transform.eulerAngles.y;

        //오일러 각이 우리가 아는 각이다.

        if (angle >= 180f)
        {
            angle -= 360f;  Debug.Log(angle + "center");
        }
        if (dontpop == 1)
        {
            GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupScript>().Popup_4();
            if (js.stick == "i")
            {
                close();
                dontpop += 1;
                js.stick = "x";
            }
        }


        if (angle <= 30 && angle >= -30)
        {
            Play();
        }
        else
        {
            pauseAudio();
            if (dontpop == 2)       //플레이 성공조건을 만족시
            {
                invoke_popupgood(); // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupScript>().Popup_good();

                if (js.stick == "i")
                {
                    Invoke("close", 0.5f);             //GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
                    dontpop  = 3;
                    js.stick = "x";
                }
            }
            else if (dontpop == 3)
            {
                Invoke("popcamera", 0.5f);
                //GameObject.FindGameObjectWithTag("MainCamera").GetComponent<tutorial_SceanChange>().enabled = true;     //카메라 튜토리얼 키기.

                GameObject.FindGameObjectWithTag("pCenter").GetComponent <Obj_Rotate_center>().enabled   = true;
                GameObject.FindGameObjectWithTag("pCenter").GetComponent <tutorial_Arm_center>().enabled = false;
            }
        }

        Debug.Log(angle);
    }
Example #7
0
    // Update is called once per frame
    void Update()                               //회전 각도 -45 45 제한 걸기 필요.
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;

        pauseAudio();
        playAudio();

        float angle = this.transform.eulerAngles.y;     //오일러 각이 우리가 아는 각이다.
        float ang   = this.transform.rotation.y;

        if (angle > 180f)
        {
            angle -= 360f;
        }

        if (angle < 30f && angle > -30f)
        {
            if (js.stick == "e")
            {
                this.transform.Rotate(0, speed2 * 6 * Time.deltaTime, 0);
                js.stick = "x";
            }

            if (js.stick == "f")
            {
                this.transform.Rotate(0, -speed2 * 6 * Time.deltaTime, 0);
                js.stick = "x";
            }
        }
        else                 //제한범위 밖이면
        {
            if (angle > 30f) //왼쪽으로 30도가 넘으면 I 키를 눌러서 오른쪽으로 옮기게
            {
                pauseAudio();
                if (js.stick == "f")
                {
                    this.transform.Rotate(0, -speed2 * 6 * Time.deltaTime, 0);
                    js.stick = "x";
                }
            }


            if (angle < -30f) //오른쪽으로 30도가 넘으면 U키를눌러서 왼쪽으로 옮기게
            {
                pauseAudio();
                if (js.stick == "e")
                {    //임시로 기둥 돌리기
                    this.transform.Rotate(0, speed2 * 6 * Time.deltaTime, 0);
                    js.stick = "x";
                }
            }
        }
    }
Example #8
0
 // Update is called once per frame
 void Update()
 {
     js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
     if (pop == true)
     {
         if (js.stick == "i")
         {
             GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupSystem>().ClosePopup();       //팝업닫기
             Invoke("delay", 3);
         }
     }
 }
Example #9
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        if (popupcount == 0)
        {
            if (js.stick == "i")
            {
                Invoke("close", 1);

                Invoke("TriggerAni", 2);

                popupcount = 1;
            }
        }
    }
Example #10
0
 public void Update()
 {
     js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
     if (js.stick == "j")      //ESC버튼으로 메뉴창 끄고켜기
     {
         if (ESC.activeSelf)
         {
             ESC.SetActive(false);
         }
         else
         {
             ESC.SetActive(true);
         }
         js.stick = "x";
     }
 }
    public void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.CompareTag("enemy"))
        {
            float angle_p1 = GameObject.FindGameObjectWithTag("p1").transform.eulerAngles.z;
            float angle_p2 = GameObject.FindGameObjectWithTag("p2").transform.eulerAngles.z;
            float angle_pc = GameObject.FindGameObjectWithTag("pCenter").transform.eulerAngles.y;
            if (angle_p1 >= 180f)
            {
                angle_p1 -= 360f;
            }
            if (angle_p2 >= 180f)
            {
                angle_p2 -= 360f;
            }
            if (angle_pc >= 180f)
            {
                angle_pc -= 360f;
            }
            if (collision.collider.CompareTag("enemy"))
            {
                js.segment += (string.Format("{0:000}", angle_p1));
                js.segment += (string.Format("{0:000}", angle_p2));
                js.segment += (string.Format("{0:000}", angle_pc));
                seg         = js.segment;
                js.sp1.Write(seg);
                GameTimeText.text = "5초 뒤에 영상이 실행 됩니다.";
                Invoke("delay", 5);
            }
        }

        void Start()
        {
        }

        // Update is called once per frame
        void Update()
        {
            js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        }

        void delay()
        {
            SceneManager.LoadScene("난이도하_연결");
        }
    }
Example #12
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        if (popupcount == 0)
        {
            if (js.stick == "i")
            {
                Invoke("close", 1);     //팝업닫고

                popupcount = 1;
            }
        }
        else if (popupcount == 1)
        {
            Invoke("go", 3);
        }
    }
Example #13
0
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        if (dontpop == 1)
        {
            GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupScript>().Popup_1_hard();   //로딩암 설명창 먼저 띄우고
            if (js.stick == "i")
            {
                close();        //팝업닫기
                dontpop = 0;    //딜레이 시간동안 popup_explane이 다시 시작 못하게.
                Invoke("dontpopinvoke3", 1);
            }
        }
        else if (dontpop == 3)      //튜토리얼 시작.
        {
            GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupScript>().Popup_2_hard();
            if (js.stick == "i")
            {
                close();                        // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
                dontpop = 0;
                Invoke("dontpopinvoke4", 1);
            }
        }
        else if (dontpop == 4)
        {
            GameObject.FindGameObjectWithTag("popupSys").GetComponent <PopupScript>().Popup_3_hard();
            if (js.stick == "i")
            {
                close();                        // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
                dontpop = 0;
                Invoke("dontpopinvoke5", 1);
            }
        }
        else if (dontpop == 5)
        {
            Invoke("startArm", 1);  //튜토리얼 조종 시작

            GameObject.FindGameObjectWithTag("popupSys").GetComponent <popup_description_hard>().enabled = false;
        }
    }
Example #14
0
    // Update is called once per frame
    public void Update()

    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        //30도 이상이 움직이면 튜토리얼 1이 시작된다.
        if (js.stick == "i" && countFire3 == 4)
        {
            close();            // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
        }

        if (dontpop == 1)
        {
            Invoke("popup5", 0.5f);      // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupScript>().Popup_5();
            if (js.stick == "i")
            {
                Invoke("close", 0.5f);
                dontpop = 2;
            }
        }


        if (js.stick == "g")  //조건
        {
            countFire3 += 1;
            js.stick    = "x";
            if (countFire3 == 3)
            {
                Invoke("popupend", 0.5f); // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupScript>().Popup_end();

                GameObject.FindGameObjectWithTag("p1").GetComponent <p1>().enabled = true;
                GameObject.FindGameObjectWithTag("p2").GetComponent <p2>().enabled = true;
                // GameObject.FindGameObjectWithTag("MainCamera").GetComponent<tutorial_SceanChange>().enabled = false;
                countFire3 = 4;
            }
        }


        //  GameObject.FindGameObjectWithTag("p2").GetComponent<tutorial_Arm_p2>().enabled = false;     //팝업 끝내고 비활성화. 그럼 1번은 작업이 끝이겟죠?
    }
Example #15
0
    // Update is called once per frame
    public void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        //30도 이상이 움직이면 튜토리얼 1이 시작된다.

        float angle    = GameObject.FindGameObjectWithTag("p2").transform.eulerAngles.z;
        float angle_p1 = GameObject.FindGameObjectWithTag("p1").transform.eulerAngles.z;

        //오일러 각이 우리가 아는 각이다.
        if (js.stick == "c" || js.stick == "d")
        {
            SwitchButton_Text.text = "로딩암 파이프기울기 조종";
            ifput_w = 1;
        }

        if (angle >= 180f)
        {
            angle -= 360f;
        }
        //  Debug.Log(angle + "p2");
        if (dontpop == 1)
        {
            popup3();// GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupScript>().Popup_3();
            if (js.stick == "i")
            {
                close();

                dontpop  = 2;
                js.stick = "x";
            }
        }

        //Debug.Log("p2==>" + angle);
        if (dontpop == 2 && ifput_w == 1 && anglematch == false)
        {
            if (angle_p1 >= 180f)
            {
                angle_p1 -= 360f;
            }
            Play();
            // Debug.Log(angle_p1 + "==>p1의 부호는");
            if (angle_p1 > 0)   //p1이 왼쪽으로 기울었다. 10도. p2상속값도 10.
            {
                if (angle < 10 || angle > 30)
                {
                    anglematch = true;
                }                              //7~40도까지 제한
            }
            else if (angle_p1 < 0)             //p1이 음수. 오른쪽으로 기울엇다. -20도. p2상속값도-20
            {
                if (angle < -15 || angle > 5)
                {
                    anglematch = true;
                }
            }
        }

        if (dontpop == 2 && ifput_w == 1 && anglematch == true) //플레이 성공조건을 만족시
        {
            pauseAudio();                                       //로딩암 소리 한번 꺼주기.
            invoke_popupgood2();

            if (js.stick == "i")
            {
                Invoke("close", invokeSpeed); //  GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();

                ifput_w  = 2;
                js.stick = "x";
            }
        }
        else if (ifput_w == 2)
        {
            Invoke("popupcenter", 1);

            GameObject.FindGameObjectWithTag("p2").GetComponent <tutorial_Arm_p2>().enabled = false;     //팝업 끝내고 비활성화.

            //  GameObject.FindGameObjectWithTag("pCenter").GetComponent<tutorial_Arm_center>().enabled = true;
        }

        //  Debug.Log(angle);
    }
Example #16
0
    // Update is called once per frame
    public void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
        float angle2 = GameObject.FindGameObjectWithTag("p1").transform.eulerAngles.z;

        //30도 이상이 움직이면 튜토리얼 1이 시작된다.
        // float angle = transform.eulerAngles.z;     //오일러 각이 우리가 아는 각이다.

        if (angle2 >= 180f)
        {
            angle2 -= 360f;
        }

        if (js.stick == "a" || js.stick == "b")
        {
            SwitchButton_Text.text = "로딩암 상체기울기 조종";
            ifput_q  = 1;
            js.stick = "x";
        }

        if (dontpop == 1)
        {
            popup2();
            if (js.stick == "i")
            {
                close();//GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();
                dontpop += 1;
                js.stick = "x";
            }
        }

        //   Debug.Log("p1==>" + angle2);
        if ((angle2 <= 10 && angle2 >= -20) && ifput_q == 1)  //조건을 만족시.
        {
            Play();
        }
        else
        {
            if (dontpop == 2 && ifput_q == 1)
            {
                pauseAudio();                            //로딩암 소리 한번 꺼주기.
                Invoke("invoke_popupgood", invokeSpeed); //   GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupScript>().Popup_good();

                if (js.stick == "i")
                {
                    Invoke("close", invokeSpeed); // GameObject.FindGameObjectWithTag("popupSys").GetComponent<PopupSystem>().ClosePopup();

                    ifput_q  = 2;
                    js.stick = "x";
                }
            }
            else if (ifput_q == 2)
            {
                Invoke("startp2", 1);      //2번 활성화.


                GameObject.FindGameObjectWithTag("p1").GetComponent <tutorial_Arm_p1>().enabled = false;     //팝업 끝내고 비활성화. 그럼 1번은 작업이 끝이겟죠?
            }

            //연결 팝업시 클로즈는 1초 그다음 스크립트활성화는 2초 주자.
        }

        //Debug.Log(angle);
    }
Example #17
0
File: p2.cs Project: joosehwan/-
    // Update is called once per frame
    void Update()
    {
        js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;

        Play();
    }
Example #18
0
 // Update is called once per frame
 public void Update()
 {
     js = GameObject.FindGameObjectWithTag("server").GetComponent <joystickServer>() as joystickServer;
     float angle_p1 = GameObject.FindGameObjectWithTag("p1").transform.eulerAngles.z;
     float angle_p2 = GameObject.FindGameObjectWithTag("p2").transform.eulerAngles.z;
 }