目录 一、简单介绍 Unity中的一些知识点整理。 本节简单介绍在Unity开发中的,在AR/VR 开发中,有时候需要在 3D 空间进行 UI 元素的拖拽功能,或者即把UI元素从一个面板位置拖拽到另一个面板位置,有时候Laser 镭射线拖拽 UI 元素,不小心拖出屏幕的时候,常规的拖拽操作就会出现位置错误,如果您也遇到了类似情况,这里提供一个简单思路方法,提供参考,如果你有新的方式也可以留言,多谢。 二、实现原理 1、常规的 UI 拖拽功能,一般使用 RectTransformUtility.ScreenPointToWorldPointInRectangle 或者 RectTransformUtility.ScreenPointToLocalPointInRectangle 进行位置的计算 1、RectTransformUtility.ScreenPointToWorldPointInRectangle(this.gameObject.GetComponent<RectTransform>(), eventData.position,...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile