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); }
// public abstract void Fire(); public void SetDamage(InfoCollision info) { if (IsDead) { return; } if (_currentHealth > 0) { _currentHealth -= info.Damage; } if (_currentHealth <= 0) { Die(); IsDead = true; } }
public void SetDamage(InfoCollision info) { Debug.Log(info.Damage * _damageMultipler + "head damage"); OnApplyDamageChange?.Invoke(info); }
public void SetDamage(InfoCollision info) { OnApplyDamageChange?.Invoke(info); }