本文整理汇总了C#中UnityEngine.Object.ToAssetPaths方法的典型用法代码示例。如果您正苦于以下问题:C# Object.ToAssetPaths方法的具体用法?C# Object.ToAssetPaths怎么用?C# Object.ToAssetPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Object
的用法示例。
在下文中一共展示了Object.ToAssetPaths方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyAndCommit
public static void ApplyAndCommit(Object obj, string commitMessage = "", bool showCommitDialog = false)
{
var gameObject = obj as GameObject;
if (ObjectUtilities.ChangesStoredInScene(obj)) SceneManagerUtilities.SaveActiveScene();
if (PrefabHelper.IsPrefab(gameObject, true, false) && !PrefabHelper.IsPrefabParent(obj)) PrefabHelper.ApplyPrefab(gameObject);
if (onHierarchyCommit != null) onHierarchyCommit(obj);
VCCommands.Instance.CommitDialog(obj.ToAssetPaths(), showCommitDialog, commitMessage);
}
示例2: AllowLocalEdit
public static void AllowLocalEdit(Object obj)
{
VCCommands.Instance.AllowLocalEdit(obj.ToAssetPaths());
if (onHierarchyAllowLocalEdit != null) onHierarchyAllowLocalEdit(obj);
}
示例3: RevertObject
private static Object RevertObject(Object obj)
{
if (ObjectUtilities.ChangesStoredInScene(obj)) SceneManagerUtilities.SaveActiveScene();
bool success = VCCommands.Instance.Revert(obj.ToAssetPaths());
if (success && onHierarchyReverted != null) onHierarchyReverted(obj);
return obj;
}
示例4: VCDialog
public static bool VCDialog(string command, Object obj)
{
return VCDialog(command, obj.ToAssetPaths());
}
示例5: VCDeleteWithConfirmation
public static void VCDeleteWithConfirmation(Object obj, bool showConfirmation = true)
{
VCDeleteWithConfirmation(obj.ToAssetPaths(), showConfirmation);
}
示例6: VersionControlStatusGUI
public static void VersionControlStatusGUI(GUIStyle style, VersionControlStatus assetStatus, Object obj, bool showAddCommit, bool showLockAndAllowLocalEdit, bool showRevert, bool confirmRevert = false)
{
using (new PushState<bool>(GUI.enabled, VCCommands.Instance.Ready, v => GUI.enabled = v))
{
if (assetStatus.lockStatus == VCLockStatus.LockedHere || assetStatus.ModifiedOrLocalEditAllowed() || !VCUtility.ManagedByRepository(assetStatus))
{
if (!assetStatus.ModifiedOrLocalEditAllowed() && obj.GetAssetPath() != "" && showAddCommit)
{
if (GUILayout.Button((VCUtility.ManagedByRepository(assetStatus) ? Terminology.commit : Terminology.add), GetPrefabToolbarStyle(style, true)))
{
VCUtility.ApplyAndCommit(obj, Terminology.commit + " from Inspector");
}
}
}
if (!VCUtility.HaveVCLock(assetStatus) && VCUtility.ManagedByRepository(assetStatus) && showLockAndAllowLocalEdit)
{
if (assetStatus.fileStatus == VCFileStatus.Added)
{
if (GUILayout.Button(Terminology.commit, GetPrefabToolbarStyle(style, true)))
{
VCUtility.ApplyAndCommit(obj, Terminology.commit + " from Inspector");
}
}
else if (assetStatus.lockStatus != VCLockStatus.LockedOther)
{
if (GUILayout.Button(Terminology.getlock, GetPrefabToolbarStyle(style, true)))
{
VCCommands.Instance.GetLockTask(obj.ToAssetPaths());
}
}
if (!assetStatus.LocalEditAllowed())
{
if (GUILayout.Button(Terminology.allowLocalEdit, GetPrefabToolbarStyle(style, true)))
{
VCCommands.Instance.AllowLocalEdit(obj.ToAssetPaths());
}
}
}
if (showRevert)
{
if (GUILayout.Button(Terminology.revert, GetPrefabToolbarStyle(style, VCUtility.ShouldVCRevert(obj))))
{
if ((!confirmRevert || Event.current.shift) || VCUtility.VCDialog(Terminology.revert, obj))
{
var seletedGo = Selection.activeGameObject;
var revertedObj = VCUtility.Revert(obj);
OnNextUpdate.Do(() => Selection.activeObject = ((obj is GameObject) ? revertedObj : seletedGo));
}
}
}
}
}