示例#1
0
 public override void OnHit(float damage, Transform damagedBy)
 {
     _freeze = true;
     _objectShake.Shake();
     base.OnHit(damage, damagedBy);
     StartCoroutine(Unfreeze());
 }
 public virtual void TakeDamage(float damage)
 {
     if (dead)
     {
         return;
     }
     hp -= damage;
     StartCoroutine(_shake.Shake());
     if (hp <= 0)
     {
         dead = true;
         Debug.Log(name + " being killed!");
         OnDeath();
         allies.Remove(this);
     }
 }
示例#3
0
 IEnumerator Shake()
 {
     while (gameObject)
     {
         _shake.Shake();
         yield return(new WaitForSeconds(_shake.duration));
     }
 }
示例#4
0
 public void CameraAction()
 {
     _Shaker.Shake();
     if (_TimeSlowOn)
     {
         Time.timeScale = _SlowRate;
     }
 }
示例#5
0
 void OnHit(Collider other)
 {
     if ("The Word".Equals(other.tag))
     {
         var theWord = other.GetComponent <ThePrayerWord> ();
         // MoveUp (_stepUp);
         _hp.TakeDamage(theWord.damage);
         _shake.Shake();
         ChangeAppearance();
         InstantiateHitFx(theWord.transform.position);
         theWord.SelfDestruct();
     }
     if ("The Traitor Bullet".Equals(other.tag))
     {
         var theTraitorBullet = other.GetComponent <TheTraitorBullet> ();
         _hp.TakeDamage(theTraitorBullet.damage);
         _shake.Shake();
         theTraitorBullet.SelfDestruct();
     }
 }
示例#6
0
    public void Damage()
    {
        Timelag(0.05f);

        BgShaker.Shake(ShakeTime, ShakeScale);

        GameManager.Inst().Player.Shaker.Shake(ShakeTime, ShakeScale);

        for (int i = 0; i < 4; i++)
        {
            if (GameManager.Inst().GetSubweapons(i) != null)
            {
                GameManager.Inst().GetSubweapons(i).Shaker.Shake(ShakeTime, ShakeScale);
            }
        }

        for (int i = 0; i < 4; i++)
        {
            GameManager.Inst().UiManager.MainUI.Center.Turrets[i].Shaker.Shake(ShakeTime, ShakeScale);
        }
    }