您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
644 B
29 行
644 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class PlaySystems : MonoBehaviour {
|
|
|
|
public ParticleSystem[] particleSystems;
|
|
[Range(0, 1)]
|
|
public float simPoint = 0.5f;
|
|
void OnEnable () {
|
|
foreach(ParticleSystem ps in particleSystems){
|
|
if (ps != null)
|
|
{
|
|
float life = ps.main.duration * simPoint;
|
|
ps.Simulate(life, true, true, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
foreach (ParticleSystem ps in particleSystems)
|
|
{
|
|
if(ps != null)
|
|
ps.Stop();
|
|
}
|
|
}
|
|
}
|