Skip to content

Commit 31eba76

Browse files
committed
add assest store tool and add the unitypackage and the tutorial markdown
1 parent ddb6ba6 commit 31eba76

File tree

6 files changed

+66
-0
lines changed

6 files changed

+66
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
10.8 KB
Loading

SimpleJoystick.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# How To Make a Simple Joystick
2+
## The One In Stand Assests from Unity3D
3+
![joystick](https://i.imgsafe.org/a26ae3b.png)
4+
This prefab is with the move button and jump button. And there is other 4 prefabs in the package too.
5+
![4 prefabs](https://i.imgsafe.org/3a8a2a1.png)
6+
7+
### How To Get It?
8+
Assets > Import Package > CrossPlatformInput
9+
10+
### How To Use It?
11+
1. Add the prefab to the scene;
12+
2. Get the axis like the original Input Manager.
13+
14+
**i.e.**
15+
16+
using UnityStandardAssets.CrossPlatformInput;
17+
...
18+
//just like using Input Manager
19+
x = CrossPlatformInputManager.GetAxis("Horizontal");
20+
y = CrossPlatformInputManager.GetAxis("Vertical");
21+
...
22+
CrossPlatformInputManager.GetButtonDown("Jump");
23+
24+
25+
**P.S.**
26+
- The cross platform input is from the unity3d standard asses, make sure that you have already install it.
27+
- More About It, Please Read CrossPlatformInputGuidelines in the package folder.
28+
29+
## [Simple Joystick (Move Rotate Fire)](https://www.assetstore.unity3d.com/#!/content/59691)
30+
This is a different joystick, which support movement rotation and fire/jump input.
31+
![simple](https://lh3.googleusercontent.com/fU1DUGyP_QRbPKgu8qmuAM4737jHDWCg7CPE5qu-8eHE7nVvsuiEj2WrxXBjLv_efIc=h900)
32+
33+
And it will release on assest store days later.
34+
35+
### How To
36+
1. Download And Import The Package
37+
2. Drag and drop the `ControlCanvas` to the scene
38+
3. Add `EventSystem` to the scene too
39+
4. It is done (There is a sample scene in the package, you can double click to open it.)
40+
41+
#### Download And Import The Package
42+
[Simple Joystick on Assest Store]((https://www.assetstore.unity3d.com/#!/content/59691), the assest package will be released days later.
43+
44+
#### Drag and drop
45+
![drag drop](https://i.imgsafe.org/40a618e.png)
46+
47+
#### Add EventSystem
48+
![event](https://i.imgsafe.org/9149fa4.png)
49+
And it is ok to keep the default parameters.
50+
51+
#### Use the 3 static classes to get Axis and Fire
52+
- JoystickMove.instance. (H and V)
53+
- JoystickRotate.instance. (H and V)
54+
- JoystickFire.instance.Fire
55+
56+
##### Example
57+
void Update () {
58+
transform.Translate(new Vector3(JoystickMove.instance.H,0f,JoystickMove.instance.V)*speed*Time.deltaTime);
59+
60+
61+
transform.LookAt(transform.position+new Vector3(JoystickRotate.instance.H,0f,JoystickRotate.instance.V));
62+
63+
if(JoystickFire.instance.Fire){
64+
Debug.Log("fire");
65+
}
66+
}// this is in the sample scene `CubeControl`

simpleJoystick.unitypackage

36.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)