Пример #1
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;
        }
Пример #2
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);
        }
Пример #3
0
 public void Start()
 {
     FPSCursorRenderer.SetUpBrowserInput(GetComponent <Browser>(), GetComponent <MeshCollider>());
 }
Пример #4
0
        public static FPSBrowserUI Create(MeshCollider meshCollider, Transform worldPointer, FPSCursorRenderer cursorRenderer)
        {
            var ui = meshCollider.gameObject.GetComponent <FPSBrowserUI>();

            if (!ui)
            {
                ui = meshCollider.gameObject.AddComponent <FPSBrowserUI>();
            }
            ui.meshCollider   = meshCollider;
            ui.worldPointer   = worldPointer;
            ui.cursorRenderer = cursorRenderer;

            return(ui);
        }