@@ -73,9 +73,45 @@ public void init(int value)
73
73
BodiesCountSlider . GetComponent < SliderUi > ( ) . Label . text = "Number of Galaxies" ;
74
74
RadiusSlider . GetComponent < SliderUi > ( ) . Label . text = "Universe Radius" ;
75
75
initialVelocitySlider . GetComponent < SliderUi > ( ) . Label . text = "Galaxies Initial Velocity" ;
76
+
77
+ break ;
78
+
79
+ }
80
+ }
81
+ SimulationType previousType ;
82
+ public void setCameraRotation ( )
83
+ {
84
+ Debug . Log ( previousType + " " + GlobalManager . Instance . SimulationParameter . simulationType ) ;
85
+ if ( previousType == GlobalManager . Instance . SimulationParameter . simulationType )
86
+ return ;
87
+
88
+ switch ( GlobalManager . Instance . SimulationParameter . simulationType )
89
+ {
90
+ case SimulationType . Galaxy :
91
+ Camera . main . transform . rotation = Quaternion . Euler ( 90 , 0 , 0 ) ;
92
+ Camera . main . GetComponent < CameraMovement > ( ) . AutoRotation = false ;
93
+ Camera . main . GetComponent < CameraMovement > ( ) . DistanceToTarget = radiusSlider . value ;
94
+
95
+ break ;
96
+ case SimulationType . Collision :
97
+ Camera . main . transform . rotation = Quaternion . Euler ( 90 , 0 , 0 ) ;
98
+ Camera . main . GetComponent < CameraMovement > ( ) . AutoRotation = false ;
99
+ Camera . main . GetComponent < CameraMovement > ( ) . DistanceToTarget = radiusSlider . value * 2 ;
100
+
101
+
102
+ break ;
103
+ case SimulationType . Universe :
104
+ Camera . main . transform . rotation = Quaternion . Euler ( 0 , 0 , 0 ) ;
105
+ Camera . main . GetComponent < CameraMovement > ( ) . AutoRotation = true ;
106
+ Camera . main . GetComponent < CameraMovement > ( ) . DistanceToTarget = radiusSlider . value * 2 ;
107
+
76
108
break ;
77
109
78
110
}
111
+
112
+
113
+ previousType = GlobalManager . Instance . SimulationParameter . simulationType ;
114
+
79
115
}
80
116
}
81
117
0 commit comments