效果模块,以及代码位置整理

This commit is contained in:
SoulliesOfficial
2025-02-16 11:15:42 -05:00
parent 934d1b5aba
commit d77e1a0f70
204 changed files with 1107 additions and 347 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
namespace Ichni.Editor
{

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
@@ -20,7 +21,19 @@ namespace Ichni.Editor
private void ApplyParameters(string text)
{
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, text);
Type type = connectedBaseElement.GetType().GetField(parameterName).FieldType;
if (type == typeof(int))
{
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, int.Parse(text));
}
else if (type == typeof(float))
{
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, float.Parse(text));
}
else if (type == typeof(string))
{
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, text);
}
connectedBaseElement.Refresh();
}
}

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace Ichni.Editor
@@ -22,5 +23,10 @@ namespace Ichni.Editor
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, value);
connectedBaseElement.Refresh();
}
public void AddListenerFunction(UnityAction<bool> action)
{
toggle.onValueChanged.AddListener(action);
}
}
}

View File

@@ -6,9 +6,9 @@ namespace Ichni.Editor
{
public class EditorUIManager : MonoBehaviour
{
public MainPage mainPage;
public Hierarchy hierarchy;
public Inspector inspector;
public Timeline timeline;
}
}

View File

@@ -72,6 +72,16 @@ namespace Ichni.Editor
container.dynamicUIElements.Add(button);
return button;
}
public DynamicUIToggle GenerateToggle(IBaseElement baseElement, DynamicUIContainer container, string title,
string parameterName)
{
DynamicUIToggle toggle = Instantiate(EditorManager.instance.basePrefabs.toggle, container.rect)
.GetComponent<DynamicUIToggle>();
toggle.Initialize(baseElement, title, parameterName);
container.dynamicUIElements.Add(toggle);
return toggle;
}
public DynamicUIInputField GenerateInputField(IBaseElement baseElement, DynamicUIContainer container,
string title, string parameterName)

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6795f50bfe6d14cb7a78043ec0d9b433
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ichni.Editor
{
public class MainPage : StaticWindow
{
public Canvas mainCanvas;
public ToolBar toolBar;
public ResolutionHints resolutionHints;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dcc87ae8f9fe04833b49d5d7396d9693
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77cef690bc8234daba9231732db8dfb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Ichni.Editor
{
public partial class ResolutionHints : MonoBehaviour
{
public Image phoneFrame;
public Image iPadFrame;
public Image safeAreaFrame;
}
public partial class ResolutionHints
{
public void SetPhoneFrame()
{
phoneFrame.gameObject.SetActive(!phoneFrame.gameObject.activeSelf);
}
public void SetIPadFrame()
{
iPadFrame.gameObject.SetActive(!iPadFrame.gameObject.activeSelf);
}
public void SetSafeAreaFrame()
{
safeAreaFrame.gameObject.SetActive(!safeAreaFrame.gameObject.activeSelf);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f39aaf316b5904be48688dae23e2e35f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Ichni.Editor
{
public partial class ToolBar : MonoBehaviour
{
public Button projectInfoButton;
public Button songInfoButton;
public Button saveButton;
public Button exportButton;
private void Start()
{
saveButton.onClick.AddListener(EditorManager.instance.projectManager.saveManager.Save);
exportButton.onClick.AddListener(EditorManager.instance.projectManager.exportManager.Export);
}
}
public partial class ToolBar
{
}
}

View File

@@ -1,18 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ToolBar : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}