Quantcast
Channel: HAPPY*TRAP » Unity
Viewing all articles
Browse latest Browse all 10

[Unity] オブジェクトの表示、非表示

$
0
0
※サンプルコードはC#です。

表示

renderer.enabled = true;

非表示

renderer.enabled = false;




また、iTweenライブラリを使用するとフェードイン、フェードアウトも簡単に
実装できます。

フェードイン

iTween.FadeTo(gameObject, iTween.Hash("alpha", 1, "time", .5f));

フェードアウト

iTween.FadeTo(gameObject, iTween.Hash("alpha", 0, "time", .5f));

iTweenライブラリの詳細、ダウンロードは以下からどうぞ。

Viewing all articles
Browse latest Browse all 10

Trending Articles