1、没法加Anchor
使用复制吧
2、多分辨率如何弄。(尤其差很远的情况下)
控制UIRoot的高,可以设置缩放
3、如何使得一个面板及其子都不可以有事件。
NGUITools.SetActive(this.transform.parent.gameObject, false);
4、算出实时屏幕宽高度
UIRoot uiroot = (UIRoot)GameObject.FindObjectOfType(typeof(UIRoot));
int height = uiroot.manualHeight;
int width = Mathf.CeilToInt(Screen.width * 1.0f / Screen.height * heightb);
1、没法加Anchor
使用复制吧
2、多分辨率如何弄。(尤其差很远的情况下)
控制UIRoot的高,可以设置缩放
3、如何使得一个面板及其子都不可以有事件。
NGUITools.SetActive(this.transform.parent.gameObject, false);
4、算出实时屏幕宽高度
UIRoot uiroot = (UIRoot)GameObject.FindObjectOfType(typeof(UIRoot));
int height = uiroot.manualHeight;
int width = Mathf.CeilToInt(Screen.width * 1.0f / Screen.height * heightb);
Plane.Raycast 光线投射
function Raycast (ray : Ray, out enter : float) : bool
Description描述
Intersects a ray with the plane.
一条射线和平面相交。
This function sets enter to the distance along the ray, where it intersects the plane. If the ray is parallel to the plane, function returns false and sets enter to zero.
这个函数设置out enter沿着射线,相交平面的距离,如果该射线是平行于平面,函数返回false,并且设置out enter到0。
1、===========================================
没法加Anchor
使用复制吧
2、===========================================
多分辨率如何弄。(尤其差很远的情况下)
控制UIRoot的高,可以设置缩放
3、===========================================
如何使得一个面板及其子都不可以有事件。
NGUITools.SetActive(this.transform.parent.gameObject, false);
4、===========================================
算出实时屏幕宽高度
UIRoot uiroot = (UIRoot)GameObject.FindObjectOfType(typeof(UIRoot));
int height = uiroot.manualHeight;
int width = Mathf.CeilToInt(Screen.width * 1.0f / Screen.height * heightb);
Transform trans = cachedTransform;
Plane plane = new Plane(trans.rotation * Vector3.back, trans.position);
// If the ray doesn't hit the plane, do nothing
float dist;
Ray ray = cachedCamera.ScreenPointToRay(screenPos);
if (!plane.Raycast(ray, out dist)) return;
// Transform the point from world space to local space
CenterOnPos(trans.InverseTransformPoint(ray.GetPoint(dist)));