예제 #1
0
 public static void Shake(float duration, float magnitude)
 {
     if (isShaking)
     {
         return;
     }
     isShaking = true;
     instance.StartCoroutine(instance.DoShake(duration, magnitude));
 }
예제 #2
0
    public void PlayerDied(GameObject player)
    {
        if (camShake == null)
        {
            camShake = Camera.main.GetComponent <CameraShaker>();
        }
        camShake.DoShake();

        StartCoroutine(ResetPlayer(player, ContinuousRespawnTime));
    }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(_buttonForShake))
     {
         if (_shaker != null)
         {
             _shaker.DoShake(settings);
         }
     }
 }
예제 #4
0
 public static void Shake(float strength, float duration)
 {
     instance.DoShake(strength * 2.0f, duration);
 }