Пример #1
0
        private void CellGUI(Rect cellRect, TreeViewItem item, int column, ref RowGUIArgs args)
        {
            ExecuteResultTreeItem resultItem    = item as ExecuteResultTreeItem;
            NodeExceptionItem     exceptionItem = item as NodeExceptionItem;

            ExecuteGraphResult r = null;
            NodeException      e = null;

            if (resultItem != null)
            {
                r = resultItem.Result;
            }
            else
            {
                r = exceptionItem.Result;
                e = exceptionItem.Exception;
            }

            switch (column)
            {
            case 0://Collapse/Expand
            {
                DefaultGUI.Label(cellRect, string.Empty, args.selected, args.focused);
            }
            break;

            case 1://Status
            {
                var rect = cellRect;
                if (e != null)
                {
                    rect.x += 8f;
                }
                DefaultGUI.Label(rect, (r.IsAnyIssueFound) ? "Fail" : "Success", args.selected, args.focused);
            }
            break;

            case 2://Graph
            {
                var graphName = Path.GetFileNameWithoutExtension(r.GraphAssetPath);
                DefaultGUI.Label(cellRect, graphName, args.selected, args.focused);
            }
            break;

            case 3://Platform
                DefaultGUI.Label(cellRect, BuildTargetUtility.TargetToHumaneString(r.Target), args.selected, args.focused);
                break;

            case 4://Description
                if (e != null)
                {
                    DefaultGUI.Label(cellRect, e.Reason, args.selected, args.focused);
                }
                else
                {
                    DefaultGUI.Label(cellRect, string.Empty, args.selected, args.focused);
                }
                break;
            }
        }
Пример #2
0
        public static AssetProcessEvent CreateErrorEvent(NodeException e, string graphGuid)
        {
            var ev      = new AssetProcessEvent();
            var assetId = (e.Asset == null) ? null : e.Asset.assetDatabaseId;

            ev.Init(EventKind.Error, assetId, graphGuid, e.Node.Id, e.Node.Name, e.Reason, e.HowToFix);
            return(ev);
        }
Пример #3
0
        public void LogError(NodeException e)
        {
            AssetGraphController gc = AssetGraphPostprocessor.Postprocessor.GetCurrentGraphController();

            if (gc == null)
            {
                throw new AssetGraphException("Error event attempt to log but no graph is in stack.");
            }

            var newEvent = AssetProcessEvent.CreateErrorEvent(e, gc.TargetGraph.GetGraphGuid());

            AddEvent(newEvent);
        }
Пример #4
0
 public void SetSelectedExecuteResult(ExecuteGraphResult r, NodeException e)
 {
     m_selectedResult    = r;
     m_selectedException = e;
     m_msgScrollPos      = new Vector2(0f, 0f);
 }
Пример #5
0
 public NodeExceptionItem(ExecuteGraphResult r, NodeException e) : base(s_id++, 1, string.Empty)
 {
     m_result    = r;
     m_exception = e;
     displayName = string.Format("{0}:{1}", m_exception.Node.Name, m_exception.Reason);
 }
Пример #6
0
 public NodeExceptionItem(ExecuteGraphResult r, NodeException e) : base(s_id++, 1, string.Empty)
 {
     m_result    = r;
     m_exception = e;
     displayName = $"{m_exception.Node.Name}:{m_exception.Reason}";
 }