private static IconUtils.Icon GetHierarchyIcon(Object obj) { IconUtils.Icon iconType = IconUtils.rubyIcon; if (ObjectUtilities.ChangesStoredInPrefab(obj)) { iconType = IconUtils.squareIcon; } if (IsChildNode(obj)) { iconType = IconUtils.childIcon; } return(iconType); }
private static void DrawIcon(Rect rect, IconUtils.Icon iconType, string assetPath, Object instance = null, float xOffset = 0f) { if (VCSettings.VCEnabled) { var assetStatus = VCCommands.Instance.GetAssetStatus(assetPath); string statusText = AssetStatusUtils.GetStatusText(assetStatus); Texture2D texture = iconType.GetTexture(AssetStatusUtils.GetStatusColor(assetStatus, true)); Rect placement = GetRightAligned(rect, iconType.Size); placement.x += xOffset; var clickRect = placement; //clickRect.xMax += iconType.Size * 0.25f; //clickRect.xMin -= rect.width * 0.15f; if (texture) { GUI.DrawTexture(placement, texture); } if (GUI.Button(clickRect, new GUIContent("", statusText), GUIStyle.none)) { VCGUIControls.DiaplayVCContextMenu(assetPath, instance, 10.0f, -40.0f, true); } } }