Unity3d外掛程式]EasyTouch簡單用法
EasyTouch使用 EasyTouch
目錄[-]
一、
二、操作步驟
1.官方文檔上的步驟
2.翻譯一下以上的步驟
3.根據官方的這些提示,自己來做一個屬於自己的人物遙感控制
對於移動平台上的RPG類的遊戲,我們常用虛擬搖杆來控制人物角色的行走和一些行為,相信我們對它並不陌生,之前嘗試了EasyTouch2.5,發現並沒有最新版的3.1好用,2.5版本的對於自適應沒有做的很好,而最新版的已經解決了這一問題。當然unity也內建了搖杆Joystick,用起來也簡單,但存在不少局限,不會滿足普通mmo遊戲的需求,比如指定顯示地區或者是更改一些素材等等,而這些EasyTouch外掛程式都已經幫你實現,不得不佩服外掛程式的原作者,能做出這麼炫酷好用的外掛程式,當然這估計是老外開發的,關於外掛程式的下載,你可以在AssetStore上購買,當然也可以使用free版。
我這裡也提供一個3.1版本的unity3d外掛程式:http://download.csdn.net/detail/s10141303/6962919
一、
感覺很酷有木有!接下來就看一下建立的過程吧!
二、操作步驟
1.官方文檔上的步驟
Quick Start (C#)
1-Import EasyTouch Package.
2-Create an empty gameObject, and name it EasyTouch.(You can choose another name)
Step 1 & 2 can be replace by the option menu
3-Add the EasyTouch.cs script on the EasyTouch gameObject that you just created.
4-Select the EasyTouch gameobject, and verifies that Broadcast messages is set to FALSE in the inspector.
5-Create a new C# script MyFirstTouch
6-Add these methods
[csharp] view plaincopyprint?
// Subscribe to events
void OnEnable(){
EasyTouch.On_TouchStart += On_TouchStart;
}
// Unsubscribe
void OnDisable(){
EasyTouch.On_TouchStart -= On_TouchStart;
}
// Unsubscribe
void OnDestroy(){
EasyTouch.On_TouchStart -= On_TouchStart;
}
// Touch start event
public void On_TouchStart(Gesture gesture){
Debug.Log( "Touch in " + gesture.position);
}
7-Create an empty gameObject, and name it Receiver.
8- Add MyFirstTouch script to the gameObject Receiver.
9- Run it in editor, and click on the screen