Working gardener saveable behavior tree
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
public class LawnMowerChaseBehaviour : MonoBehaviour
|
||||
public class LawnMowerChaseBehaviour : SaveableState
|
||||
{
|
||||
public Spline ChaseSpline;
|
||||
public Transform LawnMowerObject;
|
||||
@@ -23,7 +24,7 @@ public class LawnMowerChaseBehaviour : MonoBehaviour
|
||||
public bool gardenerChasing = true;
|
||||
public GardenerAudioController gardenerAudioController;
|
||||
|
||||
void Start()
|
||||
public override void OnEnterState()
|
||||
{
|
||||
LawnMowerObject.position = ChaseSpline.GetPosition(startPercentage);
|
||||
|
||||
@@ -66,6 +67,11 @@ public class LawnMowerChaseBehaviour : MonoBehaviour
|
||||
_initialTweenActive = true;
|
||||
}
|
||||
|
||||
public override void OnRestoreState(string data)
|
||||
{
|
||||
OnEnterState();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
float percentage = ChaseSpline.ClosestPoint(LawnMowerObject.position);
|
||||
|
||||
Reference in New Issue
Block a user