Exemplo n.º 1
0
 /// <summary>
 /// Shake the specified duration and amount.
 /// </summary>
 /// <param name="duration">Duration in this case is how many cycles/steps a capera is going to move</param>
 /// <param name="amount">Amount is how craze the camera is going to move</param>
 public void Shake(int duration, float amount)
 {
     instance.StopAllCoroutines();
     isFollow    = false;
     originalPos = transform.localPosition;
     instance.StartCoroutine(instance.cShake(duration, amount));
 }
Exemplo n.º 2
0
    public IEnumerator Die()
    {
        inputDelegate    = Empty;
        rotationDelegate = Empty;

        ledsIn.color = ledsOut.color = Color.black;
        GetComponent <Breakable>().Break(true);
        movementUpgradeObject.GetComponent <Breakable>().Break();
        attackUpgradeObject.GetComponent <Breakable>().Break();

        aim.gameObject.SetActive(false);

        CameraEffects cam = Camera.main.GetComponent <CameraEffects>();

        if (cam)
        {
            cam.StopAllCoroutines();
            cam.StartCoroutine(cam.Shake());
        }

        Time.timeScale = .01f;
        yield return(new WaitForSecondsRealtime(.3f));

        Time.timeScale = 1f;
    }