Beispiel #1
0
 private void Awake()
 {
     victoryScreen    = GameObject.Find("Victory Screen");
     player           = GameObject.Find("Player").transform;
     playerController = player.GetComponent <PlayerControllerCC>();
     cameraScript     = player.GetComponentInChildren <MouseRotate>();
 }
Beispiel #2
0
    private void Awake()
    {
        objectiveText = GameObject.Find("Objective Text").GetComponent <TextMeshProUGUI>(); objectiveText.text = objective; objectiveText.CrossFadeAlpha(0, 0, true);
        savedText     = GameObject.Find("Saved Text").GetComponent <TextMeshProUGUI>(); savedText.CrossFadeAlpha(0, 0, true);
        deathScreen   = GameObject.Find("Death Screen"); deathScreen.SetActive(false);
        victoryScreen = GameObject.Find("Victory Screen"); victoryScreen.SetActive(false);


        player           = GameObject.Find("Player");
        playerController = player.GetComponent <PlayerControllerCC>();
        playerHealth     = player.GetComponent <PlayerHealth>();
        cameraScript     = player.GetComponentInChildren <MouseRotate>();

        foreach (Transform child in player.transform.Find("First Person Camera"))
        {
            if (child.name.StartsWith("Gun "))
            {
                ownedGuns.Add(child.GetComponent <GunScript>()); if (child.gameObject.activeInHierarchy)
                {
                    currentGun = child.GetComponent <GunScript>();
                }
            }
        }
        enemies       = new List <GameObject>(GameObject.FindGameObjectsWithTag("Enemy"));
        livingEnemies = enemies.ToList();
    }
Beispiel #3
0
 void Awake()
 {
     leaderBoard.enabled = false;
     deathParticle       = GetComponent <ParticleSystem>();//Se toman los componentes de las variables ya nombradas
     playerAudio         = GetComponent <AudioSource> ();
     playerController    = GetComponent <PlayerController> ();
     playerShooting      = GetComponentInChildren <PlayerShooting> ();
     mouseRotate         = GetComponent <MouseRotate>();
     currentHealth       = startingHealth;
 }