Example #1
0
        public EditFunction(EditTarget t, Function f)
        {
            target   = t;
            function = f;

            arguments = Variable_Static_Readonly_Value.New(new object[function.GetNumberParameters()]);
        }
Example #2
0
        protected override EditorGUIElement CreateRootEditorGUIElement(EditTarget target)
        {
            EditorGUIElement_Container_Auto_Simple_VerticalStrip root = new EditorGUIElement_Container_Auto_Simple_VerticalStrip();

            InitilizeRootEditorGUIElement(root, target);
            return(root);
        }
Example #3
0
        protected override EditorSceneElement CreateRootEditorSceneElement(EditTarget target)
        {
            EditorSceneElement_Container_Auto root = new EditorSceneElement_Container_Auto_Simple_Normal();

            InitilizeRootEditorSceneElement(root, target);
            return(root);
        }
Example #4
0
        public EditTarget(IEnumerable <object> o, EditTarget p)
        {
            objects     = o.ToList();
            target_type = objects.Convert(z => z.GetTypeEX()).GetCommonAncestor();

            parent = p;
        }
Example #5
0
        static public EditGadget New(EditTarget target, Variable variable, AttachEditGadgetAttribute attribute)
        {
            Type object_type = target.GetTargetType();

            return(new EditGadget(target, variable,
                                  attribute.GetActionPaths().ConvertValuesOfPair(p => object_type.GetActionByPath(p)),
                                  attribute.GetVariablePaths().ConvertValuesOfPair(p => object_type.GetVariableByPath(p))
                                  ));
        }
Example #6
0
        static public bool IsSerializationNotCorrupt(this EditTarget item)
        {
            if (item.IsSerializationCorrupt() == false)
            {
                return(true);
            }

            return(false);
        }
Example #7
0
        public EditGadget(EditTarget t, Variable v, IEnumerable <KeyValuePair <string, Action> > ae, IEnumerable <KeyValuePair <string, Variable> > ve)
        {
            target = t;

            variable = v;

            aux_actions   = ae.ToDictionary();
            aux_variables = ve.ToDictionary();
        }
Example #8
0
        public bool TryGetContents(out EditTarget value)
        {
            value = new EditTarget(GetAllContents(), GetTarget());

            if (value.IsValid())
            {
                return(true);
            }

            return(false);
        }
Example #9
0
        static public bool TryGetObject <T>(this EditTarget item, out T obj, bool allow_null_object = false)
        {
            object temp;

            if (item.TryGetObject(out temp))
            {
                if (temp.Convert <T>(out obj, allow_null_object))
                {
                    return(true);
                }
            }

            obj = default(T);
            return(false);
        }
Example #10
0
        protected override EditorGUIElement PushState()
        {
            EditTarget target = GetProperty().GetContents();
            EditorGUIElement_Container_Flow_Multiline container = new EditorGUIElement_Container_Flow_Multiline();

            if (target.IsValid())
            {
                EditProperty_Array property = target.ForcePropertyArray("percents");

                container.AddFixedChild(32.0f, new EditorGUIElement_EditPropertyArray_ArraySize(property));
                container.AddWeightedChild(1.0f, new EditorGUIElement_EditPropertyArray_FloatSequence(property));
            }

            return(container);
        }
Example #11
0
        protected override Type PullState()
        {
            Type       type;
            EditTarget target = GetProperty().GetContents();

            if (target.IsValid())
            {
                target.ForcePropertyValue("type")
                .TryGetContentValues <Type>(out type);

                return(type);
            }

            return(null);
        }
Example #12
0
        protected override EditorGUIElement PushState()
        {
            EditTarget target = GetProperty().GetContents();
            EditorGUIElement_Container_Flow_Multiline container = new EditorGUIElement_Container_Flow_Multiline();

            if (target.IsValid())
            {
                container.AddWeightedChild(0.3f, target.ForceProperty("type").CreateEditorGUIElement());
                container.AddWeightedChild(0.2f, target.ForceProperty("name").CreateEditorGUIElement());
                container.AddWeightedChild(0.4f,
                                           new EditorGUIElement_Complex_EditPropertySingleValue_TypedObject(
                                               target.ForcePropertyValue("value"),
                                               target.ForcePropertyValue("type")
                                               )
                                           );
            }

            return(container);
        }
Example #13
0
        static public EditProperty New(EditTarget target, Variable variable)
        {
            Type variable_type = variable.GetVariableType();

            if (variable_type.IsTypicalIEnumerable())
            {
                return(new EditProperty_Array(target, variable));
            }

            if (
                variable.HasCustomAttributeOfType <ObjectSignifyFieldAttribute>(true) &&
                variable_type.IsTypicalValueType() == false &&
                variable_type.CanBeTreatedAs <UnityEngine.Object>() == false
                )
            {
                return(new EditProperty_Single_Object(target, variable));
            }

            return(new EditProperty_Single_Value(target, variable));
        }
Example #14
0
 protected virtual EditorSceneElement CreateRootEditorSceneElement(EditTarget target)
 {
     return(null);
 }
Example #15
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));
            }
        }
Example #16
0
 public EditProperty_Array(EditTarget t, Variable v) : base(t, v)
 {
     elements_by_index = new Dictionary <int, EditPropertyArrayElement>();
 }
Example #17
0
 public EditProperty_Single(EditTarget t, Variable v) : base(t, v)
 {
 }
Example #18
0
 public EditDisplay(EditTarget t, Variable v)
 {
     target   = t;
     variable = v;
 }
Example #19
0
 static public EditDisplay New(EditTarget target, Variable variable)
 {
     return(new EditDisplay(target, variable));
 }
Example #20
0
 public EditorGUIElement_Complex_EditTarget(EditTarget t)
 {
     target = t;
 }
Example #21
0
 public EditorSceneElement_Complex_EditTarget(EditTarget t)
 {
     target = t;
 }
Example #22
0
 public EditPropertyArrayElement(EditTarget t, Variable v, int i)
 {
     variable = v.GetVariableElement(i);
     property = EditProperty.New(t, variable);
 }
Example #23
0
 protected override void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target)
 {
     root.AddChild(new EditorSceneElement_Complex_EditTarget(target));
 }
Example #24
0
 static public EditAction New(EditTarget target, Action action)
 {
     return(new EditAction(target, action));
 }
Example #25
0
 static public bool TryGetObject(this EditTarget item, out object obj)
 {
     return(item.GetObjects().TryGetOnly(out obj));
 }
Example #26
0
 public EditProperty(EditTarget t, Variable v)
 {
     target   = t;
     variable = v;
 }
Example #27
0
 static public EditFunction New(EditTarget target, Function function)
 {
     return(new EditFunction(target, function));
 }
Example #28
0
 static public EditProperty_Array ForcePropertyArray(this EditTarget item, string path)
 {
     return(item.ForceProperty(path)
            .Convert <EditProperty_Array>()
            .AssertNotNull(() => new MissingFieldException("The property for type " + item.GetTargetType() + " at path " + path + " cannot be treated as an arrary.")));
 }
Example #29
0
 public EditAction(EditTarget o, Action a)
 {
     target = o;
     action = a;
 }
Example #30
0
 protected virtual void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target)
 {
 }