Signed-off-by: TRAfoer <lhf190@outlook.com>

This commit is contained in:
2025-07-10 11:22:04 +08:00
parent 5eb85505e4
commit 66b1b30929
9 changed files with 192 additions and 145 deletions

View File

@@ -49,10 +49,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 26252
m_assetChangeTS: 1752070946
m_fileInfoReadTS: 1752071040
m_fileWriteTS: 1752070946
m_cachefileWriteTS: 1752070946
m_assetChangeTS: 1752117412
m_fileInfoReadTS: 1752117415
m_fileWriteTS: 1752117411
m_cachefileWriteTS: 1752117411
refreshStamp: 4
UseGUIDsList:
- guid: fc6c02e75b66345c29e8a25e2e2bda9c
@@ -11523,10 +11523,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 3645
m_assetChangeTS: 1752071178
m_fileInfoReadTS: 1752071266
m_fileWriteTS: 1752071178
m_cachefileWriteTS: 1752071178
m_assetChangeTS: 1752117436
m_fileInfoReadTS: 1752117585
m_fileWriteTS: 1752117436
m_cachefileWriteTS: 1752117436
refreshStamp: 4
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -27275,10 +27275,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 3642
m_assetChangeTS: 1752071178
m_fileInfoReadTS: 1752071266
m_fileWriteTS: 1752071178
m_cachefileWriteTS: 1752071178
m_assetChangeTS: 1752117436
m_fileInfoReadTS: 1752117585
m_fileWriteTS: 1752117436
m_cachefileWriteTS: 1752117436
refreshStamp: 4
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -32070,15 +32070,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: 42c83e2f698b543f98d2cfcfb1ac5228
type: 2
m_fileInfoHash: 8549.cs
m_fileInfoHash: 8587.cs
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 8549
m_assetChangeTS: 1752050328
m_fileInfoReadTS: 1752050344
m_fileWriteTS: 1752050326
m_cachefileWriteTS: 1752050326
m_fileSize: 8587
m_assetChangeTS: 1752113994
m_fileInfoReadTS: 1752114008
m_fileWriteTS: 1752113991
m_cachefileWriteTS: 1752113991
refreshStamp: 4
UseGUIDsList: []
- guid: 42f876c7bad484946a19cce672fc2ff4
@@ -59022,15 +59022,15 @@ MonoBehaviour:
ids: d5000000
- guid: 44e8d6dab1446644688189717537509a
type: 9
m_fileInfoHash: 24025.shader
m_fileInfoHash: 24053.shader
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 24025
m_assetChangeTS: 1752040192
m_fileInfoReadTS: 1752040290
m_fileWriteTS: 1752040191
m_cachefileWriteTS: 1752040191
m_fileSize: 24053
m_assetChangeTS: 1752114657
m_fileInfoReadTS: 1752114658
m_fileWriteTS: 1752114655
m_cachefileWriteTS: 1752114655
refreshStamp: 4
UseGUIDsList: []
- guid: 44e8ffd026f750849aedc675e8b89c89
@@ -113061,15 +113061,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: 48120e902e0734a51a10b8b4c0229afa
type: 2
m_fileInfoHash: 7736.cs
m_fileInfoHash: 9066.cs
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 7736
m_assetChangeTS: 0
m_fileInfoReadTS: 1750510507
m_fileWriteTS: 1749926621
m_cachefileWriteTS: 1749926621
m_fileSize: 9066
m_assetChangeTS: 1752112782
m_fileInfoReadTS: 1752112801
m_fileWriteTS: 1752112778
m_cachefileWriteTS: 1752112778
refreshStamp: 4
UseGUIDsList: []
- guid: 4822e5675c12bf14d93b254d27ec8bd7
@@ -143522,15 +143522,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: 7ab6cd8f9a2e77c49a158e16014f9cec
type: 9
m_fileInfoHash: 2189235.json
m_fileInfoHash: 2189104.json
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 2189235
m_assetChangeTS: 1752050049
m_fileInfoReadTS: 1752050067
m_fileWriteTS: 1752050027
m_cachefileWriteTS: 1752050027
m_fileSize: 2189104
m_assetChangeTS: 1752111614
m_fileInfoReadTS: 1752111646
m_fileWriteTS: 1752111496
m_cachefileWriteTS: 1752111496
refreshStamp: 4
UseGUIDsList: []
- guid: 7af6ac3e6b51b8d4aab04adc85b8de2f
@@ -157658,10 +157658,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 3649
m_assetChangeTS: 1752071178
m_fileInfoReadTS: 1752071266
m_fileWriteTS: 1752071178
m_cachefileWriteTS: 1752071178
m_assetChangeTS: 1752117436
m_fileInfoReadTS: 1752117585
m_fileWriteTS: 1752117436
m_cachefileWriteTS: 1752117436
refreshStamp: 4
UseGUIDsList:
- guid: bf2edee5c58d82540a51f03df9d42094
@@ -162706,15 +162706,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: eb907071d10d7324995ff3aefbc2f1df
type: 2
m_fileInfoHash: 12153.cs
m_fileInfoHash: 12210.cs
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 12153
m_assetChangeTS: 1752036723
m_fileInfoReadTS: 1752036733
m_fileWriteTS: 1752036681
m_cachefileWriteTS: 1752036681
m_fileSize: 12210
m_assetChangeTS: 1752114731
m_fileInfoReadTS: 1752114746
m_fileWriteTS: 1752114727
m_cachefileWriteTS: 1752114727
refreshStamp: 4
UseGUIDsList: []
- guid: eba09c7fb206e1b47b85a4ffce19e895
@@ -169554,15 +169554,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: 6c12bb7674cd5416f8d846e62018a96d
type: 2
m_fileInfoHash: 1933.cs
m_fileInfoHash: 1943.cs
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 1933
m_assetChangeTS: 1750597263
m_fileInfoReadTS: 1750597270
m_fileWriteTS: 1750597147
m_cachefileWriteTS: 1750597147
m_fileSize: 1943
m_assetChangeTS: 1752112782
m_fileInfoReadTS: 1752112801
m_fileWriteTS: 1752112496
m_cachefileWriteTS: 1752112496
refreshStamp: 4
UseGUIDsList: []
- guid: 6c52483422841154a88cf13e132c0252
@@ -193387,10 +193387,10 @@ MonoBehaviour:
m_addressable:
m_atlas:
m_fileSize: 9628
m_assetChangeTS: 1752070946
m_fileInfoReadTS: 1752071040
m_fileWriteTS: 1752070946
m_cachefileWriteTS: 1752070946
m_assetChangeTS: 1752117436
m_fileInfoReadTS: 1752117585
m_fileWriteTS: 1752117436
m_cachefileWriteTS: 1752117436
refreshStamp: 4
UseGUIDsList:
- guid: fe393ace9b354375a9cb14cdbbc28be4
@@ -199562,15 +199562,15 @@ MonoBehaviour:
UseGUIDsList: []
- guid: aee0e6022210846a7bd6e0e20af73e3f
type: 2
m_fileInfoHash: 6731.cs
m_fileInfoHash: 6894.cs
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 6731
m_assetChangeTS: 0
m_fileInfoReadTS: 1750510485
m_fileWriteTS: 1746066075
m_cachefileWriteTS: 1746066075
m_fileSize: 6894
m_assetChangeTS: 1752110777
m_fileInfoReadTS: 1752110799
m_fileWriteTS: 1752110775
m_cachefileWriteTS: 1752110775
refreshStamp: 4
UseGUIDsList: []
- guid: ae31a855334ecf64f848ae8e0b4e5a24
@@ -219547,21 +219547,23 @@ MonoBehaviour:
UseGUIDsList: []
- guid: 7c10da0d74d78364bac94506d77290bf
type: 5
m_fileInfoHash: 2801.mat
m_fileInfoHash: 2835.mat
m_assetbundle:
m_addressable:
m_atlas:
m_fileSize: 2801
m_assetChangeTS: 1752051116
m_fileInfoReadTS: 1752051329
m_fileWriteTS: 1752051115
m_cachefileWriteTS: 1752051115
m_fileSize: 2835
m_assetChangeTS: 1752117412
m_fileInfoReadTS: 1752117415
m_fileWriteTS: 1752117411
m_cachefileWriteTS: 1752117411
refreshStamp: 4
UseGUIDsList:
- guid: 06e8da9b2b26f09459e8a93e84b2e0c9
ids: 30000000
- guid: f7cb012c92543074491a665c761d51dc
ids: 59000000
- guid: 7ba462c2dc80b544eacfdc537aab22c6
ids: 59000000
- guid: 9c45cdb2bfece1848a36238ef1c265be
type: 2
m_fileInfoHash: 736.cs

