UI调整
This commit is contained in:
@@ -1,62 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using Cielonos.MainGame.Characters;
|
||||
using Sirenix.OdinInspector;
|
||||
using SLSUtilities.General;
|
||||
using SoftCircuits.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Cielonos.MainGame.Inventory
|
||||
{
|
||||
[CreateAssetMenu(fileName = "FunctionData", menuName = "Cielonos/Items/FunctionData")]
|
||||
public partial class FunctionData : SerializedScriptableObject
|
||||
{
|
||||
[DictionaryDrawerSettings(KeyLabel = "Function Unit", DisplayMode = DictionaryDisplayOptions.ExpandedFoldout)]
|
||||
[ListDrawerSettings(ShowIndexLabels = false, ListElementLabelName = "unitName", CustomAddFunction = "AddFunctionUnit")]
|
||||
[Searchable]
|
||||
public Dictionary<string, FunctionUnit> functionUnits = new Dictionary<string, FunctionUnit>();
|
||||
public List<FunctionUnit> functionUnitList = new List<FunctionUnit>();
|
||||
|
||||
[OnInspectorGUI("UpdateUnits")]
|
||||
public void UpdateUnits()
|
||||
{
|
||||
foreach (var unit in functionUnits.Values)
|
||||
foreach (var unit in functionUnitList)
|
||||
{
|
||||
unit.parentData = this;
|
||||
}
|
||||
}
|
||||
|
||||
private FunctionUnit AddFunctionUnit()
|
||||
{
|
||||
FunctionUnit newUnit = new FunctionUnit
|
||||
{
|
||||
unitName = $"Function {functionUnitList.Count + 1}",
|
||||
parentData = this
|
||||
};
|
||||
return newUnit;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class FunctionData
|
||||
{
|
||||
public enum IntervalReductionType
|
||||
public enum CooldownReductionType
|
||||
{
|
||||
None = 0,
|
||||
Cooldown = 1,
|
||||
AttackSpeed = 10
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class FunctionUnit
|
||||
{
|
||||
[ReadOnly]
|
||||
public FunctionData parentData;
|
||||
|
||||
|
||||
[TitleGroup("Information")]
|
||||
public string unitName;
|
||||
[TitleGroup("Information")]
|
||||
public bool shownInUI;
|
||||
[TitleGroup("Information")]
|
||||
[HideIf("shownInUI")]
|
||||
public bool isMain;
|
||||
[TitleGroup("Information")]
|
||||
[ShowIf("@shownInUI || isMain")]
|
||||
public Sprite icon;
|
||||
[TitleGroup("Information")]
|
||||
public List<string> operation;
|
||||
public List<string> operation = new List<string>();
|
||||
[TitleGroup("Information")]
|
||||
[ValueDropdown("Tags")]
|
||||
public List<string> tags = new List<string>();
|
||||
|
||||
[TitleGroup("Costs")]
|
||||
public float energyCost;
|
||||
[TitleGroup("Costs")]
|
||||
public int ammoCost;
|
||||
|
||||
[TitleGroup("Interval")]
|
||||
public float interval;
|
||||
[TitleGroup("Interval")]
|
||||
public float intervalLowerLimit;
|
||||
[TitleGroup("Interval")]
|
||||
public IntervalReductionType intervalReductionType;
|
||||
[FormerlySerializedAs("interval")] [TitleGroup("Cooldown")]
|
||||
public float cooldown;
|
||||
[FormerlySerializedAs("intervalLowerLimit")] [TitleGroup("Cooldown")]
|
||||
public float cooldownLowerLimit;
|
||||
[FormerlySerializedAs("intervalReductionType")] [TitleGroup("Cooldown")]
|
||||
public CooldownReductionType cooldownReductionType;
|
||||
|
||||
public static List<string> Tags = new()
|
||||
{
|
||||
"Disruption"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user