//The static declares it static, void is its return type public static void AddCoins(int CoinsToAdd) { Coins -= CoinsToAdd; if (Coins <= 0) { ReSpawner.ChangeLevel(); } }
public void DamagePlayer(int damage) { playerStats.PlayerHealth -= damage; if (playerStats.PlayerHealth <= 0) { ReSpawner.KillPlayer(this); } }
// Use this for initialization void Start() { if (rs == null) { rs = GameObject.FindGameObjectWithTag("PC").GetComponent <ReSpawner>(); } rs.RespawnPlayer(); }
void Start() { rs = GameObject.FindGameObjectWithTag("ReSpawner").GetComponent <ReSpawner>(); transform.position = rs.lastCheckpointPos; if (rs.hasTing) { ting.SetActive(true); ting.transform.position = transform.position; } }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); } else { Destroy(gameObject); } }
void Start() { rs = GameObject.FindGameObjectWithTag("ReSpawner").GetComponent <ReSpawner>(); }