Example #1
0
 public void DamageHp(float Damage)
 {
     if (!fade.fadeOnStart)
     {
         fade.fadeSmoth(new Color(.3f, 0, 0), 0, .5f, .3f, 1.0f, 0.5f);
     }
     playerSound.PlayerSound(PlayerSoundSetting.soundPack.Defance);
     Hp -= Damage;
     if (Hp < 0)
     {
         Hp = 0;
     }
     if (Hp <= 0)
     {
         playerSound.PlayerSound(PlayerSoundSetting.soundPack.Die);
         Hp      = 0;
         MyState = State.Die;
     }
 }
Example #2
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));
        }
    }
    public void SkillOn()
    {
        lineReset();
        if (SkillCheck(skill1))
        {
            currentSkill = 1;
            Debug.Log("마법1");
            playerSound.PlayerSound(PlayerSoundSetting.soundPack.DrawComplete);
            TimerOn = true;
            Complete.SetActive(true);
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.LTouch));
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.RTouch));
            return;
        }
        else if (SkillCheck(skill2))
        {
            currentSkill = 2;
            Debug.Log("마법2");
            playerSound.PlayerSound(PlayerSoundSetting.soundPack.DrawComplete);
            TimerOn = true;
            Complete.SetActive(true);
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.LTouch));
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.RTouch));
            return;
        }
        else if (SkillCheck(skill3))
        {
            currentSkill = 3;
            Debug.Log("마법3");
            playerSound.PlayerSound(PlayerSoundSetting.soundPack.DrawComplete);
            TimerOn = true;
            Complete.SetActive(true);
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.LTouch));
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.RTouch));
            return;
        }
        else if (SkillCheck(skill4))
        {
            currentSkill = 4;
            Debug.Log("마법4");
            playerSound.PlayerSound(PlayerSoundSetting.soundPack.DrawComplete);
            TimerOn = true;
            Complete.SetActive(true);
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.LTouch));
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.RTouch));
            return;
        }
        else if (SkillCheck(skill5))
        {
            currentSkill = 5;
            Debug.Log("마법5");
            playerSound.PlayerSound(PlayerSoundSetting.soundPack.DrawComplete);
            TimerOn = true;
            Complete.SetActive(true);
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.LTouch));
            PlayerViberation.StartCoroutine(Viberation.ViberationCoroutine(.3f, .3f, OVRInput.Controller.RTouch));
            return;
        }

        PointRestart();
        TimerOn = false;
        reset();
        gameObject.SetActive(false);
    }
Example #4
0
    private void SettingOff()
    {
        if (currentCorutine != null)
        {
            StopCoroutine(currentCorutine);
        }
        switch (LineDraw.curType)
        {
        case 0:                //아즈라 공격 형태 기를 모으는 형태, 오큘러스 터치의 충돌에서 출발하여 양손을 벌릴때 점차 커지며 방출
        {
            float handDis = Vector3.Distance(Hands[0].transform.position, Hands[1].transform.position);
            if (AzuraBall[AzuraBallNum] && MyState.GetMyState() != PlayerState.State.ChargingOver)
            {
                if (!AzuraBall[AzuraBallNum].GetComponent <AzuraSkill>().IsShoot())
                {
                    GameObject myTarget = PlayerTarget.getMytarget();
                    if (myTarget != null)
                    {
                        playerSound.PlayerSound(PlayerSoundSetting.soundPack.AttackSkill);
                        AzuraBall[AzuraBallNum].GetComponent <AzuraSkill>().shoot(typecheck.Skills[0].getCurrentSkill(), myTarget, handDis);
                    }
                }
            }
            for (int i = 0; i < AzuraBall.Length; ++i)
            {
                if (AzuraBall[i])
                {
                    if (!AzuraBall[i].GetComponent <AzuraSkill>().IsShoot())
                    {
                        AzuraBall[i].GetComponent <AzuraSkill>().resetDelete();
                        Azurapool.RemoveItem(AzuraBall[i]);
                        AzuraBall[i] = null;
                    }
                    //어떤 조건에 의거 Arrow삭제
                }
            }
        }
        break;

        case 1:                // 화살의 형태 화살을 장전한채로 트리거를 누르고 있을 시 기를 모아 방출
        {
            for (int i = 0; i < Arrow.Length; ++i)
            {
                if (Arrow[i])
                {
                    if (Arrow[i].GetComponent <Arrow>())
                    {
                        if (!Arrow[i].GetComponent <Arrow>().IsShooting())
                        {
                            Arrow[i].GetComponent <Arrow>().resetArrow();
                            Arrowpool.RemoveItem(Arrow[i]);
                            Arrow[i] = null;
                        }
                        //어떤 조건에 의거 Arrow삭제
                    }
                }
            }
        }
        break;

        case 2:                //전격 공격, 총알 발사 형태, 몬스터를 타겟하여 전격을 발사 형태, 저격 된 상태에서 기를 모아 방출
        {
            Beejae_Marker[0].transform.rotation = MarkerRotate;
            Beejae_Marker[1].transform.rotation = MarkerRotate;
            Beejae_Marker[0].SetActive(false);
            Beejae_Marker[1].SetActive(false);
        }
        break;

        case 3:                // 양 컨트롤러의 포인터가 맞춰졌을대 발동, 트리거를 계속 on하면 기를 모아 방출
        {
            Verbase_Marker[0].SetActive(false);
            Verbase_Marker[1].SetActive(false);
        }
        break;

        case 4:                 //바이올린 상태 전체 공격 위주, 한정된 시간에 여러번 좌우 이동을 통해 차징 공격
        {
            DellTouch = false;
            Dellcount = 0;
        }
        break;
        }
        currentCorutine = null;
    }