本文整理汇总了C#中UnityEngine.Object.GetAssetPath方法的典型用法代码示例。如果您正苦于以下问题:C# Object.GetAssetPath方法的具体用法?C# Object.GetAssetPath怎么用?C# Object.GetAssetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Object
的用法示例。
在下文中一共展示了Object.GetAssetPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetEditable
public static void SetEditable(Object obj, bool editable)
{
//D.Log("Setting '" + obj + "' to " + (editable ? "editable" : "readonly"));
if (obj != null && !AvoidGUILock(obj) && !IsBuiltinAsset(obj.GetAssetPath()) &&
!(obj is GameObject && PrefabHelper.IsPrefabParent(obj))) // Do not modify object flags for Project-Prefab GameObjects
{
if (editable && !IsEditable(obj)) obj.hideFlags &= ~HideFlags.NotEditable;
if (!editable && IsEditable(obj)) obj.hideFlags |= HideFlags.NotEditable;
}
}
示例2: GetLock
public static bool GetLock(Object obj, OperationMode operationMode = OperationMode.Normal)
{
bool shouldGetLock = true;
if (onHierarchyAllowGetLock != null) shouldGetLock = onHierarchyAllowGetLock(obj);
if (shouldGetLock)
{
bool success = GetLock(obj.GetAssetPath(), operationMode);
if (success && onHierarchyGetLock != null) onHierarchyGetLock(obj);
return success;
}
return false;
}
示例3: ManagedByRepository
public static bool ManagedByRepository(Object obj)
{
return ManagedByRepository(obj.GetAssetPath());
}
示例4: HaveAssetControl
public static bool HaveAssetControl(Object obj)
{
return HaveAssetControl(obj.GetAssetPath());
}
示例5: 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));
}
}
}
}
}
示例6: ChangesStoredInScene
public static bool ChangesStoredInScene(Object obj)
{
obj = GetObjectIndirection(obj);
return obj.GetAssetPath() == SceneManagerUtilities.GetCurrentScenePath();
}
示例7: IsChildNode
private static bool IsChildNode(Object obj)
{
GameObject go = obj as GameObject;
if (go != null)
{
var persistentAssetPath = obj.GetAssetPath();
var persistentParentAssetPath = go.transform.parent != null ? go.transform.parent.gameObject.GetAssetPath() : "";
return persistentAssetPath == persistentParentAssetPath;
}
return false;
}