/// <summary> /// RayCast 拾取目标 /// </summary> public void RayCheckTarget() { UnityEngine.RaycastHit hit; if (UnityEngine.Physics.Raycast(UnityEngine.Camera.main.ScreenPointToRay(UnityEngine.Input.mousePosition), out hit, 100)) { ICheatDetectable target = hit.transform.GetComponent <ICheatDetectable>(); if (target != null) { Target = target; } } }
public void ResetTarget() { _target = null; }