2025-10-06 12:38:16 +02:00
|
|
|
using UnityEngine;
|
2025-10-08 15:47:36 +02:00
|
|
|
using System.Collections;
|
2025-10-06 12:38:16 +02:00
|
|
|
using Pixelplacement;
|
|
|
|
|
|
|
|
|
|
public class AnneLiseBushPopBehaviour : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Spline popSpline;
|
|
|
|
|
public Transform bushObject;
|
|
|
|
|
public float popDuration = 1f;
|
|
|
|
|
public float popDelay = 0f;
|
|
|
|
|
|
|
|
|
|
void Start()
|
2025-10-08 15:47:36 +02:00
|
|
|
{
|
|
|
|
|
StartCoroutine(BushPeak());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PopOutOfBush()
|
2025-10-06 12:38:16 +02:00
|
|
|
{
|
|
|
|
|
// Example: Move bushObject along the spline from start (0) to end (1)
|
|
|
|
|
Tween.Spline(
|
|
|
|
|
popSpline,
|
|
|
|
|
bushObject,
|
|
|
|
|
1f,
|
|
|
|
|
0f,
|
|
|
|
|
false, // Do not orient to path
|
|
|
|
|
popDuration,
|
|
|
|
|
popDelay,
|
|
|
|
|
Tween.EaseInOut,
|
2025-10-08 15:47:36 +02:00
|
|
|
Tween.LoopType.None
|
2025-10-06 12:38:16 +02:00
|
|
|
);
|
|
|
|
|
}
|
2025-10-08 15:47:36 +02:00
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
2025-10-06 12:38:16 +02:00
|
|
|
}
|