更新
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MSFEffectExample : MonoBehaviour
|
||||
{
|
||||
public MSFEffectsGroup group;
|
||||
public int CurIndex = 0;
|
||||
public ParticleSystem CurParticle;
|
||||
private void Update()
|
||||
{
|
||||
if(Input.GetKeyDown(KeyCode.A))
|
||||
{
|
||||
CurIndex -= 1;
|
||||
}
|
||||
if(Input.GetKeyDown(KeyCode.D))
|
||||
{
|
||||
CurIndex += 1;
|
||||
}
|
||||
if(CurIndex >= group.Particles.Count)
|
||||
{
|
||||
CurIndex = 0;
|
||||
}
|
||||
if(CurIndex < 0)
|
||||
{
|
||||
CurIndex = group.Particles.Count - 1;
|
||||
}
|
||||
if(Input.GetKeyDown(KeyCode.Space)|| (Input.GetMouseButtonDown(0)))
|
||||
{
|
||||
PlayEffects();
|
||||
}
|
||||
}
|
||||
public void PlayEffects()
|
||||
{
|
||||
if(CurParticle!=null)
|
||||
{
|
||||
Destroy(CurParticle.gameObject);
|
||||
}
|
||||
CurParticle = Instantiate(group.Particles[CurIndex]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user