Example #1
0
    private void handleInfotexts()
    {
        GameObject infotext_Changes_saved = this.transform.Find("NGUIControls/Panel/selectAndConfigureDevices/Infotexts/Saving/Label - Changes saved").gameObject;
        GameObject infotext_Changes_are_not_saved_in_free_version = this.transform.Find(
            "NGUIControls/Panel/selectAndConfigureDevices/Infotexts/Saving/Label - Changes are not saved in free version").gameObject;
        GameObject infotext_Changes_not_saved_yet = this.transform.Find("NGUIControls/Panel/selectAndConfigureDevices/Infotexts/Saving/Label - Changes not saved yet").gameObject;
        GameObject infotext_Hmd_Not_Detected      = this.transform.Find("NGUIControls/Panel/selectAndConfigureDevices/Infotexts/HMD/Label - HMD not detected").gameObject;   // Was "Rift not detected"
        GameObject infotext_Hmd_Detected          = this.transform.Find("NGUIControls/Panel/selectAndConfigureDevices/Infotexts/HMD/Label - HMD detected").gameObject;       // Was "Oculus DK1 detected"

        if (RUISDisplayManager.IsHmdPresent())
        {
            if (infotext_Hmd_Detected)
            {
                UILabel hmdDetectedLabel = infotext_Hmd_Detected.GetComponent <UILabel>();
                if (hmdDetectedLabel)
                {
                    hmdDetectedLabel.text = RUISDisplayManager.GetHmdModel() + " detected";
                }
            }
            infotext_Hmd_Not_Detected.SetActive(false);
            infotext_Hmd_Detected.SetActive(true);
        }
        else
        if (infotext_Hmd_Not_Detected)
        {
            infotext_Hmd_Not_Detected.SetActive(true);
            infotext_Hmd_Detected.SetActive(false);
        }

//		bool isRiftConnected = false;
//		{
//			try
//			{
//				if(OVRManager.display != null) //06to08
//					isRiftConnected = OVRManager.display.isPresent; //06to08
//				if(OVRManager.capiHmd != null)
//					ovrHmdVersion = OVRManager.capiHmd.GetDesc().Type; //06to08
//
//
//			}
//			catch(UnityException e)
//			{
//				Debug.LogError(e);
//			}
//		}
//		if(isRiftConnected && ovrHmdVersion == Ovr.HmdType.DK1) //06to08
//		{
//			infotext_Rift_not_Detected.SetActive(false);
//			infotext_Oculus_DK1_detected.SetActive(true);
//			infotext_Oculus_DK2_detected.SetActive(false);
//		}
//		else if(isRiftConnected && (ovrHmdVersion == Ovr.HmdType.DK2 || ovrHmdVersion == Ovr.HmdType.Other)) //06to08
//		{
//			infotext_Rift_not_Detected.SetActive(false);
//			infotext_Oculus_DK2_detected.SetActive(true);
//			infotext_Oculus_DK1_detected.SetActive(false);
//		}
//		else {
//			infotext_Rift_not_Detected.SetActive(true);
//			infotext_Oculus_DK1_detected.SetActive(false);
//			infotext_Oculus_DK2_detected.SetActive(false);
//		}

        if (!XmlImportExport.XmlHandlingFunctionalityAvailable())
        {
            infotext_Changes_are_not_saved_in_free_version.SetActive(true);
            infotext_Changes_saved.SetActive(false);
            infotext_Changes_not_saved_yet.SetActive(false);
        }
        else
        {
            infotext_Changes_are_not_saved_in_free_version.SetActive(false);
            if (originalPSMoveIP == inputManager.PSMoveIP &&
                originalPSMovePort == inputManager.PSMovePort &&
                originalEnablePSMove == inputManager.enablePSMove &&
                originalEnableKinect == inputManager.enableKinect &&
                originalEnableKinect2 == inputManager.enableKinect2 &&
                originalEnableJumpGesture == inputManager.jumpGestureEnabled &&
                originalEnableHydra == inputManager.enableRazerHydra)
//			   && originalKinectDriftCorrection == inputManager.kinectDriftCorrectionPreferred)
            {
                infotext_Changes_saved.SetActive(true);
                infotext_Changes_not_saved_yet.SetActive(false);
            }
            else
            {
                infotext_Changes_not_saved_yet.SetActive(true);
                infotext_Changes_saved.SetActive(false);
            }
        }
    }