예제 #1
0
    public void Attack_Decision(Result Result_Gesture)
    {
        if (Singleton.getInstance.GameState == GameState.PlayBoss)
        {
            Debug.Log(Result_Gesture);
            if (Result_Gesture == Result.Circle && Singleton.getInstance.useSKill == false && Singleton.getInstance.skill2lv > 0 && Singleton.getInstance.skill2Cooltime < 1)
            {
                Debug.Log("파멸의일격");
                useskill    = 1;
                skill_gauge = 1;
                Debug.Log(skill_gauge);
                Singleton.getInstance.useSKill = true;
                charactor_animator.SetTrigger("skill1");
                acs.clip = ac1;
                acs.Play();
            }
            else if (Result_Gesture == Result.triangle1 && Singleton.getInstance.useSKill == false && Singleton.getInstance.skill1lv > 0 && Singleton.getInstance.skill1Cooltime < 1)
            {
                Debug.Log("강해져랏!");

                Singleton.getInstance.useSKill = true;
                useskill    = 2;
                skill_gauge = 1;
            }
            else if (Singleton.getInstance.useSKill == true)
            {
                Debug.Log("들옴");
                if (useskill == 1)
                {
                    if (skill_gauge == 1)
                    {
                        if (Result_Gesture == Result.Z)
                        {
                            Debug.Log(skill_gauge);
                            charactor_animator.SetTrigger("skill2");
                            skill_gauge = 2;
                            acs.clip    = ac1;
                            acs.Play();
                        }
                        else
                        {
                            Singleton.getInstance.useSKill = false;
                            skill_gauge = 0;
                            useskill    = 0;
                            charactor_animator.SetTrigger("cancle");
                        }
                    }
                    else if (skill_gauge == 2)
                    {
                        if (Result_Gesture == Result.Z)
                        {
                            Singleton.getInstance.skill2Cooltime = 10;

                            Debug.Log(skill_gauge);
                            skill_gauge = 0;
                            useskill    = 0;
                            Singleton.getInstance.useSKill = false;
                            charactor_animator.SetTrigger("skill3");
                            bossmanager_cs.Boss_hitby(2);
                            acs.clip = ac2;
                            acs.Play();
                            finishskill = true;
                        }
                        else
                        {
                            charactor_animator.SetTrigger("cancle");
                            Singleton.getInstance.useSKill = false;
                            skill_gauge = 0;
                            useskill    = 0;
                        }
                    }
                }
                else if (useskill == 2)
                {
                    if (skill_gauge == 1)
                    {
                        if (Result_Gesture == Result.down)
                        {
                            Singleton.getInstance.skill1Cooltime = 20;
                            skill_gauge = 0;
                            useskill    = 0;
                            Singleton.getInstance.useSKill = false;
                            StartCoroutine(enu());
                        }
                        else
                        {
                            skill_gauge = 0;
                            useskill    = 0;
                            Singleton.getInstance.useSKill = false;
                        }
                    }
                }
            }
            if (Singleton.getInstance.bossState == BossState.normal && Singleton.getInstance.useSKill == false)
            {
                if (finishskill == true)
                {
                    finishskill = false;
                }
                else
                {
                    bossmanager_cs.Boss_hitby(1);
                    CharacterAttackAniamtion(Result_Gesture);
                }
            }
            else if (Singleton.getInstance.bossState == BossState.attack)
            {
                bossmanager_cs.BossattackDecision(Result_Gesture);
            }
        }
        if (Singleton.getInstance.GameState == GameState.PlayNormal)
        {
            if (Singleton.getInstance.WrongRecognize == false)
            {
                if (CreatePattern.Pattern_list_num.Count > 0)
                {
                    if ((int)Result_Gesture == CreatePattern.Pattern_list_num.Peek())
                    {
                        /// boom effect//
                        GameObject boom_effect_gb = Instantiate(Gesture_boom_effect_pf);
                        boom_effect_gb.transform.SetParent(Gesture_boom_effect_parents.transform);
                        boom_effect_gb.transform.localPosition = new Vector3(CreatePattern.Pattern_list[0].transform.localPosition.x - 10, CreatePattern.Pattern_list[0].transform.localPosition.y + 293, -1);
                        boom_effect_gb.transform.localScale    = new Vector3(1, 1, 1);
                        Destroy(boom_effect_gb, 0.5f);
                        // 삭제
                        Debug.Log(CreatePattern.Pattern_list.Count);
                        Destroy(CreatePattern.Pattern_list[0]);
                        CreatePattern.Pattern_list.RemoveRange(0, 1);
                        CreatePattern.Pattern_list_num.Dequeue();
                        Debug.Log(CreatePattern.Pattern_list.Count);

                        CharacterAttackAniamtion(Result_Gesture);
                        monstermanager_cs.Monster_hitby();
                    }
                    else
                    {
                        Fail();
                    }
                }
            }
        }
    }