Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////
- // Créditos Équilibré Cursos e Treinamentos //
- // http://www.equilibrecursos.net //
- // http://www.youtube.com/equilibrecursos //
- //////////////////////////////////////////////
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class gameManager : MonoBehaviour {
- public SpriteRenderer renderBolinha;
- private player scriptPlayer;
- public Sprite[] sprBolinha;
- public int pontuacao;
- // Use this for initialization
- void Start () {
- pontuacao = 0;
- scriptPlayer = GameObject.Find("player").GetComponent<player>();
- renderBolinha = GameObject.Find("ball").GetComponent<SpriteRenderer>();
- }
- // Update is called once per frame
- void Update () {
- Debug.Log(pontuacao);
- if (scriptPlayer.podeAtirar && !scriptPlayer.ativaExplosao)
- renderBolinha.sprite = sprBolinha[1];
- else if (!scriptPlayer.podeAtirar && scriptPlayer.ativaExplosao)
- renderBolinha.sprite = sprBolinha[2];
- else
- renderBolinha.sprite = sprBolinha[0];
- if (scriptPlayer.podeAtirar && scriptPlayer.ativaExplosao)
- renderBolinha.color = Color.yellow;
- else
- renderBolinha.color = Color.white;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement