Exemplo n.º 1
0
 IEnumerator logicMove()
 {
     while (skillFollower.IsConfirm())
     {
         Vector3 Stick;
         Stick = InputManager_JHW.MainJoystick();
         if (Stick.z > 0.3f || Stick.x > 0.3f)
         {
             source.Play();
             ++selectSkill;
             if (selectSkill >= 5)
             {
                 selectSkill = 0;
             }
             yield return(new WaitForSeconds(1.0f));
         }
         else if (Stick.z < -0.3f || Stick.x < -0.3f)
         {
             source.Play();
             --selectSkill;
             if (selectSkill <= -1)
             {
                 selectSkill = 4;
             }
             yield return(new WaitForSeconds(1.0f));
         }
         yield return(new WaitForSeconds(.1f));
     }
     cor = false;
 }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (InputManager_JHW.LTouchHandleOn() && InputManager_JHW.LTriggerOn())
     {
         LHandAni.Play("Fist");
     }
     else if (InputManager_JHW.LTouchHandleOn())
     {
         LHandAni.Play("restDown");
     }
     else if (InputManager_JHW.LTriggerOn())
     {
         LHandAni.Play("IndexFingerDown");
     }
     else
     {
         LHandAni.Play("Idle");
     }
     if (InputManager_JHW.RTouchHandleOn() && InputManager_JHW.RTriggerOn())
     {
         RHandAni.Play("Fist");
     }
     else if (InputManager_JHW.RTouchHandleOn())
     {
         RHandAni.Play("restDown");
     }
     else if (InputManager_JHW.RTriggerOn())
     {
         RHandAni.Play("IndexFingerDown");
     }
     else
     {
         RHandAni.Play("Idle");
     }
 }
    IEnumerator KeyPad()
    {
        Vector3 Stick;

        while (this.gameObject.activeInHierarchy == true)
        {
            Stick = InputManager_JHW.MainJoystick();

            if (Stick.x < 0)
            {
                source.clip = clips[2];
                source.Play();
                index = 0;
            }

            if (Stick.x > 0)
            {
                source.clip = clips[2];
                source.Play();
                index = 1;
            }

            for (int i = 0; i < Select.Length; ++i)
            {
                Select[i].SetActive(false);
            }
            Select[index].SetActive(true);
            yield return(new WaitForSeconds(0.125f));
        }
    }
Exemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         if (choice)
         {
             Debug.Log(Singletone.Instance.stage + 3);
             sceneChange.sceneChange(Singletone.Instance.stage + 3);
         }
         else
         {
             //그냥 다시 원래 상태
             transform.parent.GetComponent <SelectMenu_Ready>().confirm = false;
             choice = false;
             gameObject.SetActive(false);
         }
     }
     if (InputManager_JHW.BButtonDown())
     {
         //그냥 원래 상태
         transform.parent.GetComponent <SelectMenu_Ready>().confirm = false;
         choice = false;
         gameObject.SetActive(false);
     }
 }
Exemplo n.º 5
0
 private void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         source.Play();
         if (index == 0)
         {
             confirm = true;
             newConfirm.SetActive(true);
             //SceneManager.LoadScene("Stage0");
         }
         if (index == 1)
         {
             Load.SetActive(true);
             this.gameObject.SetActive(false);
         }
         if (index == 2)
         {
         }            //멀티플레이
         if (index == 3)
         {
             Option.SetActive(true);
             this.gameObject.SetActive(false);
         }
     }
 }
Exemplo n.º 6
0
    IEnumerator KeyPad()
    {
        while (gameObject.activeSelf)
        {
            Vector3 Stick;
            Stick = InputManager_JHW.MainJoystick();

            if (Stick.x > 0)
            {
                choice = false;
            }

            else if (Stick.x < 0)
            {
                choice = true;
            }
            if (choice)
            {
                ui_arr[0].gameObject.SetActive(true);
                ui_arr[1].gameObject.SetActive(false);
            }
            else
            {
                ui_arr[1].gameObject.SetActive(true);
                ui_arr[0].gameObject.SetActive(false);
            }
            yield return(new WaitForSeconds(0.05f));
        }
    }
Exemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        if (MyState.GetMyState() == PlayerState.State.Talk)
        {
            return;
        }
        switch (moveType)
        {
        case MoveType.WAY_POINT:
            MoveWayPoint();
            break;

        case MoveType.LOOK_AT:
            MoveLookAt();
            break;

        case MoveType.DAYDREAM:
            MoveTouchPad();
            break;
        }
        if (InputManager_JHW.BButtonDown())
        {
            turnBack();
        }
    }
