Permalink
Browse files

Updated to Unity 5.4.x

  • Loading branch information...
GandhiGames committed Sep 22, 2016
1 parent 03ec652 commit c4ce15235485de2e13b61f79e800d1d414309fce
View
Binary file not shown.
View

This file was deleted.

Oops, something went wrong.
@@ -1,5 +1,4 @@
using UnityEngine;
using System.Collections;
namespace RewindController
{
@@ -5,20 +5,26 @@ namespace RewindController
{
/// <summary>
/// Base abstract command. All commands (e.g. movement, attack) should inherit form this class.
/// By recording a characters commands they can be played in reverse (i.e. rewound).
/// </summary>
public abstract class Command
{
protected Transform character;
protected Vector2 dir;
public Command (Transform character = null, Vector3 dir = default(Vector3))
public Command (Transform character = null, Vector3 dir = default(Vector3))
{
this.character = character;
this.dir = dir;
}
/// <summary>
/// Perform the action.
/// </summary>
public abstract void Execute ();
// Used by the RewindHandler with rewinding.
/// <summary>
/// Perform the reverse action.
/// </summary>
public abstract void Undo ();
}
}
@@ -13,9 +13,6 @@ public MovementCommand (Transform character, Vector2 dir) : base (character, dir
public override void Execute ()
{
if (dir == Vector2.zero)
return;
undoDir = -dir;
character.Translate (dir, Space.World);
@@ -29,24 +29,8 @@ public override void Execute ()
if (instanceDir == Vector2.zero)
return;
/*Debug.Log (instanceDir);
if (instanceDir.x == 0) {
UpdateAnimation ("walk", false);
if (instanceDir.y == 0) {
UpdateAnimation ("jump", false);
return;
}
} */
undoDir = -physics.Move (instanceDir);
/*if (instanceDir.y > 0)
UpdateAnimation ("jump", true);
else if (instanceDir.x != 0)
UpdateAnimation ("walk", true); */
}
public override void Undo ()
@@ -61,15 +45,5 @@ public void MultiplyByDeltaTime (float deltaTime)
instanceDir = dir;
instanceDir *= deltaTime;
}
/*private void UpdateAnimation (string name, bool active)
{
if (animator) {
animator.SetBool (name, active);
}
} */
}
}
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
m_EditorVersion: 5.2.2f1
m_EditorVersion: 5.4.1f1
m_StandardAssetsVersion: 0
Binary file not shown.

0 comments on commit c4ce152

Please sign in to comment.