- 博客(3)
- 收藏
- 关注
原创 点击button
新建button,然后绑上脚本:using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.SceneManagement;using UnityEngine.UI;using UnityEngine.Events;public class PkFlight : MonoBehaviour{ // Start is called before the
2022-03-19 19:25:35
219
转载 Unity中鼠标左键按下,拖拽物体移动
把这段脚本拖给想要拖拽的物体,然后加上碰撞盒就可以了。 private Vector3 _vec3TargetScreenSpace;// 目标物体的屏幕空间坐标 private Vector3 _vec3TargetWorldSpace;// 目标物体的世界空间坐标 private Transform _trans;// 目标物体的空间变换组件 private Vector3 _vec3MouseScreenSpace;// 鼠标的屏幕空间坐标
2022-03-13 17:57:51
2514
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅
3