回答編集履歴
1
Carからコンポーネントを取る形になっていなかったため修正
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
CarUserControl carUserControl;
|
36
36
|
|
37
|
-
CarController car;
|
37
|
+
CarController carController;
|
38
38
|
|
39
39
|
|
40
40
|
|
@@ -46,9 +46,9 @@
|
|
46
46
|
|
47
47
|
Car = GameObject.Find("Car");
|
48
48
|
|
49
|
-
carUserControl = GetComponent<CarUserControl>();
|
49
|
+
carUserControl = Car.GetComponent<CarUserControl>();
|
50
50
|
|
51
|
-
car = GetComponent<CarController>();
|
51
|
+
carController = Car.GetComponent<CarController>();
|
52
52
|
|
53
53
|
}
|
54
54
|
|
@@ -90,7 +90,7 @@
|
|
90
90
|
|
91
91
|
float h = CrossPlatformInputManager.GetAxis("Horizontal");
|
92
92
|
|
93
|
-
car.Move(h, 0.0f, 0.0f, 1.0f);
|
93
|
+
carController.Move(h, 0.0f, 0.0f, 1.0f);
|
94
94
|
|
95
95
|
}
|
96
96
|
|