Exemplo n.º 8
0
 // Update is called once per frame
 void Update()
 {
     pos   = InputManager_JHW.SubJoystick();
     pos.y = -pos.x;
     pos.x = 0.0f;
     pos.z = 0.0f;
     transform.Rotate(pos);
 }
Exemplo n.º 9
0
 // Update is called once per frame
 void Update()
 {
     if (InputManager_JHW.AButtonDown() || Confirm.color.g == 0 || Input.GetKeyDown(KeyCode.K))
     {
         if (characterIndex < DialogueStrings[stringIndex].Length)
         {
             characterIndex = DialogueStrings[stringIndex].Length;
         }
     }
 }
Exemplo n.º 10
0
    // Update is called once per frame
    void Update()
    {
        time += Time.deltaTime;
        //Vector3 vec = test.transform.position - transform.position;
        //vec.Normalize();
        //Quaternion rotate = Quaternion.LookRotation(vec);

        //transform.rotation = rotate;

        //transform.LookAt(test.transform);
        //  transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime);
        Vector3 pos = InputManager_JHW.MainJoystick();
        Vector3 right;
        Vector3 moveDir = new Vector3();
        Vector3 forword;

        //if (InputManager_JHW.AButton())
        //{
        //   transform.Rotate(0, 10, 0);
        //}
        //Vector3 rota = InputManager_JHW.SubJoystick();
        //rota.y = rota.x;
        //rota.x = 0.0f;
        //rota.z = 0.0f;

        // Vector3 char_pos = transform.position;
        // transform.Translate(new Vector3(0.0f,0.0f,0.0f));
        // transform.Rotate(rota);
        // transform.Translate(char_pos);
        if (Singletone.Instance.Hor != 0 || Singletone.Instance.Ver != 0)
        {
            forword   = player.transform.TransformDirection(Vector3.forward);
            forword.y = 0;
            forword   = forword.normalized;
            right     = new Vector3(forword.z, 0, -forword.x);
            moveDir   = Singletone.Instance.Hor * right + Singletone.Instance.Ver * forword;
            //Dir = Vector3.forward * Singletone.Instance.Ver + Vector3.right * Singletone.Instance.Hor;
            //transform.rotation = Quaternion.LookRotation(Dir);
            Singletone.Instance.Hor = 0;
            Singletone.Instance.Ver = 0;
        }

        if (moveDir != Vector3.zero)
        {
            time                = 0.0f;
            moveDir             = moveDir.normalized;
            transform.position -= moveDir * Time.deltaTime * 6.5f;
        }

        //Vector3 pos = tt.position;
        //pos.y = 0;
        //transform.position=pos;
    }
Exemplo n.º 11
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;
        //skill이 성립되었을경우 1초간 보여준다.
        if (skillon == true)
        {
            skill_timer += Time.deltaTime;
            if (skill_timer > 1.0f)
            {
                skill_timer = 0.0f;
                skillon     = false;
            }
        }
        else
        {
            //마우스 클릭시
            //if (touchOn == false && InputManager_JHW.AButton())

            if (InputManager_JHW.RTriggerOn() && touchOn == false)
            {
                if (Mystate.GetMyState() == PlayerState.State.Nomal || Mystate.GetMyState() == PlayerState.State.Drawing)
                {
                    Mystate.SetMyState(PlayerState.State.Drawing);
                    //skill 오브젝트를 좌표에 맞게 생성한다.
                    raser.gameObject.SetActive(true);

                    Vector3 pos = raser.transform.position;
                    pos += raser.transform.forward * .1f;
                    Skills[mySkills[mytype]].transform.position = pos;

                    //Skills[mySkills[mytype]].transform.rotation = transform.rotation;
                    Skills[mySkills[mytype]].transform.rotation = Camera.main.transform.rotation;
                    Skills[mySkills[mytype]].gameObject.SetActive(true);
                    touchOn = true;
                }
            }
            else if (touchOn == true && !InputManager_JHW.RTriggerOn())
            {
                raser.gameObject.SetActive(false);
                touchOn = false;
                Skills[mySkills[mytype]].SkillOn();
                Mystate.SetMyState(PlayerState.State.Nomal);
            }
            if (InputManager_JHW.LTriggerOn() && Mystate.GetMyState() == PlayerState.State.Drawing)
            {
                raser.gameObject.SetActive(false);
                touchOn = false;
                Skills[mySkills[mytype]].SkillOn();
                Mystate.SetMyState(PlayerState.State.Nomal);
            }
        }
    }
