素人Unity練習帳
Particle作成表示
Hierarchyで右クリックして
ParticleSystemをクリック

名称を変更して
とりあえず Effect01とした

Effect01を選択して
InspectorのParticleSystemの設定をいろいろ変更する


StartColorが、初期色設定


GravityModifierが、重力設定(0~1)


と、
Color over LifeTime
Size over LifTime
を、変更した


それを、Prefab化して
好きなところで表示させる。
さらに、これにスクリプトをつけることも可能。
とりあえず、ボタンを押すと、これが表示するようにすると
emptyobjectを作って、そこに
下記のようなC#Scriptを付ければ
*************************
public class dispParticleScr: MonoBehaviour {
// 生成したいPrefab
public GameObject prefab;
// 位置座標
private Vector3 prefabPosition;
void Start()
{
prefabPosition = new Vector3(0, 0, 0);
}
void OnGUI()
{
if (GUI.Button(new Rect(300, 10, 100, 50), "Disp"))
{
Instantiate(prefab, prefabPosition, Quaternion.identity);
}
}
}
*************************


Hierarchyで右クリックして
ParticleSystemをクリック

名称を変更して
とりあえず Effect01とした

Effect01を選択して
InspectorのParticleSystemの設定をいろいろ変更する


StartColorが、初期色設定


GravityModifierが、重力設定(0~1)


と、
Color over LifeTime
Size over LifTime
を、変更した


それを、Prefab化して
好きなところで表示させる。
さらに、これにスクリプトをつけることも可能。
とりあえず、ボタンを押すと、これが表示するようにすると
emptyobjectを作って、そこに
下記のようなC#Scriptを付ければ
*************************
public class dispParticleScr: MonoBehaviour {
// 生成したいPrefab
public GameObject prefab;
// 位置座標
private Vector3 prefabPosition;
void Start()
{
prefabPosition = new Vector3(0, 0, 0);
}
void OnGUI()
{
if (GUI.Button(new Rect(300, 10, 100, 50), "Disp"))
{
Instantiate(prefab, prefabPosition, Quaternion.identity);
}
}
}
*************************



Reon Viewin