void Awake() { instance = this; rectTransform = transform as RectTransform; screenLabel = new ScreenLabel(rectTransform); screenLabel.Hide(); _softwareCursor = new SoftwareCursor(rectTransform); }
public SoftwareCursor(RectTransform parentTransform) { Debug.Assert(instance == null); instance = this; _root = new GameObject("SoftwareCursor"); _rectTransform = _root.AddComponent <RectTransform>(); _rectTransform.SetParent(parentTransform, false); _rectTransform.anchorMin = new Vector2(0.0f, 0.0f); _rectTransform.anchorMax = new Vector2(0.0f, 0.0f); var behaviour = _root.AddComponent <InternalBehaviour>(); behaviour.cursor = this; _image = _root.AddComponent <RawImage>(); _image.raycastTarget = false; }
private void Awake() { instance = this; rectTransform = GetComponent <RectTransform>(); }