ShanxiKnowledgeBase/SXElectricalInspection/Assets/GuYuan/KDLYanDianBi/TestPen.cs

37 lines
779 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.AI;
public class TestPen : MonoBehaviour
{
[SerializeField] GameObject hightGame;
[SerializeField]bool isok = false;
// Start is called before the first frame update
void Start()
{
}
private void OnMouseOver()
{
}
private void OnMouseEnter()
{
isok = true;
}
private void OnMouseExit()
{
isok = false;
}
private void Update()
{
if (isok)
{
Vector3 pos = Input.mousePosition;
transform.position = Camera.main.ScreenToWorldPoint(new Vector3(pos.x, pos.y, transform.position.z));
Debug.Log("Êä³ö");
}
}
}