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

            arguments = Variable_Static_Readonly_Value.New(new object[function.GetNumberParameters()]);
        }
Beispiel #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);
        }
Beispiel #3
0
        protected override EditorSceneElement CreateRootEditorSceneElement(EditTarget target)
        {
            EditorSceneElement_Container_Auto root = new EditorSceneElement_Container_Auto_Simple_Normal();

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

            parent = p;
        }
Beispiel #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))
                                  ));
        }
Beispiel #6
0
        static public bool IsSerializationNotCorrupt(this EditTarget item)
        {
            if (item.IsSerializationCorrupt() == false)
            {
                return(true);
            }

            return(false);
        }
Beispiel #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();
        }
Beispiel #8
0
        public bool TryGetContents(out EditTarget value)
        {
            value = new EditTarget(GetAllContents(), GetTarget());

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

            return(false);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #14
0
 protected virtual EditorSceneElement CreateRootEditorSceneElement(EditTarget target)
 {
     return(null);
 }
Beispiel #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));
            }
        }
Beispiel #16
0
 public EditProperty_Array(EditTarget t, Variable v) : base(t, v)
 {
     elements_by_index = new Dictionary <int, EditPropertyArrayElement>();
 }
Beispiel #17
0
 public EditProperty_Single(EditTarget t, Variable v) : base(t, v)
 {
 }
Beispiel #18
0
 public EditDisplay(EditTarget t, Variable v)
 {
     target   = t;
     variable = v;
 }
Beispiel #19
0
 static public EditDisplay New(EditTarget target, Variable variable)
 {
     return(new EditDisplay(target, variable));
 }
Beispiel #20
0
 public EditorGUIElement_Complex_EditTarget(EditTarget t)
 {
     target = t;
 }
Beispiel #21
0
 public EditorSceneElement_Complex_EditTarget(EditTarget t)
 {
     target = t;
 }
Beispiel #22
0
 public EditPropertyArrayElement(EditTarget t, Variable v, int i)
 {
     variable = v.GetVariableElement(i);
     property = EditProperty.New(t, variable);
 }
Beispiel #23
0
 protected override void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target)
 {
     root.AddChild(new EditorSceneElement_Complex_EditTarget(target));
 }
Beispiel #24
0
 static public EditAction New(EditTarget target, Action action)
 {
     return(new EditAction(target, action));
 }
Beispiel #25
0
 static public bool TryGetObject(this EditTarget item, out object obj)
 {
     return(item.GetObjects().TryGetOnly(out obj));
 }
Beispiel #26
0
 public EditProperty(EditTarget t, Variable v)
 {
     target   = t;
     variable = v;
 }
Beispiel #27
0
 static public EditFunction New(EditTarget target, Function function)
 {
     return(new EditFunction(target, function));
 }
Beispiel #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.")));
 }
Beispiel #29
0
 public EditAction(EditTarget o, Action a)
 {
     target = o;
     action = a;
 }
Beispiel #30
0
 protected virtual void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target)
 {
 }