Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        originalY = this.transform.position.y;
        this.gameObject.SetActive(true);

        if (this.gameObject.tag == "EnemyDog")
        {
            enemyHealth = 2f;
        }

        if (this.gameObject.tag == "EnemyDrone")
        {
            enemyHealth = 2f;
        }

        animEnemy        = GetComponent <Animator>();
        enemyRigidbody2D = GetComponent <Rigidbody2D>();
        enemyCollider    = GetComponent <Collider2D>();

        shootingPoint       = GetComponentsInChildren <Transform>();
        localPesInimigo     = GetComponentsInChildren <Transform>();
        enemyVisionCollider = GetComponentsInChildren <BoxCollider2D>();

        scriptPlayerInteraction = GameObject.FindWithTag("Player").gameObject.GetComponent <scrPlayerInteraction>();
        playerTransform         = GameObject.FindWithTag("Player").gameObject.GetComponent <Transform>();
        scriptPontuacao         = GameObject.FindWithTag("Gerenciador").gameObject.GetComponent <scrpontuacao>();
        scriptGerenciaSons      = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrGerenciadorSons>();
    }
 void Awake()
 {
     scriptHighScore    = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrHighScore>();
     scriptHighScore2   = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrHighScore2>();
     scriptGerenciaSons = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrGerenciadorSons>();
     scriptHighScore.GetMenuReferences();
     scriptHighScore.GradeResults();
     scriptHighScore2.GetMenuReferences();
     scriptHighScore2.GradeResults();
 }
 void Awake()
 {
     animPlayer      = gameObject.GetComponent <Animator>();
     scriptPlayer    = gameObject.GetComponent <Player>();
     scriptPontuacao = GameObject.Find("Gerenciador").gameObject.GetComponent <scrpontuacao>();
     scriptHighScore = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrHighScore>();
     scriptHighScore.GetSceneReferences();
     scriptHighScore2 = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrHighScore2>();
     scriptHighScore2.GetSceneReferences();
     scriptGerenciaSons = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrGerenciadorSons>();
 }
 void Awake()
 {
     scriptGerenciaSons = GameObject.Find("GerenciadorGlobal(Clone)").gameObject.GetComponent <scrGerenciadorSons>();
 }