Пример #1
0
    // Use this for initialization
    void Start()
    {
        persistantGameData = new GameDataController();
        persistantGameData.LoadGamedata(this);
        leaderboards.localDataController = persistantGameData;

        // Conditionnal - Android setup
        if (Application.platform == RuntimePlatform.Android)
        {
            cameraDefault.GetComponent<UnityStandardAssets.ImageEffects.Tonemapping>().enabled = false;
        }

        if (VR.VRDevice.isPresent && enableRift)
        {
            GameObject.Find("UIs").transform.FindChild("UI_OCULUS").gameObject.SetActive(true);
            cameraOculus.SetActive(true);
            cameraDefault.SetActive(false);
            ovrCharacter.enabled = true;
            ui.panelFade = ui.oculusPanelFade;
            //GameObject.Find("OVRPlayerController").transform.GetComponentInChildren<Rigidbody>().drag = 10.0f;
        }
        else
        {
            GameObject.Find("UIs").transform.FindChild("UI_OCULUS").gameObject.SetActive(false);
            cameraOculus.SetActive(false);
            cameraDefault.SetActive(true);
            ovrCharacter.enabled = false;
            //GameObject.Find("OVRPlayerController").transform.GetComponentInChildren<Rigidbody>().drag = 1.0f;
        }
        if (collisionGenerationTime == 0)
            collisionGenerationTime = 1.0f;
        defCurrentLevel = currentLevel;
        defMoveSpeedY = moveSpeedY;
        defMoveSpeedIncr = moveSpeedIncr;
    }