Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: blackant on July 20, 2013, 11:25:02 PM

Title: Rewind Manager actions
Post by: blackant on July 20, 2013, 11: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;
}
}

}
Title: Re: Rewind Manager actions
Post by: blackant on July 20, 2013, 11: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;
}
}

}