Browse Source

fixed dying on a half turn, removed old half turns

master
JoshuaReason 5 years ago
parent
commit
79f0289d00
16 changed files with 56 additions and 93 deletions
  1. +1
    -1
      Assets/Data/Logic Blocks/Diagonal R.asset
  2. +2
    -2
      Assets/Data/Logic Blocks/Rotate Half L.asset
  3. +0
    -3
      Assets/Data/Logic Blocks/Rotate Half Left.asset
  4. +2
    -2
      Assets/Data/Logic Blocks/Rotate Half R.asset
  5. +0
    -3
      Assets/Data/Logic Blocks/Rotate Half Right.asset
  6. +2
    -2
      Assets/Data/Logic Blocks/Wait.asset
  7. +1
    -1
      Assets/Models.meta
  8. +3
    -3
      Assets/Plugins/IngameDebugConsole/Android.meta
  9. +3
    -3
      Assets/Plugins/IngameDebugConsole/Prefabs.meta
  10. +8
    -0
      Assets/Plugins/IngameDebugConsole/Scripts.meta
  11. +8
    -0
      Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
  12. +2
    -0
      Assets/Scripts/Character.cs
  13. +16
    -0
      Assets/Scripts/LevelBlocks/Water.cs
  14. +0
    -62
      Assets/Scripts/Logic/Blocks/RotateHalf.cs
  15. +0
    -11
      Assets/Scripts/Logic/Blocks/RotateHalf.cs.meta
  16. +8
    -0
      Assets/Scripts/LogicBlocks.meta

+ 1
- 1
Assets/Data/Logic Blocks/Diagonal R.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:648c6ffd9ee4e98f5e736340c5636353e3f8329bf8f5663f785aa8124ed741a9
oid sha256:cc2a56e8583e5a1953737468bc973e04cf636fe5703a9c6a12a1b89358c2c5f1
size 871

+ 2
- 2
Assets/Data/Logic Blocks/Rotate Half L.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef1cf0fb60605b274187de1b9550192ca070e6dfce03cafaec0ad84292a0bebf
size 583
oid sha256:71ee7590e5c0690f2926cb6e4fe1035abcca59f9afcec598f994d2a994cdce28
size 601

+ 0
- 3
Assets/Data/Logic Blocks/Rotate Half Left.asset View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:717bae5b5493eeae1844f77f15938d1f0f2d88f54d609e5fb196e638ba0f14a1
size 554

+ 2
- 2
Assets/Data/Logic Blocks/Rotate Half R.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:124efbaa51e1bdb16ea9643bf9b8524eb0953512d843cb520283a3dcf7d1c17f
size 584
oid sha256:4309c3f762f7bb0a52eae8f5aeb31d3f6d0a1ad10d3096f024710414c1bd5fba
size 601

+ 0
- 3
Assets/Data/Logic Blocks/Rotate Half Right.asset View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:990248dac7144fbca0b3bb00119abd7a9c46e9f59e5fbdfb6d72317fc611e668
size 555

+ 2
- 2
Assets/Data/Logic Blocks/Wait.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5b1381e41f5ac83abac527a3f5027da86df42fb91ca17392b26d58ab7c219bba
size 580
oid sha256:44b80c415d4f82a9c745d70767a360d5c1f2da9c98d27853a954c7c5190d103c
size 581

Assets/Scripts/Components.meta → Assets/Models.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8d7394d70ec233849a60a26da5f23b75
guid: 296bd90e667df1f4697823a0aa45acf0
folderAsset: yes
DefaultImporter:
externalObjects: {}

Assets/Data/Logic Blocks/Rotate Half Left.asset.meta → Assets/Plugins/IngameDebugConsole/Android.meta View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 6658a5299cc9a044a913d219abbe4a99
NativeFormatImporter:
guid: 3d7d7a61a5341904eb3c65af025b1d86
folderAsset: yes
DefaultImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

Assets/Data/Logic Blocks/Rotate Half Right.asset.meta → Assets/Plugins/IngameDebugConsole/Prefabs.meta View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: f6be455a4dfaafd4fb4a0e74a9d19b0b
NativeFormatImporter:
guid: 7dbc36665bc0d684db9a4447e27a7a4b
folderAsset: yes
DefaultImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Scripts.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 860c08388401a6d4e858fe4910ea9337
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6caae32d463529478f2186f47c2e3fe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 0
Assets/Scripts/Character.cs View File

@ -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;

+ 16
- 0
Assets/Scripts/LevelBlocks/Water.cs View File

@ -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;

+ 0
- 62
Assets/Scripts/Logic/Blocks/RotateHalf.cs View File

@ -1,62 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Logic block which deals with moving a character in a direction
/// </summary>
[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
/// <summary>
/// Rotates the player in the direction specified by this block
/// </summary>
/// <param name="player">Player to rotate</param>
protected override IEnumerator BlockLogic(Character player, float animationTime, bool useBlockDirection = false)
{
player.RotateHalf(direction, animationTime);
yield break;
}
/// <summary>
/// Returns the block that the character will endUp on after they use this logic element
/// </summary>
/// <param name="startBlock">block character is on</param>
/// <param name="layerMask">layers to ignore</param>
/// <returns>block which character will finish on after performing this function </returns>
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
}

+ 0
- 11
Assets/Scripts/Logic/Blocks/RotateHalf.cs.meta View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f6cdbe450444d7945857bf5bc1cd58d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Scripts/LogicBlocks.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save