From 80e87737465489191228c45945f4d0adbb2151d1 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 13 Apr 2022 10:06:42 +0800 Subject: *test --- AlienSurvival/Assets/Test/Scripts/TestRobot1.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'AlienSurvival/Assets/Test/Scripts/TestRobot1.cs') diff --git a/AlienSurvival/Assets/Test/Scripts/TestRobot1.cs b/AlienSurvival/Assets/Test/Scripts/TestRobot1.cs index b8f8366..367a661 100644 --- a/AlienSurvival/Assets/Test/Scripts/TestRobot1.cs +++ b/AlienSurvival/Assets/Test/Scripts/TestRobot1.cs @@ -6,13 +6,28 @@ public class TestRobot1 : MonoBehaviour { public Transform shadow; + public float x = 0; + public float y = -0.628f; public float z; // fake height public AnimationCurve curve; + public AnimationCurve curveX; + public AnimationCurve curveY; private void Update() { - + x = curveX.Evaluate(Time.time % 1f); + y = curveY.Evaluate(Time.time % 1f); + z = curve.Evaluate(Time.time % 1f); + + Vector3 pos = transform.position; + pos.x = x; + pos.y = y + z; + + transform.position = pos; + + pos.y = y; + shadow.transform.position = pos; } } -- cgit v1.1-26-g67d0