Frakke puzzle implemented
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DamianExperiments.Dump
|
||||
{
|
||||
public class FrakkeAnimEventTrigger : MonoBehaviour
|
||||
{
|
||||
[Header("Frakke Crashing References")]
|
||||
public AppleMachine FrakkeSMRef;
|
||||
public GameObject stateToChangeToAfterCrashing;
|
||||
|
||||
[Header("Fence Breaking References")]
|
||||
public AppleMachine FenceSMRef;
|
||||
public GameObject FenceStateToSet;
|
||||
|
||||
public void OnFrakkeCrashEnded()
|
||||
{
|
||||
FrakkeSMRef.ChangeState(stateToChangeToAfterCrashing);
|
||||
}
|
||||
|
||||
public void OnFenceBroken()
|
||||
{
|
||||
if (FenceSMRef != null)
|
||||
{
|
||||
FenceSMRef.ChangeState(FenceStateToSet);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("FrakkeRevUpCrashBehaviour: FenceSMRef is not assigned.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0fe9a1535dd5004ebd1d26e9482be9c
|
||||
@@ -1,20 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DamianExperiments.Dump
|
||||
{
|
||||
public class FrakkeCrashedBehaviour : MonoBehaviour
|
||||
{
|
||||
public Animator FrakkeAnimControllerRef;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (FrakkeAnimControllerRef != null)
|
||||
{
|
||||
FrakkeAnimControllerRef.SetTrigger("Crashes");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 543c2dad4fc14a740975065cf856b336
|
||||
@@ -1,21 +1,30 @@
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace DamianExperiments.Dump
|
||||
{
|
||||
public class FrakkeRevUpCrashBehaviour : MonoBehaviour
|
||||
{
|
||||
public Animator FrakkeAnimControllerRef;
|
||||
public SpriteRenderer frakkeSprites;
|
||||
public AppleMachine stateMachine;
|
||||
public AppleMachine fenceStateMachine;
|
||||
private PlayableDirector playableDirector;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (FrakkeAnimControllerRef != null)
|
||||
{
|
||||
FrakkeAnimControllerRef.SetTrigger("SpeedsOff");
|
||||
}
|
||||
playableDirector = GetComponent<PlayableDirector>();
|
||||
playableDirector.stopped += DirectorStopped;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void DirectorStopped(PlayableDirector obj)
|
||||
{
|
||||
playableDirector.stopped -= DirectorStopped;
|
||||
frakkeSprites.enabled = false;
|
||||
stateMachine.ChangeState("Frakke_Crashed");
|
||||
fenceStateMachine.ChangeState("ramp_broken");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user