示例#1
0
        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);
        }
示例#2
0
 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);
     }
 }
示例#3
0
        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;
            }
        }
示例#4
0
 public void RecordAndPlay(TrailRecordInfo recordInfo, float dt)
 {
     mRecorder.Record(recordInfo, dt);
     mPlayer.Play(recordInfo, 0);
 }
示例#5
0
 void Start()
 {
     mInfo = PlayBegin();
 }
示例#6
0
 public void Init(TrailRecordInfo recordInfo)
 {
     mSpliner.Init(recordInfo.Config.MaxPlayingRecordLength * recordInfo.Config.SplineDetail);
 }
示例#7
0
 public void Record(TrailRecordInfo info, float dt)
 {
     Record(info, info.Config.TransformBase.position, info.Config.TransformTip.position, dt);
 }