예제 #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();
     }
 }
예제 #2
0
 public void DamagePlayer(int damage)
 {
     playerStats.PlayerHealth -= damage;
     if (playerStats.PlayerHealth <= 0)
     {
         ReSpawner.KillPlayer(this);
     }
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        if (rs == null)
        {
            rs = GameObject.FindGameObjectWithTag("PC").GetComponent <ReSpawner>();
        }

        rs.RespawnPlayer();
    }
예제 #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;
     }
 }
예제 #5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #6
0
 void Start()
 {
     rs = GameObject.FindGameObjectWithTag("ReSpawner").GetComponent <ReSpawner>();
 }