Skip to content

Commit e812bce

Browse files
committed
create a function so rotate code is not duplicated
1 parent 9838f03 commit e812bce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Assets/FbxExporters/Editor/EditorRotate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void Update ()
3535
if (model == null || EditorApplication.isPlaying) {
3636
return;
3737
}
38-
model.transform.Rotate (Vector3.up, model.GetSpeed() * Time.deltaTime, Space.World);
38+
model.Rotate ();
3939
}
4040
}
4141
}

Assets/FbxExporters/RotateModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ public float GetSpeed()
2323
return speed;
2424
}
2525

26+
public void Rotate()
27+
{
28+
transform.Rotate (Vector3.up, speed * Time.deltaTime, Space.World);
29+
}
30+
2631
void Update ()
2732
{
28-
transform.Rotate (Vector3.up, speed * Time.deltaTime, Space.World);
33+
Rotate ();
2934
}
3035
}
3136
}

0 commit comments

Comments
 (0)