Restricted by postings of,


All right! Please donate, directly into the theme!
1. New unity3d project, and it is reasonable to build a scenario, the import need resources, for example, my side will import some model of the motorcycle,

2. The first concern is the motorcycle itself attribute set, and then you can give them hang up the script, attributes: Pro_bike 5. Js, voice control: Bike_sound. Js, brake control: Skid Marks. Js.
And then the specific code is as follows:
1) Pro_bike 5. Js:

(2) Bike_sound. Js:

(3) Skid Marks. Js:

[script parameter Settings as shown in figure]


3. Next, we need in the scene, create a GameObject gameScenario game object, as the entire game control center, and the additional speed control in gameScenario object: Speedometer. Js
Control the whole game object: controlHub. Cs
1 the Speedometer. Js:

(2) controlHub. Cs:


4. The camera in the scene to follow and switch classes: camSwitcher. Cs;


5. When it comes to this step is critical, it is through the GUI to make virtual joystick, virtual joystick control class: mobileControls. Cs;


6. The last run directly see the effect, [PS: HAHA! Free hands-on practice is also interesting]