Exemplo n.º 12
0
 // Update is called once per frame
 void Update()
 {
     if (InputManager_JHW.XButtonDown())
     {
         Draw_Rtouch.myType();
         Color = HandColor[LineDraw.curType];
         for (int i = 0; i < MpMaterial.Length; ++i)
         {
             MpMaterial[i].SetColor("_EmissionColor", Color);
         }
         ChangeParticle.SetActive(true);
         StartCoroutine(ChangeObject());
     }
 }
Exemplo n.º 13
0
    //우리 방식
    void MoveTouchPad()
    {
        Vector3 touchDir = InputManager_JHW.MainJoystick() * 2;

        if (touchDir.magnitude > 0.0f)
        {
            Vector3 camdir = camTr.TransformDirection(Vector3.forward);
            Vector3 dir    = camdir + touchDir;
            dir.Normalize();
            Vector3 moveDir = camTr.TransformDirection(dir);
            cc.SimpleMove(moveDir * speed);
            body.Play("Fastmove");
        }
    }
Exemplo n.º 14
0
 private void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         source.clip = clips[0];
         source.Play();
         if (index == 0)
         {
             confirm = true;
             Confirm.SetActive(true);
         }
         if (index == 1)
         {
             confirm = true;
             Confirm.SetActive(true);
         }
         if (index == 2)
         {
             confirm = true;
             Confirm.SetActive(true);
         }
         if (index == 3)
         {
             this.gameObject.SetActive(false);
             Main.SetActive(true);
         }
     }
     if (InputManager_JHW.BButtonDown())
     {
         source.clip = clips[1];
         source.Play();
         if (index == 0)
         {
             index = 3;
         }
         if (index == 1)
         {
             index = 3;
         }
         if (index == 2)
         {
             index = 3;
         }
         if (index == 3)
         {
             this.gameObject.SetActive(false);
             Main.SetActive(true);
         }
     }
 }
Exemplo n.º 15
0
 // Update is called once per frame
 void Update()
 {
     if (Input.anyKey)
     {
         if (Input.GetButtonDown("AButton"))
         {
             InputManager_JHW.AButton();
         }
         if (Input.GetButtonDown("BButton"))
         {
             Debug.Log("bButton");
         }
         if (Input.GetButtonDown("XButton"))
         {
             Debug.Log("xButton");
         }
         if (Input.GetButtonDown("YButton"))
         {
             Debug.Log("yButton");
         }
         if (Input.GetAxis("LTrigger") == 1)
         {
             Debug.Log("LTrigger");
         }
         if (Input.GetAxis("RTrigger") == 1)
         {
             Debug.Log("RTrigger");
         }
         if (Input.GetButtonDown("LTouchButton"))
         {
             Debug.Log("LTouchButton");
         }
         if (Input.GetButtonDown("RTouchButton"))
         {
             Debug.Log("RTouchButton");
         }
         if (Input.GetButtonDown("Menu"))
         {
             Debug.Log("Menu");
         }
         if (Input.GetAxis("LTouchHandle") > 0.5f)
         {
             Debug.Log("LTouchHandle");
         }
         if (Input.GetAxis("RTouchHandle") > 0.5f)
         {
             Debug.Log("RTouchHandle");
         }
     }
 }
