Anne Lise bush behavior update

This commit is contained in:
journaliciouz
2025-10-09 16:38:27 +02:00
parent 4ea8e7d16b
commit b777450bd1
18 changed files with 1342 additions and 395 deletions

View File

@@ -17,7 +17,7 @@ public class AnneLiseBushBehaviour : MonoBehaviour
}
void TakePhoto()
public void TakePhoto()
{
anneLiseBushStateMachine.ChangeState("TakePhoto");
}

View File

@@ -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;
}
}