public EditFunction(EditTarget t, Function f) { target = t; function = f; arguments = Variable_Static_Readonly_Value.New(new object[function.GetNumberParameters()]); }
protected override EditorGUIElement CreateRootEditorGUIElement(EditTarget target) { EditorGUIElement_Container_Auto_Simple_VerticalStrip root = new EditorGUIElement_Container_Auto_Simple_VerticalStrip(); InitilizeRootEditorGUIElement(root, target); return(root); }
protected override EditorSceneElement CreateRootEditorSceneElement(EditTarget target) { EditorSceneElement_Container_Auto root = new EditorSceneElement_Container_Auto_Simple_Normal(); InitilizeRootEditorSceneElement(root, target); return(root); }
public EditTarget(IEnumerable <object> o, EditTarget p) { objects = o.ToList(); target_type = objects.Convert(z => z.GetTypeEX()).GetCommonAncestor(); parent = p; }
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)) )); }
static public bool IsSerializationNotCorrupt(this EditTarget item) { if (item.IsSerializationCorrupt() == false) { return(true); } return(false); }
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(); }
public bool TryGetContents(out EditTarget value) { value = new EditTarget(GetAllContents(), GetTarget()); if (value.IsValid()) { return(true); } return(false); }
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); }
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); }
protected override Type PullState() { Type type; EditTarget target = GetProperty().GetContents(); if (target.IsValid()) { target.ForcePropertyValue("type") .TryGetContentValues <Type>(out type); return(type); } return(null); }
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); }
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)); }
protected virtual EditorSceneElement CreateRootEditorSceneElement(EditTarget target) { return(null); }
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)); } }
public EditProperty_Array(EditTarget t, Variable v) : base(t, v) { elements_by_index = new Dictionary <int, EditPropertyArrayElement>(); }
public EditProperty_Single(EditTarget t, Variable v) : base(t, v) { }
public EditDisplay(EditTarget t, Variable v) { target = t; variable = v; }
static public EditDisplay New(EditTarget target, Variable variable) { return(new EditDisplay(target, variable)); }
public EditorGUIElement_Complex_EditTarget(EditTarget t) { target = t; }
public EditorSceneElement_Complex_EditTarget(EditTarget t) { target = t; }
public EditPropertyArrayElement(EditTarget t, Variable v, int i) { variable = v.GetVariableElement(i); property = EditProperty.New(t, variable); }
protected override void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target) { root.AddChild(new EditorSceneElement_Complex_EditTarget(target)); }
static public EditAction New(EditTarget target, Action action) { return(new EditAction(target, action)); }
static public bool TryGetObject(this EditTarget item, out object obj) { return(item.GetObjects().TryGetOnly(out obj)); }
public EditProperty(EditTarget t, Variable v) { target = t; variable = v; }
static public EditFunction New(EditTarget target, Function function) { return(new EditFunction(target, function)); }
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."))); }
public EditAction(EditTarget o, Action a) { target = o; action = a; }
protected virtual void InitilizeRootEditorSceneElement(EditorSceneElement_Container_Auto root, EditTarget target) { }