Exemplo n.º 16
0
    private IEnumerator targetChange()
    {
        Vector3 Stick;
        int     index = 5;

        while (true)
        {
            Stick = InputManager_JHW.SubJoystick();
            if (Stick.x < 0)
            {
                index = 0;
            }
            else if (Stick.x > 0)
            {
                index = 1;
            }
            Vector3 RorL = Vector3.zero;
            if (index != 5)
            {
                SortTargetList();
                for (int i = 0; i < TargetCount; ++i)
                {
                    if (TargetMonster[i].gameObject != Mytarget.gameObject)
                    {
                        RorL = transform.InverseTransformPoint(TargetMonster[i].transform.position);
                    }
                    if (index == 0)
                    {
                        if (RorL.x < 0f)
                        {
                            Mytarget = TargetMonster[i];
                            break;
                        }
                    }
                    else if (index == 1)
                    {
                        if (RorL.x > 0f)
                        {
                            Mytarget = TargetMonster[i];
                            break;
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(0.5f));

            index = 5;
        }
    }
Exemplo n.º 17
0
 private void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         source.clip = clips[0];
         source.Play();
         skillChoice(RotationSkill);
     }
     if (InputManager_JHW.BButtonDown())
     {
         source.clip = clips[1];
         source.Play();
         menu.SelectMenu = -1;
         menu.confirm    = false;
     }
 }
Exemplo n.º 18
0
    //우리 방식
    void MoveTouchPad()
    {
        Vector3 touchDir = InputManager_JHW.MainJoystick();

        //if ((touchDir.magnitude > 0.0f) && !move)
        if (touchDir.magnitude > 0.0f)
        {
            Vector3 camdir = camTr.TransformDirection(Vector3.forward);
            Vector3 dir    = camdir + touchDir;
            dir.Normalize();
            Vector3 moveDir = camTr.TransformDirection(dir);
            //transform.position += moveDir * 2;
            //move = true;
            cc.SimpleMove(moveDir * speed);
        }
        //else move = false;
    }
Exemplo n.º 19
0
    private void Update()
    {
        if (InputManager_JHW.AButtonDown())
        {
            source.clip = clips[0];
            source.Play();
            if (!confirm)
            {
                SelectMenu = index;
                confirm    = true;
                player.StartCoroutine(Viberation.ViberationCoroutine(0.2f, 0.3f, OVRInput.Controller.RTouch));
                player.StartCoroutine(Viberation.ViberationCoroutine(0.2f, 0.3f, OVRInput.Controller.LTouch));
                ui_arr[SelectMenu].GetComponent <Image>().color = new Color(1, 0, 1);
                Menus[SelectMenu].transform.Translate(0, 0, -10);
                Menus[SelectMenu].transform.LookAt(Camera.main.transform);
                Menus[SelectMenu].transform.Rotate(0, 180, 0);
            }
        }
        if (InputManager_JHW.BButtonDown())
        {
            source.clip = clips[1];
            source.Play();
            if (confirm && SelectMenu >= 0)
            {
                Menus[SelectMenu].transform.rotation = Quaternion.identity;
                Menus[SelectMenu].transform.Translate(0, 0, 10);

                ui_arr[SelectMenu].GetComponent <Image>().color = new Color(1, 1, 1);
                SelectMenu = -1;
                confirm    = false;
                player.StartCoroutine(Viberation.ViberationCoroutine(0.1f, 0.1f, OVRInput.Controller.RTouch));
                player.StartCoroutine(Viberation.ViberationCoroutine(0.1f, 0.1f, OVRInput.Controller.LTouch));
            }
        }
        if (InputManager_JHW.RTriggerOn() && InputManager_JHW.LTriggerOn())
        {
            //준비 완료되었냐고 물어보는 거 확인후!!
            source.clip = clips[0];
            source.Play();
            confirm = true;
            GameStart.gameObject.SetActive(true);
            //
        }
    }
Exemplo n.º 20
0
 private void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         if (index == 1)
         {            //파일입출력으로 파일 읽어오는 코드가 필요
             source.clip = clips[0];
             source.Play();
             sceneChange.sceneChange("Ready");
         }
         if (index == 0)
         {
             source.clip = clips[1];
             source.Play();
             load.GetComponent <LoadMenu>().confirm = false;
             this.gameObject.SetActive(false);
         }
     }
 }
 private void Update()
 {
     if (InputManager_JHW.AButtonDown())
     {
         if (index == 1)
         {
             source.clip = clips[0];
             source.Play();
             Singletone.Instance.stage   = -1;
             Singletone.Instance.Myskill = new int[] { 0, -1, -1 };
             sceneChange.sceneChange("StartNew");
         }
         if (index == 0)
         {
             source.clip = clips[1];
             source.Play();
             main.GetComponent <MainMenu>().confirm = false;
             this.gameObject.SetActive(false);
         }
     }
 }
    void Update()
    {
        // mCamera.transform.LookAt(transform.position);
        //mCamera.transform.RotateAround(transform.position, Vector3.up, transform.rotation.z);

        //transform.rotation = CameraRig.transform.rotation;
        //Transform root =cc.trackingSpace;
        //Transform centerEye =cc.centerEyeAnchor;

        //if (HmdRotatesY)
        //{
        //    Vector3 prevPos = root.position;
        //    Quaternion prevRot = root.rotation;

        //    transform.rotation = Quaternion.Euler(0.0f, centerEye.rotation.eulerAngles.y, 0.0f);
        //    root.position = prevPos;
        //    root.rotation = prevRot;
        //}
        transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime);
        //transform.position = CameraRig.transform.position;
        // transform.Translate(Time.deltaTime * 1, 0, 0);
    }
