Ejemplo n.º 1
0
    public IEnumerator DeathRoutine()
    {
        yield return(Quake());

        debrisSystem.Play();
        renderer.color = deathColor;
        CameraJuicer.Shake(1);
        yield return(new WaitForNote(Note.Eighth));

        debrisSystem.Stop();
        yield return(new WaitForNote(Note.Eighth));
        // renderer.enabled = false;
    }
Ejemplo n.º 2
0
    private IEnumerator Dash()
    {
        Vector2 direction = moveInput;
        var     dashSpeed = dashDistance / dashDuration;

        var hits         = rb.Cast(direction, hitBuffer, dashDistance);
        var dashFraction = hits > 0 ? hitBuffer[0].distance / dashDistance : 1;

        var vfx = Instantiate(afterimageVfxPrefab, rb.position, Quaternion.identity);

        vfx.Run(direction, dashDistance, dashDuration, dashFraction);

        CameraJuicer.Shake(dashCameraShake);
        rb.velocity = direction * dashSpeed;

        yield return(new WaitForSeconds(dashDuration * dashFraction));

        fsm.ChangeToState(STATE_MOVE);
    }
Ejemplo n.º 3
0
    private IEnumerator Fire()
    {
        var hits = Physics2D.Raycast(transform.position, direction, hitFilter, hitBuffer);

        if (hits > 0)
        {
            var hitDetector = hitBuffer[0].collider.gameObject.GetComponent <HitDetector>();
            if (hitDetector != null)
            {
                hitDetector.Hit(Hit.Shot, direction);
            }
        }

        beam.startWidth = beam.endWidth = fireBeamWidth;

        CameraJuicer.Kick(direction);
        CameraJuicer.Shake();

        yield return(new WaitForSeconds(0.1f));

        beam.enabled = false;
    }
Ejemplo n.º 4
0
 private void Awake()
 {
     Debug.Assert(inst == null);
     inst = this;
 }