You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
786 B
35 lines
786 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class SkillArmTest : MonoBehaviour |
|
{ |
|
private CarSkill skill; |
|
Ray ray; |
|
RaycastHit hit; |
|
private void Awake() |
|
{ |
|
skill = gameObject.GetComponent<CarSkill>(); |
|
} |
|
// 创建射线到屏 |
|
// Update is called once per fram |
|
void OnGUI() |
|
{ |
|
|
|
if (GUI.Button(new Rect(0, 200, 200, 50), "复原举臂")) |
|
{ |
|
skill.ArmReset(); |
|
} |
|
} |
|
private void Update() |
|
{ |
|
if (Input.GetMouseButtonDown(0)) |
|
{ |
|
ray = Camera.main.ScreenPointToRay(Input.mousePosition); |
|
if (Physics.Raycast(ray, out hit)) |
|
{ |
|
skill.ArmLifting(hit.point); |
|
} |
|
} |
|
} |
|
}
|
|
|