private void Shoot(CharacterSurvival survival) { Projectile projectileGo = Instantiate(projectile, barrelTip.position, Quaternion.identity); projectileGo.SetVelocity(mobilePart.forward); survival.TakeDamage(damageAmountPerShot); }
// Properties // Components // Events #endregion #region Unity Callbacks private void Awake() { survival = character.survival; rectTransform = GetComponent <RectTransform>(); camera = Camera.main; healthImages = new Image[survival.CurrentHealth]; InstantiateImages(); startedColor = healthImages[0].color; }
void Awake() { locomotion = GetComponent <CharacterLocomotion>(); locomotion.character = this; entity = GetComponent <CharacterEntity>(); entity.character = this; animationHandler = GetComponent <AnimationHandler>(); survival = GetComponent <CharacterSurvival>(); survival.character = this; }