You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.3 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos
{
public class ParticleViewer : MonoBehaviour
{
public StructuredBuffer buffer;
public Material material;
public bool Initialized { get { return is_initialized; } }
bool is_initialized = false;
private IEnumerator Start()
{
while (buffer.count == 0)
yield return null;
OnStart();
yield return Initialize();
is_initialized = true;
}
private void Update()
{
if (is_initialized == false)
return;
OnUpdate();
}
private void FixedUpdate()
{
if (is_initialized == false)
return;
OnFixedUpdate();
}
private void OnDestroy()
{
Release();
}
protected virtual void OnStart()
{
}
protected virtual void OnUpdate()
{
}
protected virtual void OnFixedUpdate()
{
}
protected virtual IEnumerator Initialize()
{
is_initialized = true;
yield return null;
}
protected virtual void Release()
{
}
}
}