细化一些UI
我觉得TimelineCanvas可以利用一下 比如把note放在上面?
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Ichni.Editor
|
||||
{
|
||||
public partial class EditorConsole : MonoBehaviour
|
||||
{
|
||||
|
||||
public Canvas[] scaleParts;
|
||||
public Interpreter functionInterpreter;
|
||||
public TMP_InputField InputCommand;
|
||||
private Dictionary<int,string> historyCommand=new Dictionary<int,string>();
|
||||
@@ -52,6 +52,19 @@ namespace Ichni.Editor
|
||||
|
||||
isHide=!isHide;
|
||||
}
|
||||
if(Keyboard.current.leftCtrlKey.isPressed&&Keyboard.current.upArrowKey.wasPressedThisFrame){
|
||||
foreach(Canvas i in scaleParts){
|
||||
var canvasScaler = i.GetComponent<CanvasScaler>();
|
||||
canvasScaler.referenceResolution = new Vector2(canvasScaler.referenceResolution.x + 100, canvasScaler.referenceResolution.y);
|
||||
}
|
||||
}else
|
||||
if(Keyboard.current.leftCtrlKey.isPressed&&Keyboard.current.downArrowKey.wasPressedThisFrame){
|
||||
foreach(Canvas i in scaleParts){
|
||||
var canvasScaler = i.GetComponent<CanvasScaler>();
|
||||
canvasScaler.referenceResolution = new Vector2(canvasScaler.referenceResolution.x - 100, canvasScaler.referenceResolution.y);
|
||||
|
||||
}
|
||||
}
|
||||
if(InputCommand.isFocused){
|
||||
if(Keyboard.current.downArrowKey.wasPressedThisFrame){
|
||||
if(historyCommand.Count-1>historycount){
|
||||
|
||||
@@ -25,8 +25,13 @@ namespace Ichni.Editor
|
||||
foreach(var i in GetComponentsInChildren<DynamicUIElement>()){
|
||||
i.DeviverSet(num);
|
||||
if(i.GetType()!=typeof(DynamicUIButton))CanCompress=false;
|
||||
if(i.GetType()==typeof(DynamicUIBaseColorPicker)||
|
||||
i.GetType()==typeof(DynamicUIEmissionColorPicker)){//一个container可能不会有除了color以外的的东西吧
|
||||
gridLayoutGroup.cellSize=new Vector2(gridLayoutGroup.cellSize.x,gridLayoutGroup.cellSize.y*2.5f);
|
||||
}
|
||||
}
|
||||
if(CanCompress)gridLayoutGroup.cellSize=new Vector2(gridLayoutGroup.cellSize.x,gridLayoutGroup.cellSize.y/2);
|
||||
//Danger:写了好多特判
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
@@ -13,6 +14,11 @@ namespace Ichni.Editor
|
||||
public TMP_InputField inputFieldBaseG;
|
||||
public TMP_InputField inputFieldBaseB;
|
||||
public TMP_InputField inputFieldBaseA;
|
||||
|
||||
public Slider sliderR;
|
||||
public Slider sliderG;
|
||||
public Slider sliderB;
|
||||
public Slider sliderA;
|
||||
public Image colorPreview;
|
||||
|
||||
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
|
||||
@@ -23,12 +29,16 @@ namespace Ichni.Editor
|
||||
inputFieldBaseG.text = baseColor.g.ToString();
|
||||
inputFieldBaseB.text = baseColor.b.ToString();
|
||||
inputFieldBaseA.text = baseColor.a.ToString();
|
||||
|
||||
sliderR.value=baseColor.r;
|
||||
sliderG.value=baseColor.g;
|
||||
sliderB.value=baseColor.b;
|
||||
sliderA.value=baseColor.a;
|
||||
inputFieldBaseR.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
inputFieldBaseG.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
inputFieldBaseB.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
inputFieldBaseA.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
|
||||
|
||||
colorPreview.color = baseColor;
|
||||
}
|
||||
|
||||
@@ -40,5 +50,12 @@ namespace Ichni.Editor
|
||||
colorPreview.color = newValue;
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
public void SliderChange(float value){
|
||||
inputFieldBaseR.text=sliderR.value.ToString();
|
||||
inputFieldBaseG.text=sliderG.value.ToString();
|
||||
inputFieldBaseB.text=sliderB.value.ToString();
|
||||
inputFieldBaseA.text=sliderA.value.ToString();
|
||||
ApplyParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,10 @@ namespace Ichni.Editor
|
||||
public TMP_InputField inputFieldEmissionG;
|
||||
public TMP_InputField inputFieldEmissionB;
|
||||
public TMP_InputField inputFieldEmissionI;
|
||||
public Slider sliderR;
|
||||
public Slider sliderG;
|
||||
public Slider sliderB;
|
||||
|
||||
public Image colorPreview;
|
||||
|
||||
public void Initialize(IBaseElement baseElement, string title,
|
||||
@@ -36,6 +40,11 @@ namespace Ichni.Editor
|
||||
inputFieldEmissionB.text = emissionColor.b.ToString();
|
||||
inputFieldEmissionI.text = emissionIntensity.ToString();
|
||||
|
||||
sliderR.value=emissionColor.r;
|
||||
sliderG.value=emissionColor.g;
|
||||
sliderB.value=emissionColor.b;
|
||||
|
||||
|
||||
toggleEnableEmission.onValueChanged.AddListener(_ => ApplyParameters());
|
||||
inputFieldEmissionR.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
inputFieldEmissionG.onEndEdit.AddListener(_ => ApplyParameters());
|
||||
@@ -58,5 +67,11 @@ namespace Ichni.Editor
|
||||
colorPreview.color = emissionColor;
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
public void SliderChange(float value){
|
||||
inputFieldEmissionR.text=sliderR.value.ToString();
|
||||
inputFieldEmissionG.text=sliderG.value.ToString();
|
||||
inputFieldEmissionB.text=sliderB.value.ToString();
|
||||
ApplyParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace Ichni.Editor
|
||||
public int tabLayer;
|
||||
public bool isSelected;
|
||||
public bool isExpanded;
|
||||
|
||||
public Image BgImage;
|
||||
public RectTransform tabRect;
|
||||
public LayoutElement layoutElement;
|
||||
public RectTransform tabMainRect;
|
||||
|
||||
@@ -86,6 +86,7 @@ namespace Ichni.RhythmGame
|
||||
var emissionColor = inspector.GenerateEmissionColorPicker(this, container, "Emission Color",
|
||||
nameof(emissionEnabled), nameof(originalEmissionColor), nameof(originalEmissionIntensity));
|
||||
}
|
||||
container.SetDeviver(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,14 @@ namespace Ichni.Editor
|
||||
|
||||
public void SelectElement(GameElement gameElement)
|
||||
{
|
||||
if(currentSelectedElement != null)
|
||||
{
|
||||
currentSelectedElement.connectedTab.isSelected = false;
|
||||
currentSelectedElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
|
||||
}
|
||||
currentSelectedElement = gameElement;
|
||||
currentSelectedElement.connectedTab.isSelected = true;
|
||||
currentSelectedElement.connectedTab.BgImage.color = new Color(0.5f,0.5f, 0.5f, 0.2f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user