Beispiel #1
0
        public static FPSBrowserUI Create(MeshCollider meshCollider, Transform worldPointer, FPSCursorRenderer cursorRenderer)
        {
            FPSBrowserUI fPSBrowserUI = meshCollider.gameObject.GetComponent <FPSBrowserUI>();

            if (!fPSBrowserUI)
            {
                fPSBrowserUI = meshCollider.gameObject.AddComponent <FPSBrowserUI>();
            }
            fPSBrowserUI.meshCollider   = meshCollider;
            fPSBrowserUI.worldPointer   = worldPointer;
            fPSBrowserUI.cursorRenderer = cursorRenderer;
            return(fPSBrowserUI);
        }
Beispiel #2
0
        public static void SetUpBrowserInput(Browser browser, MeshCollider mesh)
        {
            FPSCursorRenderer instance  = Instance;
            Transform         transform = instance.pointer;

            if (!transform)
            {
                transform = Camera.main.transform;
            }
            FPSBrowserUI fPSBrowserUI = FPSBrowserUI.Create(mesh, transform, instance);

            fPSBrowserUI.maxDistance = instance.maxDistance;
            browser.UIHandler        = fPSBrowserUI;
        }
Beispiel #3
0
        public static void SetUpBrowserInput(Browser browser, MeshCollider mesh)
        {
            var crossHair = Instance;

            var pointer = crossHair.pointer;

            if (!pointer)
            {
                pointer = Camera.main.transform;              //nb: don't use crossHair.pointer ?? camera, will incorrectly return null
            }
            var fpsUI = FPSBrowserUI.Create(mesh, pointer, crossHair);

            fpsUI.maxDistance = crossHair.maxDistance;
            browser.UIHandler = fpsUI;
        }
Beispiel #4
0
 public void SetCursor(BrowserCursor newCursor, FPSBrowserUI ui)
 {
     currentCursor = newCursor;
 }