Inspector内容开始填充完善
This commit is contained in:
30
Assets/Scripts/Manager/BackgroundController.cs
Normal file
30
Assets/Scripts/Manager/BackgroundController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
public class BackgroundController : MonoBehaviour
|
||||
{
|
||||
public Canvas backgroundCanvas;
|
||||
public Image backgroundImage;
|
||||
public Material skyboxMaterial;
|
||||
|
||||
public void EnableBackground(bool enable)
|
||||
{
|
||||
backgroundCanvas.gameObject.SetActive(enable);
|
||||
}
|
||||
|
||||
public void SetBackground(Sprite sprite)
|
||||
{
|
||||
backgroundImage.sprite = sprite;
|
||||
}
|
||||
|
||||
public void SetSkybox(Material material)
|
||||
{
|
||||
skyboxMaterial = material;
|
||||
RenderSettings.skybox = material;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Manager/BackgroundController.cs.meta
Normal file
11
Assets/Scripts/Manager/BackgroundController.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3baf07428c9f4d22b526fcc35f801cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -37,7 +37,8 @@ public class BasePrefabsCollection : SerializedScriptableObject
|
||||
public GameObject text;
|
||||
public GameObject button;
|
||||
public GameObject toggle;
|
||||
public GameObject dropdown;
|
||||
[FormerlySerializedAs("dropdown")] public GameObject enumDropdown;
|
||||
public GameObject stringListDropdown;
|
||||
public GameObject baseColorPicker;
|
||||
public GameObject emissionColorPicker;
|
||||
[Title("DynamicUI相关-Composite")]
|
||||
@@ -46,4 +47,8 @@ public class BasePrefabsCollection : SerializedScriptableObject
|
||||
public GameObject animatedFloatUnit;
|
||||
public GameObject animatedIntUnit;
|
||||
public GameObject animatedBoolUnit;
|
||||
|
||||
[Title("Background相关")]
|
||||
public Sprite defaultBackground;
|
||||
public Material defaultSkyboxMaterial;
|
||||
}
|
||||
|
||||
@@ -10,13 +10,14 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni
|
||||
{
|
||||
public class EditorManager : SerializedMonoBehaviour
|
||||
public class EditorManager : GameElement
|
||||
{
|
||||
public static EditorManager instance;
|
||||
|
||||
public ProjectManager projectManager;
|
||||
public EditorUIManager uiManager;
|
||||
public EditorSettings editorSettings;
|
||||
public BackgroundController backgroundController;
|
||||
|
||||
public ProjectInformation projectInformation;
|
||||
public SongInformation songInformation;
|
||||
@@ -43,7 +44,10 @@ namespace Ichni
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//CreateNew();
|
||||
this.elementName = "EditorManager";
|
||||
this.elementGuid = Guid.Empty;
|
||||
uiManager.hierarchy.GenerateTab(this, null);
|
||||
|
||||
projectManager.loadManager.Load("TestProject");
|
||||
uiManager.timeline.musicPlayer.audioSource.clip = songInformation.song;
|
||||
|
||||
@@ -57,9 +61,20 @@ namespace Ichni
|
||||
gameElement.AfterInitialize();
|
||||
gameElement.Refresh();
|
||||
});
|
||||
|
||||
// projectManager.saveManager.Save();
|
||||
// projectManager.exportManager.Export();
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
var container = inspector.GenerateContainer("Editor Manager");
|
||||
var judgeTypeDropdown = inspector.GenerateDropdown(this, container, "Judge Type",
|
||||
typeof(NoteBase.NoteJudgeType), nameof(currentJudgeType));
|
||||
var generateBackgroundSetterButton =
|
||||
inspector.GenerateButton(this, container, "Generate Background Setter",
|
||||
() => BackgroundSetter.GenerateElement("Background Setter", Guid.NewGuid(),
|
||||
new List<string>(), true, null, false,
|
||||
"basic", "Skybox", "Background"));
|
||||
projectInformation.SetUpInspector();
|
||||
songInformation.SetUpInspector();
|
||||
}
|
||||
|
||||
private void CreateNew()
|
||||
|
||||
@@ -27,8 +27,13 @@ namespace Ichni
|
||||
LoadAllThemeBundlesAbstract();
|
||||
//DontDestroyOnLoad(gameObject);
|
||||
LoadThemeBundle("basic");
|
||||
LoadThemeBundle("departure_to_multiverse");
|
||||
}
|
||||
|
||||
public ThemeBundle GetThemeBundle(string themeBundleName)
|
||||
{
|
||||
return loadedThemeBundleList.Find(bundle => bundle.themeBundleName == themeBundleName);
|
||||
}
|
||||
|
||||
public T GetObject<T>(string themeBundleName, string objectName) where T : class
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user