public void MakeEgg(Vector3 position, Vector3 direction)
    {
        PlayRandomSound(attackSoundsScream);

        // create new egg
        var newEgg = Instantiate(eggPrefab, position, this.transform.rotation) as GameObject;

        // set egg move direction
        var eggController = newEgg.GetComponent <EggController>();

        eggController.direction = direction;

        this.transform.LookAt(otherPlayer.transform.position);
        _velocity             = Vector3.zero;
        disabledControls      = true;
        _lastDisabledControls = Time.time;

        _animator.SetTrigger("Hit");

        foreach (var ps in _particleSystems)
        {
            ps.Play();
        }

        if (_screenShaker != null && Random.value < screenShakeChanceOnHit)
        {
            _screenShaker.ShakeScreen(2);
        }
    }
Esempio n. 2
0
 public void DeathShake()
 {
     ScreenShaker.ShakeScreen(deathShakeInstensity, deathShakeInstensity);
 }
Esempio n. 3
0
 public void DamageShake()
 {
     ScreenShaker.ShakeScreen(damageShakeInstensity, damageShakeDuration);
 }