2025-12-02 14:49:55 +01:00
|
|
|
using UnityEngine;
|
|
|
|
|
using Core.Lifecycle;
|
|
|
|
|
using Core.SaveLoad;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
|
|
public class CanStealFlowerStateBehaviour : AppleState
|
|
|
|
|
{
|
|
|
|
|
public ReceptionistBehaviour receptionistObject;
|
|
|
|
|
|
2025-12-08 13:34:08 +01:00
|
|
|
public void OnEnable()
|
2025-12-02 14:49:55 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
StartCoroutine(holdStateForSeconds(receptionistObject.holdFlowerDuration));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnRestoreState(string data)
|
|
|
|
|
{
|
|
|
|
|
base.OnRestoreState(data);
|
|
|
|
|
StartCoroutine(holdStateForSeconds(receptionistObject.holdFlowerDuration));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IEnumerator holdStateForSeconds(int seconds)
|
|
|
|
|
{
|
|
|
|
|
yield return new WaitForSeconds(seconds);
|
|
|
|
|
ChangeState("ThrowAwayFlower");
|
|
|
|
|
yield return null;
|
|
|
|
|
}
|
|
|
|
|
}
|