Exemplo n.º 1
0
 //The static declares it static, void is its return type
 public static void AddCoins(int CoinsToAdd)
 {
     Coins -= CoinsToAdd;
     if (Coins <= 0)
     {
         ReSpawner.ChangeLevel();
     }
 }
Exemplo n.º 2
0
 public void DamagePlayer(int damage)
 {
     playerStats.PlayerHealth -= damage;
     if (playerStats.PlayerHealth <= 0)
     {
         ReSpawner.KillPlayer(this);
     }
 }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        if (rs == null)
        {
            rs = GameObject.FindGameObjectWithTag("PC").GetComponent <ReSpawner>();
        }

        rs.RespawnPlayer();
    }
Exemplo n.º 4
0
 void Start()
 {
     rs = GameObject.FindGameObjectWithTag("ReSpawner").GetComponent <ReSpawner>();
     transform.position = rs.lastCheckpointPos;
     if (rs.hasTing)
     {
         ting.SetActive(true);
         ting.transform.position = transform.position;
     }
 }
Exemplo n.º 5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 6
0
 void Start()
 {
     rs = GameObject.FindGameObjectWithTag("ReSpawner").GetComponent <ReSpawner>();
 }