diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 0000000..e93efb4 --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 456ced1fb7da474449f76d49f58fcd17 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Logic.meta b/Assets/Scripts/Logic.meta new file mode 100644 index 0000000..0e47e85 --- /dev/null +++ b/Assets/Scripts/Logic.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4725bfe007bb414dacfc2557d4a578e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Logic/Blocks.meta b/Assets/Scripts/Logic/Blocks.meta new file mode 100644 index 0000000..b53db01 --- /dev/null +++ b/Assets/Scripts/Logic/Blocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d143a9277c3daab4e9b1ecc5e7f6bdda +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Logic/Blocks/LogicBlock.cs b/Assets/Scripts/Logic/Blocks/LogicBlock.cs new file mode 100644 index 0000000..50eef52 --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/LogicBlock.cs @@ -0,0 +1,62 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// Base class all logic blocks are derived from +/// +[System.Serializable] +public abstract class LogicBlock : ScriptableObject +{ + + #region Inspector Fields + [SerializeField] + [Header("Base Settings")] + [Tooltip("Wait until this block is resolved before moving to next")] + protected bool WaitUntilFinished = false; + + [SerializeField] + [Tooltip("Amount of times to run this Block before moving to next")] + protected int RepeatAmount = 1; + #endregion Inspector Fields + + #region private variables + + /// + /// Amount of times this block has run + /// + protected int RepeatCount = 0; + + #endregion private variables + + + #region Class Functions + /// + /// Runs the block + /// + /// returns true if block is finished + public virtual bool Run() + { + RepeatCount++; + BlockLogic(); + + return (RepeatCount == RepeatAmount); + } + + /// + /// Returns the amount of space this logic block takes up + /// + /// Int which controlls how much space this takes up + public virtual int Size() + { + return 1; + } + + /// + /// Where derived callses should implement the logic for their classes + /// + /// returns true if block is finished + protected abstract void BlockLogic(); + + #endregion Class Functions +} diff --git a/Assets/Scripts/Logic/Blocks/LogicBlock.cs.meta b/Assets/Scripts/Logic/Blocks/LogicBlock.cs.meta new file mode 100644 index 0000000..93e7a2e --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/LogicBlock.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d11fe9c95f831e34c9b0a8897d1a95cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Logic/Blocks/Move.cs b/Assets/Scripts/Logic/Blocks/Move.cs new file mode 100644 index 0000000..272949b --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/Move.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// Logic block which deals with moving a character in a direction +/// +[CreateAssetMenu(menuName = "Major Project/Move Block")] +public class Move : LogicBlock +{ + #region Class Functions + + protected override void BlockLogic() + { + Debug.Log("Move"); + } + + #endregion Class Functions +} diff --git a/Assets/Scripts/Logic/Blocks/Move.cs.meta b/Assets/Scripts/Logic/Blocks/Move.cs.meta new file mode 100644 index 0000000..3b7fe41 --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/Move.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: edcd06d926f58f445aebd02362c2dfcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Logic/Blocks/Rotate.cs b/Assets/Scripts/Logic/Blocks/Rotate.cs new file mode 100644 index 0000000..3b83788 --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/Rotate.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// Logic block which deals with moving a character in a direction +/// +[CreateAssetMenu(menuName = "Major Project/Rotate Block")] +public class Rotate : LogicBlock +{ + public enum Direction { Left, Right} + + #region Inspector Fields + [SerializeField] + [Header("Rotate Settings")] + [Tooltip("Direction to rotate in")] + protected Direction direction; + #endregion Inspector Fields + + + #region Class Functions + + protected override void BlockLogic() + { + Debug.Log("Rotate " + direction.ToString()); + } + + #endregion Class Functions +} diff --git a/Assets/Scripts/Logic/Blocks/Rotate.cs.meta b/Assets/Scripts/Logic/Blocks/Rotate.cs.meta new file mode 100644 index 0000000..48e50d5 --- /dev/null +++ b/Assets/Scripts/Logic/Blocks/Rotate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: beff3a08f33878e44ba810c90a08b62d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/World Assets.meta b/Assets/World Assets.meta new file mode 100644 index 0000000..0c19536 --- /dev/null +++ b/Assets/World Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ece630d9a8c11c543956472c51dad691 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/World Assets/Logic Blocks.meta b/Assets/World Assets/Logic Blocks.meta new file mode 100644 index 0000000..6646be8 --- /dev/null +++ b/Assets/World Assets/Logic Blocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e082f07e6a38ded42945888080672510 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/World Assets/Logic Blocks/Move.asset b/Assets/World Assets/Logic Blocks/Move.asset new file mode 100644 index 0000000..1593ce1 --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Move.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f30f384f120eeb69292d9ff04a9e267e536ef80a35c6a7820a032e88257d9e8 +size 434 diff --git a/Assets/World Assets/Logic Blocks/Move.asset.meta b/Assets/World Assets/Logic Blocks/Move.asset.meta new file mode 100644 index 0000000..4a6fa43 --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Move.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b1bcd75cb7dade4fb598ee3412594c2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/World Assets/Logic Blocks/Rotate Left.asset b/Assets/World Assets/Logic Blocks/Rotate Left.asset new file mode 100644 index 0000000..da3c338 --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Rotate Left.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:323f3c70cf40755730cb81a31da6a58931177674b836d0b5bbc8b9f88af4b447 +size 456 diff --git a/Assets/World Assets/Logic Blocks/Rotate Left.asset.meta b/Assets/World Assets/Logic Blocks/Rotate Left.asset.meta new file mode 100644 index 0000000..4edc23c --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Rotate Left.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa238796cf1886244951ec8c2fed1855 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/World Assets/Logic Blocks/Rotate Right.asset b/Assets/World Assets/Logic Blocks/Rotate Right.asset new file mode 100644 index 0000000..45391ed --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Rotate Right.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6886b6e048617b3ecd1de69b35f0e598467d7d2444a59a26f58fcb16a988960 +size 457 diff --git a/Assets/World Assets/Logic Blocks/Rotate Right.asset.meta b/Assets/World Assets/Logic Blocks/Rotate Right.asset.meta new file mode 100644 index 0000000..69e6fa2 --- /dev/null +++ b/Assets/World Assets/Logic Blocks/Rotate Right.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 41f4cb946475b2849a802a8297d81e25 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 85074f5..1816da4 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.3.7f1 +m_EditorVersion: 2018.3.4f1