// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { bossEnemyController = animator.GetComponent <EnemyController>(); boss = animator.GetComponent <BossIA>(); player = GameObject.FindGameObjectWithTag("Player").transform; rb = animator.GetComponent <Rigidbody2D>(); }
private void Die() { BossIA boss = gameObject.GetComponent <BossIA>(); isAlive = false; deathPosition = gameObject.transform; if (boss == null) { DestroyGameObject(); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { bossEnemyController = animator.GetComponent <EnemyController>(); boss = animator.GetComponent <BossIA>(); player = GameObject.FindGameObjectWithTag("Player").transform; rb = animator.GetComponent <Rigidbody2D>(); Transform[] staticPositions = FindObjectsOfType <Transform>(); foreach (Transform staticPosistion in staticPositions) { if (staticPosistion.CompareTag("BossRightPosition")) { this.rightPosition = staticPosistion; } if (staticPosistion.CompareTag("BossLeftPosition")) { this.leftPosition = staticPosistion; } } }
// Use this for initialization void Start() { player = GetComponent <PlayerActions>(); boss = GameObject.Find("Boss").GetComponent <BossIA>(); }
void Start() { boss = jefazo.GetComponent <BossIA>(); }
void Start() { //pega script do componente pai, radar é filho do boss script = (BossIA)GetComponentInParent(typeof(BossIA)); }