-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
191 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
|
||
|
||
using System; | ||
|
||
namespace Abduction.Audio | ||
{ | ||
|
||
///<summary> | ||
/// Plays the music with transitions | ||
///</summary> | ||
public class Fader : MonoBehaviour | ||
{ | ||
|
||
[Serializable] | ||
public struct Stage | ||
{ | ||
public AudioClip clip; | ||
|
||
public AnimationCurve transitionIn; | ||
|
||
public AnimationCurve transisionOut; | ||
} | ||
|
||
[SerializeField] | ||
private Stage[] stages; | ||
|
||
|
||
|
||
private AnimationCurve @in; | ||
|
||
private AnimationCurve @out; | ||
|
||
|
||
|
||
public void FadeBetween() | ||
{ | ||
@in = stages[0].transitionIn; | ||
@out = stages[1].transisionOut; | ||
} | ||
|
||
|
||
public void AnalizeLerp() | ||
{ | ||
|
||
} | ||
|
||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
Assets/Scripts/Runtime/Test.meta → Assets/Scripts/Runtime/StateMachine.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using UnityEngine; | ||
using Abduction.Audio; | ||
|
||
namespace Abduction.StateBehaviour | ||
{ | ||
|
||
/// <summary> | ||
/// Dictates the state for the music | ||
/// </summary> | ||
public class MusicState : State | ||
{ | ||
[SerializeField] | ||
private Fader fader; | ||
|
||
|
||
public override void OnRun() | ||
{ | ||
// Check alterations | ||
} | ||
|
||
|
||
public override void OnSwap() | ||
{ | ||
Transition(); | ||
} | ||
|
||
|
||
private void Transition() | ||
{ | ||
// Use the fader to transition between stages | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...s/Runtime/Test/Audio/AudioManager.cs.meta → ...s/Runtime/StateMachine/MusicState.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using UnityEngine; | ||
|
||
|
||
namespace Abduction.StateBehaviour | ||
{ | ||
public abstract class State : MonoBehaviour | ||
{ | ||
public abstract void OnRun(); | ||
|
||
public abstract void OnSwap(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Runtime/Test/Abduction/Abduction.cs.meta → ...cripts/Runtime/StateMachine/State.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using UnityEngine; | ||
|
||
|
||
namespace Abduction.StateBehaviour | ||
{ | ||
|
||
/// <summary> | ||
/// Runs the state on a loop | ||
/// </summary> | ||
public class StateMachine : MonoBehaviour | ||
{ | ||
|
||
private State _state; | ||
|
||
|
||
private void Run() | ||
{ | ||
_state.OnRun(); | ||
|
||
} | ||
|
||
|
||
private void Swap() | ||
{ | ||
_state.OnSwap(); | ||
} | ||
|
||
public void SetChange(in State @state) | ||
{ | ||
_state.OnSwap(); | ||
|
||
// Start running | ||
|
||
_state = @state; | ||
|
||
} | ||
|
||
|
||
#if PHYSICS | ||
|
||
private void FixedUpdate() | ||
{ | ||
Run(); | ||
} | ||
|
||
#endif | ||
|
||
private void Update() | ||
{ | ||
Run(); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.