Refactored Anne Lise bush into state machine

This commit is contained in:
2025-10-08 15:47:36 +02:00
parent a5fab5ba86
commit 92f935f272
17 changed files with 1866 additions and 568 deletions

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using System.Collections;
using Pixelplacement;
public class AnneLiseBushPopBehaviour : MonoBehaviour
@@ -9,6 +10,12 @@ public class AnneLiseBushPopBehaviour : MonoBehaviour
public float popDelay = 0f;
void Start()
{
StartCoroutine(BushPeak());
}
void PopOutOfBush()
{
// Example: Move bushObject along the spline from start (0) to end (1)
Tween.Spline(
@@ -20,7 +27,30 @@ public class AnneLiseBushPopBehaviour : MonoBehaviour
popDuration,
popDelay,
Tween.EaseInOut,
Tween.LoopType.PingPong
Tween.LoopType.None
);
}
void HideInBush()
{
// Example: Move bushObject along the spline from start (0) to end (1)
Tween.Spline(
popSpline,
bushObject,
0f,
1f,
false, // Do not orient to path
popDuration,
popDelay,
Tween.EaseInOut,
Tween.LoopType.None
);
}
IEnumerator BushPeak()
{
PopOutOfBush();
yield return new WaitForSeconds(5);
HideInBush();
}
}