Exemplo n.º 23
0
    IEnumerator KeyPad()
    {
        if (!confirm)
        {
            Vector3 Stick;
            while (this.gameObject.activeInHierarchy)
            {
                //KeyBoard
                Stick = InputManager_JHW.MainJoystick();

                if (Stick.x > 0)
                {
                    if (index != 2 && index != 3)
                    {
                        index++;
                        source.clip = clips[2];
                        source.Play();
                    }
                }

                if (Stick.x < 0)
                {
                    if (index != 0 && index != 3)
                    {
                        index--;
                        source.clip = clips[2];
                        source.Play();
                    }
                }
                for (int i = 0; i < Select.Length; ++i)
                {
                    Select[i].SetActive(false);
                }
                Select[index].SetActive(true);
                yield return(new WaitForSeconds(0.125f));
            }
        }
    }
Exemplo n.º 24
0
    void Update()
    {
        ////Vector3 vec = test.transform.position - transform.position;
        ////vec.Normalize();
        ////Quaternion rotate = Quaternion.LookRotation(vec);

        ////transform.rotation = rotate;
        //if (InputManager_JHW.AButton())
        //{
        //    transform.Rotate(0, 30, 0);
        //}
        ////transform.LookAt(test.transform);
        ////  transform.Translate(InputManager_JHW.MainJoystick() * Time.deltaTime);
        //Vector3 pos = InputManager_JHW.MainJoystick();
        //Vector3 right;
        //Vector3 moveDir=new Vector3();
        //Vector3 forword;
        //if (Singletone.Instance.Hor != 0 || Singletone.Instance.Ver!=0)
        //{
        //  forword = transform.TransformDirection(Vector3.forward);
        //    forword.y = 0;
        //    forword = forword.normalized;
        //   right = new Vector3(forword.z, 0, -forword.x);
        //   moveDir = Singletone.Instance.Hor * right + Singletone.Instance.Ver * forword;
        //    //Dir = Vector3.forward * Singletone.Instance.Ver + Vector3.right * Singletone.Instance.Hor;
        //    //transform.rotation = Quaternion.LookRotation(Dir);
        //    Singletone.Instance.Hor = 0;
        //    Singletone.Instance.Ver = 0;

        //}

        //if (moveDir != Vector3.zero)
        //{
        //    moveDir = moveDir.normalized;
        //    transform.position = moveDir;
        //}
        transform.position = InputManager_JHW.MainJoystick();
    }
Exemplo n.º 25
0
    IEnumerator KeyPad()
    {
        Vector3 Stick;

        while (this.gameObject.activeInHierarchy == true)
        {
            if (timer < 1.0f)
            {
                timer += Time.deltaTime * 25;
            }
            Stick = InputManager_JHW.MainJoystick();
            if (index < 2)
            {
                if (Stick.z > 0)
                {
                    index = 0;
                    source.Play();
                }

                if (Stick.z < 0)
                {
                    index = 1;
                    source.Play();
                }
            }
            else if (index == 4 || index == 3)
            {
                if (Stick.z > 0)
                {
                    index = 3;
                    source.Play();
                }
                if (Stick.z < 0)
                {
                    index = 4;
                    source.Play();
                }
            }

            else if (11 <= index && index <= 13)
            {
                if (Stick.x > 0 && index < 13)
                {
                    index++;
                    source.Play();
                }

                if (Stick.x < 0 && index > 11)
                {
                    index--; source.Play();
                }
            }

            else if (21 <= index && index <= 23)
            {
                if (Stick.x > 0 && index < 23)
                {
                    index++; source.Play();
                }

                if (Stick.x < 0 && index > 21)
                {
                    index--; source.Play();
                }
            }
            else if (30 <= index && index <= 33)
            {
                if (Stick.x > 0 && index < 33)
                {
                    index++; source.Play();
                }

                if (Stick.x < 0 && index > 30)
                {
                    index--; source.Play();
                }
            }

            for (int i = 0; i < Select.Length; ++i)
            {
                Select[i].SetActive(false);
            }

            if (index < 5)
            {
                Select[index].SetActive(true);
                for (int i = 0; i < 3; ++i)
                {
                    Box[i].SetActive(false);
                    Box2[i].SetActive(false);
                }
                for (int i = 0; i < 4; ++i)
                {
                    GrapicBox[i].SetActive(false);
                }
            }
            for (int i = 0; i < 3; ++i)
            {
                Box[i].SetActive(false);
                Box2[i].SetActive(false);
            }
            for (int i = 0; i < 4; ++i)
            {
                GrapicBox[i].SetActive(false);
            }
            if (11 <= index && index <= 13)
            {
                Box[index - 11].SetActive(true);
            }
            if (21 <= index && index <= 23)
            {
                Box2[index - 21].SetActive(true);
            }
            if (30 <= index && index <= 33)
            {
                GrapicBox[index - 30].SetActive(true);
            }

            yield return(new WaitForSeconds(0.125f));
        }
    }
