本文整理汇总了C#中UnityEngine.ParticleSystem.Play方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.Play方法的具体用法?C# ParticleSystem.Play怎么用?C# ParticleSystem.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.Play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown (0)) {
clone = Instantiate (shotEffectPrefab, transform.position, transform.rotation) as ParticleSystem;
clone.Play ();
}
}
示例2: setShield
public void setShield(bool hasShield)
{
this.hasShield = true;
shield = GetComponent<ParticleSystem>();
shield.Play();
StartCoroutine (KeepShield());
}
示例3: Awake
void Awake()
{
//lane = 1;
particles = transform.GetChild (0).gameObject.GetComponent<ParticleSystem> ();
beam = transform.GetChild (1).gameObject.GetComponent<ParticleSystem> ();
line = transform.GetChild (2).gameObject.GetComponent<LineRenderer> ();
inLaserSequence = false;
inSplitSequence = false;
isActive = true;
startFadeOut = false;
startFadeIn = false;
line.sortingLayerName = "Explosion/Fizz";
transform.position += Vector3.up * -(lane - 2);
if (Team == "Blue") {
particles.transform.position = GameObject.FindGameObjectWithTag ("BlueBase").transform.position + Vector3.up * -(lane - 2);
} else if (Team == "Red") {
particles.transform.position = GameObject.FindGameObjectWithTag ("RedBase").transform.position + Vector3.up * -(lane - 2);
}
particles.Play ();
Invoke ("beginBeam", 0.5f);
Invoke ("drawLine", 1);
Invoke ("setLooping", 2);
Invoke ("setInactive", 1.5f);
Invoke ("destroy", 3);
Debug.Log (particles.gameObject.transform.position);
}
示例4: Start
// Use this for initialization
void Start()
{
psys = GetComponent<ParticleSystem>();
psys.Play();
if (!psys) Destroy(gameObject);
Destroy(gameObject, psys.duration + psys.startLifetime);
}
示例5: Explode
// fonction appelée lorsqu'un boulet de canon explose
public void Explode(Vector3 position)
{
Vector3 dist;
for(int i = 0; i < projectilePoolActive.Count; i++)
{
go = (GameObject) projectilePoolActive[i];
dist = go.transform.position - position;
if(dist.magnitude < 999){/*...*/}
}
if(fxPoolReady.Count > 0)
{
go = (GameObject) fxPoolReady[0];
go.transform.position = position;
go.SetActive(true);
fx = go.GetComponent(typeof(FX)) as FX;
fx.Trigger();
ps = go.GetComponent(typeof(ParticleSystem)) as ParticleSystem;
ps.Play();
fxPoolReady.RemoveAt(0);
fxPoolActive.Add(go);
}
print("<explode>");
}
示例6: Start
void Start()
{
transform.Rotate(new Vector3(285f,350f,355f));
particle = GetComponent<ParticleSystem>();
particle.Play();
Invoke ("Delete",particle.startLifetime);
}
示例7: Start
void Start()
{
stateController = GameObject.FindWithTag("Player").GetComponent<TurtleStateController>();
forceVector = transform.forward * magnitude;
particleSystem = GetComponent<ParticleSystem>();
particleSystem.Play();
}
示例8: ParticleEffectInstanceManager
public ParticleEffectInstanceManager(EffectManager effect_manager, Mesh character_mesh, bool letter_flipped, ParticleEffectSetup effect_setup, AnimationProgressionVariables progression_vars, AnimatePerOptions animate_per, ParticleEmitter particle_emitter = null, ParticleSystem particle_system = null)
{
m_particle_emitter = particle_emitter;
m_particle_system = particle_system;
m_letter_mesh = character_mesh;
m_letter_flipped = letter_flipped;
m_follow_mesh = effect_setup.m_follow_mesh;
m_duration = effect_setup.m_duration.GetValue(progression_vars, animate_per);
m_delay = effect_setup.m_delay.GetValue(progression_vars, animate_per);
m_position_offset = effect_setup.m_position_offset.GetValue(progression_vars, animate_per);
m_rotation_offset = Quaternion.Euler(effect_setup.m_rotation_offset.GetValue(progression_vars, animate_per));
m_rotate_with_letter = effect_setup.m_rotate_relative_to_letter;
m_effect_manager_handle = effect_manager;
m_active = false;
if(m_particle_emitter != null)
{
m_transform = m_particle_emitter.transform;
m_particle_emitter.emit = true;
m_particle_emitter.enabled = false;
}
else if(m_particle_system != null)
{
m_transform = m_particle_system.transform;
m_particle_system.playOnAwake = false;
m_particle_system.Play();
#if !UNITY_3_5 && UNITY_EDITOR
p_system_timer = 0;
#endif
}
}
示例9: Start
// Use this for initialization
void Start () {
activeObjectList = new List<GameObject>();
pushForce = new Vector2(0.0f, 0.0f);
particles = gameObject.GetComponent<ParticleSystem>();
emis = particles.emission;
emis.enabled = false;
particles.Play();
}
示例10: Play
public override void Play(GameObject target)
{
// Get particle system
_particleSystem = target.GetComponent<ParticleSystem>();
_particleSystem.time = 0;
_particleSystem.Play();
}
示例11: LevelIncrease
public void LevelIncrease()
{
levelUp = GameObject.Find ("Level_Up_Popup").GetComponent<ParticleSystem> ();
levelUp.Stop();
level++;
levelUp.enableEmission = true;
levelUp.Play();
}
示例12: Start
void Start()
{
ps = GetComponent<ParticleSystem>();
ps.Stop();
RandSize();
ps.Play();
//StartCoroutine(SetTime());
}
示例13: CheckCurrentSmoke
void CheckCurrentSmoke(ref ParticleSystem compareWith)
{
if (currentSmoke.name != compareWith.name) // if currentSmoke isn't the same that compareWith smoke
{
currentSmoke.Stop(); // stop Playing current smoke
currentSmoke = compareWith; // set currentSmoke to correct smoke that we compare with
currentSmoke.Play(); // Play smoke
}
}
示例14: Start
void Start()
{
transform.LookAt(PlayerStats.Player.transform.position);
PS = GetComponent<ParticleSystem>();
AS = GetComponent<AudioSource>();
Value = HitObject.GetComponent<SteamAmount>().Amount;
PS.Play();
StartCoroutine(CheckSteamAudio());
}
示例15: Start
// Use this for initialization
void Start()
{
source = GetComponent<AudioSource>();
_smoke = Instantiate(Resources.Load("Smoke") as GameObject);
_smoke.transform.parent = transform;
_smoke.transform.position = transform.position;
smoke = _smoke.GetComponent<ParticleSystem>();
smoke.Play();
}