Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     _health   = this.gameObject.GetComponent <HealthHandler>();
     _method   = OnDeath;
     _renderer = this.gameObject.GetComponent <SpriteRenderer>();
     _health.RegisterDeathMethod(_method);
     _defend.Add(this);
 }
Example #2
0
 void Start()
 {
     debounce = false;
     delta    = 0f;
     _health  = gameObject.GetComponent <HealthHandler>();
     _method  = DeathMethod;
     _health.RegisterDeathMethod(_method);
     _collider = this.gameObject.GetComponent <BoxCollider2D>();
 }
Example #3
0
 void Start()
 {
     status = 0;
     myCID  = CreatureId + 1;
     CreatureId++;
     Creatures[myCID] = gameObject;
     _health          = gameObject.GetComponent <HealthHandler>();
     _method          = DeathMethod;
     _health.RegisterDeathMethod(_method);
     _pathAI          = gameObject.GetComponent <AIPath>();
     killObject       = CastleDefend.GetStructure(gameObject);
     body             = gameObject.GetComponent <Rigidbody2D>();
     _seeker          = gameObject.GetComponent <Seeker>();
     scanIndex        = Structures.currentScan;
     _aiPath          = gameObject.GetComponent <AIPath>();
     direction        = 0;
     _animator        = gameObject.GetComponent <Animator>();
     _pathAI.maxSpeed = Random.Range(MinSpeed, MaxSpeed);
     _seeker.StartPath(transform.position, killObject.transform.position, OnPathComplete);
 }