protected override void DrawPort(GUIContent label)
        {
            SirenixEditorGUI.BeginBox();
            SirenixEditorGUI.BeginBoxHeader();
            isUnfolded.Value = SirenixEditorGUI.Foldout(isUnfolded.Value, label == null ? GUIContent.none : label);
            NodePortDrawerHelper.DrawPortHandle(NodePortInfo);
            SirenixEditorGUI.EndBoxHeader();

            if (SirenixEditorGUI.BeginFadeGroup(this, isUnfolded.Value))
            {
                CallNextDrawer(null);
            }
            SirenixEditorGUI.EndFadeGroup();

            SirenixEditorGUI.EndBox();
        }
Esempio n. 2
0
        protected override void DrawPort(GUIContent label)
        {
            SirenixEditorGUI.BeginBox();
            SirenixEditorGUI.BeginBoxHeader();
            if (label != null)
            {
                EditorGUILayout.LabelField(label);
            }
            NodePortDrawerHelper.DrawPortHandle(NodePortInfo);
            SirenixEditorGUI.EndBoxHeader();

            if (DrawValue)
            {
                CallNextDrawer(null);
            }
            else
            {
                GUILayout.Space(-3.5f);
            }

            SirenixEditorGUI.EndBox();
        }
Esempio n. 3
0
 protected override void DrawPort(GUIContent label)
 {
     NodePortDrawerHelper.DrawPortHandle(NodePortInfo, 0);
 }
Esempio n. 4
0
        protected override void DrawPort(GUIContent label)
        {
            if (hideContents)
            {
                NodePortDrawerHelper.DrawPortHandle(NodePortInfo);

                // Offset back to make up for the port draw
                GUILayout.Space(-18);
                return;
            }

            using (new EditorGUILayout.HorizontalScope())
            {
                NodePortDrawerHelper.DrawPortHandle(NodePortInfo);

                // Offset back to make up for the port draw
                GUILayout.Space(-4);

                // Collections don't have the same kinds of labels
                if (Property.ChildResolver is ICollectionResolver)
                {
                    CallNextDrawer(label);
                    return;
                }

                bool drawLabel = label != null && label != GUIContent.none;
                if (NodePortInfo.Port.IsInput)
                {
                    if (drawLabel)
                    {
                        if (DrawValue)
                        {
                            EditorGUILayout.LabelField(label, GUILayout.Width(GUIHelper.BetterLabelWidth));
                        }
                        else
                        {
                            EditorGUILayout.LabelField(label, GUILayout.MaxWidth(float.MaxValue), GUILayout.ExpandWidth(true));
                        }
                    }

                    if (DrawValue)
                    {
                        using (new EditorGUILayout.VerticalScope())
                            CallNextDrawer(null);
                    }

                    if (!DrawValue || drawLabel && Property.Parent != null && Property.Parent.ChildResolver is GroupPropertyResolver)
                    {
                        GUILayout.FlexibleSpace();
                    }
                }
                else
                {
                    if (!DrawValue || drawLabel && Property.Parent != null && Property.Parent.ChildResolver is GroupPropertyResolver)
                    {
                        GUILayout.FlexibleSpace();
                    }

                    if (DrawValue)
                    {
                        using (new EditorGUILayout.VerticalScope())
                            CallNextDrawer(null);
                    }

                    if (drawLabel)
                    {
                        if (DrawValue)
                        {
                            EditorGUILayout.LabelField(label, NodeEditorResources.OutputPort, GUILayout.Width(GUIHelper.BetterLabelWidth));
                        }
                        else
                        {
                            EditorGUILayout.LabelField(label, NodeEditorResources.OutputPort, GUILayout.MaxWidth(float.MaxValue), GUILayout.ExpandWidth(true));
                        }
                    }
                }
            }
        }