Anne Lise bush behavior update
This commit is contained in:
@@ -17,7 +17,7 @@ public class AnneLiseBushBehaviour : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
void TakePhoto()
|
||||
public void TakePhoto()
|
||||
{
|
||||
anneLiseBushStateMachine.ChangeState("TakePhoto");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Pixelplacement;
|
||||
using Input;
|
||||
using Pixelplacement;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using static Input.PlayerTouchController;
|
||||
|
||||
|
||||
public class TakePhotoState : State
|
||||
@@ -9,7 +11,9 @@ public class TakePhotoState : State
|
||||
public Transform playerTargetObject;
|
||||
private GameObject playerCharacter;
|
||||
private PlayerTouchController playerTouchController;
|
||||
private Vector2 newPlayerPosition;
|
||||
private Vector3 newPlayerPosition;
|
||||
|
||||
private
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
@@ -27,7 +31,25 @@ public class TakePhotoState : State
|
||||
{
|
||||
playerCharacter = GameObject.FindWithTag("Player");
|
||||
playerTouchController = playerCharacter.GetComponent<PlayerTouchController>();
|
||||
newPlayerPosition = new Vector2(playerCharacter.transform.position.x, playerCharacter.transform.position.y);
|
||||
playerTouchController.MoveDirectlyTo(newPlayerPosition);
|
||||
playerTouchController.OnArrivedAtTarget += PlayerHasArrived;
|
||||
|
||||
newPlayerPosition = new Vector3(playerTargetObject.transform.position.x, playerTargetObject.transform.position.y, playerTargetObject.transform.position.z);
|
||||
//playerTouchController.InterruptMoveTo();
|
||||
playerTouchController.MoveToAndNotify(newPlayerPosition);
|
||||
InputManager.Instance.SetInputMode(InputMode.InputDisabled);
|
||||
}
|
||||
|
||||
// When the player has arrived at the bush do Animator.SetTrigger(Takephoto) and whatevs
|
||||
|
||||
public void PhotoTaken()
|
||||
{
|
||||
ChangeState("Hidden");
|
||||
InputManager.Instance.SetInputMode(InputMode.Game);
|
||||
}
|
||||
|
||||
void PlayerHasArrived()
|
||||
{
|
||||
GetComponent<Animator>().SetTrigger("TakePhoto");
|
||||
playerTouchController.OnArrivedAtTarget += null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user