Unity3d外掛程式]EasyTouch簡單用法

來源:互聯網
上載者:User

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


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.