Added cookie eating interaction, fixed museum interaction
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using AppleHills.Core;
|
||||
using Core.SaveLoad;
|
||||
using Input;
|
||||
using Minigames.DivingForPictures.Player;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
public class CookieEatingBehavior : AppleState
|
||||
{
|
||||
public SpriteRenderer cookieEatingSprites;
|
||||
public SpriteRenderer consumedCookieSprites;
|
||||
|
||||
private PlayableDirector cookieEatingDirector;
|
||||
private SpriteRenderer playerSprites;
|
||||
|
||||
|
||||
// On Enable, hide player sprite, activate traf sprites and play animation
|
||||
public void CookieClicked()
|
||||
{
|
||||
playerSprites = QuickAccess.Instance.PlayerGameObject.GetComponentInChildren<SpriteRenderer>();
|
||||
cookieEatingDirector = GetComponentInChildren<PlayableDirector>();
|
||||
playerSprites.enabled = false;
|
||||
consumedCookieSprites.enabled = false;
|
||||
cookieEatingDirector.enabled = true;
|
||||
InputManager.Instance.SetInputMode(InputMode.InputDisabled);
|
||||
|
||||
}
|
||||
|
||||
// When trafalgar animation done, hide trafalgar sprite, activate player sprites and go to next state
|
||||
public void CookieEatingDone()
|
||||
{
|
||||
playerSprites.enabled = true;
|
||||
ChangeStateString("cabinet_open_empty");
|
||||
InputManager.Instance.SetInputMode(InputMode.Game);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user