Files
AppleHillsProduction/Assets/Scripts/DamianExperiments/AnnaLiseAnd Lurespots/AnneLiseBushPopBehaviour.cs

57 lines
1.2 KiB
C#

using UnityEngine;
using System.Collections;
using Pixelplacement;
public class AnneLiseBushPopBehaviour : MonoBehaviour
{
public Spline popSpline;
public Transform bushObject;
public float popDuration = 1f;
public float popDelay = 0f;
void Start()
{
StartCoroutine(BushPeak());
}
void PopOutOfBush()
{
// 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,
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();
}
}