using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour
{
/// <summary>
/// hendle touch down message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchDown(Vector3 position)
{
print("TouchInput.currentCamera=" + TouchInput.currentCamera
+ "TouchInput.ray=" + TouchInput.ray
+ "TouchInput.position=" + TouchInput.position
+ "TouchInput.deltaPosition=" + TouchInput.deltaPosition
+ "TouchInput.deltaTime=" + TouchInput.deltaTime
+ "TouchInput.fingerId=" + TouchInput.fingerId
+ "TouchInput.phase=" + TouchInput.phase
+ "TouchInput.tapCount=" + TouchInput.tapCount);
GetComponent<TextMesh>().text = "onTouchDown";
}
/// <summary>
/// hendle touch move message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchMove(Vector3 position)
{
GetComponent<TextMesh>().text = "onTouchMove";
}
/// <summary>
/// hendle touch up as button message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchUpAsButton(Vector3 position)
{
GetComponent<TextMesh>().text = "onTouchUpAsButton";
}
/// <summary>
/// hendle touch up message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchUp(Vector3 position)
{
GetComponent<TextMesh>().text = "onTouchUp";
}
/// <summary>
/// hendle touch enter message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchEnter(Vector3 position)
{
GetComponent<TextMesh>().text = "onTouchEnter";
}
/// <summary>
/// hendle touch exit message.
/// </summary>
/// <param name="position">touch position.</param>
void onTouchExit(Vector3 position)
{
GetComponent<TextMesh>().text = "onTouchExit";
}
}
RNTouchInput Example code
最新推荐文章于 2019-04-05 01:50:46 发布