/// <summary> /// Posts the transform action. /// </summary> /// <param name="action">Action.</param> public void PostTransformAction(SFPostionDelegateAction <float> action) { //create the six actions mgr.PostDelegateAction((TransformAction.PosX), () => { Vector3 vec = action.PosSelector(); return(vec.x); }); mgr.PostDelegateAction((TransformAction.PosY), () => { Vector3 vec = action.PosSelector(); return(vec.y); }); mgr.PostDelegateAction((TransformAction.PosZ), () => { Vector3 vec = action.PosSelector(); return(vec.z); }); mgr.PostDelegateAction((TransformAction.RotX), () => { Quaternion rotation = action.RotSelector(); return(rotation.eulerAngles.x); }); mgr.PostDelegateAction((TransformAction.RotY), () => { Quaternion rotation = action.RotSelector(); return(rotation.eulerAngles.y); }); mgr.PostDelegateAction((TransformAction.RotZ), () => { Quaternion rotation = action.RotSelector(); return(rotation.eulerAngles.z); }); //action.FrameID = curFrameID + 1; //tempActions.Add(action); }
/// <summary> /// Posts the transform action. /// </summary> /// <param name="posSelector">Position selector.</param> /// <param name="rotSelector">Rot selector.</param> public void PostTransformAction(Func <Vector3> posSelector, Func <Quaternion> rotSelector) { SFPostionDelegateAction <float> action = new SFPostionDelegateAction <float> (posSelector, rotSelector); PostTransformAction(action); }