diff --git a/Assets/Data/Logic Blocks/Diagonal R.asset b/Assets/Data/Logic Blocks/Diagonal R.asset
index 791b11a..0bc56ee 100644
--- a/Assets/Data/Logic Blocks/Diagonal R.asset
+++ b/Assets/Data/Logic Blocks/Diagonal R.asset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:648c6ffd9ee4e98f5e736340c5636353e3f8329bf8f5663f785aa8124ed741a9
+oid sha256:cc2a56e8583e5a1953737468bc973e04cf636fe5703a9c6a12a1b89358c2c5f1
size 871
diff --git a/Assets/Data/Logic Blocks/Rotate Half L.asset b/Assets/Data/Logic Blocks/Rotate Half L.asset
index 2450648..769934c 100644
--- a/Assets/Data/Logic Blocks/Rotate Half L.asset
+++ b/Assets/Data/Logic Blocks/Rotate Half L.asset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ef1cf0fb60605b274187de1b9550192ca070e6dfce03cafaec0ad84292a0bebf
-size 583
+oid sha256:71ee7590e5c0690f2926cb6e4fe1035abcca59f9afcec598f994d2a994cdce28
+size 601
diff --git a/Assets/Data/Logic Blocks/Rotate Half Left.asset b/Assets/Data/Logic Blocks/Rotate Half Left.asset
deleted file mode 100644
index 2ec5ee4..0000000
--- a/Assets/Data/Logic Blocks/Rotate Half Left.asset
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:717bae5b5493eeae1844f77f15938d1f0f2d88f54d609e5fb196e638ba0f14a1
-size 554
diff --git a/Assets/Data/Logic Blocks/Rotate Half R.asset b/Assets/Data/Logic Blocks/Rotate Half R.asset
index ca1e63f..d1dbd62 100644
--- a/Assets/Data/Logic Blocks/Rotate Half R.asset
+++ b/Assets/Data/Logic Blocks/Rotate Half R.asset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:124efbaa51e1bdb16ea9643bf9b8524eb0953512d843cb520283a3dcf7d1c17f
-size 584
+oid sha256:4309c3f762f7bb0a52eae8f5aeb31d3f6d0a1ad10d3096f024710414c1bd5fba
+size 601
diff --git a/Assets/Data/Logic Blocks/Rotate Half Right.asset b/Assets/Data/Logic Blocks/Rotate Half Right.asset
deleted file mode 100644
index 3984049..0000000
--- a/Assets/Data/Logic Blocks/Rotate Half Right.asset
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:990248dac7144fbca0b3bb00119abd7a9c46e9f59e5fbdfb6d72317fc611e668
-size 555
diff --git a/Assets/Data/Logic Blocks/Wait.asset b/Assets/Data/Logic Blocks/Wait.asset
index df98c17..ee77c9b 100644
--- a/Assets/Data/Logic Blocks/Wait.asset
+++ b/Assets/Data/Logic Blocks/Wait.asset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5b1381e41f5ac83abac527a3f5027da86df42fb91ca17392b26d58ab7c219bba
-size 580
+oid sha256:44b80c415d4f82a9c745d70767a360d5c1f2da9c98d27853a954c7c5190d103c
+size 581
diff --git a/Assets/Scripts/Components.meta b/Assets/Models.meta
similarity index 77%
rename from Assets/Scripts/Components.meta
rename to Assets/Models.meta
index 5a95b09..5346456 100644
--- a/Assets/Scripts/Components.meta
+++ b/Assets/Models.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 8d7394d70ec233849a60a26da5f23b75
+guid: 296bd90e667df1f4697823a0aa45acf0
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/Data/Logic Blocks/Rotate Half Left.asset.meta b/Assets/Plugins/IngameDebugConsole/Android.meta
similarity index 52%
rename from Assets/Data/Logic Blocks/Rotate Half Left.asset.meta
rename to Assets/Plugins/IngameDebugConsole/Android.meta
index 1fe5727..12049b6 100644
--- a/Assets/Data/Logic Blocks/Rotate Half Left.asset.meta
+++ b/Assets/Plugins/IngameDebugConsole/Android.meta
@@ -1,8 +1,8 @@
fileFormatVersion: 2
-guid: 6658a5299cc9a044a913d219abbe4a99
-NativeFormatImporter:
+guid: 3d7d7a61a5341904eb3c65af025b1d86
+folderAsset: yes
+DefaultImporter:
externalObjects: {}
- mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/Data/Logic Blocks/Rotate Half Right.asset.meta b/Assets/Plugins/IngameDebugConsole/Prefabs.meta
similarity index 52%
rename from Assets/Data/Logic Blocks/Rotate Half Right.asset.meta
rename to Assets/Plugins/IngameDebugConsole/Prefabs.meta
index b733043..6aa8bf2 100644
--- a/Assets/Data/Logic Blocks/Rotate Half Right.asset.meta
+++ b/Assets/Plugins/IngameDebugConsole/Prefabs.meta
@@ -1,8 +1,8 @@
fileFormatVersion: 2
-guid: f6be455a4dfaafd4fb4a0e74a9d19b0b
-NativeFormatImporter:
+guid: 7dbc36665bc0d684db9a4447e27a7a4b
+folderAsset: yes
+DefaultImporter:
externalObjects: {}
- mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/Plugins/IngameDebugConsole/Scripts.meta b/Assets/Plugins/IngameDebugConsole/Scripts.meta
new file mode 100644
index 0000000..72dcaac
--- /dev/null
+++ b/Assets/Plugins/IngameDebugConsole/Scripts.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 860c08388401a6d4e858fe4910ea9337
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta b/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
new file mode 100644
index 0000000..f3769b1
--- /dev/null
+++ b/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f6caae32d463529478f2186f47c2e3fe
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Character.cs b/Assets/Scripts/Character.cs
index b930283..49e9dcf 100644
--- a/Assets/Scripts/Character.cs
+++ b/Assets/Scripts/Character.cs
@@ -51,6 +51,7 @@ public class Character : MonoBehaviour
#region Read Only
public Block CurrentBlock { get { return _currentBlock; } }
+ public float lastRotation { get; private set;}
#endregion Read Only
#region Unity Functions
@@ -204,6 +205,7 @@ public class Character : MonoBehaviour
break;
}
+ lastRotation = angles * RotationDir;
float elapsedTime = 0;
diff --git a/Assets/Scripts/LevelBlocks/Water.cs b/Assets/Scripts/LevelBlocks/Water.cs
index be15131..9b8598d 100644
--- a/Assets/Scripts/LevelBlocks/Water.cs
+++ b/Assets/Scripts/LevelBlocks/Water.cs
@@ -55,6 +55,22 @@ public class Water : ActiveBlock
if (trappedCharacter != null)
{
+
+ //if character is on an angle undo their last rotation
+ if (trappedCharacter.transform.eulerAngles.y % 90 != 0)
+ {
+ trappedCharacter.transform.Rotate(Vector3.up, -trappedCharacter.lastRotation);
+
+ //if they are still on an angle fix to the closest rotation
+ if (trappedCharacter.transform.eulerAngles.y % 90 != 0)
+ {
+ Vector3 newRot = trappedCharacter.transform.eulerAngles;
+ newRot.y = Mathf.Round(newRot.y / 90) * 90;
+ trappedCharacter.transform.eulerAngles = newRot;
+ }
+ }
+
+
StartCoroutine(LerpToPosition(trappedCharacter.transform, VisualPosition, 1));
yield return StartCoroutine(LerpToPosition(lillyPad.transform, VisualPosition, 1));
trappedCharacter.stuck = false;
diff --git a/Assets/Scripts/Logic/Blocks/RotateHalf.cs b/Assets/Scripts/Logic/Blocks/RotateHalf.cs
deleted file mode 100644
index 0b22b76..0000000
--- a/Assets/Scripts/Logic/Blocks/RotateHalf.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-///
-/// Logic block which deals with moving a character in a direction
-///
-[CreateAssetMenu(menuName = "Major Project/RotateHalf Block")]
-[System.Serializable]
-public class RotateHalf : LogicBlock
-{
- #region Inspector Fields
- [SerializeField]
- [Header("Rotate Settings")]
- [Tooltip("Direction to rotate in")]
- protected Direction direction;
- #endregion Inspector Fields
-
-
- #region Class Functions
-
- ///
- /// Rotates the player in the direction specified by this block
- ///
- /// Player to rotate
- protected override IEnumerator BlockLogic(Character player, float animationTime, bool useBlockDirection = false)
- {
- player.RotateHalf(direction, animationTime);
- yield break;
- }
-
- ///
- /// Returns the block that the character will endUp on after they use this logic element
- ///
- /// block character is on
- /// layers to ignore
- /// block which character will finish on after performing this function
- public override Block GetEndBlock(Block startBlock, Transform transform, LayerMask layerMask)
- {
- //no movement when rotating
- return startBlock;
- }
-
- public override void CopyToken(BlockToken token)
- {
- base.CopyToken(token);
- direction = ((DirectionToken)token).direction;
- }
-
- public override BlockToken ToToken(BlockToken token = null)
- {
- if (token == null)
- token = new DirectionToken(this);
-
- DirectionToken retVal = (DirectionToken)base.ToToken(token);
- retVal.direction = direction;
-
- return retVal;
- }
-
- #endregion Class Functions
-}
diff --git a/Assets/Scripts/Logic/Blocks/RotateHalf.cs.meta b/Assets/Scripts/Logic/Blocks/RotateHalf.cs.meta
deleted file mode 100644
index 0a6654d..0000000
--- a/Assets/Scripts/Logic/Blocks/RotateHalf.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f6cdbe450444d7945857bf5bc1cd58d2
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/LogicBlocks.meta b/Assets/Scripts/LogicBlocks.meta
new file mode 100644
index 0000000..98af9d1
--- /dev/null
+++ b/Assets/Scripts/LogicBlocks.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8936b441d7647f74884c94f97bfb8931
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant: