本文整理汇总了C#中UnityEngine.UI.RawImage.GetPixelAdjustedRect方法的典型用法代码示例。如果您正苦于以下问题:C# RawImage.GetPixelAdjustedRect方法的具体用法?C# RawImage.GetPixelAdjustedRect怎么用?C# RawImage.GetPixelAdjustedRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.UI.RawImage
的用法示例。
在下文中一共展示了RawImage.GetPixelAdjustedRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
direccioZ = Mathf.Cos((Camera.main.transform.eulerAngles.y * Mathf.PI)/180);
direccioX = Mathf.Sin((Camera.main.transform.eulerAngles.y * Mathf.PI)/180);
itsMinimapCamera = GameObject.Find("MiniMap").GetComponent<Camera>();
itsMainCamera = GameObject.Find("Main Camera").GetComponent<Camera>();
cameraPoint = GameObject.Find ("CameraPoint");
image = GameObject.Find("HUDMiniMapImage").GetComponent<RawImage>();
canvas = GameObject.Find("CanvasHUD").GetComponent<Canvas>();
Vector2 origin = new Vector2 (image.transform.position.x - (image.GetPixelAdjustedRect ().width * canvas.scaleFactor) / 2, image.transform.position.y - (image.GetPixelAdjustedRect ().height * canvas.scaleFactor) / 2);
float miniscale = Terrain.activeTerrain.terrainData.heightmapHeight / (image.GetPixelAdjustedRect ().height*canvas.scaleFactor);
mp = new Vector2 (cameraPoint.transform.position.x / miniscale + origin.x, cameraPoint.transform.position.z / miniscale + origin.y);
mini = GameObject.Find ("HUDMiniMap").GetComponent<RectTransform> ();
N = GameObject.Find ("N").GetComponent<RectTransform> ();
S = GameObject.Find ("S").GetComponent<RectTransform> ();
E = GameObject.Find ("E").GetComponent<RectTransform> ();
W = GameObject.Find ("W").GetComponent<RectTransform> ();
}