Skip to content

Instantly share code, notes, and snippets.

@suakig
Created May 12, 2015 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suakig/8e42aaea5010cf867d9e to your computer and use it in GitHub Desktop.
Save suakig/8e42aaea5010cf867d9e to your computer and use it in GitHub Desktop.
CoinText.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class CoinText : MonoBehaviour
{
private Text coinText;
void Awake ()
{
DeleGateAction.OnCoinChange += OnCoinChange;
coinText = transform.GetComponent<Text> ();
DeleGateAction.CoinChange ();
}
private void OnCoinChange(int coin)
{
coinText.text = "coin:" + coin.ToString ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment