File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,11 @@ private static Object LoadModel (string fbxFileName)
81
81
modelGO = UnityEditor . PrefabUtility . InstantiatePrefab ( unityMainAsset ) as GameObject ;
82
82
83
83
GameObject turntableGO = GameObject . Find ( "TurnTable" ) ;
84
- if ( turntableGO != null )
85
- {
84
+ if ( turntableGO != null ) {
86
85
modelGO . transform . parent = turntableGO . transform ;
86
+ turntableGO . AddComponent < RotateModel > ( ) ;
87
+ } else {
88
+ modelGO . AddComponent < RotateModel > ( ) ;
87
89
}
88
90
}
89
91
Original file line number Diff line number Diff line change
1
+ using System . Collections ;
2
+ using System . Collections . Generic ;
3
+ using UnityEngine ;
4
+
5
+ public class RotateModel : MonoBehaviour {
6
+
7
+ public float speed = 10f ;
8
+
9
+ void Update ( ) {
10
+ transform . Rotate ( Vector3 . up , speed * Time . deltaTime ) ;
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments