|
@@ -1,6 +1,7 @@
|
|
|
//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
|
|
//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
|
|
|
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
|
|
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
|
|
|
using System;
|
|
using System;
|
|
|
|
|
+using System.Linq;
|
|
|
using BansheeEngine;
|
|
using BansheeEngine;
|
|
|
|
|
|
|
|
namespace BansheeEditor
|
|
namespace BansheeEditor
|
|
@@ -129,10 +130,11 @@ namespace BansheeEditor
|
|
|
/// contain other fields, in which case you should increase this value by one.</param>
|
|
/// contain other fields, in which case you should increase this value by one.</param>
|
|
|
/// <param name="layout">Parent layout that all the field elements will be added to.</param>
|
|
/// <param name="layout">Parent layout that all the field elements will be added to.</param>
|
|
|
/// <param name="property">Serializable property referencing the array whose contents to display.</param>
|
|
/// <param name="property">Serializable property referencing the array whose contents to display.</param>
|
|
|
|
|
+ /// <param name="style">Information related the field style</param>
|
|
|
/// <returns>Inspectable field implementation that can be used for displaying the GUI for a serializable property
|
|
/// <returns>Inspectable field implementation that can be used for displaying the GUI for a serializable property
|
|
|
/// of the provided type.</returns>
|
|
/// of the provided type.</returns>
|
|
|
public static InspectableField CreateInspectable(Inspector parent, string title, string path, int layoutIndex,
|
|
public static InspectableField CreateInspectable(Inspector parent, string title, string path, int layoutIndex,
|
|
|
- int depth, InspectableFieldLayout layout, SerializableProperty property)
|
|
|
|
|
|
|
+ int depth, InspectableFieldLayout layout, SerializableProperty property, InspectableFieldStyle[] style = null)
|
|
|
{
|
|
{
|
|
|
InspectableField field = null;
|
|
InspectableField field = null;
|
|
|
|
|
|
|
@@ -143,13 +145,30 @@ namespace BansheeEditor
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ InspectableFieldRangeStyle rangeInfo = null;
|
|
|
|
|
+ if (style != null)
|
|
|
|
|
+ rangeInfo = InspectableFieldStyle.FindStyle<InspectableFieldRangeStyle>(style);
|
|
|
switch (property.Type)
|
|
switch (property.Type)
|
|
|
{
|
|
{
|
|
|
case SerializableProperty.FieldType.Int:
|
|
case SerializableProperty.FieldType.Int:
|
|
|
- field = new InspectableInt(parent, title, path, depth, layout, property);
|
|
|
|
|
|
|
+ if (rangeInfo == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ field = new InspectableInt(parent, title, path, depth, layout, property);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ field = new InspectableRangedInt(parent, title, path, depth, layout, property, rangeInfo);
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
case SerializableProperty.FieldType.Float:
|
|
case SerializableProperty.FieldType.Float:
|
|
|
- field = new InspectableFloat(parent, title, path, depth, layout, property);
|
|
|
|
|
|
|
+ if (rangeInfo == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ field = new InspectableFloat(parent, title, path, depth, layout, property);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ field = new InspectableRangedFloat(parent, title, path, depth, layout, property, rangeInfo);
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
case SerializableProperty.FieldType.Bool:
|
|
case SerializableProperty.FieldType.Bool:
|
|
|
field = new InspectableBool(parent, title, path, depth, layout, property);
|
|
field = new InspectableBool(parent, title, path, depth, layout, property);
|