public TrailRecordInfo PlayBegin() { var mr = GetComponent <MeshRenderer>(); Config.RegisterLayerInfo(gameObject.layer, mr.sortingLayerName, mr.sortingOrder); var recordInfo = new TrailRecordInfo(Config); mPlayer.Init(recordInfo); return(recordInfo); }
public void Record(TrailRecordInfo info, Vector3 basePosition, Vector3 tipPosition, float dt) { if (info.RecordElements.Count < info.Config.MaxPlayingRecordLength) { var snapshot = new LineInfo(); snapshot.Init(basePosition, tipPosition); info.RecordElements.AddHead(snapshot); } else { info.RecordElements.TryRemoveTail(out var tail); tail.Init(basePosition, tipPosition); info.RecordElements.AddHead(tail); } }
public void Play(TrailRecordInfo recordInfo, int recordNum) { TrailMeshObject tmo = recordInfo.tmo; NF.Collections.Generic.LinkedList <LineInfo> records = recordInfo.RecordElements; SplineMeshInfo meshInfo = recordInfo.MeshInfo; TrailRecordConfig config = recordInfo.Config; switch (config.ELinePerVertexCount) { case TrailRecordConfig.E_LinePerVertexCount.TWO: UpdateMeshObjectWithSpline2(tmo, recordInfo.mMeshModifier, records, meshInfo, config); break; case TrailRecordConfig.E_LinePerVertexCount.THREE: UpdateMeshObjectWithSpline3(tmo, recordInfo.mMeshModifier, records, meshInfo, config); break; } }
public void RecordAndPlay(TrailRecordInfo recordInfo, float dt) { mRecorder.Record(recordInfo, dt); mPlayer.Play(recordInfo, 0); }
void Start() { mInfo = PlayBegin(); }
public void Init(TrailRecordInfo recordInfo) { mSpliner.Init(recordInfo.Config.MaxPlayingRecordLength * recordInfo.Config.SplineDetail); }
public void Record(TrailRecordInfo info, float dt) { Record(info, info.Config.TransformBase.position, info.Config.TransformTip.position, dt); }