diff --git a/Assets/Scenes/Abduction/Abduction.unity b/Assets/Scenes/Abduction/Abduction.unity index 3920cd0..a4f4276 100644 --- a/Assets/Scenes/Abduction/Abduction.unity +++ b/Assets/Scenes/Abduction/Abduction.unity @@ -4803,7 +4803,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 144531526} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -2.68, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -6607,7 +6607,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &187296716 Transform: m_ObjectHideFlags: 0 @@ -16845,7 +16845,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 348527799} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 31.13538, y: -17.453907, z: -22.280586} + m_LocalPosition: {x: 33.037956, y: -19.758352, z: -20.92453} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -59124,12 +59124,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: stages: - - clip: {fileID: 8300000, guid: c5faceb05b0aa5148a3996af25ed32d1, type: 3} - transition: - serializedVersion: 2 + - {clip: {fileID: 8300000, guid: c5faceb05b0aa5148a3996af25ed32d1, type: 3}, transition: m_Curve: - - serializedVersion: 3 - time: 0 + - time: 0 value: 0 inSlope: 0 outSlope: 0 @@ -59137,8 +59134,7 @@ MonoBehaviour: weightedMode: 0 inWeight: 0 outWeight: 0 - - serializedVersion: 3 - time: 1 + - time: 1 value: 1 inSlope: 2 outSlope: 2 @@ -59149,12 +59145,10 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - - clip: {fileID: 8300000, guid: 0f76dfafe6ccd6947a5ed211ed29f40c, type: 3} - transition: - serializedVersion: 2 +} + - {clip: {fileID: 8300000, guid: 0f76dfafe6ccd6947a5ed211ed29f40c, type: 3}, transition: m_Curve: - - serializedVersion: 3 - time: 0 + - time: 0 value: 0 inSlope: 0 outSlope: 0 @@ -59162,8 +59156,7 @@ MonoBehaviour: weightedMode: 0 inWeight: 0 outWeight: 0 - - serializedVersion: 3 - time: 1 + - time: 1 value: 1 inSlope: 2 outSlope: 2 @@ -59174,12 +59167,10 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - - clip: {fileID: 8300000, guid: ddeeff2a24811924b96d0f93c0da4c58, type: 3} - transition: - serializedVersion: 2 +} + - {clip: {fileID: 8300000, guid: ddeeff2a24811924b96d0f93c0da4c58, type: 3}, transition: m_Curve: - - serializedVersion: 3 - time: 0 + - time: 0 value: 0 inSlope: 0 outSlope: 0 @@ -59187,8 +59178,7 @@ MonoBehaviour: weightedMode: 0 inWeight: 0 outWeight: 0 - - serializedVersion: 3 - time: 1 + - time: 1 value: 1 inSlope: 2 outSlope: 2 @@ -59199,12 +59189,10 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - - clip: {fileID: 8300000, guid: 671674c736bf0c74495c612200ba8826, type: 3} - transition: - serializedVersion: 2 +} + - {clip: {fileID: 8300000, guid: 671674c736bf0c74495c612200ba8826, type: 3}, transition: m_Curve: - - serializedVersion: 3 - time: 0 + - time: 0 value: 0 inSlope: 0 outSlope: 0 @@ -59212,8 +59200,7 @@ MonoBehaviour: weightedMode: 0 inWeight: 0 outWeight: 0 - - serializedVersion: 3 - time: 1 + - time: 1 value: 1 inSlope: 2 outSlope: 2 @@ -59224,14 +59211,13 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - currentStage: - clip: {fileID: 0} - transition: - serializedVersion: 2 +} + currentStage: {clip: {fileID: 0}, transition: m_Curve: [] m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +} --- !u!4 &1712739896 Transform: m_ObjectHideFlags: 0 @@ -59936,7 +59922,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 29763bfeba1c80d4ea3c8745c46a9b23, type: 3} m_Name: m_EditorClassIdentifier: - audioSource: {fileID: 1600006925} + stages: [] --- !u!4 &1734884801 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Runtime/Test/Audio.meta b/Assets/Scripts/Runtime/Audio.meta similarity index 100% rename from Assets/Scripts/Runtime/Test/Audio.meta rename to Assets/Scripts/Runtime/Audio.meta diff --git a/Assets/Scripts/Runtime/Audio/Fader.cs b/Assets/Scripts/Runtime/Audio/Fader.cs new file mode 100644 index 0000000..03a26a8 --- /dev/null +++ b/Assets/Scripts/Runtime/Audio/Fader.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using System.Collections; + + + +using System; + +namespace Abduction.Audio +{ + + /// + /// Plays the music with transitions + /// + 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() + { + + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/Test/Audio/Modulizer.cs.meta b/Assets/Scripts/Runtime/Audio/Fader.cs.meta similarity index 100% rename from Assets/Scripts/Runtime/Test/Audio/Modulizer.cs.meta rename to Assets/Scripts/Runtime/Audio/Fader.cs.meta diff --git a/Assets/Scripts/Runtime/Test.meta b/Assets/Scripts/Runtime/StateMachine.meta similarity index 77% rename from Assets/Scripts/Runtime/Test.meta rename to Assets/Scripts/Runtime/StateMachine.meta index d868e8d..acf6089 100644 --- a/Assets/Scripts/Runtime/Test.meta +++ b/Assets/Scripts/Runtime/StateMachine.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a8d455fdc17231a4c94a446722c80166 +guid: c53ddcc173143ba4a9c4d080519c9cf6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Scripts/Runtime/StateMachine/MusicState.cs b/Assets/Scripts/Runtime/StateMachine/MusicState.cs new file mode 100644 index 0000000..a0882eb --- /dev/null +++ b/Assets/Scripts/Runtime/StateMachine/MusicState.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using Abduction.Audio; + +namespace Abduction.StateBehaviour +{ + + /// + /// Dictates the state for the music + /// + 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 + } + } +} diff --git a/Assets/Scripts/Runtime/Test/Audio/AudioManager.cs.meta b/Assets/Scripts/Runtime/StateMachine/MusicState.cs.meta similarity index 83% rename from Assets/Scripts/Runtime/Test/Audio/AudioManager.cs.meta rename to Assets/Scripts/Runtime/StateMachine/MusicState.cs.meta index f866dba..974e625 100644 --- a/Assets/Scripts/Runtime/Test/Audio/AudioManager.cs.meta +++ b/Assets/Scripts/Runtime/StateMachine/MusicState.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 88f88b9fb75ea794aa4ece65770e1f6c +guid: 0f1d7307c3e322d40a4c06ef3d47f25b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Runtime/StateMachine/State.cs b/Assets/Scripts/Runtime/StateMachine/State.cs new file mode 100644 index 0000000..f7a54d1 --- /dev/null +++ b/Assets/Scripts/Runtime/StateMachine/State.cs @@ -0,0 +1,12 @@ +using UnityEngine; + + +namespace Abduction.StateBehaviour +{ + public abstract class State : MonoBehaviour + { + public abstract void OnRun(); + + public abstract void OnSwap(); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/Test/Abduction/Abduction.cs.meta b/Assets/Scripts/Runtime/StateMachine/State.cs.meta similarity index 83% rename from Assets/Scripts/Runtime/Test/Abduction/Abduction.cs.meta rename to Assets/Scripts/Runtime/StateMachine/State.cs.meta index 815dde7..1b71db0 100644 --- a/Assets/Scripts/Runtime/Test/Abduction/Abduction.cs.meta +++ b/Assets/Scripts/Runtime/StateMachine/State.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4fe1accde1d4f694dbdd0b954b2b8a13 +guid: 13db51a11dae4434e8a24bc8ebc77f68 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Runtime/StateMachine/StateMachine.cs b/Assets/Scripts/Runtime/StateMachine/StateMachine.cs new file mode 100644 index 0000000..711c397 --- /dev/null +++ b/Assets/Scripts/Runtime/StateMachine/StateMachine.cs @@ -0,0 +1,58 @@ +using UnityEngine; + + +namespace Abduction.StateBehaviour +{ + + /// + /// Runs the state on a loop + /// + 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(); + } + + } + + + + +} diff --git a/Assets/Scripts/Runtime/StateMachine/StateMachine.cs.meta b/Assets/Scripts/Runtime/StateMachine/StateMachine.cs.meta new file mode 100644 index 0000000..8ed9f06 --- /dev/null +++ b/Assets/Scripts/Runtime/StateMachine/StateMachine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc88ade9ee8ed32489003840a5cf3a54 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Runtime/Test/Abduction.meta b/Assets/Scripts/Runtime/Test/Abduction.meta deleted file mode 100644 index 111121a..0000000 --- a/Assets/Scripts/Runtime/Test/Abduction.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: da3e9adac23efbd4b8905531eb403f55 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Runtime/Test/Abduction/Abduction.cs b/Assets/Scripts/Runtime/Test/Abduction/Abduction.cs deleted file mode 100644 index 36163e6..0000000 --- a/Assets/Scripts/Runtime/Test/Abduction/Abduction.cs +++ /dev/null @@ -1,110 +0,0 @@ - -using System; -using UnityEngine; -using System.Collections; - -namespace Nuruk.Test -{ - public class Abduction : MonoBehaviour - { - - [SerializeField,Space(4)] - private GameObject inputReceptor; - - private Transform draggee; - - private Rigidbody holderBody; - - - private Vector3 criticPoint; - - private Vector3 holderVec; - - - private void Awake() - { - Renderer r = GetComponent(); - - // Making the final point of the abduction ray. - criticPoint = new Vector3(r.bounds.center.x, (transform.position.y + 5f), r.bounds.center.z); - - } - - - private void OnTriggerEnter(Collider other) - { - - if(draggee) - return; - - GetComponent().enabled = false; - - holderBody = other.gameObject.GetComponent(); - - holderBody.useGravity = false; - - draggee = other.transform; - - draggee.LookAt(transform,new Vector3(0,1,0)); - - StartCoroutine(Abduct()); - - } - - private IEnumerator Abduct() - { - - holderVec = new Vector3(0.035f, 0.15f, -0.035f); - - // Create the compensatory value for the x value - AxisDirection(); - - while(draggee.position.y <= criticPoint .y) - { - - CalculateCritialLimit(); - - draggee.position += holderVec; - - yield return new WaitForFixedUpdate(); - } - - holderBody.useGravity = true; - - draggee = null; - - yield break; - - } - - - /// Factor to reduce - private void AxisDirection() - { - - if(draggee.position.x > criticPoint.x) - { - holderVec.x *= -1; - return; - } - - // Factor to increase - holderVec.x *= 1; - - } - - - /// Calculate y given the x and advance x in time - // The final output is a Vector3 - private void CalculateCritialLimit() - { - - if((int) draggee.position.x == (int)criticPoint.x) - holderVec.x = 0; - - if((int) draggee.position.z == (int)criticPoint.z) - holderVec.z = 0; - - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/Test/Audio/AudioManager.cs b/Assets/Scripts/Runtime/Test/Audio/AudioManager.cs deleted file mode 100644 index cdc0294..0000000 --- a/Assets/Scripts/Runtime/Test/Audio/AudioManager.cs +++ /dev/null @@ -1,45 +0,0 @@ -using UnityEngine; - -/// BACKLOG -/// Update each stage with a different animation curve. -/// Change stage. -/// Detect the entry of a new stage. - -namespace Abduction.Test.Audio -{ - - [System.Serializable] - public struct Stage - { - public AudioClip clip; - - public AnimationCurve transition; - } - - - public class AudioManager : MonoBehaviour - { - - [SerializeField] - private Stage[] stages; - - - public static AudioManager Instance; - - - [HideInInspector] - public Stage currentStage; - - private void Awake() - { - Instance = this; - currentStage = stages[0]; - } - - - public Stage[] ServeStages() - { - return stages; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/Test/Audio/Modulizer.cs b/Assets/Scripts/Runtime/Test/Audio/Modulizer.cs deleted file mode 100644 index 36b263f..0000000 --- a/Assets/Scripts/Runtime/Test/Audio/Modulizer.cs +++ /dev/null @@ -1,78 +0,0 @@ -using UnityEngine; -using System.Collections; - - -/// The character enters a determined middle space and then the audio changes. - // The audio changes with a little fade. - // But the player can not go back. - - -namespace Abduction.Test.Audio -{ - - /// - /// Plays the music with transitions - /// - public class Modulizer : MonoBehaviour - { - #region Inspector - - [SerializeField,Space(3)] - private AudioSource audioSource; - - #endregion - - #region REMOVE - - private void Start() - { - PlayMusic(); - } - - #endregion - - - /// - /// Play the current stage ambient music. - /// - private void PlayMusic() - { - - audioSource.clip = AudioManager.Instance.currentStage.clip; - - audioSource.Play(); - - } - - - private IEnumerator FadeIn() - { - while(audioSource.volume <= 0) - { - - audioSource.volume -= 0.034f; - - yield return new WaitForFixedUpdate(); - - } - - // Play the next ambient music - PlayMusic(); - - } - - - private IEnumerator FadeOut() - { - while(audioSource.volume >= 0.84f) - { - - audioSource.volume += 0.034f; - - yield return new WaitForFixedUpdate(); - - } - - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/Test/UI.meta b/Assets/Scripts/Runtime/UI/StartScreen.meta similarity index 100% rename from Assets/Scripts/Runtime/Test/UI.meta rename to Assets/Scripts/Runtime/UI/StartScreen.meta diff --git a/Assets/Scripts/Runtime/Test/UI/StartScreen.uxml b/Assets/Scripts/Runtime/UI/StartScreen/StartScreen.uxml similarity index 100% rename from Assets/Scripts/Runtime/Test/UI/StartScreen.uxml rename to Assets/Scripts/Runtime/UI/StartScreen/StartScreen.uxml diff --git a/Assets/Scripts/Runtime/Test/UI/StartScreen.uxml.meta b/Assets/Scripts/Runtime/UI/StartScreen/StartScreen.uxml.meta similarity index 100% rename from Assets/Scripts/Runtime/Test/UI/StartScreen.uxml.meta rename to Assets/Scripts/Runtime/UI/StartScreen/StartScreen.uxml.meta diff --git a/Assets/Scripts/Runtime/Test/UI/Starter.cs b/Assets/Scripts/Runtime/UI/StartScreen/Starter.cs similarity index 100% rename from Assets/Scripts/Runtime/Test/UI/Starter.cs rename to Assets/Scripts/Runtime/UI/StartScreen/Starter.cs diff --git a/Assets/Scripts/Runtime/Test/UI/Starter.cs.meta b/Assets/Scripts/Runtime/UI/StartScreen/Starter.cs.meta similarity index 100% rename from Assets/Scripts/Runtime/Test/UI/Starter.cs.meta rename to Assets/Scripts/Runtime/UI/StartScreen/Starter.cs.meta diff --git a/Assets/Scripts/TutorialInfo/Scripts/Editor/ReadmeEditor.cs b/Assets/Scripts/TutorialInfo/Scripts/Editor/ReadmeEditor.cs index 0dbfbf9..4aafd0e 100644 --- a/Assets/Scripts/TutorialInfo/Scripts/Editor/ReadmeEditor.cs +++ b/Assets/Scripts/TutorialInfo/Scripts/Editor/ReadmeEditor.cs @@ -70,7 +70,7 @@ static void LoadLayout() { var assembly = typeof(EditorApplication).Assembly; var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true); - var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); + var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); method.Invoke(null, new object[] { Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false }); }