33 lines
508 B
C#
33 lines
508 B
C#
using UnityEngine;
|
|
|
|
public class WaterAnimationFloating : MonoBehaviour
|
|
{
|
|
public float AnimDelay = 1f;
|
|
|
|
[Range(0f, 1f)]
|
|
public float AnimStartPosition;
|
|
|
|
public float AnimSpeed = 1f;
|
|
|
|
private Animator animator;
|
|
|
|
private void Start()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
animator.Play("Floating_01", 1, AnimStartPosition);
|
|
animator.speed = AnimSpeed;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Time.time > AnimDelay)
|
|
{
|
|
animator.enabled = true;
|
|
}
|
|
else
|
|
{
|
|
animator.enabled = false;
|
|
}
|
|
}
|
|
}
|