Files
valheim/Assets/_Valheim/Scripts/Weapons/CheckParticleSystem.cs
2025-07-04 14:16:14 +08:00

49 lines
970 B
C#

using System.Net;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class CheckParticleSystem : MonoBehaviour
{
public bool IsStop { get; set; }
// public IceStaff IceStaff;
private Action _cb;
public void Init(Action cb)
{
_cb = cb;
ParticleSystem particle = GetComponent<ParticleSystem>();
ParticleSystem.MainModule mainModule = particle.main;
mainModule.loop = false;
mainModule.stopAction = ParticleSystemStopAction.Callback;
}
public void OnParticleSystemStopped()
{
// if (IceStaff != null)
// {
// IceStaff.IsStop = true;
// }
if (_cb != null)
{
_cb.Invoke();
}
}
public void OnDisable()
{
// if (IceStaff != null)
// {
// IceStaff.IsStop = false;
// }
// transform.gameObject.SetActive(false);
}
}