Coin取得時のエフェクト

  • 取得側
Main.coin+=10;
GameObject obj=GameObject.Instantiate(getCoinText, new Vector2( end.x,end.y ),  Quaternion.identity) as GameObject;
obj.GetComponent<TextMesh>().text="10coins";
obj.GetComponent<MeshRenderer>().sortingLayerName = "UI";

  • 3DTextに追加するscript
public class getCoinText : MonoBehaviour {
	int count=70;
	void Update () {
		count--;
		if(count<=0)
			Destroy(gameObject);
		transform.Translate( new Vector3(0,0.02f,0) );
	}
}

タグ:

sample
最終更新:2015年06月21日 21:31