playMaker

Author Topic: Rewind Manager actions  (Read 1788 times)

blackant

  • Sr. Member
  • ****
  • Posts: 426
  • http://blackantmaster.com
    • View Profile
    • blackantmaster.com
Rewind Manager actions
« on: July 20, 2013, 08:25:02 PM »
i added some actions for those like me how are using the asset "RewindManager" from asset store.

those are very simple basic actions, you should simply put the bool used for player control ability true or false.

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

[ActionCategory("RewindManager")]
[Tooltip("DescriptionStart Rewinding Time Manager.")]
public class StopRewind : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Objects To Disable")]
public FsmBool EnablePlayerBool;


public override void Reset()
{
EnablePlayerBool = null;


}

// Code that runs on entering the state.
public override void OnEnter()
{
RewindManager.StopRewind();

Finish();
}

void Update ()
{
if (RewindManager.RewindStarted == false)
{
EnablePlayerBool = false;
}
else
{
EnablePlayerBool = true;
}
}

}

blackant

  • Sr. Member
  • ****
  • Posts: 426
  • http://blackantmaster.com
    • View Profile
    • blackantmaster.com
Re: Rewind Manager actions
« Reply #1 on: July 20, 2013, 08:26:03 PM »
and the stop action:

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

[ActionCategory("RewindManager")]
[Tooltip("DescriptionStart Rewinding Time Manager.")]
public class StopRewind : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Objects To Disable")]
public FsmBool EnablePlayerBool;


public override void Reset()
{
EnablePlayerBool = null;


}

// Code that runs on entering the state.
public override void OnEnter()
{
RewindManager.StopRewind();

Finish();
}

void Update ()
{
if (RewindManager.RewindStarted == false)
{
EnablePlayerBool = false;
}
else
{
EnablePlayerBool = true;
}
}

}