Further updates to state machines
This commit is contained in:
committed by
Michal Pikulski
parent
199480447e
commit
b3e0f90e09
@@ -1,18 +1,22 @@
|
||||
using UnityEngine;
|
||||
using Core.SaveLoad;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
|
||||
public class AnneLiseBushBehaviour : MonoBehaviour
|
||||
namespace StateMachines.Quarry.AnneLise
|
||||
{
|
||||
|
||||
private StateMachine anneLiseBushStateMachine;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
public class AnneLiseBushBehaviour : MonoBehaviour
|
||||
{
|
||||
anneLiseBushStateMachine = GetComponent<StateMachine>();
|
||||
}
|
||||
|
||||
public void TakePhoto()
|
||||
{
|
||||
anneLiseBushStateMachine.ChangeState("TakePhoto");
|
||||
private AppleMachine _anneLiseBushStateMachine;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
_anneLiseBushStateMachine = GetComponent<AppleMachine>();
|
||||
}
|
||||
|
||||
public void TakePhoto()
|
||||
{
|
||||
_anneLiseBushStateMachine.ChangeState("TakePhoto");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,20 +14,17 @@ namespace StateMachines.Quarry.AnneLise
|
||||
|
||||
public UnityEvent animFlash;
|
||||
public UnityEvent animStart;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Find references that are needed regardless of enter/restore
|
||||
_playerCharacter = GameObject.FindWithTag("Player");
|
||||
_playerTouchController = _playerCharacter.GetComponent<PlayerTouchController>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called when entering this state during normal gameplay.
|
||||
/// Initiates player movement and triggers photo-taking sequence.
|
||||
/// </summary>
|
||||
public override void OnEnterState()
|
||||
{
|
||||
// Find references that are needed regardless of enter/restore
|
||||
_playerCharacter = GameObject.FindWithTag("Player");
|
||||
_playerTouchController = _playerCharacter.GetComponent<PlayerTouchController>();
|
||||
|
||||
// Subscribe to player arrival event
|
||||
_playerTouchController.OnArrivedAtTarget += PlayerHasArrived;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user