Finished secretary
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c58863fe98ab1064883ff19770b1fe73
|
||||
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
using Core.Lifecycle;
|
||||
using Core.SaveLoad;
|
||||
|
||||
public class ReceptionistBehaviour : MonoBehaviour
|
||||
{
|
||||
public int holdFlowerDuration;
|
||||
public bool flowerWasStolen;
|
||||
|
||||
public void FlowerHasBeenStolen()
|
||||
{
|
||||
flowerWasStolen = true;
|
||||
GetComponentInChildren<AppleMachine>().ChangeState("FlowerWasStolen");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09b8ca1e43adc5d479def14f3927b5bb
|
||||
Reference in New Issue
Block a user