44 lines
933 B
C#
44 lines
933 B
C#
using Assets.Code.Scripts;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.HighDefinition;
|
|
|
|
public abstract class WaterFXInstance : MonoBehaviour, IBatchUpdate
|
|
{
|
|
[SerializeField]
|
|
private UpdateManager.UpdateMode _updateMode = UpdateManager.UpdateMode.Always;
|
|
|
|
[SerializeField]
|
|
protected float _decalAmplitude = 0.5f;
|
|
|
|
[SerializeField]
|
|
protected float _decalDecaySpeed = 1f;
|
|
|
|
[HideInInspector]
|
|
public bool IsVisible;
|
|
|
|
protected WaterFXManager _manager;
|
|
|
|
protected Pool<WaterDecal> _pool;
|
|
|
|
protected virtual void Init()
|
|
{
|
|
_manager = WaterFXManager.GetInstance();
|
|
_manager.AddFXInstance(GetHashCode(), this);
|
|
UpdateManager.RegisterSlicedUpdate(this, _updateMode);
|
|
}
|
|
|
|
protected virtual void Deactivate()
|
|
{
|
|
_manager.RemoveFXInstance(GetHashCode());
|
|
}
|
|
|
|
protected virtual void OnDestroy()
|
|
{
|
|
UpdateManager.DeregisterSlicedUpdate(this);
|
|
}
|
|
|
|
public abstract void UpdateFX();
|
|
|
|
public abstract void BatchUpdate();
|
|
}
|