提交修改
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
|
||||
public class HitTestMain : MonoBehaviour
|
||||
{
|
||||
Transform cube;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Application.targetFrameRate = 60;
|
||||
|
||||
cube = GameObject.Find("Cube").transform;
|
||||
|
||||
Stage.inst.onTouchBegin.Add(OnTouchBegin);
|
||||
}
|
||||
|
||||
void OnTouchBegin()
|
||||
{
|
||||
if (!Stage.isTouchOnUI)
|
||||
{
|
||||
RaycastHit hit;
|
||||
Ray ray = Camera.main.ScreenPointToRay(new Vector2(Stage.inst.touchPosition.x, Screen.height - Stage.inst.touchPosition.y));
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
if (hit.transform == cube)
|
||||
{
|
||||
Debug.Log("Hit the cube");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnKeyDown(EventContext context)
|
||||
{
|
||||
if (context.inputEvent.keyCode == KeyCode.Escape)
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12542fe68a883624ea477c953ae0cf52
|
||||
timeCreated: 1456474677
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user