public TransformRecordableItem(RecordableInfo recordableInfo, int frame) : base(recordableInfo.instanceID)
 {
     m_FrameIds = new List <int>(200)
     {
         frame
     };
 }
 public AnimatorRecordableItem(RecordableInfo recordableInfo, int frame) : base(recordableInfo.instanceID)
 {
     m_LayerNames.Add(new LayerInfo
     {
         time = GameDebuggerDatabase.GetRecords(frame).time,
         name = GetStateNameForRecordable(recordableInfo.recordable)
     });
 }
Exemplo n.º 3
0
        public static FrameInfo FromJson(string json)
        {
            FrameInfo frameInfo = JsonUtility.FromJson <FrameInfo>(json);

            frameInfo.records = new List <RecordableInfo>();
            foreach (var recordableJson in frameInfo.recordableInfoJsons)
            {
                frameInfo.records.Add(RecordableInfo.FromJson(recordableJson));
            }
            frameInfo.recordableInfoJsons.Clear();
            return(frameInfo);
        }
Exemplo n.º 4
0
        public RigidBodyRecordableItem(RecordableInfo recordableInfo, int frame) : base(recordableInfo.instanceID)
        {
            m_FrameIds = new List <int>(200)
            {
                frame
            };
            var rr = (RigidBodyRecordable)recordableInfo.recordable;

            m_Velocities = new List <float>(200)
            {
                rr.speed.magnitude
            };
        }
        public override void Refresh(RecordableInfo recordableInfo, int frame)
        {
            var tr = recordableInfo.recordable as TransformRecordable;

            if (tr != null)
            {
                var lastRecords = GameDebuggerDatabase.GetRecords(m_FrameIds.Last());
                var info        = lastRecords.records.Find(otherRecInfo => m_InstanceId == otherRecInfo.instanceID);
                if (!tr.ApproximatelyEquals((TransformRecordable)info.recordable))
                {
                    m_FrameIds.Add(frame);
                }
            }
        }
Exemplo n.º 6
0
        public override void Refresh(RecordableInfo recordableInfo, int frame)
        {
            var rr = recordableInfo.recordable as RigidBodyRecordable;

            if (rr != null)
            {
                var lastRecords = GameDebuggerDatabase.GetRecords(m_FrameIds.Last());
                var info        = lastRecords.records.Find(otherRecInfo => m_InstanceId == otherRecInfo.instanceID);
                if (info.recordable != null && !rr.ApproximatelyEquals((RigidBodyRecordable)info.recordable))
                {
                    m_FrameIds.Add(frame);
                    m_Velocities.Add(rr.speed.magnitude);
                }
            }
        }
        public override void Refresh(RecordableInfo recordableInfo, int frame)
        {
            var ar = recordableInfo.recordable as AnimatorRecordable;

            if (ar != null)
            {
                var otherStateName   = GetStateNameForRecordable(ar);
                var currentStateName = m_LayerNames.Last().name;
                if (otherStateName != currentStateName)
                {
                    m_LayerNames.Add(new LayerInfo()
                    {
                        name = otherStateName,
                        time = GameDebuggerDatabase.GetRecords(frame).time
                    });
                }
            }
        }
 public static TrackItem Create(RecordableInfo recordableInfo, int frame)
 {
     if (recordableInfo.recordable is TransformRecordable)
     {
         return(new TransformRecordableItem(recordableInfo, frame));
     }
     if (recordableInfo.recordable is AnimatorRecordable)
     {
         return(new AnimatorRecordableItem(recordableInfo, frame));
     }
     if (recordableInfo.recordable is RigidBodyRecordable)
     {
         return(new RigidBodyRecordableItem(recordableInfo, frame));
     }
     if (recordableInfo.recordable is InputRecordable)
     {
         return(new InputRecordableItem(recordableInfo, frame));
     }
     if (recordableInfo.recordable is ScreenShotRecordable)
     {
         return(new ScreenshotRecordableItem(recordableInfo, frame));
     }
     return(null);
 }
Exemplo n.º 9
0
 public abstract void Refresh(RecordableInfo recordableInfo, int frame);
Exemplo n.º 10
0
 public override void Refresh(RecordableInfo recordableInfo, int frame)
 {
     m_Screenshots.Add(GetScreenshotForFrame(recordableInfo.recordable, frame));
 }
Exemplo n.º 11
0
 public ScreenshotRecordableItem(RecordableInfo recordableInfo, int frame)
     : base(recordableInfo.instanceID)
 {
     m_Screenshots.Add(GetScreenshotForFrame(recordableInfo.recordable, frame));
 }
 public override void Refresh(RecordableInfo recordableInfo, int frame)
 {
     AddToInputs(GetInputsForFrame(recordableInfo.recordable, frame));
 }
 public InputRecordableItem(RecordableInfo recordableInfo, int frame) : base(recordableInfo.instanceID)
 {
     AddToInputs(GetInputsForFrame(recordableInfo.recordable, frame));
 }