View File

@@ -46,6 +46,12 @@ namespace Ichni.Editor
}
private void DetectSetRange()
{
if (Keyboard.current.spaceKey.wasPressedThisFrame)
{
EditorManager.instance.musicPlayer.PlayMusic();
}
if (Mouse.current.scroll.ReadValue().y != 0)
{

View File

@@ -181,7 +181,7 @@ namespace Ichni.RhythmGame
return;
}
}
currentAnimationIndex = 0;
return;
}

View File

@@ -20,6 +20,11 @@ namespace Ichni.RhythmGame
public Gradient gradient;
public TransformSubmodule transformSubmodule { get; set; }
float IHaveTrail.visibleTimeLength
{
get => visibleTimeLength;
set => visibleTimeLength = value;
}
public static Trail GenerateElement(string name, Guid id, List<string> tags, bool isFirstGenerated,
GameElement parentElement, float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
@@ -121,11 +126,42 @@ namespace Ichni.RhythmGame
}
}
}
public static void FreezeAllTrails(bool freeze)
{
foreach (GameElement x in EditorManager.instance.beatmapContainer.gameElementList)
{
if (x is IHaveTrail t && t != null)
{
FreezeTrail(freeze, t);
}
}
}
public static void FreezeTrail(bool freeze, IHaveTrail trail)
{
if (!freeze)
{
UnfreezeTrail(trail);
return;
}
trail.trailRenderer.time = Mathf.Infinity; // 使现有轨迹永不消失
trail.trailRenderer.emitting = false; // 停止生成新轨迹点
}
// 解冻尾迹(恢复动态更新)
public static void UnfreezeTrail(IHaveTrail trail)
{
trail.trailRenderer.Clear(); // 清除当前冻结的轨迹
trail.trailRenderer.time = trail.visibleTimeLength; // 恢复原始持续时间
trail.trailRenderer.emitting = true; // 重新开始发射轨迹点
}
}
public interface IHaveTrail
{
TrailRenderer trailRenderer { get; set; }
float visibleTimeLength { get; set; }
}
namespace Beatmap

