增加TubeGenerator,DUI架构调整
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Ichni.Editor
|
||||
ApplyParameters();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
inputFieldBaseR.onEndEdit.AddListener(_ => action());
|
||||
inputFieldBaseG.onEndEdit.AddListener(_ => action());
|
||||
|
||||
@@ -13,10 +13,10 @@ namespace Ichni.Editor
|
||||
public Button button;
|
||||
public TMP_Text buttonText;
|
||||
|
||||
public void SetText(string buttonText, bool hasTitle)
|
||||
public void SetText(string buttonText, bool showTitle)
|
||||
{
|
||||
this.buttonText.text = buttonText;
|
||||
if(!hasTitle) title.gameObject.SetActive(false);
|
||||
if(!showTitle) title.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void ApplyFunction(UnityAction function)
|
||||
@@ -27,5 +27,10 @@ namespace Ichni.Editor
|
||||
button.onClick.AddListener(connectedBaseElement.Refresh);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,13 @@ namespace Ichni.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public void Mark(IHaveInspection inspection, string mark)
|
||||
{
|
||||
inspection.MarkedElements.Add(mark, this);
|
||||
}
|
||||
|
||||
public abstract void AddListenerFunction(UnityAction action);
|
||||
|
||||
public virtual void DeviverSet(int DeviveNum){
|
||||
float o=2f/DeviveNum;//因为所有的单UI都是根据2栏来的
|
||||
Button[] childb=GetComponentsInChildren<Button>();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Ichni.Editor
|
||||
ApplyParameters();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
inputFieldEmissionR.onEndEdit.AddListener(_ => action());
|
||||
inputFieldEmissionG.onEndEdit.AddListener(_ => action());
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction<int> action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
dropdown.onValueChanged.AddListener(action);
|
||||
dropdown.onValueChanged.AddListener(_ => action());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using Ichni.RhythmGame;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
@@ -21,5 +22,10 @@ namespace Ichni.Editor
|
||||
{
|
||||
Observable.EveryUpdate().Subscribe(_ => text.text = content()).AddTo(gameObject);
|
||||
}
|
||||
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,9 +71,9 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction<string> action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
inputField.onEndEdit.AddListener(action);
|
||||
inputField.onEndEdit.AddListener(_ => action());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
@@ -34,5 +35,10 @@ namespace Ichni.Editor
|
||||
{
|
||||
text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString();
|
||||
}
|
||||
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,9 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction<int> action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
dropdown.onValueChanged.AddListener(action);
|
||||
dropdown.onValueChanged.AddListener(_ => action());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,9 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction<bool> action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
toggle.onValueChanged.AddListener(action);
|
||||
toggle.onValueChanged.AddListener(_ => action());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void AddListenerFunction(UnityAction action)
|
||||
public override void AddListenerFunction(UnityAction action)
|
||||
{
|
||||
inputFieldX.onEndEdit.AddListener(_ => action());
|
||||
inputFieldY.onEndEdit.AddListener(_ => action());
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Ichni.Editor
|
||||
{
|
||||
public RectTransform WindowRect { get; set; }
|
||||
public List<DynamicUIContainer> Containers { get; set; }
|
||||
public Dictionary<string, DynamicUIElement> MarkedElements { get; set; }
|
||||
|
||||
public CompositeParameterWindow GenerateCompositeParameterWindow(IBaseElement baseElement, string title,
|
||||
string parameterName)
|
||||
|
||||
@@ -17,11 +17,13 @@ namespace Ichni.Editor
|
||||
|
||||
public RectTransform WindowRect { get; set; }
|
||||
public List<DynamicUIContainer> Containers { get; set; }
|
||||
public Dictionary<string, DynamicUIElement> MarkedElements { get; set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
WindowRect = inspectorRect;
|
||||
Containers = new List<DynamicUIContainer>();
|
||||
MarkedElements = new Dictionary<string, DynamicUIElement>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -39,6 +41,7 @@ namespace Ichni.Editor
|
||||
{
|
||||
Containers.ForEach(container => Destroy(container.gameObject));
|
||||
Containers.Clear();
|
||||
MarkedElements.Clear();
|
||||
}
|
||||
|
||||
public InspectorSecondaryWindow GenerateSecondaryWindow(GameElement gameElement, string title)
|
||||
|
||||
@@ -10,16 +10,17 @@ namespace Ichni.Editor
|
||||
public GameElement connectedGameElement;
|
||||
public RectTransform WindowRect { get; set; }
|
||||
public List<DynamicUIContainer> Containers { get; set; }
|
||||
public Dictionary<string, DynamicUIElement> MarkedElements { get; set; }
|
||||
|
||||
public void Initialize(GameElement gameElement, string titleText)
|
||||
{
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
WindowRect = windowRect;
|
||||
Containers = new List<DynamicUIContainer>();
|
||||
|
||||
MarkedElements = new Dictionary<string, DynamicUIElement>();
|
||||
|
||||
connectedGameElement = gameElement;
|
||||
InitializeWindow(titleText);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user