You've already forked taptap2024_GJ_chidouren
init
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
|
||||
public class ControlUIEvent : MonoBehaviour {
|
||||
|
||||
public Text moveStartText;
|
||||
public Text moveText;
|
||||
public Text moveSpeedText;
|
||||
public Text moveEndText;
|
||||
public Text touchStartText;
|
||||
public Text touchUpText;
|
||||
public Text downRightText;
|
||||
public Text downDownText;
|
||||
public Text downLeftText;
|
||||
public Text downUpText;
|
||||
public Text rightText;
|
||||
public Text downText;
|
||||
public Text leftText;
|
||||
public Text upText;
|
||||
|
||||
bool isDown;
|
||||
bool isLeft;
|
||||
bool isUp;
|
||||
bool isRight;
|
||||
|
||||
void Update(){
|
||||
|
||||
if (isDown){
|
||||
downText.text="YES";
|
||||
isDown = false;
|
||||
}
|
||||
else{
|
||||
downText.text="";
|
||||
}
|
||||
|
||||
if (isLeft){
|
||||
leftText.text="YES";
|
||||
isLeft = false;
|
||||
}
|
||||
else{
|
||||
leftText.text="";
|
||||
}
|
||||
|
||||
if (isUp){
|
||||
upText.text="YES";
|
||||
isUp = false;
|
||||
}
|
||||
else{
|
||||
upText.text="";
|
||||
}
|
||||
|
||||
if (isRight){
|
||||
rightText.text="YES";
|
||||
isRight = false;
|
||||
}
|
||||
else{
|
||||
rightText.text="";
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveStart(){
|
||||
moveStartText.text="YES";
|
||||
StartCoroutine( ClearText(moveStartText));
|
||||
}
|
||||
|
||||
public void Move(Vector2 move){
|
||||
moveText.text = move.ToString();
|
||||
}
|
||||
|
||||
public void MoveSpeed(Vector2 move){
|
||||
moveSpeedText.text = move.ToString();
|
||||
}
|
||||
|
||||
public void MoveEnd(){
|
||||
if (moveEndText.enabled){
|
||||
moveEndText.text = "YES";
|
||||
StartCoroutine( ClearText(moveEndText));
|
||||
StartCoroutine( ClearText(touchUpText));
|
||||
StartCoroutine( ClearText(moveText));
|
||||
StartCoroutine( ClearText(moveSpeedText));
|
||||
}
|
||||
}
|
||||
|
||||
public void TouchStart(){
|
||||
touchStartText.text="YES";
|
||||
StartCoroutine( ClearText(touchStartText));
|
||||
}
|
||||
|
||||
public void TouchUp(){
|
||||
touchUpText.text="YES";
|
||||
StartCoroutine( ClearText(touchUpText));
|
||||
StartCoroutine( ClearText(moveText));
|
||||
StartCoroutine( ClearText(moveSpeedText));
|
||||
}
|
||||
|
||||
public void DownRight(){
|
||||
downRightText.text="YES";
|
||||
StartCoroutine( ClearText(downRightText));
|
||||
}
|
||||
|
||||
public void DownDown(){
|
||||
downDownText.text="YES";
|
||||
StartCoroutine( ClearText(downDownText));
|
||||
}
|
||||
|
||||
public void DownLeft(){
|
||||
downLeftText.text="YES";
|
||||
StartCoroutine( ClearText(downLeftText));
|
||||
}
|
||||
|
||||
public void DownUp(){
|
||||
downUpText.text="YES";
|
||||
StartCoroutine( ClearText(downUpText));
|
||||
}
|
||||
|
||||
public void Right(){
|
||||
isRight = true;
|
||||
}
|
||||
|
||||
public void Down(){
|
||||
isDown = true;
|
||||
}
|
||||
|
||||
public void Left(){
|
||||
isLeft = true;
|
||||
}
|
||||
|
||||
public void Up(){
|
||||
isUp = true;
|
||||
}
|
||||
|
||||
|
||||
IEnumerator ClearText(Text textToCLead){
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
textToCLead.text = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25654e83a9afffc45b9c3d9a4a945b56
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,82 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
|
||||
public class ControlUIInput : MonoBehaviour {
|
||||
|
||||
public Text getAxisText;
|
||||
public Text getAxisSpeedText;
|
||||
public Text getAxisYText;
|
||||
public Text getAxisYSpeedText;
|
||||
public Text downRightText;
|
||||
public Text downDownText;
|
||||
public Text downLeftText;
|
||||
public Text downUpText;
|
||||
public Text rightText;
|
||||
public Text downText;
|
||||
public Text leftText;
|
||||
public Text upText;
|
||||
|
||||
void Update () {
|
||||
|
||||
getAxisText.text = ETCInput.GetAxis("Horizontal").ToString("f2");
|
||||
getAxisSpeedText.text = ETCInput.GetAxisSpeed("Horizontal").ToString("f2");
|
||||
|
||||
getAxisYText.text = ETCInput.GetAxis("Vertical").ToString("f2");
|
||||
getAxisYSpeedText.text = ETCInput.GetAxisSpeed("Vertical").ToString("f2");
|
||||
|
||||
if (ETCInput.GetAxisDownRight("Horizontal")){
|
||||
downRightText.text = "YES";
|
||||
StartCoroutine( ClearText(downRightText));
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisDownDown("Vertical")){
|
||||
downDownText.text = "YES";
|
||||
StartCoroutine( ClearText(downDownText));
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisDownLeft("Horizontal")){
|
||||
downLeftText.text = "YES";
|
||||
StartCoroutine( ClearText(downLeftText));
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisDownUp("Vertical")){
|
||||
downUpText.text = "YES";
|
||||
StartCoroutine( ClearText(downUpText));
|
||||
}
|
||||
|
||||
|
||||
if (ETCInput.GetAxisPressedRight("Horizontal")){
|
||||
rightText.text ="YES";
|
||||
}
|
||||
else{
|
||||
rightText.text ="";
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisPressedDown("Vertical")){
|
||||
downText.text ="YES";
|
||||
}
|
||||
else{
|
||||
downText.text ="";
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisPressedLeft("Horizontal")){
|
||||
leftText.text ="Yes";
|
||||
}
|
||||
else{
|
||||
leftText.text ="";
|
||||
}
|
||||
|
||||
if (ETCInput.GetAxisPressedUp("Vertical")){
|
||||
upText.text ="YES";
|
||||
}
|
||||
else{
|
||||
upText.text ="";
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ClearText(Text textToCLead){
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
textToCLead.text = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d233f3bf7cda10442bee49710a428e0f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user