View File

@@ -31,9 +31,13 @@ namespace Ichni.Editor
{
isPlaying = !isPlaying;
Trail.SetAllTrails(true, false);
EditorManager.instance.songInformation.songTime = audioSource.time;
if (isPlaying) audioSource.Play();
if (isPlaying)
{
Trail.FreezeAllTrails(!isPlaying);
audioSource.Play();
}
else PauseMusic();
}
public IEnumerator PlayBackMusic()
@@ -48,15 +52,14 @@ namespace Ichni.Editor
public void PauseMusic()
{
isPlaying = false;
Trail.SetAllTrails(false, false);
EditorManager.instance.songInformation.songTime = audioSource.time;
audioSource.Pause();
Trail.FreezeAllTrails(!isPlaying);
}
public void StopMusic()
{
isPlaying = false;
Trail.SetAllTrails(false, true);
EditorManager.instance.songInformation.songTime = 0;
audioSource.Stop();
EditorManager.instance.uiManager.timeline.timePointerModule.SetRange(0);

View File

@@ -604,15 +604,15 @@ Shader "Soullies/TrackShader"
}
/*ASEBEGIN
Version=19501
Node;AmplifyShaderEditor.SamplerNode;6;-992,-272;Inherit;True;Property;_MainTexture;MainTexture;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.SamplerNode;6;-992,-272;Inherit;True;Property;_MainTexture;MainTexture;0;0;Create;True;0;0;0;False;0;False;-1;None;fe0f51232d3c144e98a40dcef497dca2;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.BreakToComponentsNode;10;-672,-272;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.StaticSwitch;28;-496,-160;Inherit;False;Property;_UseRedAsAlpha;UseRedAsAlpha;3;0;Create;True;0;0;0;False;0;False;0;1;0;True;;Toggle;2;Key0;Key1;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;20;-80,208;Inherit;False;Property;_EmissionColor;EmissionColor;2;1;[HDR];Create;True;0;0;0;False;0;False;0,0,0,0;1,1,1,2;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.StaticSwitch;28;-496,-160;Inherit;False;Property;_UseRedAsAlpha;UseRedAsAlpha;3;0;Create;True;0;0;0;False;0;False;0;1;1;True;;Toggle;2;Key0;Key1;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;20;-80,208;Inherit;False;Property;_EmissionColor;EmissionColor;2;1;[HDR];Create;True;0;0;0;False;0;False;0,0,0,0;2,2,2,1;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.ColorNode;52;-80,16;Inherit;False;Constant;_Color0;Color 0;6;0;Create;True;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.ColorNode;8;-368,-16;Inherit;False;Property;_BaseColor;BaseColor;1;0;Create;True;0;0;0;False;0;False;0,0,0,0;1,1,1,1;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
Node;AmplifyShaderEditor.DynamicAppendNode;13;-192,-272;Inherit;False;COLOR;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;14;-16,-192;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.StaticSwitch;31;192,-16;Inherit;False;Property;_Emission;Emission;4;0;Create;True;0;0;0;False;0;False;0;0;0;True;;Toggle;2;Key0;Key1;Create;True;True;All;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.StaticSwitch;31;192,-16;Inherit;False;Property;_Emission;Emission;4;0;Create;True;0;0;0;False;0;False;0;0;1;True;;Toggle;2;Key0;Key1;Create;True;True;All;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;416,-144;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;51;-992,-64;Inherit;False;Property;_ZWrite;ZWrite;5;1;[Toggle];Create;True;0;0;0;True;0;False;1;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;46;704,-160;Float;False;True;-1;2;ASEMaterialInspector;0;15;Soullies/TrackShader;cf964e524c8e69742b1d21fbe2ebcc4a;True;Sprite Unlit;0;0;Sprite Unlit;4;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;3;True;12;all;0;False;True;2;5;False;;10;False;;3;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;1;True;_ZWrite;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;3;Vertex Position;1;0;Debug Display;0;0;External Alpha;0;0;0;4;True;True;True;True;False;;False;0
@@ -634,4 +634,4 @@ WireConnection;21;0;14;0
WireConnection;21;1;31;0
WireConnection;46;1;21;0
ASEEND*/
//CHKSM=EA604D256C238DFBFBF20BE7874E9FB8B5287D43
//CHKSM=E65F973E568AE6F4B05686DB263B5CECCFE0746C

