예제 #1
0
        public bool InitializeActionManifestFileRelativeFilePath()
        {
            string oldPath = ActionManifestFileRelativeFilePath;
            string newPath;

            if (OpenVRHelpers.IsUsingSteamVRInput())
            {
                newPath = System.IO.Path.Combine(OpenVRSettings.GetStreamingSteamVRPath(false), OpenVRHelpers.GetActionManifestNameFromPlugin());

                string fullpath = System.IO.Path.GetFullPath(".");
                newPath = newPath.Remove(0, fullpath.Length + 1);

                if (newPath.StartsWith("Assets"))
                {
                    newPath = newPath.Remove(0, "Assets".Length + 1);
                }
            }
            else
            {
                newPath = null;
            }

#if UNITY_EDITOR
            if (newPath != oldPath)
            {
                ActionManifestFileRelativeFilePath = newPath;
                UnityEditor.EditorUtility.SetDirty(this);
                UnityEditor.AssetDatabase.SaveAssets();
                return(true);
            }
#endif
            return(false);
        }
예제 #2
0
 public void InitializeActionManifestFileRelativeFilePath()
 {
     if (IsLegacy)
     {
         ActionManifestFileRelativeFilePath = System.IO.Path.Combine(OpenVRSettings.GetStreamingSteamVRPath(false), OpenVRSettings.ActionManifestFileName);
     }
 }
예제 #3
0
        public bool InitializeActionManifestFileRelativeFilePath()
        {
            string temp = ActionManifestFileRelativeFilePath;

            if (IsLegacy)
            {
                ActionManifestFileRelativeFilePath = System.IO.Path.Combine(OpenVRSettings.GetStreamingSteamVRPath(false), OpenVRSettings.ActionManifestFileName);
            }
            else
            {
                ActionManifestFileRelativeFilePath = System.IO.Path.Combine(OpenVRSettings.GetStreamingSteamVRPath(false), OpenVRHelpers.GetActionManifestNameFromPlugin());
            }

            #if UNITY_EDITOR
            if (temp != ActionManifestFileRelativeFilePath)
            {
                UnityEditor.EditorUtility.SetDirty(this);
                UnityEditor.AssetDatabase.SaveAssets();
                return(true);
            }
            #endif
            return(false);
        }