void Start()
    {
        characterController = GetComponent <CharacterController>();

        // Lock cursor
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;

        bool isVR = GameManager.mode == Mode.PC;

        gameObject.SetActive(isVR);

        VrHelper.SetEnabled(false);
    }
Ejemplo n.º 2
0
    protected override void Awake()
    {
        base.Awake();

        data = new PointerEventData(eventSystem);

        if (canvas != null)
        {
            if (VrHelper.VRIsPresent())
            {
                canvas.worldCamera = camera;
            }
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        print(VrHelper.VRIsPresent());

        // mode = (VrHelper.VRIsPresent()) ? Mode.VR : Mode.PC;

        DontDestroyOnLoad(gameObject);

        for (int i = 0; i < lightColors.Length; i++)
        {
            switch (i)
            {
            case 0:
                lightColors[i] = Color.red;
                pinLight.color = Color.red;
                break;

            case 1:
                lightColors[i] = Color.white;
                break;

            case 2:
                lightColors[i] = Color.yellow;
                break;

            case 3:
                lightColors[i] = Color.blue;
                break;

            case 4:
                lightColors[i] = Color.cyan;
                break;

            case 5:
                lightColors[i] = Color.magenta;
                break;
            }
        }

        SaveBallData();
        SavePinData();
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        bool isVR = GameManager.mode == Mode.VR;

        gameObject.SetActive(isVR);

        VrHelper.SetEnabled(true);

        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
            return;
        }

        leftController.Setup();
        rightController.Setup();
    }