Exemplo n.º 26
0
    private void Update()
    {
        //KeyBoard - Enter
        if (InputManager_JHW.AButtonDown())
        {
            source.Play();

            if (11 <= index && index <= 13)
            {
                sound = index;
                for (int i = 0; i < 3; ++i)
                {
                    Sound[i].SetActive(false);
                }
                Sound[sound - 11].SetActive(true);
            }

            if (21 <= index && index <= 23)
            {
                sound2 = index;
                for (int i = 0; i < 3; ++i)
                {
                    Sound2[i].SetActive(false);
                }
                Sound2[sound2 - 21].SetActive(true);
            }

            if (30 <= index && index <= 33)
            {
                grapic = index;
                for (int i = 0; i < 4; ++i)
                {
                    Grapic[i].SetActive(false);
                }
                Grapic[grapic - 30].SetActive(true);
            }

            if (index == 3)
            {
                index = sound;
            }
            if (index == 4)
            {
                index = sound2;
            }

            if (index == 0)
            {
                index = 3;
            }



            if (index == 1)
            {
                index = grapic;
            }

            if (index == 2)
            {
                this.gameObject.SetActive(false);
                Main.SetActive(true);
            }
        }
        else if (InputManager_JHW.BButtonDown())
        {
            source.Play();
            bool CheckB = false;
            if ((index == 0 || index == 1) &&
                CheckB == false)
            {
                index  = 2;
                CheckB = true;
            }
            if ((index == 2) &&
                CheckB == false)
            {
                index  = 0;
                CheckB = true;
            }
            if (index == 3 || index == 4)
            {
                index = 0;
            }
            if (11 <= index && index <= 13)
            {
                index = 3;
            }
            if (21 <= index && index <= 23)
            {
                index = 4;
            }
            if (30 <= index && index <= 33)
            {
                index = 1;
            }
        }
    }
Exemplo n.º 27
0
    IEnumerator KeyPad()
    {
        while (true)
        {
            if (!confirm)
            {
                Vector3 Stick;
                Stick = InputManager_JHW.MainJoystick();

                if (Stick.x > 0)
                {
                    if (myposit.x < 2)
                    {
                        source.clip = clips[2];
                        source.Play();
                        myposit.x++;
                    }
                }

                if (Stick.x < 0)
                {
                    if (myposit.x > 0)
                    {
                        source.clip = clips[2];
                        source.Play();
                        myposit.x--;
                    }
                }
                if (Stick.z > 0)
                {
                    {
                        source.clip = clips[2];
                        source.Play();
                        myposit.y = 1;
                    }
                }
                if (Stick.z < 0)
                {
                    {
                        source.clip = clips[2];
                        source.Play();
                        myposit.y = -1;
                    }
                }

                if (Vector2.Distance(myposit, new Vector2(-1, 1)) < 0.1f)
                {
                    index = 0;
                }
                else if (Vector2.Distance(myposit, new Vector2(0, 1)) < 0.1f)
                {
                    index = 0;
                }
                else if (Vector2.Distance(myposit, new Vector2(1, 1)) < 0.1f)
                {
                    index = 1;
                }
                else if (Vector2.Distance(myposit, new Vector2(2, 1)) < 0.1f)
                {
                    index = 2;
                }
                else if (Vector2.Distance(myposit, new Vector2(-1, -1)) < 0.1f)
                {
                    index = 3;
                }
                else if (Vector2.Distance(myposit, new Vector2(0, -1)) < 0.1f)
                {
                    index = 3;
                }
                else if (Vector2.Distance(myposit, new Vector2(1, -1)) < 0.1f)
                {
                    index = 5;
                }
                else if (Vector2.Distance(myposit, new Vector2(2, -1)) < 0.1f)
                {
                    index = 6;
                }

                for (int i = 0; i < 7; ++i)
                {
                    ui_arr[i].SetActive(false);
                    if (i == index)
                    {
                        selMenu = Menus[i];
                        ui_arr[i].SetActive(true);
                        continue;
                    }
                }
                yield return(new WaitForSeconds(0.05f));
            }

            yield return(new WaitForSeconds(0.05f));
        }
    }
