@@ -49,10 +49,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 26252
|
||||
m_assetChangeTS: 1752141270
|
||||
m_fileInfoReadTS: 1752141435
|
||||
m_fileWriteTS: 1752141270
|
||||
m_cachefileWriteTS: 1752141270
|
||||
m_assetChangeTS: 1752149790
|
||||
m_fileInfoReadTS: 1752149952
|
||||
m_fileWriteTS: 1752149790
|
||||
m_cachefileWriteTS: 1752149790
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: fc6c02e75b66345c29e8a25e2e2bda9c
|
||||
@@ -11523,10 +11523,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 3645
|
||||
m_assetChangeTS: 1752141561
|
||||
m_fileInfoReadTS: 1752141709
|
||||
m_fileWriteTS: 1752141561
|
||||
m_cachefileWriteTS: 1752141561
|
||||
m_assetChangeTS: 1752149790
|
||||
m_fileInfoReadTS: 1752149952
|
||||
m_fileWriteTS: 1752149790
|
||||
m_cachefileWriteTS: 1752149790
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: bf2edee5c58d82540a51f03df9d42094
|
||||
@@ -27273,10 +27273,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 3642
|
||||
m_assetChangeTS: 1752141561
|
||||
m_fileInfoReadTS: 1752141709
|
||||
m_fileWriteTS: 1752141561
|
||||
m_cachefileWriteTS: 1752141561
|
||||
m_assetChangeTS: 1752149790
|
||||
m_fileInfoReadTS: 1752149952
|
||||
m_fileWriteTS: 1752149790
|
||||
m_cachefileWriteTS: 1752149790
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: bf2edee5c58d82540a51f03df9d42094
|
||||
@@ -68418,15 +68418,15 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 2243
|
||||
m_assetChangeTS: 0
|
||||
m_fileInfoReadTS: 1750510511
|
||||
m_fileWriteTS: 1748660166
|
||||
m_cachefileWriteTS: 1748660166
|
||||
m_assetChangeTS: 1752156777
|
||||
m_fileInfoReadTS: 1752156778
|
||||
m_fileWriteTS: 1752156777
|
||||
m_cachefileWriteTS: 1752156777
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: fe87c0e1cc204ed48ad3b37840f39efc
|
||||
ids: 73000000
|
||||
- guid: 0b9510d2790829140953392aae2b6679
|
||||
- guid: f7876974a1b60ed4ca3dfd37f229386f
|
||||
ids: d5000000
|
||||
- guid: f4f4421f529503243bfef5076ae82512
|
||||
type: 2
|
||||
@@ -80957,15 +80957,15 @@ MonoBehaviour:
|
||||
ids: 73000000
|
||||
- guid: e581b946f0ff64cccafda0d2e8d76681
|
||||
type: 2
|
||||
m_fileInfoHash: 765.cs
|
||||
m_fileInfoHash: 945.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 765
|
||||
m_assetChangeTS: 0
|
||||
m_fileInfoReadTS: 1750510510
|
||||
m_fileWriteTS: 1744655573
|
||||
m_cachefileWriteTS: 1744655573
|
||||
m_fileSize: 945
|
||||
m_assetChangeTS: 1752158834
|
||||
m_fileInfoReadTS: 1752158848
|
||||
m_fileWriteTS: 1752158829
|
||||
m_cachefileWriteTS: 1752158829
|
||||
refreshStamp: 2
|
||||
UseGUIDsList: []
|
||||
- guid: e591aafff0492c94590cf9702f6c408f
|
||||
@@ -113059,15 +113059,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 48120e902e0734a51a10b8b4c0229afa
|
||||
type: 2
|
||||
m_fileInfoHash: 9066.cs
|
||||
m_fileInfoHash: 13059.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 9066
|
||||
m_assetChangeTS: 1752112782
|
||||
m_fileInfoReadTS: 1752112801
|
||||
m_fileWriteTS: 1752112778
|
||||
m_cachefileWriteTS: 1752112778
|
||||
m_fileSize: 13059
|
||||
m_assetChangeTS: 1752156805
|
||||
m_fileInfoReadTS: 1752156822
|
||||
m_fileWriteTS: 1752156621
|
||||
m_cachefileWriteTS: 1752156621
|
||||
refreshStamp: 2
|
||||
UseGUIDsList: []
|
||||
- guid: 4822e5675c12bf14d93b254d27ec8bd7
|
||||
@@ -126382,15 +126382,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 49f2af6ffb61a4145ab7ed3d0873b6a2
|
||||
type: 5
|
||||
m_fileInfoHash: 9753.prefab
|
||||
m_fileInfoHash: 9474.prefab
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 9753
|
||||
m_assetChangeTS: 0
|
||||
m_fileInfoReadTS: 1750510505
|
||||
m_fileWriteTS: 1742680962
|
||||
m_cachefileWriteTS: 1742680962
|
||||
m_fileSize: 9474
|
||||
m_assetChangeTS: 1752159075
|
||||
m_fileInfoReadTS: 1752159076
|
||||
m_fileWriteTS: 1752159075
|
||||
m_cachefileWriteTS: 1752159075
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: f4688fdb7df04437aeb418b961361dc5
|
||||
@@ -143520,15 +143520,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 7ab6cd8f9a2e77c49a158e16014f9cec
|
||||
type: 9
|
||||
m_fileInfoHash: 2189130.json
|
||||
m_fileInfoHash: 2483039.json
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 2189130
|
||||
m_assetChangeTS: 1752140763
|
||||
m_fileInfoReadTS: 1752140787
|
||||
m_fileWriteTS: 1752140672
|
||||
m_cachefileWriteTS: 1752140672
|
||||
m_fileSize: 2483039
|
||||
m_assetChangeTS: 1752160831
|
||||
m_fileInfoReadTS: 1752160846
|
||||
m_fileWriteTS: 1752160748
|
||||
m_cachefileWriteTS: 1752160748
|
||||
refreshStamp: 2
|
||||
UseGUIDsList: []
|
||||
- guid: 7af6ac3e6b51b8d4aab04adc85b8de2f
|
||||
@@ -157654,10 +157654,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 3649
|
||||
m_assetChangeTS: 1752141561
|
||||
m_fileInfoReadTS: 1752141709
|
||||
m_fileWriteTS: 1752141561
|
||||
m_cachefileWriteTS: 1752141561
|
||||
m_assetChangeTS: 1752149790
|
||||
m_fileInfoReadTS: 1752149952
|
||||
m_fileWriteTS: 1752149790
|
||||
m_cachefileWriteTS: 1752149790
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: bf2edee5c58d82540a51f03df9d42094
|
||||
@@ -193383,10 +193383,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 9628
|
||||
m_assetChangeTS: 1752141270
|
||||
m_fileInfoReadTS: 1752141435
|
||||
m_fileWriteTS: 1752141270
|
||||
m_cachefileWriteTS: 1752141270
|
||||
m_assetChangeTS: 1752149790
|
||||
m_fileInfoReadTS: 1752149952
|
||||
m_fileWriteTS: 1752149790
|
||||
m_cachefileWriteTS: 1752149790
|
||||
refreshStamp: 2
|
||||
UseGUIDsList:
|
||||
- guid: fe393ace9b354375a9cb14cdbbc28be4
|
||||
@@ -217256,15 +217256,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 0fcb60107ebf5574aa5fe168f6e3978e
|
||||
type: 9
|
||||
m_fileInfoHash: 2481725.json
|
||||
m_fileInfoHash: 2482335.json
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 2481725
|
||||
m_assetChangeTS: 1752149701
|
||||
m_fileInfoReadTS: 1752149704
|
||||
m_fileWriteTS: 1752149663
|
||||
m_cachefileWriteTS: 1752149663
|
||||
m_fileSize: 2482335
|
||||
m_assetChangeTS: 1752158061
|
||||
m_fileInfoReadTS: 1752158082
|
||||
m_fileWriteTS: 1752157122
|
||||
m_cachefileWriteTS: 1752157122
|
||||
refreshStamp: 2
|
||||
UseGUIDsList: []
|
||||
- guid: a343a8560a860bf4188c8f63103f455a
|
||||
@@ -219589,15 +219589,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 2312c9a28a322f445b6a61d3c72a9d26
|
||||
type: 2
|
||||
m_fileInfoHash: 9647.cs
|
||||
m_fileInfoHash: 12322.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 9647
|
||||
m_assetChangeTS: 1751998927
|
||||
m_fileInfoReadTS: 1751998937
|
||||
m_fileWriteTS: 1751998924
|
||||
m_cachefileWriteTS: 1751998924
|
||||
m_fileSize: 12322
|
||||
m_assetChangeTS: 1752161183
|
||||
m_fileInfoReadTS: 1752161196
|
||||
m_fileWriteTS: 1752161132
|
||||
m_cachefileWriteTS: 1752161132
|
||||
refreshStamp: 2
|
||||
UseGUIDsList: []
|
||||
- guid: 73c1a62e4b1e48c40a2e3ec311bda4da
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -185,8 +185,8 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
title: {fileID: 4146383444293307128}
|
||||
canvasGroup: {fileID: 0}
|
||||
parameterName:
|
||||
isAlwaysUpdated: 0
|
||||
text: {fileID: 1511802765271541473}
|
||||
--- !u!1 &4303436613740383453
|
||||
GameObject:
|
||||
@@ -220,9 +220,9 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2546924885880613247}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0.0000076293945, y: -17.5}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -67.5}
|
||||
m_SizeDelta: {x: 220, y: 65}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8091948658150366110
|
||||
@@ -253,7 +253,13 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: (1,2,3,4)
|
||||
m_text: '(1,2,3,4)111111111111111111111111111111111111111111
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
111'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
@@ -280,15 +286,15 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 15
|
||||
m_fontSize: 15
|
||||
m_fontSizeBase: 32
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 15
|
||||
m_fontSizeMax: 36
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
@@ -296,7 +302,7 @@ MonoBehaviour:
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_enableWordWrapping: 0
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
|
||||
@@ -65,7 +65,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 0b9510d2790829140953392aae2b6679, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: f7876974a1b60ed4ca3dfd37f229386f, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
||||
@@ -12,12 +12,15 @@ namespace Ichni.Editor
|
||||
public class DynamicUIHintText : DynamicUIElement
|
||||
{
|
||||
public TMP_Text text;
|
||||
|
||||
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
|
||||
{
|
||||
base.Initialize(baseElement, title, parameterName);
|
||||
}
|
||||
public void SetContent(string content)
|
||||
{
|
||||
text.text = content;
|
||||
}
|
||||
|
||||
|
||||
public void SetUpdatingContent(Func<string> content)
|
||||
{
|
||||
Observable.EveryUpdate().Subscribe(_ => text.text = content()).AddTo(gameObject);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -19,14 +21,14 @@ namespace Ichni.RhythmGame
|
||||
public List<float> blendSpeedList;
|
||||
public List<float> blendTimeList;
|
||||
public int currentSkyboxIndex = 0;
|
||||
|
||||
|
||||
public List<string> themeBundleListForSelection;
|
||||
public List<string> skyboxNameListForSelection;
|
||||
public string selectedThemeBundle;
|
||||
public string selectedSkybox;
|
||||
|
||||
|
||||
public static SkyboxSubsetter GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, List<string> themeBundleList,List<string> skyboxList,
|
||||
bool isFirstGenerated, GameElement parentElement, List<string> themeBundleList, List<string> skyboxList,
|
||||
List<float> blendTimeList, List<float> blendSpeedList)
|
||||
{
|
||||
SkyboxSubsetter skyboxSubsetter = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
@@ -63,7 +65,7 @@ namespace Ichni.RhythmGame
|
||||
skyboxBlender.makeFirstMaterialSkybox = true;
|
||||
skyboxBlender.InspectorAndAwakeChanges();
|
||||
}
|
||||
|
||||
|
||||
private void AddSkybox(string skyboxThemeBundleName, string skyboxObjectName)
|
||||
{
|
||||
Material skybox = ThemeBundleManager.instance.GetObject<Material>(skyboxThemeBundleName, skyboxObjectName);
|
||||
@@ -75,7 +77,7 @@ namespace Ichni.RhythmGame
|
||||
skyboxBlender.skyboxMaterials.Add(skybox);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (skyBoxThemeBundleList.Count > 1)
|
||||
@@ -88,17 +90,17 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
float startTime = index == 0 ? -delay : blendTimeList[index - 1];
|
||||
float endTime = index >= blendTimeList.Count ? finalTime : blendTimeList[index];
|
||||
if(songTime >= startTime && songTime < endTime && currentSkyboxIndex != index)
|
||||
if (songTime >= startTime && songTime < endTime && currentSkyboxIndex != index)
|
||||
{
|
||||
currentSkyboxIndex = index;
|
||||
if(currentSkyboxIndex != 0) skyboxBlender.blendSpeed = blendSpeedList[currentSkyboxIndex - 1];
|
||||
if (currentSkyboxIndex != 0) skyboxBlender.blendSpeed = blendSpeedList[currentSkyboxIndex - 1];
|
||||
skyboxBlender.Blend(currentSkyboxIndex, false);
|
||||
DynamicGI.UpdateEnvironment();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new SkyboxSubsetter_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
@@ -112,28 +114,82 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
|
||||
var container = inspector.GenerateContainer("Skybox Subsetter");
|
||||
DynamicUISubcontainer mainSettings = container.GenerateSubcontainer(3);
|
||||
|
||||
|
||||
var blendSpeedListButton = inspector.GenerateButton(this, mainSettings, "Blend Speed List", () =>
|
||||
{
|
||||
inspector.GenerateCompositeParameterWindow(this, "Blend Speed List", nameof(blendSpeedList))
|
||||
.SetAsFloatList();
|
||||
});
|
||||
|
||||
|
||||
var blendTimeListButton = inspector.GenerateButton(this, mainSettings, "Blend Time List", () =>
|
||||
{
|
||||
inspector.GenerateCompositeParameterWindow(this, "Blend Time List", nameof(blendTimeList))
|
||||
.SetAsFloatList();
|
||||
});
|
||||
|
||||
|
||||
DynamicUISubcontainer materialSettings = container.GenerateSubcontainer(3);
|
||||
// 新增:显示skybox配置情况//这他妈是什么
|
||||
|
||||
DynamicUISubcontainer Textsettings = container.GenerateSubcontainer(2);
|
||||
for (int i = 0; i < (skyBoxThemeBundleList?.Count ?? 0); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 安全访问元素:检查索引是否在所有列表的有效范围内
|
||||
string bundleName = i < skyBoxThemeBundleList.Count ? skyBoxThemeBundleList[i] : "<Missing Bundle>";
|
||||
string name = i < skyboxNameList.Count ? skyboxNameList[i] : "<Missing Name>";
|
||||
|
||||
inspector.GenerateHintText(this, Textsettings, $"{i + 1}. [{bundleName}] {name}\n");
|
||||
|
||||
// 创建局部变量解决闭包问题
|
||||
int index = i;
|
||||
inspector.GenerateButton(this, Textsettings, "Remove Skybox", () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 移除前检查所有列表的索引有效性
|
||||
if (index < skyBoxThemeBundleList.Count)
|
||||
skyBoxThemeBundleList.RemoveAt(index);
|
||||
else
|
||||
Debug.LogError($"Cannot remove: skyBoxThemeBundleList index {index} out of range");
|
||||
|
||||
if (index < skyboxNameList.Count)
|
||||
skyboxNameList.RemoveAt(index);
|
||||
else
|
||||
Debug.LogError($"Cannot remove: skyboxNameList index {index} out of range");
|
||||
|
||||
if (index < skyboxMaterialList.Count)
|
||||
skyboxMaterialList.RemoveAt(index);
|
||||
else
|
||||
Debug.LogError($"Cannot remove: skyboxMaterialList index {index} out of range");
|
||||
|
||||
if (index < skyboxBlender.skyboxMaterials.Count)
|
||||
skyboxBlender.skyboxMaterials.RemoveAt(index);
|
||||
else
|
||||
Debug.LogError($"Cannot remove: skyboxMaterials index {index} out of range");
|
||||
|
||||
inspectorMain.SetInspector(this);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"Error during removal: {ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"Error generating UI for index {i}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log((mainSettings == null) + " " + (themeBundleListForSelection == null) + " " + (selectedThemeBundle == null));
|
||||
var themeBundleDropdown =
|
||||
var themeBundleDropdown =
|
||||
inspector.GenerateDropdown(this, materialSettings, "Theme Bundle", themeBundleListForSelection, nameof(selectedThemeBundle))
|
||||
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||
|
||||
|
||||
if (selectedThemeBundle != String.Empty && ThemeBundleManager.instance.TryGetThemeBundle(selectedThemeBundle, out ThemeBundle themeBundle))
|
||||
{
|
||||
skyboxNameListForSelection = themeBundle.assetList_Material.ConvertAll(x => x.name);
|
||||
@@ -143,14 +199,16 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
var objectNameDropdown =
|
||||
var objectNameDropdown =
|
||||
inspector.GenerateDropdown(this, materialSettings, "Material Name", new List<string>(), nameof(selectedSkybox));
|
||||
objectNameDropdown.dropdown.interactable = false;
|
||||
} // 如果没有选择主题包,则材质名称下拉框不可用
|
||||
|
||||
|
||||
var setMaterialButton = inspector.GenerateButton(this, materialSettings, "Add Skybox", () =>
|
||||
{
|
||||
AddSkybox(selectedThemeBundle, selectedSkybox);
|
||||
inspectorMain.SetInspector(this);
|
||||
|
||||
});
|
||||
|
||||
if (selectedThemeBundle == String.Empty || selectedSkybox == String.Empty)
|
||||
@@ -171,11 +229,11 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public SkyboxSubsetter_BM()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SkyboxSubsetter_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
List<string> skyBoxThemeBundleList, List<string> skyboxNameList, List<float> blendTimeList, List<float> blendSpeedList)
|
||||
List<string> skyBoxThemeBundleList, List<string> skyboxNameList, List<float> blendTimeList, List<float> blendSpeedList)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.skyBoxThemeBundleList = skyBoxThemeBundleList;
|
||||
@@ -183,7 +241,7 @@ namespace Ichni.RhythmGame
|
||||
this.blendTimeList = blendTimeList;
|
||||
this.blendSpeedList = blendSpeedList;
|
||||
}
|
||||
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = SkyboxSubsetter.GenerateElement(elementName, elementGuid, tags, false,
|
||||
|
||||
@@ -13,6 +13,10 @@ namespace Ichni.RhythmGame
|
||||
public TrailRenderer trailRenderer { get; set; }
|
||||
public Material renderMaterial;
|
||||
|
||||
// Add these fields for material selection in inspector
|
||||
public string materialThemeBundleName;
|
||||
public string materialName;
|
||||
|
||||
public float visibleTimeLength;
|
||||
public bool isAutoOrient;
|
||||
public float widthMultiplier;
|
||||
@@ -58,6 +62,18 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
}
|
||||
|
||||
// 新增:通过主题包名和材质名获取材质的方法
|
||||
public Material GetMaterialFromThemeBundle()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(materialThemeBundleName) && !string.IsNullOrEmpty(materialName))
|
||||
{
|
||||
var mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
if (mat != null)
|
||||
return mat;
|
||||
}
|
||||
return EditorManager.instance.basePrefabs.defaultTrailMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Trail
|
||||
@@ -65,7 +81,7 @@ namespace Ichni.RhythmGame
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Trail_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, renderMaterial, gradient);
|
||||
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, materialThemeBundleName, materialName, gradient);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
@@ -95,6 +111,44 @@ namespace Ichni.RhythmGame
|
||||
widthCurveWindow.closeButton.onClick.AddListener(() => trailRenderer.widthCurve = widthCurve);
|
||||
});
|
||||
|
||||
// ----------- 新增:材质设置 -----------
|
||||
var materialSettings = container.GenerateSubcontainer(3);
|
||||
|
||||
// 主题包下拉框
|
||||
if (ThemeBundleManager.instance != null)
|
||||
{
|
||||
var themeBundleDropdown = inspector
|
||||
.GenerateDropdown(this, materialSettings, "Theme Bundle", ThemeBundleManager.instance.selectedThemeBundleList, "materialThemeBundleName")
|
||||
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||
// 材质名下拉框
|
||||
if (!string.IsNullOrEmpty(materialThemeBundleName) && ThemeBundleManager.instance.TryGetThemeBundle(materialThemeBundleName, out ThemeBundle themeBundle))
|
||||
{
|
||||
List<string> materialNameList = themeBundle.assetList_Material.ConvertAll(x => x.name);
|
||||
var objectNameDropdown = inspector.GenerateDropdown(this, materialSettings, "Material Name", materialNameList, "materialName")
|
||||
.AddListenerFunction(() => inspectorMain.SetInspector(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
var objectNameDropdown = inspector.GenerateDropdown(this, materialSettings, "Material Name", new List<string>(), "materialName");
|
||||
objectNameDropdown.dropdown.interactable = false;
|
||||
}
|
||||
// 应用材质按钮
|
||||
var applyMaterialButton = inspector.GenerateButton(this, materialSettings, "Apply Material", () =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(materialThemeBundleName) && !string.IsNullOrEmpty(materialName))
|
||||
{
|
||||
Material mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
if (mat != null)
|
||||
{
|
||||
renderMaterial = mat;
|
||||
if (trailRenderer != null)
|
||||
trailRenderer.material = renderMaterial;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// ----------- 材质设置结束 -----------
|
||||
|
||||
var colorSettings = container.GenerateSubcontainer(3);
|
||||
var gradientColorKeysButton = inspector.GenerateButton(this, colorSettings, "Gradient Color Keys", () =>
|
||||
{
|
||||
@@ -170,6 +224,8 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public float visibleTimeLength;
|
||||
public string renderMaterialName;
|
||||
public string materialThemeBundleName; // 新增
|
||||
public string materialName; // 新增
|
||||
public bool isAutoOrient;
|
||||
public float widthMultiplier;
|
||||
public AnimationCurve widthCurve;
|
||||
@@ -182,11 +238,14 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public Trail_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
|
||||
AnimationCurve widthCurve, Material renderMaterial, Gradient gradient) : base(elementName, elementGuid, tags,
|
||||
AnimationCurve widthCurve, string materialThemeBundleName, string materialName, Gradient gradient) : base(elementName, elementGuid, tags,
|
||||
attachedElement)
|
||||
{
|
||||
this.visibleTimeLength = visibleTimeLength;
|
||||
this.renderMaterialName = renderMaterial.name;
|
||||
// 新增:保存主题包名和材质名
|
||||
this.materialThemeBundleName = materialThemeBundleName;
|
||||
this.materialName = materialName;
|
||||
|
||||
this.isAutoOrient = isAutoOrient;
|
||||
this.widthMultiplier = widthMultiplier;
|
||||
this.widthCurve = widthCurve;
|
||||
@@ -195,16 +254,28 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
// 新增:根据bm里的主题包名和材质名获取材质
|
||||
Material mat = null;
|
||||
if (!string.IsNullOrEmpty(materialThemeBundleName) && !string.IsNullOrEmpty(materialName))
|
||||
{
|
||||
mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
}
|
||||
matchedElement = Trail.GenerateElement(elementName, elementGuid, tags,
|
||||
false, GetElement(attachedElementGuid),
|
||||
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, gradient);
|
||||
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, gradient, mat);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
// 新增:根据bm里的主题包名和材质名获取材质
|
||||
Material mat = null;
|
||||
if (!string.IsNullOrEmpty(materialThemeBundleName) && !string.IsNullOrEmpty(materialName))
|
||||
{
|
||||
mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
}
|
||||
return Trail.GenerateElement(elementName, Guid.NewGuid(), tags,
|
||||
false, parent, visibleTimeLength,
|
||||
isAutoOrient, widthMultiplier, widthCurve, gradient);
|
||||
isAutoOrient, widthMultiplier, widthCurve, gradient, mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -884,7 +884,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -1397,7 +1399,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "departure_to_multiverse",
|
||||
"materialName" : "EnergyTrail0",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -1910,7 +1914,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -63528,6 +63534,12 @@
|
||||
"startTime" : 28.8,
|
||||
"endTime" : 32,
|
||||
"animationCurveType" : 0
|
||||
},{
|
||||
"startValue" : 0,
|
||||
"endValue" : 1,
|
||||
"startTime" : 28.8,
|
||||
"endTime" : 32,
|
||||
"animationCurveType" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -63615,7 +63627,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -63699,7 +63713,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -72588,7 +72604,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -72815,7 +72833,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -73042,7 +73062,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
@@ -73269,7 +73291,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Trail_BM,Assembly-CSharp",
|
||||
"visibleTimeLength" : 1,
|
||||
"renderMaterialName" : "DefaultTrailMaterial",
|
||||
"renderMaterialName" : null,
|
||||
"materialThemeBundleName" : "",
|
||||
"materialName" : "",
|
||||
"isAutoOrient" : true,
|
||||
"widthMultiplier" : 1,
|
||||
"widthCurve" : {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user