View File

@@ -64,7 +64,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex:
m_Texture: {fileID: 0}
m_Texture: {fileID: 8900000, guid: 7ba462c2dc80b544eacfdc537aab22c6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex2:
@@ -96,6 +96,6 @@ Material:
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Tint: {r: 0.39999998, g: 0.39999998, b: 0.39999998, a: 0.5}
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
- _Tint2: {r: 0.39999998, g: 0.39999998, b: 0.39999998, a: 0.5}
m_BuildTextureStacks: []

View File

@@ -2987,6 +2987,12 @@
"startTime" : 46.8000031,
"endTime" : 48,
"animationCurveType" : 1
},{
"startValue" : 0,
"endValue" : 180,
"startTime" : 56.4,
"endTime" : 57.6,
"animationCurveType" : 3
}
]
},
@@ -65532,6 +65538,18 @@
"startTime" : 28.8,
"endTime" : 32,
"animationCurveType" : 0
},{
"startValue" : 0,
"endValue" : 1,
"startTime" : 28.8,
"endTime" : 32,
"animationCurveType" : 0
},{
"startValue" : 0,
"endValue" : 1,
"startTime" : 28.8,
"endTime" : 32,
"animationCurveType" : 0
}
]
},
@@ -78683,30 +78701,6 @@
"attachedElementGuid" : {
"value" : "78202e41-44cf-4314-9ee9-8edee92c664a"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.SkyboxSubsetter_BM,Assembly-CSharp",
"skyBoxThemeBundleList" : [
"departure_to_multiverse"
],
"skyboxNameList" : [
"DTM_Particle_SquareFilled"
],
"blendTimeList" : [
20
],
"blendSpeedList" : [
1
],
"elementName" : "New Skybox Subsetter",
"tags" : [
],
"elementGuid" : {
"value" : "171a976f-7b7d-4ccf-a766-9587ef8c9da7"
},
"attachedElementGuid" : {
"value" : "044b34e9-31c8-40a8-8eb1-d5f744f8f295"
}
}
],
"attachedElementGuid" : {

View File

@@ -16,35 +16,40 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
public GameObject headPoint, headCircle;
public GameObject trailBody;
public bool isHeadEnabled;
public List<Renderer> renderers;
public ParticleSystem headCircleParticle;
public TrailRenderer trailRenderer { get; set; }
public FlexibleFloat visibleTimeLength;
public FlexibleBool enableTimes;
public float enableProcessTime = 0.5f;
public float headSize = 1f;
public FlexibleFloat headRotateSpeed;
float IHaveTrail.visibleTimeLength
{
get => visibleTimeLength.animations.Count > 0 ? visibleTimeLength.value : 5f;
set => visibleTimeLength.value = value;
}
public override bool haveEmissionColor => true;
public static DTMTrail GenerateElement(string elementName, Guid id, List<string> tags,
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
bool isStatic, FlexibleFloat visibleTimeLength, FlexibleBool enableTimes, FlexibleFloat headRotateSpeed, float enableProcessTime,
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
bool isStatic, FlexibleFloat visibleTimeLength, FlexibleBool enableTimes, FlexibleFloat headRotateSpeed, float enableProcessTime,
float headSize)
{
DTMTrail dtmTrail = EnvironmentObject.GenerateElement(elementName, id, tags,
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DTMTrail>();
dtmTrail.isHeadEnabled = false;
dtmTrail.visibleTimeLength = visibleTimeLength;
dtmTrail.enableTimes = enableTimes;
dtmTrail.headRotateSpeed = headRotateSpeed;
dtmTrail.enableProcessTime = enableProcessTime;
dtmTrail.headSize = headSize;
return dtmTrail;
}
@@ -64,7 +69,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
if (parentElement is TrackHeadPoint trackHeadPoint)
{
enableTimes.Add( new AnimatedBool(0f, false));
enableTimes.Add(new AnimatedBool(0f, false));
enableTimes.Add(new AnimatedBool(trackHeadPoint.trackTimeSubmoduleMovable.trackStartTime, true));
enableTimes.Add(new AnimatedBool(trackHeadPoint.trackTimeSubmoduleMovable.trackEndTime, false));
}
@@ -81,14 +86,14 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
rotationBySpeedModule.z = 0;
headPoint.transform.localScale = Vector3.zero;
headCircle.transform.localScale = Vector3.zero;
renderers.ForEach(rend => rend.InitializeShader());
}
public override void Refresh()
{
base.Refresh();
renderers.ForEach(rend =>
{
if (colorSubmodule.emissionEnabled)
@@ -100,13 +105,13 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
rend.material.DisableKeyword("_EMISSION_ON");
}
rend.material.EnableKeyword("_USEREDASALPHA_ON");
Debug.Log(rend.material.IsKeywordEnabled("_EMISSION_ON") + " " + rend.material.IsKeywordEnabled("_USEREDASALPHA_ON"));
rend.material.SetColor("_BaseColor", colorSubmodule.currentBaseColor);
rend.material.SetColor("_EmissionColor", colorSubmodule.GetCurrentEmissionColor());
rend.material.SetColor("_EmissionColor", colorSubmodule.GetCurrentEmissionColor());
});
}
@@ -114,24 +119,25 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
float songTime = EditorManager.instance.songInformation.songTime;
enableTimes.UpdateFlexibleBool(songTime);
if(enableTimes.value && !isHeadEnabled)
if (enableTimes.value && !isHeadEnabled)
{
EnableHead();
isHeadEnabled = true;
}
else if(!enableTimes.value && isHeadEnabled)
else if (!enableTimes.value && isHeadEnabled)
{
DisableHead();
isHeadEnabled = false;
}
visibleTimeLength.UpdateFlexibleFloat(songTime);
if (visibleTimeLength.animations.Count > 0)
if (visibleTimeLength.animations.Count > 0 && EditorManager.instance.musicPlayer.isPlaying)//为的是接口里头那个用来set的
{
Debug.Log(trailRenderer == null);
// Debug.Log(trailRenderer == null);
print($"TrailRenderer time set to {visibleTimeLength.value}");
trailRenderer.time = visibleTimeLength.value;
}
if (isHeadEnabled && headRotateSpeed.animations.Count > 0)
{
headRotateSpeed.UpdateFlexibleFloat(songTime);
@@ -154,27 +160,27 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
enableHeadSequence.PlayBackwards();
}
private Sequence enableHeadSequence;
private Sequence disableHeadSequence;
private Sequence headBounceSequence;
public void SetUpTweeners()
{
enableHeadSequence?.Kill(true);
disableHeadSequence?.Kill(true);
headBounceSequence?.Kill(true);
enableHeadSequence = DOTween.Sequence();
enableHeadSequence.Append(headPoint.transform.DOScale(headSize, enableProcessTime).SetEase(Ease.OutQuad));
enableHeadSequence.Join(headCircle.transform.DOScale(headSize, enableProcessTime).SetEase(Ease.OutQuad));
enableHeadSequence.SetAutoKill(false);
disableHeadSequence = DOTween.Sequence();
disableHeadSequence.Append(headPoint.transform.DOScale(0, enableProcessTime).SetEase(Ease.OutQuad));
disableHeadSequence.Join(headCircle.transform.DOScale(0, enableProcessTime).SetEase(Ease.OutQuad));
disableHeadSequence.SetAutoKill(false);
headBounceSequence = DOTween.Sequence();
headBounceSequence.Append(headPoint.transform.DOBlendableScaleBy(Vector3.one * 0.2f, 0.2f).SetEase(Ease.OutBack));
headBounceSequence.Join(headCircle.transform.DOBlendableScaleBy(Vector3.one * 0.2f, 0.2f).SetEase(Ease.OutBack));
@@ -188,7 +194,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
headBounceSequence.Restart();
}
}
public partial class DTMTrail
{
public override void SaveBM()
@@ -204,21 +210,21 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("DTMTrail");
var subcontainer = container.GenerateSubcontainer(3);
var visibleTimeLengthButton = inspector.GenerateButton(this, subcontainer, "Visible Time Length", () =>
{
var ew = inspector.GenerateCompositeParameterWindow(
this, "Visible Time Length", nameof(visibleTimeLength));
ew.SetAsFlexibleFloat();
});
var enableTimeListButton = inspector.GenerateButton(this, subcontainer, "Enable Head Time List", () =>
{
var ew = inspector.GenerateCompositeParameterWindow(
this, "Enable Head Time List", nameof(enableTimes));
ew.SetAsFlexibleBool();
});
var headRotateSpeedButton = inspector.GenerateButton(this, subcontainer, "Head Rotate Speed", () =>
{
var ew = inspector.GenerateCompositeParameterWindow(
@@ -229,14 +235,14 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
var enableProcessTimeInputField =
inspector.GenerateInputField(this, subcontainer, "Enable Process Time", nameof(enableProcessTime))
.AddListenerFunction(SetUpTweeners);
var headSizeInputField =
var headSizeInputField =
inspector.GenerateInputField(this, subcontainer, "Head Size", nameof(headSize))
.AddListenerFunction(SetUpTweeners);
}
}
namespace Beatmap
{
public partial class DTMTrail_BM : EnvironmentObject_BM
@@ -245,17 +251,17 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
public FlexibleBool_BM enableTimes;
public float enableProcessTime = 0.5f;
public float headSize = 1f;
public FlexibleFloat_BM headRotateSpeed;
public DTMTrail_BM()
{
}
public DTMTrail_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM parentElement,
string themeBundleName, string objectName, bool isStatic, FlexibleFloat visibleTimeLength,
FlexibleBool enableTimes, FlexibleFloat headRotateSpeed, float enableProcessTime, float headSize):
FlexibleBool enableTimes, FlexibleFloat headRotateSpeed, float enableProcessTime, float headSize) :
base(elementName, elementGuid, tags, parentElement, themeBundleName, objectName, isStatic)
{
this.visibleTimeLength = visibleTimeLength.ConvertToBM();
@@ -268,14 +274,14 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
public override void ExecuteBM()
{
matchedElement = DTMTrail.GenerateElement(elementName, elementGuid, tags, false,
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic, visibleTimeLength?.ConvertToGameType(),
themeBundleName, objectName, GetElement(attachedElementGuid), isStatic, visibleTimeLength?.ConvertToGameType(),
enableTimes.ConvertToGameType(), headRotateSpeed?.ConvertToGameType(), enableProcessTime, headSize);
}
public override GameElement DuplicateBM(GameElement parent)
{
return DTMTrail.GenerateElement(elementName, Guid.NewGuid(), tags, false,
themeBundleName, objectName, parent, isStatic, visibleTimeLength?.ConvertToGameType(), enableTimes.ConvertToGameType(),
themeBundleName, objectName, parent, isStatic, visibleTimeLength?.ConvertToGameType(), enableTimes.ConvertToGameType(),
headRotateSpeed?.ConvertToGameType(), enableProcessTime, headSize);
}
}