Ejemplo n.º 1
0
 void Awake()
 {
     instance      = this;
     rectTransform = transform as RectTransform;
     screenLabel   = new ScreenLabel(rectTransform);
     screenLabel.Hide();
     _softwareCursor = new SoftwareCursor(rectTransform);
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     instance      = this;
     rectTransform = GetComponent <RectTransform>();
 }