Importing the CrossPlatformInput package adds a menu item to Unity, "CrossPlatformInput", which allows you to enable or disable the CrossPlatformInput in the editor. You must enable the CrossPlatformInput in order to see the control rigs in the editor, and to start using Unity Remote to control your game.
The CrossPlatformInput sample assets contains two main sections.
1) The folder of prefabs provide a variety of ready-to-use "MobileControlRigs". Each control rig is suitable for a different purpose, and each implements the touch or tilt-based equivalent of some of the default standalone axes or buttons. These are ready to drop into your scene, and to use them you simply need to read the axes via the CrossPlatformInput class, rather than Unity's regular Input class.
2) The set of scripts provided are the scripts we used to put together the control rigs prefabs. They provide a simplified way of reading basic mobile input, such as tilt, taps and swipe gestures. They are designed so that various mobile controls can be read in the same way as regular Unity axes and buttons. You can use these scripts to build your own MobileControlRigs.
For example the Car control rig feeds the tilt input of the mobile device to the "Horizontal" axis, and has an accelerator and brake touch button which are fed as a pair into the "Vertical" axis. These are virtual equivalents of the real "Horizontal" and "Vertical" axes defined in Unity's Input Manager.
Therefore when you read CrossPlatformInput.GetAxis("Horizontal"), you will either get the "real" input value - if your build target is non-mobile, or the value from the mobile control rig - if your build target is set to a mobile platform.
The CrossPlatformInput scripts and prefabs are provided together as an example of how you can implement a cross-platform control solution in Unity. They also allow us to provide our other sample scenes in a form that can be published as standalone or to mobile targets with no modification.
To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your scene (or create your own), and then make calls to CrossPlatformInput functions, referring to the axes and buttons that the Rig implements.
When reading input from the CrossPlatformInput class, the values returned will be taken either from Unity's Input Manager settings, or from the mobile-specific controls set up, depending on which build target you have selected.
The CrossPlatformInput class is designed to be called instead of Unity's own Input class, and so mirrors certain parts of the Input API - specifically the functions relating to Axes and Buttons:
GetAxis, GetAxisRaw
GetButton, GetButtonDown, GetButtonUp
Notes for coders:
This package sets two compiler define symbols. One is always set automatically, the other is optionally set from a menu item.
Importing the "CrossPlatformInput" package will automatically add a compiler define symbol, "CROSS_PLATFORM_INPUT". This enables the CrossPlatformInput functions defined in some of the other Sample Asset packages (such as the Characters, Planes, etc). Without this symbol defined, those packages use Unity's regular Input class, which means they can be imported alone and still work without the CrossPlatformInput package.
The optional define (which is set by default, but can be disabled using the "Mobile Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active when a mobile build target is selected. It also enables certain mobile-specific control nuances in some of the packages, which make more sense when the character or vehicle is being controlled using mobile input (such as auto-leveling the character's look direction). This define is optional because some developers prefer to use standalone input methods instead of the Unity Remote app, when testing mobile apps in the editor's play mode.
没有合适的资源?快使用搜索试试~ 我知道了~
Unity3D 物体运动小程序
共1225个文件
info:297个
meta:273个
bin:96个
需积分: 50 19 下载量 117 浏览量
2018-11-16
23:14:33
上传
评论 1
收藏 91.3MB RAR 举报
温馨提示
Unity3D 物体运动小游戏,在场景中有两个小方块,一个小方块可以通过WASD四个键来进行运动操作,另一个设置了规定的路径在不断循环运动。
资源推荐
资源详情
资源评论
收起资源包目录
Unity3D 物体运动小程序 (1225个子文件)
00000000000000001000000000000000 4KB
00000000000000002000000000000000 4KB
00000000000000003000000000000000 4KB
00000000000000004000000000000000 4KB
00000000000000004100000000000000 4KB
00000000000000005000000000000000 4KB
00000000000000005100000000000000 4KB
00000000000000006000000000000000 4KB
00000000000000006100000000000000 4KB
00000000000000007000000000000000 4KB
00000000000000008000000000000000 4KB
00000000000000008100000000000000 4KB
00000000000000009000000000000000 4KB
00000000000000009100000000000000 4KB
0000000000000000a000000000000000 4KB
0000000000000000b000000000000000 4KB
0000000000000000c000000000000000 4KB
00c3c865782347f41b6358d9fba14b48 8KB
03a71764f1184704c9a74acb7490450e 1.34MB
047330f39d11745ad0004adb8d76c639 9KB
0626b924325d1c34cafa6b22297f4e4f 53KB
0aa00c0212e047047aa5a1ce93b07f49 4KB
0b9521b5225154b4c80f57b74a8910e6 4KB
0c6271a290ef75b4c97d58746c86c5b8 96KB
0d2f50a8e0bb841a5aaa90ae55db8849 5KB
0ec79c3d1dd0fb640b7f3f72ebb28f74 1.34MB
0f57aeb1b8dce3342bea5c28ac17db24 9KB
1092dd21af768cb499771bf88709dbbd 4KB
164389b7a7cdb494989c31dc2f0f7178 4KB
172f40c874b35fc42a66d568a70f9867 4KB
174090ae7f9eff84abe76f0ff062efac 4KB
17e234879cb994b7f93d7437c10d23d6 4KB
18214e9d6af6248559d501391856f1c7 350KB
19d7ece9e3def3745a0f6e75d984fdf6 4KB
1cac2e0bcc34e4b3cbb4bd85982eba83 15KB
1caf40fc8bebb6b43b2550c05ca791d6 9KB
1cb3f0c5c8637644dae1816a674f7e10 4KB
1d6e8dd2fb70b7b4cbe9041da980b7c9 4KB
1fbc4e410d66d804aaf31b4c25b16ffc 179KB
20c65bc5a7d28f54c9ca69569d77706d 1.34MB
2169821f0567671499a5c10104c69c24 4KB
21b01056ea59b814f9ae15d8e6bb3aac 4KB
22bbf57ec543cee42a5aa0ec2dd9e457 5KB
246cc59c7a84ea44f87f6b70acfe30c5 5KB
24b990205a90e0949842f0961c5f19e3 4KB
29014cd42b6d273408e0ceefd336c0b3 6KB
29fae2a5829449146932e5d41495043b 5KB
2a91e8dd37cdd41efb4859b65aced7a2 6KB
2b46b029d8dc37049aebb484e79998ff 350KB
2bcb00d145ec17e4cad096cedfd84138 4KB
2c0b1e62b5409f6468554bb2f297badc 4KB
2c116325e19b8a04d916864cc540ec2d 1.34MB
2c1c27ec8c3b75a4c80a795adc9ca788 179KB
2c528fec5d95e4ac28cf46399b887662 94KB
2c538784885b34a5987ed9f6651d9ecd 4KB
2dc67c8fe799ae845add403087340bd1 4KB
2dd3788f8589b40bf82a92d76ffc5091 350KB
30586af2d47849140b2d533bb6f75eaa 1.34MB
306f8f570579fb3448d141a63029ef94 1.34MB
30abebfd9bf1c49d8a2d26e61e66bc15 4KB
3369231b1ed7ad34e84d9240a571db81 4KB
33850b67ffcaa4b6c9a7146e4be0b917 4KB
34d2758af9e0a2b4690fbcfcad0285d6 691KB
34e1452e07a0b40c295c5b10aa679465 4KB
34f07406286974e4ca236867d8d58b51 350KB
355b3169750599e4f957a9d54675c3fa 4KB
36dd0b22da8874ed38075789055ca664 179KB
371fa5d370f67534696194100d17bfad 350KB
37fac21d1f093d344816942d1abce94e 5KB
39baceec69bb1ee4fb4194d50e1a6d10 4KB
3a7cedf246fca744f90cbdc9dbe41166 11KB
3bf2bbbc8bf6c674dbdd7e7bed3467bd 4KB
3cc8ac37e0da341db819af6143a07b03 4KB
3d8675433a508ec47b8f895201eacf20 352KB
3dc82647157f5fb4d9b4bade4825b42d 4KB
3e27d9cfd3a59af4ebdf7444f6f57620 691KB
41232aac50fb25a40b390906295f9aa6 1.34MB
4185bc77c7194462ca3b1097ef4a5de0 14KB
41e4f29e5dee9ec48a2538955ef1de71 4KB
42e7f46d0e5a84171a3909479c1646ba 5KB
440eb36db91ca410f800ff3cfe43572f 179KB
45cab4c9b31009748999eec1556926b3 1.34MB
46160e8fc1456bc4d9fb3de64ba88c31 4KB
469edab27ab6d004d84af2c4a851bd7f 1.29MB
475c4a4e617a8401b84ca7b32c7cc460 70KB
492f54f4accf00440828ffcb9e4fcc19 6KB
49b611e658efbf443b686a4036f74fe3 96KB
4be5b19d42487c24f830c4ee36849a95 4KB
4c4bc148459cd764dbb1d4e94e49299b 4KB
4d6c994b9ad45b847bc67ec5f857fc78 350KB
4db017495c69e8140a56a0e2b669e3f8 96KB
4f65f58f1750429468db4bef75317815 4KB
4f9d71771b07cb6438e0d35b038b43a7 4KB
50d95e01ce44ff842949168ffec200cf 4KB
52b7d70b1de7c4ce09662b77c14d9fda 4KB
5485e2f56028a3c4cb54f5caa167377e 96KB
54ee8e39b634b6d45aae528b6b24e879 4KB
55e2334423fefa34fb4916f6780413d3 350KB
57225f817366f704fb9b710e3865030d 4KB
57df284b8a7c87b4894ac5f9c86e0be9 4KB
共 1225 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
空城机
- 粉丝: 3015
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功