diff options
| author | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
| commit | c5f145786f4c6d2fe4bea831dfc16e52228920a5 (patch) | |
| tree | a6ead7ea8266c767d58ed0f816dcd7a1dd75bd65 /GameCode/BoatAnimation.cs | |
| parent | 48b64e573a1709dc923cb9162b55be0246b3ff63 (diff) | |
* move
Diffstat (limited to 'GameCode/BoatAnimation.cs')
| -rw-r--r-- | GameCode/BoatAnimation.cs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/GameCode/BoatAnimation.cs b/GameCode/BoatAnimation.cs deleted file mode 100644 index d038afa..0000000 --- a/GameCode/BoatAnimation.cs +++ /dev/null @@ -1,37 +0,0 @@ -using UnityEngine; - -public class BoatAnimation : MonoBehaviour -{ - private Vector3 startPosition; - - private Quaternion startRotation; - - private float time; - - [SerializeField] - private AnimationCurve yOffset; - - [SerializeField] - private AnimationCurve xRotation; - - [SerializeField] - private AnimationCurve yRotation; - - [SerializeField] - private AnimationCurve zRotation; - - private void Start() - { - time = Random.value * 10000f; - startPosition = base.transform.position; - startRotation = base.transform.rotation; - } - - private void Update() - { - time += Time.deltaTime; - Quaternion quaternion = Quaternion.Euler(xRotation.Evaluate(time), yRotation.Evaluate(time), zRotation.Evaluate(time)); - base.transform.rotation = startRotation * quaternion; - base.transform.position = startPosition + Vector3.up * yOffset.Evaluate(time); - } -} |
