[Unity] 파티클 시스템 Play Stop 스크립트 제어
2021. 9. 5. 18:30ㆍ카테고리 없음
1. Particle System > Play On Awake* 체크 꺼줌
2. 스크립트 작성 후 particleObject 에다가 ParticleSystem 넣어줌
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Particle : MonoBehaviour
{
public bool playAura = true; //파티클 제어 bool
public ParticleSystem particleObject; //파티클시스템
void Start()
{
playAura = true;
particleObject.Play();
}
void Update()
{
if (playAura)
particleObject.Play();
else if (!playAura)
particleObject.Stop();
}
}