Exemplo n.º 28
0
    private IEnumerator DisplatStrings(string stringToDisplay)
    {
        int stringLength         = stringToDisplay.Length;
        int currentCaracterIndex = 0;

        HideIcons();
        _textComponent.text = "";
        while (currentCaracterIndex < stringLength)
        {
            _textComponent.text += stringToDisplay[currentCaracterIndex];
            currentCaracterIndex++;
            if (currentCaracterIndex < stringLength)
            {
                if (InputManager_JHW.BButton())
                {
                    yield return(new WaitForSeconds(CharacterRateMultuplier));
                }
                else
                {
                    yield return(new WaitForSeconds(SecondsBetweenCharacters));
                }
            }
            else
            {
                break;
            }
        }
        ShowIcon();
        while (true)
        {
            if (InputManager_JHW.BButtonDown())
            {
                if (_isEndofDialogue)
                {
                    dia_Play.setEnd(true);
                    if (WaveStart.Length > 0)
                    {
                        myState.SetMyState(PlayerState.State.Nomal);
                        dia_Play.setPlay(true);
                        if (WaveStart[wavecnt] != null)
                        {
                            Debug.Log(WaveStart[wavecnt]);
                            WaveStart[wavecnt].GetComponent <MobGenerater>().Wave_Start = true;
                            wavecnt++;
                        }
                        else
                        {
                            Debug.Log(WaveStart[wavecnt]);
                        }
                    }
                }
                break;
            }
            yield return(0);
        }
        HideIcons();
        _isStringBeingRevealed = false;
        _textComponent.text    = "";
        if (_isEndofDialogue)
        {
            _isEndofDialogue = false;
            dia_Play.setPlay(true);
        }
    }
Exemplo n.º 29
0
    // Update is called once per frame
    void Update()
    {
        if (InputManager_JHW.LTriggerOn() && InputManager_JHW.RTriggerOn())
        {
            if (MyState.GetMyState() == PlayerState.State.Nomal)
            {
                MyState.SetMyState(PlayerState.State.Attack);
                if (currentCorutine == null)
                {
                    flug = true;
                    switch (LineDraw.curType)
                    {
                    case 0:                            //아즈라 공격 형태 기를 모으는 형태, 오큘러스 터치의 충돌에서 출발하여 양손을 벌릴때 점차 커지며 방출
                    {
                        currentCorutine = StartCoroutine(AzuraControll());
                    }
                    break;

                    case 1:                            // 화살의 형태 화살을 장전한채로 트리거를 누르고 있을 시 기를 모아 방출
                    {
                        currentCorutine = StartCoroutine(SeikwanControll());
                    }
                    break;

                    case 2:                            //전격 공격, 총알 발사 형태, 몬스터를 타겟하여 전격을 발사 형태, 저격 된 상태에서 기를 모아 방출
                    {
                        currentCorutine = StartCoroutine(BeejaeControll());
                    }
                    break;

                    case 3:                            // 양 컨트롤러의 포인터가 맞춰졌을대 발동, 트리거를 계속 on하면 기를 모아 방출 베르베시
                    {
                        currentCorutine = StartCoroutine(VerbaseControll());
                    }
                    break;

                    case 4:                            //바이올린 상태 전체 공격 위주, 한정된 시간에 여러번 좌우 이동을 통해 차징 공격
                    {
                        currentCorutine = StartCoroutine(DellControll());
                    }
                    break;
                    }
                }
            }
        }
        else if ((!InputManager_JHW.RTriggerOn() && !InputManager_JHW.LTriggerOn()) && flug)
        {
            flug = false;
            MyState.SetMyState(PlayerState.State.Nomal);
            SettingOff();
        }
        if (MyState.GetMyState() == PlayerState.State.ChargingOver)
        {
            SettingOff();
        }
        if (LineDraw.curType == 1)
        {
            for (int i = 0; i < Arrow.Length; ++i)
            {
                if (Arrow[i])
                {
                    if (Arrow[i].GetComponent <SeiKwanSkill>().IsDelete())
                    {
                        Arrow[i].GetComponent <SeiKwanSkill>().resetDelete();
                        Arrowpool.RemoveItem(Arrow[i]);
                        Arrow[i] = null;
                    }
                    //어떤 조건에 의거 Arrow삭제
                }
            }
        }
        else if (LineDraw.curType == 0)
        {
            for (int i = 0; i < AzuraBall.Length; ++i)
            {
                if (AzuraBall[i])
                {
                    if (AzuraBall[i].GetComponent <AzuraSkill>().IsDelete())
                    {
                        AzuraBall[i].GetComponent <AzuraSkill>().resetDelete();
                        Azurapool.RemoveItem(AzuraBall[i]);
                        AzuraBall[i] = null;
                    }
                    //어떤 조건에 의거 AzuraBall삭제
                }
            }
        }
    }
