Exemplo n.º 1
0
 private void Start()
 {
     //Gets The Rigid Body Attatched to this Game Object
     myRigidBody = gameObject.GetComponent <Rigidbody2D>();
     //Gets the Sprite Renderer attatched to this game object
     sprite = gameObject.GetComponent <SpriteRenderer>();
     //Gets The Shot Manager Script attatched to this Game Object
     shooterScript = GameObject.Find("ShotManager").GetComponent <ShootScript>();
     //Assigns the Sprites to the player lives array
     playerLivesSprites = transform.GetChild(2).gameObject.GetComponent <SpriteRenderer>();
     //Creates the pool of ShotPrefabs
     shooterScript.CreateChildren(shotPrefab);
     //Resets the Time to Respawn in the editor
     timeToRespawnMax = timeToRespawn;
     //Finds the Spawn Script
     spScript = GameObject.Find("SpawnManager").gameObject.GetComponent <SpawnManager>();
     //Finds the UI Script
     uiScript = GameObject.Find("CanvasUI").gameObject.GetComponent <UIManager>();
     health   = 3;
     PlayerHealthSpriteChanger(health);
     GetComponent <AudioSource>().volume = GameManagment.instance.sfxLevel;
 }