コード例 #1
0
        public override void Draw(int depth, RelationType relationType, ITypeColorProvider colorProvider, ISelectionChanger selectionChanger,
                                  NodeDisplayData displayData, ViewAreaData viewAreaData)
        {
            float offset = GetPositionOffset(viewAreaData);

            PathNode.DrawPathNodes(PosX, PosY + offset, PathNode, colorProvider);
            DrawPathNodeConnections(PathNode, TargetNodes, colorProvider, offset);
        }
コード例 #2
0
        public override void Draw(int depth, RelationType relationType, ITypeColorProvider colorProvider,
                                  ISelectionChanger selectionChanger, NodeDisplayData displayData, ViewAreaData viewAreaData)
        {
            Vector2 position = GetPosition(viewAreaData);

            Color rectColor = (depth == 0) ? ARVStyles.NodeBackGroundColorOwn : ARVStyles.NodeBackGroundColor;

            bool isMissing = NodeData.IsMissing;

            if (NodeData.IsEditorAsset)
            {
                rectColor.b += 0.05f;
            }

            if (isMissing)
            {
                rectColor = new Color(0.8f, 0.07f, 0.02f, 1.0f);
            }

            int assetPreviewSize = displayData.AssetPreviewSize;

            EditorGUI.DrawRect(new Rect(position.x + assetPreviewSize, position.y, displayData.NodeWidth, 16), rectColor);

            if (NodeData.IsPackedToApp && displayData.HighlightPackagedAssets)
            {
                EditorGUI.DrawRect(new Rect(position.x + assetPreviewSize, position.y + 16, displayData.NodeWidth, 1), ARVStyles.PackageToAppColor);
            }

            DrawPreviewTexture(position.x, position.y, displayData);

            GUIStyle style     = new GUIStyle();
            Color    textColor = Color.white;

            if (depth > 0)
            {
                string typeId = GetRelations(AssetRelationsViewerWindow.InvertRelationType(relationType))[0].Datas[0].Type;                 // TODO move
                textColor = colorProvider.GetConnectionColorForType(typeId);
            }

            textColor *= ARVStyles.TextColorMod;

            style.normal.textColor = textColor;
            style.clipping         = TextClipping.Clip;
            string name = isMissing ? "Missing!!!" : NodeData.Name;

            GUI.Label(new Rect(position.x + assetPreviewSize, position.y, displayData.NodeWidth - 32, assetPreviewSize), name, style);

            if (displayData.ShowAdditionalInformation)
            {
                string text = string.Format("Size: {0}kb | TreeSize: {1}kb ", NodeData.OwnSize, NodeData.HierarchySize);
                GUI.Label(new Rect(position.x + assetPreviewSize, position.y + 16, 200, 16), text);
            }

            DrawIsFilteredOverlay(position, displayData);

            if (GUI.Button(new Rect(position.x + displayData.NodeWidth + assetPreviewSize - 16, position.y, 16, 16), ">"))
            {
                selectionChanger.ChangeSelection(NodeData.Id, NodeData.Type);
            }

            if (GUI.Button(new Rect(position.x + displayData.NodeWidth + assetPreviewSize - 32, position.y, 16, 16), "s"))
            {
                NodeData.TypeHandler.SelectInEditor(NodeData.Id);
            }
        }
コード例 #3
0
 public abstract void Draw(int depth, RelationType relationType, ITypeColorProvider colorProvider,
                           ISelectionChanger selectionChanger, NodeDisplayData displayData, ViewAreaData viewAreaData);