本文整理汇总了C#中UnityEditor.VersionControl.Asset类的典型用法代码示例。如果您正苦于以下问题:C# Asset类的具体用法?C# Asset怎么用?C# Asset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Asset类属于UnityEditor.VersionControl命名空间,在下文中一共展示了Asset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawOverlay
public static void DrawOverlay(Asset asset, Asset metaAsset, Rect itemRect)
{
if (asset == null || metaAsset == null || Event.current.type != EventType.Repaint)
return;
string externalVersionControl = EditorSettings.externalVersionControl;
if (externalVersionControl == ExternalVersionControl.Disabled || externalVersionControl == ExternalVersionControl.AutoDetect || (externalVersionControl == ExternalVersionControl.Generic || externalVersionControl == ExternalVersionControl.AssetServer))
return;
Overlay.DrawOverlays(asset, metaAsset, itemRect);
}
示例2: DrawOverlay
public static void DrawOverlay(Asset asset, Asset metaAsset, Rect itemRect)
{
if (((asset != null) && (metaAsset != null)) && (Event.current.type == EventType.Repaint))
{
string externalVersionControl = EditorSettings.externalVersionControl;
if (((externalVersionControl != ExternalVersionControl.Disabled) && (externalVersionControl != ExternalVersionControl.AutoDetect)) && ((externalVersionControl != ExternalVersionControl.Generic) && (externalVersionControl != ExternalVersionControl.AssetServer)))
{
DrawOverlays(asset, metaAsset, itemRect);
}
}
}
示例3: Add
public ListItem Add(ListItem parent, string name, Asset asset)
{
ListItem item = (parent == null) ? this.root : parent;
ListItem listItem = new ListItem {
Name = name,
Asset = asset
};
item.Add(listItem);
ListItem twinAsset = this.GetTwinAsset(listItem);
if (((twinAsset != null) && (listItem.Asset != null)) && (twinAsset.Asset.state == (listItem.Asset.state & ~Asset.States.MetaFile)))
{
listItem.Hidden = true;
}
if ((listItem.Asset != null) && (listItem.Asset.path.Length > 0))
{
this.pathSearch[listItem.Asset.path.ToLower()] = listItem;
}
return listItem;
}
示例4: DrawOverlay
public static void DrawOverlay(Asset asset, Rect itemRect)
{
if (asset == null)
{
return;
}
if (Event.current.type != EventType.Repaint)
{
return;
}
Overlay.m_Asset = asset;
Overlay.m_ItemRect = itemRect;
Overlay.m_IconPrefix = EditorSettings.externalVersionControl;
if (Overlay.m_IconPrefix == ExternalVersionControl.Disabled || Overlay.m_IconPrefix == ExternalVersionControl.AutoDetect || Overlay.m_IconPrefix == ExternalVersionControl.Generic || Overlay.m_IconPrefix == ExternalVersionControl.AssetServer)
{
return;
}
Overlay.DrawOverlays();
}
示例5: IsChildOf
public bool IsChildOf(Asset other);
示例6: IsChildOf
public extern bool IsChildOf(Asset other);
示例7: DrawOverlayDescription
private void DrawOverlayDescription(Asset.States state)
{
Rect atlasRectForState = Provider.GetAtlasRectForState((int)state);
if (atlasRectForState.width == 0f)
{
return;
}
Texture2D overlayAtlas = Provider.overlayAtlas;
if (overlayAtlas == null)
{
return;
}
GUILayout.Label(" " + Asset.StateToString(state), EditorStyles.miniLabel, new GUILayoutOption[0]);
Rect lastRect = GUILayoutUtility.GetLastRect();
lastRect.width = 16f;
GUI.DrawTextureWithTexCoords(lastRect, overlayAtlas, atlasRectForState);
}
示例8: Lock
/// <summary>
/// <para>Attempt to lock an asset for exclusive editing.</para>
/// </summary>
/// <param name="assets">List of assets to lock/unlock.</param>
/// <param name="locked">True to lock assets, false to unlock assets.</param>
/// <param name="asset">Asset to lock/unlock.</param>
public static Task Lock(Asset asset, bool locked)
{
Asset[] assets = new Asset[] { asset };
return Internal_Lock(assets, locked);
}
示例9: Add
public ListItem Add(ListItem parent, string name, Asset asset)
{
ListItem listItem1 = parent == null ? this.root : parent;
ListItem listItem2 = new ListItem();
listItem2.Name = name;
listItem2.Asset = asset;
listItem1.Add(listItem2);
ListItem twinAsset = this.GetTwinAsset(listItem2);
if (twinAsset != null && listItem2.Asset != null && twinAsset.Asset.state == (listItem2.Asset.state & ~Asset.States.MetaFile))
listItem2.Hidden = true;
if (listItem2.Asset == null || listItem2.Asset.path.Length <= 0)
return listItem2;
this.pathSearch[listItem2.Asset.path.ToLower()] = listItem2;
return listItem2;
}
示例10: IsOneOfStates
public bool IsOneOfStates(Asset.States[] states)
{
foreach (Asset.States state in states)
{
if ((this.state & state) != Asset.States.None)
return true;
}
return false;
}
示例11: AllStateToString
internal static string AllStateToString(Asset.States state)
{
StringBuilder stringBuilder = new StringBuilder();
if (Asset.IsState(state, Asset.States.AddedLocal))
stringBuilder.AppendLine("Added Local");
if (Asset.IsState(state, Asset.States.AddedRemote))
stringBuilder.AppendLine("Added Remote");
if (Asset.IsState(state, Asset.States.CheckedOutLocal))
stringBuilder.AppendLine("Checked Out Local");
if (Asset.IsState(state, Asset.States.CheckedOutRemote))
stringBuilder.AppendLine("Checked Out Remote");
if (Asset.IsState(state, Asset.States.Conflicted))
stringBuilder.AppendLine("Conflicted");
if (Asset.IsState(state, Asset.States.DeletedLocal))
stringBuilder.AppendLine("Deleted Local");
if (Asset.IsState(state, Asset.States.DeletedRemote))
stringBuilder.AppendLine("Deleted Remote");
if (Asset.IsState(state, Asset.States.Local))
stringBuilder.AppendLine("Local");
if (Asset.IsState(state, Asset.States.LockedLocal))
stringBuilder.AppendLine("Locked Local");
if (Asset.IsState(state, Asset.States.LockedRemote))
stringBuilder.AppendLine("Locked Remote");
if (Asset.IsState(state, Asset.States.OutOfSync))
stringBuilder.AppendLine("Out Of Sync");
if (Asset.IsState(state, Asset.States.Synced))
stringBuilder.AppendLine("Synced");
if (Asset.IsState(state, Asset.States.Missing))
stringBuilder.AppendLine("Missing");
if (Asset.IsState(state, Asset.States.ReadOnly))
stringBuilder.AppendLine("ReadOnly");
return stringBuilder.ToString();
}
示例12: UnlockIsValid
/// <summary>
/// <para>Returns true if locking the assets is a valid operation.</para>
/// </summary>
/// <param name="assets">The assets to lock.</param>
/// <param name="asset">The asset to lock.</param>
public static bool UnlockIsValid(Asset asset)
{
Asset[] assets = new Asset[] { asset };
return Internal_UnlockIsValid(assets);
}
示例13: OnGUI
//.........这里部分代码省略.........
GUI.color = color;
if (current.isKey && GUIUtility.keyboardControl == 0 && current.type == EventType.KeyDown && current.keyCode == KeyCode.F5)
{
flag2 = true;
current.Use();
}
if (flag2)
{
Provider.InvalidateCache();
if (Provider.isActive && Provider.onlineState == OnlineState.Online)
{
Task task = Provider.ChangeSets();
task.SetCompletionAction(CompletionAction.OnChangeSetsPendingWindow);
Task task2 = Provider.Incoming();
task2.SetCompletionAction(CompletionAction.OnIncomingPendingWindow);
}
else
{
Provider.UpdateSettings();
}
}
GUILayout.EndArea();
Rect rect = new Rect(0f, fixedHeight, base.position.width, base.position.height - fixedHeight - 17f);
bool flag3 = false;
GUILayout.EndHorizontal();
if (!Provider.isActive)
{
Color color2 = GUI.color;
GUI.color = new Color(0.8f, 0.5f, 0.5f);
rect.height = fixedHeight;
GUILayout.BeginArea(rect);
GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
GUILayout.FlexibleSpace();
string text = "DISABLED";
if (Provider.enabled)
{
if (Provider.onlineState == OnlineState.Updating)
{
GUI.color = new Color(0.8f, 0.8f, 0.5f);
text = "CONNECTING...";
}
else
{
text = "OFFLINE";
}
}
GUILayout.Label(text, EditorStyles.miniLabel, new GUILayoutOption[0]);
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.EndArea();
rect.y += rect.height;
if (!string.IsNullOrEmpty(Provider.offlineReason))
{
GUI.Label(rect, Provider.offlineReason);
}
GUI.color = color2;
flag3 = false;
}
else
{
if (this.m_ShowIncoming)
{
flag3 |= this.incomingList.OnGUI(rect, base.hasFocus);
}
else
{
flag3 |= this.pendingList.OnGUI(rect, base.hasFocus);
}
rect.y += rect.height;
rect.height = 17f;
GUI.Label(rect, GUIContent.none, WindowPending.s_Styles.bottomBarBg);
GUIContent content2 = new GUIContent("Apply All Incoming Changes");
Vector2 vector = EditorStyles.miniButton.CalcSize(content2);
Rect rect2 = new Rect(rect.x, rect.y - 2f, rect.width - vector.x - 5f, rect.height);
WindowPending.ProgressGUI(rect2, Provider.activeTask, false);
if (this.m_ShowIncoming)
{
Rect position = rect;
position.width = vector.x;
position.height = vector.y;
position.y = rect.y + 2f;
position.x = base.position.width - vector.x - 5f;
EditorGUI.BeginDisabledGroup(this.incomingList.Size == 0);
if (GUI.Button(position, content2, EditorStyles.miniButton))
{
Asset item = new Asset(string.Empty);
Task latest = Provider.GetLatest(new AssetList
{
item
});
latest.SetCompletionAction(CompletionAction.OnGotLatestPendingWindow);
}
EditorGUI.EndDisabledGroup();
}
}
if (flag3)
{
base.Repaint();
}
}
示例14: Status
/// <summary>
/// <para>Start a task that will fetch the most recent status from revision control system.</para>
/// </summary>
/// <param name="assets">The assets fetch new state for.</param>
/// <param name="asset">The asset path to fetch new state for.</param>
/// <param name="recursively">If any assets specified are folders this flag will get status for all descendants of the folder as well.</param>
public static Task Status(Asset asset)
{
Asset[] assets = new Asset[] { asset };
return Internal_Status(assets, true);
}
示例15: ChangeSetMove
/// <summary>
/// <para>Move an asset or list of assets from their current changeset to a new changeset.</para>
/// </summary>
/// <param name="assets">List of asset to move to changeset.</param>
/// <param name="changeset">Changeset to move asset to.</param>
/// <param name="asset">Asset to move to changeset.</param>
/// <param name="changesetID">ChangesetID to move asset to.</param>
public static Task ChangeSetMove(Asset asset, string changesetID)
{
ChangeSet target = new ChangeSet("", changesetID);
Asset[] assets = new Asset[] { asset };
return Internal_ChangeSetMove(assets, target);
}