public virtual EditorProperty[] GetEditorProperties() { EditorProperty[] p = new EditorProperty[1]; p[0].name = string.Empty; p[0].value = null; return(p); }
public EditorPluginImporterExtension() : base(null) { editorCPUProperty = new CPUProperty(EditorGUIUtility.TrTextContent("CPU", "The processor architectiure that this plugin is compatible with"), "CPU", EditorPluginCPUArchitecture.AnyCPU, (Enum e) => CanSelectArch(e)); editorOSProperty = new EditorProperty(EditorGUIUtility.TrTextContent("OS", "The Editor operating system that this plugin is compatible with"), "OS", EditorPluginOSArchitecture.AnyOS); properties = new Property[] { editorOSProperty, editorCPUProperty }; }
public InvisiGoody(float xpos, float ypos) : base(xpos, ypos, new Sprite("swirl")) { this._visibleInGame = false; this.sequence.isValid = false; this.size = new EditorProperty <int>(1, (Thing)this, 1f, 16f, 1f); this.valid = new EditorProperty <bool>(false, (Thing)this); this.sound = new EditorProperty <bool>(false, (Thing)this); }
public Altar(float xpos, float ypos, int dir) : base(xpos, ypos) { this.wide = new EditorProperty <int>(1, (Thing)this, 1f, 3f, 1f); this.graphic = (Sprite) new SpriteMap("altar", 48, 16); this.hugWalls = WallHug.Floor; this.UpdateSize(); this.thickness = 0.0f; this.depth = new Depth(0.01f); this.placementLayerOverride = Layer.Blocks; }
public CustomCamera() : base() { this.graphic = new Sprite("swirl"); this.center = new Vec2(8f, 8f); this.collisionSize = new Vec2(16f, 16f); this.collisionOffset = new Vec2(-8f, -8f); this._canFlip = false; this._visibleInGame = false; this.wide = new EditorProperty <int>(320, (Thing)this, 60f, 1920f, 1f); }
public SnowDrift(float xpos, float ypos, int dir) : base(xpos, ypos) { this.style = new EditorProperty <int>(-1, (Thing)this, -1f, 3f, 1f); this.graphic = (Sprite) new SpriteMap("drifts", 16, 17); if ((int)this.style == -1) { (this.graphic as SpriteMap).frame = Rando.Int(3); } this.hugWalls = WallHug.Floor; this.center = new Vec2(8f, 14f); this.collisionSize = new Vec2(14f, 4f); this.collisionOffset = new Vec2(-7f, -2f); this.layer = Layer.Blocks; this.depth = new Depth(0.5f); }
bool TryGetEntityProperty(MemberInfo memberInfo, ref Dictionary <string, List <EditorProperty> > folders) { EditorPropertyAttribute propertyAttribute; if (memberInfo.TryGetAttribute(out propertyAttribute)) { Type memberType = null; switch (memberInfo.MemberType) { case MemberTypes.Field: memberType = (memberInfo as FieldInfo).FieldType; break; case MemberTypes.Property: memberType = (memberInfo as PropertyInfo).PropertyType; break; } var limits = new EditorPropertyLimits(propertyAttribute.Min, propertyAttribute.Max); var property = new EditorProperty(propertyAttribute.Name ?? memberInfo.Name, propertyAttribute.Description, Entity.GetEditorType(memberType, propertyAttribute.Type), limits, propertyAttribute.Flags); if (propertyAttribute.Folder == null) { propertyAttribute.Folder = "Default"; } if (!folders.ContainsKey(propertyAttribute.Folder)) { folders.Add(propertyAttribute.Folder, new List <EditorProperty>()); } folders[propertyAttribute.Folder].Add(property); return(true); } return(false); }
public override void SetEditorProperty(EditorProperty _property) { this.GetType().GetProperty(_property.name).SetValue(this, _property.value, null); }
bool TryGetEntityProperty(MemberInfo memberInfo, ref Dictionary<string, List<EditorProperty>> folders) { EditorPropertyAttribute propertyAttribute; if (memberInfo.TryGetAttribute(out propertyAttribute)) { Type memberType = null; switch (memberInfo.MemberType) { case MemberTypes.Field: memberType = (memberInfo as FieldInfo).FieldType; break; case MemberTypes.Property: memberType = (memberInfo as PropertyInfo).PropertyType; break; } var limits = new EditorPropertyLimits(propertyAttribute.Min, propertyAttribute.Max); var property = new EditorProperty(propertyAttribute.Name ?? memberInfo.Name, propertyAttribute.Description, Entity.GetEditorType(memberType, propertyAttribute.Type), limits, propertyAttribute.Flags); if (propertyAttribute.Folder == null) propertyAttribute.Folder = "Default"; if (!folders.ContainsKey(propertyAttribute.Folder)) folders.Add(propertyAttribute.Folder, new List<EditorProperty>()); folders[propertyAttribute.Folder].Add(property); return true; } return false; }
set => SetValue(EditorProperty, value);
public virtual void SetEditorProperty(EditorProperty _property) { }
public void SetEditorProperty(EditorProperty _property) { }