// Use this for initialization void Start() { animator = GetComponent <Animator>(); player = GameObject.Find("Player"); beingAttacked = GetComponent <BeingAttacked>(); if (beingAttacked == null) { custom = true; } }
void OnEnable() { // TODO: Wallmaster sounds for when you enter/exit the room utility = Camera.main.GetComponent <GameUtilities>(); rend = GetComponent <SpriteRenderer>(); rb = GetComponent <Rigidbody>(); player = GameObject.Find("Player"); playerAttacked = player.GetComponent <BeingAttacked>(); inventory = GetComponent <EnemyInventory>(); cam = Camera.main; dieAction = Die; inventory.RegisterDeathCallbacks(dieAction); }
protected virtual void OnBeingAttacked(AttackEventArgs args) { BeingAttacked?.Invoke(args); }
protected virtual void OnBeingAttacked() { Console.WriteLine($"King {this.Name} is under attack!"); BeingAttacked?.Invoke(this, EventArgs.Empty); }
public virtual void StartAttack() { Console.WriteLine($"King {this.Name} is under attack!"); BeingAttacked?.Invoke(this, EventArgs.Empty); }
private void OnBeingAttacked() { BeingAttacked?.Invoke(this, EventArgs.Empty); }
void Start() { utility = Camera.main.GetComponent <GameUtilities>(); beingAttacked = GetComponent <BeingAttacked>(); }