コード例 #1
0
ファイル: Coin.cs プロジェクト: tamjosei/Unity
    private void OnTriggerEnter2D(Collider2D collider)
    {
        Player player = collider.GetComponent <Player>();

        if (player != null)
        {
            coinCount++;
            CoinWindow.SetCoinCount(coinCount);
            Destroy(gameObject);
        }
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
 private void Awake()
 {
     instance = this;
     coinText = transform.Find("coinText").GetComponent <Text>();
     SetCoinCount(0);
 }