Beispiel #1
0
        public static Collider GetObject(Vector3?screenPos = null, LayerMask?layer = null, Camera camera = null)
        {
            if (_Instance == null)
            {
                _Instance = new GameObject().AddComponent <Mouse3D>();
            }

            return(_Instance.InternalGetObject(screenPos, layer, camera));
        }
Beispiel #2
0
        private void Awake()
        {
            if (_Instance != null && _Instance != this)
            {
                Destroy(gameObject);
                return;
            }

            _Instance = this;
        }
Beispiel #3
0
        public static Vector3 GetPosOnVirtualPlane(Vector3 point, Vector3 normal, Vector3?screenPos = null,
                                                   Camera camera = null)
        {
            if (_Instance == null)
            {
                _Instance = new GameObject().AddComponent <Mouse3D>();
            }

            return(_Instance.InternalGetPosOnVirtualPlane(point, normal, screenPos, camera));
        }
Beispiel #4
0
        public static Vector3 GetPos(Vector3?screenPos = null, LayerMask?layer = null, Camera camera = null)
        {
            if (_Instance == null)
            {
                _Instance = new GameObject().AddComponent <Mouse3D>();
            }

            var pos = _Instance.InternalGetPos(screenPos, layer, camera);

            return(pos);
        }