Exemplo n.º 1
0
 // 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>();
 }
Exemplo n.º 2
0
    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;
            }
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     player = GetComponent <PlayerActions>();
     boss   = GameObject.Find("Boss").GetComponent <BossIA>();
 }
Exemplo n.º 5
0
 void Start()
 {
     boss = jefazo.GetComponent <BossIA>();
 }
Exemplo n.º 6
0
 void Start()
 {
     //pega script do componente pai, radar é filho do boss
     script = (BossIA)GetComponentInParent(typeof(BossIA));
 }