Ejemplo n.º 1
0
    private IEnumerator DoMiss()
    {
        needle.gameObject.SetActive(false);
        animOutline.SetTrigger("Miss");

        yield return(new WaitForSeconds(0.5f));

        outline.gameObject.SetActive(false);

        boostPhase = BoostPhase.End;
    }
Ejemplo n.º 2
0
    private IEnumerator PreCheck()
    {
        yield return(new WaitForSeconds(0.5f));

        needle.gameObject.SetActive(true);
        outline.gameObject.SetActive(true);

        yield return(new WaitForSeconds(0.1f));

        boostPhase = BoostPhase.Start;
    }
Ejemplo n.º 3
0
    private void Update()
    {
        switch (boostPhase)
        {
        case BoostPhase.Pre:

            working = true;
            StartCoroutine(PreCheck());
            boostPhase = BoostPhase.Waiting;
            int randomRo = UnityEngine.Random.Range(0, 360);
            // gameObject.transform.localEulerAngles = new Vector3(0, 0, randomRo);
            needle.transform.localEulerAngles = new Vector3(0, 0, 350);
            count++;
            break;

        case BoostPhase.Start:
            boostPhase = BoostPhase.Checking;
            roNeedle   = true;
            break;

        case BoostPhase.Checking:

            if (roNeedle)
            {
                needle.Rotate(Vector3.back * speedNeedle * Time.deltaTime);
            }

            if (needle.rotation.eulerAngles.z > 350)
            {
                StartCoroutine(DoMiss());
            }

            break;

        case BoostPhase.End:
            working    = false;
            boostPhase = BoostPhase.None;
            count      = 1;
            cooldownButton.Z_StartCooldown();
            break;
        }
    }
Ejemplo n.º 4
0
    private IEnumerator DoHit()
    {
        [email protected]();

        needle.gameObject.SetActive(false);
        animOutline.SetTrigger("Hit");

        yield return(new WaitForSeconds(0.5f));

        outline.gameObject.SetActive(false);

        yield return(new WaitForEndOfFrame());

        if (countCheck < count)
        {
            boostPhase = BoostPhase.End;
        }
        else
        {
            boostPhase = BoostPhase.Pre;
        }
    }
Ejemplo n.º 5
0
    public void Check()
    {
        if (GameManager_Story.instance.phase != PhaseGame.Playing)
        {
            return;
        }

        roNeedle = false;

        if (!working && boostPhase == BoostPhase.None)
        {
            [email protected]();
            boostPhase = BoostPhase.Pre;
        }
        if (needle.eulerAngles.z >= min && needle.eulerAngles.z <= max && boostPhase == BoostPhase.Checking)
        {
            StartCoroutine(DoHit());
        }
        else if (boostPhase == BoostPhase.Checking)
        {
            StartCoroutine(DoMiss());
        }
    }