public static void Revert(string path) { #if UNITY_VC if (HasVC()) { UnityEditor.VersionControl.Asset vcAsset = UnityEditor.VersionControl.Provider.GetAssetByPath(path); if (vcAsset != null) { UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Revert(vcAsset, UnityEditor.VersionControl.RevertMode.Normal); task.Wait(); AssetDatabase.Refresh(); } } #endif }
public static bool CheckOut(string path) { #if UNITY_VC if (HasVC()) { UnityEditor.VersionControl.Asset vcAsset = UnityEditor.VersionControl.Provider.GetAssetByPath(path); if (vcAsset != null) { UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(vcAsset, UnityEditor.VersionControl.CheckoutMode.Both); task.Wait(); } } return(IsEditable(path)); #else return(true); #endif }