当前位置: 首页>>代码示例>>C#>>正文


C# Object.GetAssetPath方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:10,代码来源:EditableManager.cs

示例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;
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:12,代码来源:VCUtility.cs

示例3: ManagedByRepository

 public static bool ManagedByRepository(Object obj)
 {
     return ManagedByRepository(obj.GetAssetPath());
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:4,代码来源:VCUtility.cs

示例4: HaveAssetControl

 public static bool HaveAssetControl(Object obj)
 {
     return HaveAssetControl(obj.GetAssetPath());
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:4,代码来源:VCUtility.cs

示例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));
                        }
                    }
                }
            }
        }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:54,代码来源:VCGUIControls.cs

示例6: ChangesStoredInScene

 public static bool ChangesStoredInScene(Object obj)
 {
     obj = GetObjectIndirection(obj);
     return obj.GetAssetPath() == SceneManagerUtilities.GetCurrentScenePath();
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:5,代码来源:ObjectExtension.cs

示例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;
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:11,代码来源:VCStatusIcons.cs


注:本文中的UnityEngine.Object.GetAssetPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。