/// <summary>
    /// Destroy this instance.
    /// </summary>
    void OnDestroy()
    {
        // We may want to turn this off so that values are maintained between level / scene loads
        if (!ResetTrackerOnLoad || HMD == null)
            return;

        HMD.Destroy();
        Hmd.Shutdown();
        HMD = null;
    }
Exemple #2
0
	void Awake()
	{
        // Detect whether this platform is a supported platform
        RuntimePlatform currPlatform = Application.platform;
        SupportedPlatform |= currPlatform == RuntimePlatform.Android;
        SupportedPlatform |= currPlatform == RuntimePlatform.LinuxPlayer;
        SupportedPlatform |= currPlatform == RuntimePlatform.OSXEditor;
        SupportedPlatform |= currPlatform == RuntimePlatform.OSXPlayer;
        SupportedPlatform |= currPlatform == RuntimePlatform.WindowsEditor;
        SupportedPlatform |= currPlatform == RuntimePlatform.WindowsPlayer;
        if (!SupportedPlatform)
        {
            Debug.LogWarning("This platform is unsupported");
            return;
        }

        if (HMD != null)
            return;
        HMD = Hmd.GetHmd();

        SetLowPersistenceMode(true);
	}
    void Awake()
    {
        string[] args = System.Environment.GetCommandLineArgs();
        for (int i = 0; i < args.Length; ++i)
        {
            if (args[i] == "-fullscreen")
            {
                Debug.Log("Going to Full-Screen");
                Screen.fullScreen = true;
            }
            else if (args[i] == "-window")
            {
                Debug.Log("Going to Window");
                Screen.fullScreen = false;
            }
        }

        // Detect whether this platform is a supported platform
        RuntimePlatform currPlatform = Application.platform;
        SupportedPlatform |= currPlatform == RuntimePlatform.Android;
        SupportedPlatform |= currPlatform == RuntimePlatform.LinuxPlayer;
        SupportedPlatform |= currPlatform == RuntimePlatform.OSXEditor;
        SupportedPlatform |= currPlatform == RuntimePlatform.OSXPlayer;
        SupportedPlatform |= currPlatform == RuntimePlatform.WindowsEditor;
        SupportedPlatform |= currPlatform == RuntimePlatform.WindowsPlayer;
        if (!SupportedPlatform)
        {
            Debug.LogWarning("This platform is unsupported");
            return;
        }

        if (HMD != null)
            return;

        HMD = Hmd.GetHmd();

        //HACK: Forcing LP off until service initializes it properly.
        SetLowPersistenceMode(true);
    }