Ejemplo n.º 1
0
        static public T AddChildWithAttachments <T>(this EditorGUIElement_Container_Auto item, T child, IEnumerable <EditorGUIElementAttachment> attachments) where T : EditorGUIElement
        {
            item.AddChild(child);
            child.AddAttachments(attachments);

            return(child);
        }
Ejemplo n.º 2
0
        protected override EditorGUIElement PushState()
        {
            EditorGUIElement_Container_Auto container = new EditorGUIElement_Container_Auto_Simple_VerticalStrip();

            if (target.IsValid())
            {
                if (target.IsSerializationNotCorrupt())
                {
                    container.AddChildren(
                        target.GetPropertys()
                        .Convert(p => p.CreateLabeledEditorGUIElement())
                        );

                    container.AddChildren(
                        target.GetDisplays()
                        .Convert(d => d.CreateLabeledEditorGUIElement())
                        );

                    container.AddChildren(
                        target.GetFunctions()
                        .Convert(f => f.CreateEditorGUIElement())
                        );

                    container.AddChildren(
                        target.GetActions()
                        .Convert(a => a.CreateEditorGUIElement())
                        );
                }

                if (target.IsSerializationCorrupt() || GetLayoutState().ShouldAlwaysShowRecoveryFields())
                {
                    EditorGUIElement_Container_Auto recovery_container = container.AddChild(new EditorGUIElement_Container_Auto_Simple_VerticalStrip());

                    if (target.IsSerializationCorrupt())
                    {
                        recovery_container.AddChild(new EditorGUIElement_Text("!Corruption Detected!"));
                        recovery_container.AddAttachment(new EditorGUIElementAttachment_Box(Color.red));
                    }
                    else
                    {
                        recovery_container.AddAttachment(new EditorGUIElementAttachment_Box(Color.blue));
                    }

                    recovery_container.AddChildren(
                        target.GetRecoveryPropertys()
                        .Convert(p => p.CreateLabeledEditorGUIElement())
                        );

                    recovery_container.AddChildren(
                        target.GetRecoveryActions()
                        .Convert(a => a.CreateEditorGUIElement())
                        );
                }
            }

            return(container);
        }
Ejemplo n.º 3
0
        protected override void InitilizeRootEditorGUIElement(EditorGUIElement_Container_Auto root, EditTarget target)
        {
            root.AddChild(new EditorGUIElement_Complex_EditTarget(target));

            SpriteVectorizer sprite_vectorizer;

            if (target.TryGetObject <SpriteVectorizer>(out sprite_vectorizer))
            {
                root.AddChild(new EditorGUIElement_SpriteVectorizerTest(sprite_vectorizer));
            }
        }
Ejemplo n.º 4
0
 protected override void InitializeRootEditorGUIElement(EditorGUIElement_Container_Auto root)
 {
     root.AddChild(new EditorGUIElement_Complex_EditTarget(new EditTarget(Painter.GetInstance())));
 }
Ejemplo n.º 5
0
 protected virtual void InitializeRootEditorGUIElement(EditorGUIElement_Container_Auto root)
 {
 }
Ejemplo n.º 6
0
 protected override void InitilizeRootEditorGUIElement(EditorGUIElement_Container_Auto root, EditTarget target)
 {
     root.AddChild(new EditorGUIElement_Complex_EditTarget(target));
 }
Ejemplo n.º 7
0
 static public T AddChildWithAttachments <T>(this EditorGUIElement_Container_Auto item, T child, params EditorGUIElementAttachment[] attachments) where T : EditorGUIElement
 {
     return(item.AddChildWithAttachments(child, (IEnumerable <EditorGUIElementAttachment>)attachments));
 }
Ejemplo n.º 8
0
 protected virtual void InitilizeRootEditorGUIElement(EditorGUIElement_Container_Auto root, EditTarget target)
 {
 }