private void OnTriggerEnter2D(Collider2D collider) { Player player = collider.GetComponent <Player>(); if (player != null) { coinCount++; CoinWindow.SetCoinCount(coinCount); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collider) { Player player = collider.GetComponent <Player>(); if (player != null) { coinCount++; CoinWindow.SetCoinCount(coinCount); OSCHandler.Instance.SendMessageToClient("pd", "/unity/coin", 1); Destroy(gameObject); } }
private void Awake() { instance = this; coinText = transform.Find("coinText").GetComponent <Text>(); SetCoinCount(0); }