Esempio n. 1
0
        public virtual void SetDamage(InfoCollision info)
        {
            if (_projector == null)
            {
                return;
            }
            var projectorRotation  = Quaternion.FromToRotation(-Vector3.forward, info.Contact.normal);
            var _instantiateObject = Instantiate(_projector, info.Contact.point + info.Contact.normal * OFFSET,
                                                 projectorRotation); // TODO manager

            _instantiateObject.transform.rotation = Quaternion.Euler
                                                        (_instantiateObject.transform.eulerAngles.x,
                                                        _instantiateObject.transform.eulerAngles.y,
                                                        Random.Range(0, 360));
            Destroy(_instantiateObject.gameObject, _delayToDestroy);
        }
Esempio n. 2
0
        // public abstract void Fire();

        public void SetDamage(InfoCollision info)
        {
            if (IsDead)
            {
                return;
            }

            if (_currentHealth > 0)
            {
                _currentHealth -= info.Damage;
            }

            if (_currentHealth <= 0)
            {
                Die();
                IsDead = true;
            }
        }
Esempio n. 3
0
 public void SetDamage(InfoCollision info)
 {
     Debug.Log(info.Damage * _damageMultipler + "head damage");
     OnApplyDamageChange?.Invoke(info);
 }
Esempio n. 4
0
 public void SetDamage(InfoCollision info)
 {
     OnApplyDamageChange?.Invoke(info);
 }