Refactored Anne Lise bush into state machine
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
public class AnneLiseBushBehaviour : MonoBehaviour
|
||||
{
|
||||
|
||||
private StateMachine anneLiseBushStateMachine;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
anneLiseBushStateMachine = GetComponent<StateMachine>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TakePhoto()
|
||||
{
|
||||
anneLiseBushStateMachine.ChangeState("TakePhoto");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 603ecc4a6ab6bb84c8cb9773fa310b69
|
||||
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Pixelplacement;
|
||||
using Input;
|
||||
|
||||
|
||||
public class TakePhotoState : State
|
||||
{
|
||||
public Transform playerTargetObject;
|
||||
private GameObject playerCharacter;
|
||||
private PlayerTouchController playerTouchController;
|
||||
private Vector2 newPlayerPosition;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
playerCharacter = GameObject.FindWithTag("Player");
|
||||
playerTouchController = playerCharacter.GetComponent<PlayerTouchController>();
|
||||
newPlayerPosition = new Vector2(playerCharacter.transform.position.x, playerCharacter.transform.position.y);
|
||||
playerTouchController.MoveDirectlyTo(newPlayerPosition);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 260954bde403f504c84c67f22b8a5888
|
||||
Reference in New Issue
Block a user