// Use this for initialization
 void Start()
 {
     animator      = GetComponent <Animator>();
     player        = GameObject.Find("Player");
     beingAttacked = GetComponent <BeingAttacked>();
     if (beingAttacked == null)
     {
         custom = true;
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
 protected virtual void OnBeingAttacked(AttackEventArgs args)
 {
     BeingAttacked?.Invoke(args);
 }
예제 #4
0
파일: King.cs 프로젝트: Andrey5kot/Labs
 protected virtual void OnBeingAttacked()
 {
     Console.WriteLine($"King {this.Name} is under attack!");
     BeingAttacked?.Invoke(this, EventArgs.Empty);
 }
예제 #5
0
        public virtual void StartAttack()
        {
            Console.WriteLine($"King {this.Name} is under attack!");

            BeingAttacked?.Invoke(this, EventArgs.Empty);
        }
예제 #6
0
 private void OnBeingAttacked()
 {
     BeingAttacked?.Invoke(this, EventArgs.Empty);
 }
 void Start()
 {
     utility       = Camera.main.GetComponent <GameUtilities>();
     beingAttacked = GetComponent <BeingAttacked>();
 }