rename attribute and fix parsing

This commit is contained in:
nothingTVatYT
2024-01-28 23:28:35 +01:00
parent d28b0ab2a6
commit 2625144945
11 changed files with 42 additions and 40 deletions

View File

@@ -4,7 +4,7 @@ using System;
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
using Utils = FlaxEditor.Utilities.Utils;
using Utils = FlaxEngine.Utils;
namespace FlaxEditor.CustomEditors.Editors
{
@@ -26,8 +26,8 @@ namespace FlaxEditor.CustomEditors.Editors
// Try get limit attribute for value min/max range setting and slider speed
var attributes = Values.GetAttributes();
var categoryAttribute = attributes.FirstOrDefault(x => x is ValueCategoryAttribute);
var valueCategory = ((ValueCategoryAttribute)categoryAttribute)?.Category ?? Utils.ValueCategory.None;
var categoryAttribute = attributes.FirstOrDefault(x => x is NumberCategoryAttribute);
var valueCategory = ((NumberCategoryAttribute)categoryAttribute)?.Category ?? Utils.ValueCategory.None;
if (attributes != null)
{
var limit = attributes.FirstOrDefault(x => x is LimitAttribute);

View File

@@ -4,7 +4,7 @@ using System;
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
using Utils = FlaxEditor.Utilities.Utils;
using Utils = FlaxEngine.Utils;
namespace FlaxEditor.CustomEditors.Editors
{
@@ -31,8 +31,8 @@ namespace FlaxEditor.CustomEditors.Editors
// Try get limit attribute for value min/max range setting and slider speed
var attributes = Values.GetAttributes();
var categoryAttribute = attributes.FirstOrDefault(x => x is ValueCategoryAttribute);
var valueCategory = ((ValueCategoryAttribute)categoryAttribute)?.Category ?? Utils.ValueCategory.None;
var categoryAttribute = attributes.FirstOrDefault(x => x is NumberCategoryAttribute);
var valueCategory = ((NumberCategoryAttribute)categoryAttribute)?.Category ?? Utils.ValueCategory.None;
if (attributes != null)
{
var range = attributes.FirstOrDefault(x => x is RangeAttribute);

View File

@@ -4,7 +4,7 @@ using System.Linq;
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
using FlaxEngine.GUI;
using Utils = FlaxEditor.Utilities.Utils;
using Utils = FlaxEngine.Utils;
namespace FlaxEditor.CustomEditors.Editors
{
@@ -75,7 +75,7 @@ namespace FlaxEditor.CustomEditors.Editors
if (attributes != null)
{
limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute);
var categoryAttribute = (ValueCategoryAttribute)attributes.FirstOrDefault(x => x is ValueCategoryAttribute);
var categoryAttribute = (NumberCategoryAttribute)attributes.FirstOrDefault(x => x is NumberCategoryAttribute);
if (categoryAttribute != null)
category = categoryAttribute.Category;
}
@@ -261,7 +261,7 @@ namespace FlaxEditor.CustomEditors.Editors
if (attributes != null)
{
limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute);
var categoryAttribute = (ValueCategoryAttribute)attributes.FirstOrDefault(x => x is ValueCategoryAttribute);
var categoryAttribute = (NumberCategoryAttribute)attributes.FirstOrDefault(x => x is NumberCategoryAttribute);
if (categoryAttribute != null)
category = categoryAttribute.Category;
}