37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
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);
|
|
}
|
|
}
|