Exemplo n.º 1
0
    IEnumerator WaitForUpper()
    {
        print("!!!!!!!");
        GameObject cloneExclamation = Instantiate(exclamation, exclamationSpawn);

        Destroy(cloneExclamation, 0.7f);
        yield return(new WaitForSeconds(0.5f));

        punchScript.Uppercut();
    }
Exemplo n.º 2
0
    void StopTouchingMouse()
    {
        CountAndCutBool(false);

        if (!punchScript.Dodged)
        {
            //if (!punchScript.atacou)
            {
                if (punchScript.Block)
                {
                    punchScript.Block = false;
                    print("semblock");

                    return;
                }
                else
                {
                    if (velocity > minCutVelocity)
                    {
                        touchEnd = rb.position;
                    }

                    if (timeTouch > 0.02f && timeTouch < minTimeBlock && rb.position.x < -3f)
                    {
                        print("entrou tempo");
                        if (TutorialManager.instance.actualState == TutorialManager.States.Pt3 || (TutorialManager.instance.actualState == TutorialManager.States.Pt18))
                        {
                            if (punchScript.PunchIndex != 1)
                            {
                                punchScript.Atacou = true;
                                punchScript.Jab();
                                print("jab");
                            }
                        }
                    }
                    else if (timeTouch > 0.02f && timeTouch < minTimeBlock && rb.position.x > -3f)
                    {
                        if (TutorialManager.instance.actualState == TutorialManager.States.Pt5 || (TutorialManager.instance.actualState == TutorialManager.States.Pt18))
                        {
                            if (punchScript.PunchIndex != 1 && punchScript.PunchIndex != 2)
                            {
                                punchScript.Atacou = true;
                                punchScript.Cross();
                                print("direto");
                            }
                        }
                    }
                    else if ((touchEnd.x != 0) && touchEnd.y != 0)
                    {
                        if (Mathf.Abs(touchStart.x - touchEnd.x) > Mathf.Abs((touchStart.y - touchEnd.y) / 2))
                        {
                            if (TutorialManager.instance.actualState == TutorialManager.States.Pt7 || (TutorialManager.instance.actualState == TutorialManager.States.Pt18))
                            {
                                //if (touchStart.x > touchEnd.x)
                                //{
                                //    if (!punchScript.atacou)
                                //    {
                                //        punchScript.atacou = true;
                                //        punchScript.HookRight();
                                //        print("esquerda");
                                //    }
                                //}
                                //else
                                if (touchStart.x < touchEnd.x)
                                {
                                    if (punchScript.PunchIndex != 1 && punchScript.PunchIndex != 2 && punchScript.PunchIndex != 3)
                                    {
                                        punchScript.Atacou = true;
                                        punchScript.HookLeft();
                                        print("direita");
                                    }
                                }
                            }
                        }
                        else if (Mathf.Abs(touchStart.x - touchEnd.x) < Mathf.Abs((touchStart.y - touchEnd.y) / 2))
                        {
                            if (touchStart.y < touchEnd.y)
                            {
                                if (TutorialManager.instance.actualState == TutorialManager.States.Pt9 || (TutorialManager.instance.actualState == TutorialManager.States.Pt18))
                                {
                                    if (punchScript.PunchIndex != 1 && punchScript.PunchIndex != 2 && punchScript.PunchIndex != 3 && punchScript.PunchIndex != 4)
                                    {
                                        punchScript.Atacou = true;
                                        punchScript.Uppercut();
                                        print("cima");
                                    }
                                }
                            }
                            else if (touchStart.y > touchEnd.y)
                            {
                                print("baixo");
                                if (TutorialManager.instance.actualState == TutorialManager.States.Pt16 || (TutorialManager.instance.actualState == TutorialManager.States.Pt18))
                                {
                                    if (rb.position.x < -3f)
                                    {
                                        //if (!MenuController.instance.useGyro)
                                        {
                                            if (!punchScript.Hit)
                                            {
                                                if (!punchScript.Atacou)
                                                {
                                                    if (!punchScript.Block)
                                                    {
                                                        if (!punchScript.Dodged)
                                                        {
                                                            if (punchScript.HPScriptTutorial.CurrentStamina >= punchScript.StaminaDodge)
                                                            {
                                                                dodgeScript.DodgedLeft();
                                                                print("esquerdo");
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    else if (rb.position.x > -3f)
                                    {
                                        //if (!MenuController.instance.useGyro)
                                        {
                                            if (!punchScript.Hit)
                                            {
                                                if (!punchScript.Atacou)
                                                {
                                                    if (!punchScript.Block)
                                                    {
                                                        if (!punchScript.Dodged)
                                                        {
                                                            if (punchScript.HPScriptTutorial.CurrentStamina >= punchScript.StaminaDodge)
                                                            {
                                                                dodgeScript.DodgedRight();
                                                                print("direito");
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (currentBladeTrail != null)
        {
            currentBladeTrail.transform.SetParent(null);
            Destroy(currentBladeTrail, 0.5f);
        }
        touchEnd = new Vector2(0, 0);
    }