コード例 #1
0
        public EditFunction(EditTarget t, Function f)
        {
            target   = t;
            function = f;

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

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

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

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

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

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