Skip to content

Commit c3f7601

Browse files
committed
add back missing RotateModel code
1 parent 846198c commit c3f7601

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

Assets/FbxExporters/Editor/EditorRotate.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
namespace FbxExporters.Review
1515
{
16-
[CustomEditor (typeof(RotateModel))]
16+
[CustomEditor (typeof(FbxTurnTableBase))]
1717
public class EditorRotate : UnityEditor.Editor
1818
{
19-
RotateModel model;
19+
FbxTurnTableBase model;
2020

2121
public void OnEnable ()
2222
{
23-
model = (RotateModel)target;
23+
model = (FbxTurnTableBase)target;
2424
EditorApplication.update += Update;
2525
}
2626

Assets/FbxExporters/FbxTurnTableBase.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,27 @@ public class FbxTurnTableBase : MonoBehaviour
1818
[SerializeField]
1919
private float speed = 10f;
2020

21-
void Update ()
21+
#if UNITY_EDITOR
22+
private float timeOfLastUpdate = float.MaxValue;
23+
#endif
24+
25+
public void Rotate()
2226
{
23-
transform.Rotate (Vector3.up, speed * Time.deltaTime, Space.World);
27+
float deltaTime = 0;
28+
#if UNITY_EDITOR
29+
deltaTime = Time.realtimeSinceStartup - timeOfLastUpdate;
30+
if(deltaTime <= 0){
31+
deltaTime = 0.001f;
32+
}
33+
timeOfLastUpdate = Time.realtimeSinceStartup;
34+
#else
35+
deltaTime = Time.deltaTime;
36+
#endif
37+
transform.Rotate (Vector3.up, speed * deltaTime, Space.World);
38+
}
39+
40+
void Update () {
41+
Rotate ();
2442
}
2543
}
2644
}

0 commit comments

Comments
 (0)