「Coin取得時のエフェクト」の編集履歴(バックアップ)一覧はこちら
Coin取得時のエフェクト - (2015/06/21 (日) 21:31:40) の1つ前との変更点
追加された行は緑色になります。
削除された行は赤色になります。
-取得側
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) );
}
}
-取得側
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) );
}
}