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


C# Object.ToAssetPaths方法代码示例

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

示例2: AllowLocalEdit

 public static void AllowLocalEdit(Object obj)
 {
     VCCommands.Instance.AllowLocalEdit(obj.ToAssetPaths());
     if (onHierarchyAllowLocalEdit != null) onHierarchyAllowLocalEdit(obj);
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:5,代码来源:VCUtility.cs

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

示例4: VCDialog

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

示例5: VCDeleteWithConfirmation

 public static void VCDeleteWithConfirmation(Object obj, bool showConfirmation = true)
 {
     VCDeleteWithConfirmation(obj.ToAssetPaths(), showConfirmation);
 }
开发者ID:kjems,项目名称:uversioncontrol,代码行数:4,代码来源:VCUtility.cs

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


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