Ejemplo n.º 1
0
 void Start()
 {
     score            = 0;
     scoreBox         = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>();
     deathBox         = GameObject.FindGameObjectWithTag("Death").GetComponent <Text>();
     winBox           = GameObject.FindGameObjectWithTag("Win").GetComponent <Text>();
     dashBox          = GameObject.FindGameObjectWithTag("Dash Text").GetComponent <Text>();
     dashSlider       = GameObject.FindGameObjectWithTag("Dash Slider").GetComponent <Slider>();
     ammoBox          = GameObject.FindGameObjectWithTag("Ammo Text").GetComponent <Text>();
     ammoSlider       = GameObject.FindGameObjectWithTag("Ammo Slider").GetComponent <Slider>();
     dashBoxP2        = GameObject.FindGameObjectWithTag("Dash Text P2").GetComponent <Text>();
     dashSliderP2     = GameObject.FindGameObjectWithTag("Dash Slider P2").GetComponent <Slider>();
     ammoBoxP2        = GameObject.FindGameObjectWithTag("Ammo Text P2").GetComponent <Text>();
     ammoSliderP2     = GameObject.FindGameObjectWithTag("Ammo Slider P2").GetComponent <Slider>();
     enemySpawns      = GameObject.FindGameObjectsWithTag("Enemy Spawn Point");
     deathBox.enabled = false;
     winBox.enabled   = false;
     livesP1          = startingLives;
     livesP2          = startingLives;
     livesP1Text      = GameObject.FindGameObjectWithTag("Lives P1").GetComponent <Text>();
     livesP2Text      = GameObject.FindGameObjectWithTag("Lives P2").GetComponent <Text>();
     livesP1Text.text = "Lives: " + livesP1;
     livesP2Text.text = "Lives: " + livesP2;
     respawnTimerP1   = GameObject.FindGameObjectWithTag("Respawn Timer P1");
     respawnTimerP2   = GameObject.FindGameObjectWithTag("Respawn Timer P2");
     respawnTimerP1.SetActive(false);
     respawnTimerP2.SetActive(false);
     player1Script  = GameObject.FindGameObjectWithTag("Player").GetComponent <Player1ControllerScript>();
     player2Script  = GameObject.FindGameObjectWithTag("Player2").GetComponent <Player2ControllerScript>();
     bigEnemyScript = GameObject.FindGameObjectWithTag("Big Enemy").GetComponent <BigEnemyScript>();
 }
Ejemplo n.º 2
0
 void Start()
 {
     anim            = GetComponent <Animator>();
     lightsaberSound = GetComponent <AudioSource>();
     player1Script   = transform.parent.GetComponent <Player1ControllerScript>();
 }