35 lines
813 B
C#
35 lines
813 B
C#
#region Using statements
|
|
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
#endregion
|
|
|
|
namespace Unheimlich.VFX.StylisedWater
|
|
{
|
|
public class WateverVolumeFloater : MonoBehaviour
|
|
{
|
|
#region Public fields
|
|
|
|
public WaterVolumeHelper WaterVolumeHelper = null;
|
|
|
|
#endregion
|
|
|
|
#region MonoBehaviour events
|
|
|
|
void Update()
|
|
{
|
|
var instance = WaterVolumeHelper ? WaterVolumeHelper : WaterVolumeHelper.Instance;
|
|
if (!instance)
|
|
{
|
|
Debug.Log("No Instance !");
|
|
return;
|
|
}
|
|
|
|
transform.position = new Vector3(transform.position.x, instance.GetHeight(transform.position) ?? transform.position.y, transform.position.z);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |