29 lines
704 B
C#
29 lines
704 B
C#
|
|
using UnityEngine;
|
||
|
|
using Core.Lifecycle;
|
||
|
|
using Core.SaveLoad;
|
||
|
|
using System.Collections;
|
||
|
|
|
||
|
|
public class CanStealFlowerStateBehaviour : AppleState
|
||
|
|
{
|
||
|
|
public ReceptionistBehaviour receptionistObject;
|
||
|
|
|
||
|
|
public override void OnEnterState()
|
||
|
|
{
|
||
|
|
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|