Hi,
Following a request, please find an action to get the Sine. I will carry one building the rest of trigo actions to voer the whole possibilities.
// (c) Copyright HutongGames, LLC 2010-2012. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("trigonometry")]
[Tooltip("Get the sine. You can use degrees, simply check on the DegToRad conversion")]
public class GetSine : FsmStateAction
{
[RequiredField]
public FsmFloat angle;
public FsmBool DegToRad;
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat result;
public bool everyFrame;
public override void Reset()
{
angle = null;
DegToRad = true;
everyFrame = false;
result = null;
}
public override void OnEnter()
{
DoSine();
if (!everyFrame)
Finish();
}
public override void OnUpdate()
{
DoSine();
}
void DoSine()
{
float _angle = angle.Value;
if (DegToRad.Value)
{
_angle = _angle*Mathf.Deg2Rad;
}
result.Value = Mathf.Sin(_angle);
}
}
}
bye,
Jean