Exemplo n.º 30
0
    private IEnumerator SeikwanControll()
    {
        bool    instance = false;
        float   distance = 0.0f;
        Vector3 Seikwan  = ArrowPrefab.transform.localScale;
        int     ArrowNum = new int();

        while (flug)
        {
            if (!instance && (AzuraHands[0].GetTouch() || AzuraHands[1].GetTouch()) &&
                (InputManager_JHW.LTriggerOn() && InputManager_JHW.RTriggerOn()))
            {
                instance = true;
                for (int i = 0; i < Arrow.Length; ++i)
                {
                    if (Arrow[i] == null)
                    {
                        ArrowNum = i;
                        Arrow[i] = Arrowpool.NewItem();
                        Arrow[i].transform.position = Hands[0].transform.position;
                        Rigidbody r = Arrow[i].GetComponent <Rigidbody>();
                        r.useGravity = false;
                        r.velocity   = new Vector3(0, 0, 0);
                        break;
                    }
                    //5발 다쏘고 난다음도 생각해야함
                }
                MyState.SetMyState(PlayerState.State.Charging, typecheck.Skills[1].GetSkillChargingTime());
            }
            else if (instance)
            {
                float handDis = Vector3.Distance(Hands[0].transform.position, Hands[1].transform.position);
                if ((!InputManager_JHW.RTriggerOn() && InputManager_JHW.LTriggerOn()))
                {
                    if (!Arrow[ArrowNum].GetComponent <SeiKwanSkill>().IsShoot())
                    {
                        //Rigidbody r = Arrow[ArrowNum].GetComponent<Rigidbody>();
                        //Vector3 Arrowforward = Arrow[ArrowNum].transform.forward;
                        GameObject myTarget = PlayerTarget.getMytarget();
                        //Vector3 TargettingDir = Vector3.zero;
                        if (myTarget != null)
                        {
                            playerSound.PlayerSound(PlayerSoundSetting.soundPack.AttackSkill);
                            Arrow[ArrowNum].GetComponent <SeiKwanSkill>().shoot(typecheck.Skills[1].getCurrentSkill(), myTarget, handDis);
                        }
                        else
                        {
                            if (typecheck.Skills[1].getCurrentSkill() == 1)
                            {
                                playerSound.PlayerSound(PlayerSoundSetting.soundPack.AttackSkill);
                                Arrow[ArrowNum].GetComponent <SeiKwanSkill>().shoot(typecheck.Skills[1].getCurrentSkill(), myTarget, handDis);
                            }
                            else
                            {
                                Arrow[ArrowNum].GetComponent <SeiKwanSkill>().resetDelete();
                                Arrowpool.RemoveItem(Arrow[ArrowNum]);
                                Arrow[ArrowNum] = null;
                            }
                        }

                        instance = false;
                        distance = 0.0f;
                        MyState.CharginTimeReset();
                    }
                    Debug.Log(Hands[0].transform.position);
                }
                else
                {
                    Vector3 ArrowPos  = (Hands[0].transform.position + Hands[1].transform.position) / 2;
                    Vector3 LookAtpos = Hands[0].transform.position;
                    if (!MyState.IsBack())
                    {
                        if (Hands[0].transform.localPosition.x < 0)
                        {
                            LookAtpos.z -= 0.06f;
                        }
                        else
                        {
                            LookAtpos.z += 0.06f;
                        }
                    }
                    else
                    {
                        Debug.Log(Hands[0].transform.localPosition.x);
                        if (Hands[0].transform.localPosition.x < 0)
                        {
                            LookAtpos.z += 0.06f;
                        }
                        else
                        {
                            LookAtpos.z -= 0.06f;
                        }
                    }

                    ArrowPos += Hands[0].transform.forward * 0.05f;
                    Arrow[ArrowNum].transform.LookAt(LookAtpos);
                    Arrow[ArrowNum].transform.position = ArrowPos;

                    if (handDis > distance)
                    {
                        distance  = handDis;
                        Seikwan.z = distance * 10;
                        Arrow[ArrowNum].transform.localScale = Seikwan;
                    }
                }
            }
            yield return(new WaitForSeconds(0.03f));
        }
    }