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