Ejemplo n.º 1
0
        private static void CreateGuiCursor()
        {
            GameObject canvas = RectCanvas.GetCanvasObject();

            float xPos = Screen.width / 2 - (cursorSize / 2);
            float yPos = Screen.height / 2 - (cursorSize / 2);

            RectComponent canvasComponent = canvas.GetComponent <RectComponent>();

            guiCursor = canvasComponent.AddChild <RectImage>(cursorObjName);

            RectImage guiCursorComponent = guiCursor.GetComponent <RectImage>();

            guiCursorComponent.size     = new Vector2(cursorSize, cursorSize);
            guiCursorComponent.position = new Vector2(xPos, yPos);

            guiCursor.gameObject.SetActive(false);
        }
Ejemplo n.º 2
0
 public void RemoveChild(RectComponent rectComponent)
 {
     GameObject.Destroy(rectComponent.gameObject);
 }