public override void SecondUpdate() { //Should be in the habit of doing this first, i guess base.SecondUpdate(); mAttackManager.SecondUpdate(); HurtBox.UpdatePosition(); sight.UpdatePosition(); }
public override void Spawn(Vector2 spawnPoint) { base.Spawn(spawnPoint); Renderer.SetSprite(prototype.sprite); if (prototype.animationController != null) { Renderer.Animator.runtimeAnimatorController = prototype.animationController; } HurtBox.UpdatePosition(); sight.UpdatePosition(); //Renderer.SetSprite(prototype.) if (!(this is BossEnemy) && !(this is EnemyPart)) { EnemyHealthBar temp = GameObject.Instantiate(Resources.Load <EnemyHealthBar>("Prefabs/UI/EnemyHealthBar"), Renderer.transform) as EnemyHealthBar; temp.transform.localPosition = new Vector3(0, Body.mAABB.HalfSizeY * 2 + 20); temp.InitHealthbar(this); mHealth.healthbar = temp; } }