Skip to content

Commit cafd9f1

Browse files
author
Felix Lange
committed
decouple mousedata from recorder to make recorder editor only
1 parent 9654862 commit cafd9f1

File tree

7 files changed

+30
-11
lines changed

7 files changed

+30
-11
lines changed

Example/Scripts/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Scripts/MouseRecorder.cs renamed to Example/Scripts/Editor/MouseRecorder.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929
//record mouse position as world coordinates
3030
public class MouseRecorder : StringRecorder
3131
{
32-
33-
[System.Serializable]
34-
public class MouseData
35-
{
36-
public Vector3 worldPos;
37-
public bool pressed;
38-
}
39-
4032
private MouseData mouseData = new MouseData();
4133

4234
protected new void Update()

Example/Scripts/MouseData.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using UnityEngine;
2+
3+
[System.Serializable]
4+
public class MouseData
5+
{
6+
public Vector3 worldPos;
7+
public bool pressed;
8+
}

Example/Scripts/MouseData.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Scripts/MouseDrawer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
public class MouseDrawer : DataListener
3030
{
3131

32-
private MouseRecorder.MouseData mouseData = new MouseRecorder.MouseData();
32+
private MouseData mouseData = new MouseData();
3333

3434
public override void ProcessData(DataFrame results)
3535
{
3636
StringData stringData = results as StringData;
37-
mouseData = JsonUtility.FromJson<MouseRecorder.MouseData>(stringData.data);
37+
mouseData = JsonUtility.FromJson<MouseData>(stringData.data);
3838
}
3939

4040
void OnDrawGizmos()

Example/Scripts/MousePlotter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void OnDrawGizmos()
3939
foreach (DataFrame frame in recording.DataFrames)
4040
{
4141
StringData stringData = frame as StringData;
42-
MouseRecorder.MouseData mouseData = JsonUtility.FromJson<MouseRecorder.MouseData>(stringData.data);
42+
MouseData mouseData = JsonUtility.FromJson<MouseData>(stringData.data);
4343

4444
float radius;
4545
if (mouseData.pressed)

0 commit comments

Comments
 (0)