@@ -39,7 +39,7 @@ Material:
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 1
|
||||
- _AlphaCutoff: 0.5
|
||||
- _Opacity: 2.03
|
||||
- _Opacity: 1
|
||||
- _QueueControl: 0
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
@@ -49,12 +49,12 @@ Material:
|
||||
- _cube_softness: 0
|
||||
- _cube_width: 0.1
|
||||
- _gap_softness: 0.48
|
||||
- _gapsize: 0.46
|
||||
- _ring_radius: 0.73
|
||||
- _gapsize: 0.47
|
||||
- _ring_radius: 0.76
|
||||
- _ring_rotation: 0
|
||||
- _ring_rotation_angle: 0
|
||||
- _ring_softness: 0
|
||||
- _ring_width: 0.1
|
||||
- _ring_softness: 0.02
|
||||
- _ring_width: 0.03
|
||||
m_Colors:
|
||||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _ImageColor: {r: 0.7490196, g: 0.7490196, b: 0.7490196, a: 1}
|
||||
|
||||
@@ -1923,14 +1923,14 @@ Shader "Soullies/hit_point"
|
||||
}
|
||||
/*ASEBEGIN
|
||||
Version=19904
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;135;-3824,1056;Inherit;False;Property;_ring_rotation;ring_rotation;11;0;Create;True;0;0;0;False;0;False;0;-1;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;162;-3824,1152;Inherit;False;Constant;_Float0;Float 0;13;0;Create;True;0;0;0;False;0;False;0.1;0;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;135;-3824,1056;Inherit;False;Property;_ring_rotation;ring_rotation;11;0;Create;True;0;0;0;False;0;False;0;-1;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.TexCoordVertexDataNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;52;-3328,464;Inherit;True;0;2;0;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||||
Node;AmplifyShaderEditor.Vector2Node, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;50;-3328,688;Inherit;False;Constant;_Vector2;Vector 0;0;0;Create;True;0;0;0;False;0;False;0.5,0.5;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
||||
Node;AmplifyShaderEditor.SimpleTimeNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;134;-3808,864;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.SimpleMultiplyOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;161;-3536,1056;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;164;-3392,1440;Inherit;False;Constant;_Float1;Float 1;13;0;Create;True;0;0;0;False;0;False;0.002777778;0;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;157;-3424,1328;Inherit;False;Property;_ring_rotation_angle;ring_rotation_angle;12;0;Create;True;0;0;0;False;0;False;0;-1;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;157;-3472,1280;Inherit;False;Property;_ring_rotation_angle;ring_rotation_angle;12;0;Create;True;0;0;0;False;0;False;0;-1;0;0;0;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.SimpleSubtractOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;51;-3088,576;Inherit;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
||||
Node;AmplifyShaderEditor.SimpleMultiplyOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;136;-3232,1072;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
||||
Node;AmplifyShaderEditor.SimpleMultiplyOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;163;-3168,1360;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
||||
@@ -2052,4 +2052,4 @@ WireConnection;159;1;153;0
|
||||
WireConnection;141;2;160;0
|
||||
WireConnection;141;3;159;0
|
||||
ASEEND*/
|
||||
//CHKSM=28CA609AED335968D7464B6B289150127DD5CC7C
|
||||
//CHKSM=90EA8C023062947A057C48618E0E42E4E5B6664F
|
||||
37171
Assets/FR2_Cache.asset
37171
Assets/FR2_Cache.asset
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Ichni.Editor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -16,13 +19,49 @@ namespace Ichni.RhythmGame
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
IHaveInspection insp = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspector = EditorManager.instance.uiManager.inspector;
|
||||
IHaveInspection insp = inspector;
|
||||
|
||||
// ── 组件下拉菜单 ──
|
||||
List<string> componentOptions = new List<string>();
|
||||
if (animatedObject != null)
|
||||
{
|
||||
var components = animatedObject.gameObject.GetComponents<Component>();
|
||||
foreach (var c in components)
|
||||
{
|
||||
string fullName = c.GetType().FullName;
|
||||
if (!componentOptions.Contains(fullName))
|
||||
componentOptions.Add(fullName);
|
||||
}
|
||||
componentOptions.Sort();
|
||||
}
|
||||
|
||||
// ── 属性/字段下拉菜单(基于当前 componentName) ──
|
||||
List<string> propertyOptions = new List<string>();
|
||||
if (!string.IsNullOrEmpty(componentName))
|
||||
{
|
||||
Type compType = ResolveComponentType(componentName);
|
||||
if (compType != null)
|
||||
{
|
||||
foreach (var prop in compType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (prop.CanWrite && prop.PropertyType == typeof(Color))
|
||||
propertyOptions.Add(prop.Name);
|
||||
}
|
||||
foreach (var field in compType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (field.FieldType == typeof(Color) && !propertyOptions.Contains(field.Name))
|
||||
propertyOptions.Add(field.Name);
|
||||
}
|
||||
propertyOptions.Sort();
|
||||
}
|
||||
}
|
||||
|
||||
InspectorBuilder.For(this)
|
||||
.Section("Property Animation Color")
|
||||
.InputField(nameof(componentName), "Component Name")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.InputField(nameof(propertyName), "Property Name")
|
||||
.Dropdown(nameof(componentName), componentOptions, "Component")
|
||||
.OnChanged(() => { AfterInitialize(); inspector.SetInspector(this); })
|
||||
.Dropdown(nameof(propertyName), propertyOptions, "Property")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.Button("GraphicEditor", () => insp.GenerateGraphicalFlexibleFloatWindow(this, "Property Color",
|
||||
new FlexibleFloat[] { propertyValueR, propertyValueG, propertyValueB, propertyValueA },
|
||||
@@ -33,5 +72,15 @@ namespace Ichni.RhythmGame
|
||||
.Button("Color A", () => insp.GenerateCompositeParameterWindow(this, "Color A", nameof(propertyValueA)).SetAsFlexibleFloat())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private static Type ResolveComponentType(string typeName)
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
Type type = assembly.GetType(typeName);
|
||||
if (type != null) return type;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Ichni.Editor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -15,18 +18,64 @@ namespace Ichni.RhythmGame
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
IHaveInspection insp = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspector = EditorManager.instance.uiManager.inspector;
|
||||
IHaveInspection insp = inspector;
|
||||
|
||||
// ── 组件下拉菜单 ──
|
||||
List<string> componentOptions = new List<string>();
|
||||
if (animatedObject != null)
|
||||
{
|
||||
var components = animatedObject.gameObject.GetComponents<Component>();
|
||||
foreach (var c in components)
|
||||
{
|
||||
string fullName = c.GetType().FullName;
|
||||
if (!componentOptions.Contains(fullName))
|
||||
componentOptions.Add(fullName);
|
||||
}
|
||||
componentOptions.Sort();
|
||||
}
|
||||
|
||||
// ── 属性/字段下拉菜单(基于当前 componentName) ──
|
||||
List<string> propertyOptions = new List<string>();
|
||||
if (!string.IsNullOrEmpty(componentName))
|
||||
{
|
||||
Type compType = ResolveComponentType(componentName);
|
||||
if (compType != null)
|
||||
{
|
||||
foreach (var prop in compType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (prop.CanWrite && prop.PropertyType == typeof(float))
|
||||
propertyOptions.Add(prop.Name);
|
||||
}
|
||||
foreach (var field in compType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (field.FieldType == typeof(float) && !propertyOptions.Contains(field.Name))
|
||||
propertyOptions.Add(field.Name);
|
||||
}
|
||||
propertyOptions.Sort();
|
||||
}
|
||||
}
|
||||
|
||||
InspectorBuilder.For(this)
|
||||
.Section("Property Animation Float")
|
||||
.InputField(nameof(componentName), "Component Name")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.InputField(nameof(propertyName), "Property Name")
|
||||
.Dropdown(nameof(componentName), componentOptions, "Component")
|
||||
.OnChanged(() => { AfterInitialize(); inspector.SetInspector(this); })
|
||||
.Dropdown(nameof(propertyName), propertyOptions, "Property")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.Button("GraphicEditor", () => insp.GenerateGraphicalFlexibleFloatWindow(this, "Property Float",
|
||||
new FlexibleFloat[] { propertyValue }, new string[] { "Value" }))
|
||||
.Button("Float Value", () => insp.GenerateCompositeParameterWindow(this, "Float Value", nameof(propertyValue)).SetAsFlexibleFloat())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private static Type ResolveComponentType(string typeName)
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
Type type = assembly.GetType(typeName);
|
||||
if (type != null) return type;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Ichni.Editor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -15,13 +18,49 @@ namespace Ichni.RhythmGame
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
IHaveInspection insp = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspector = EditorManager.instance.uiManager.inspector;
|
||||
IHaveInspection insp = inspector;
|
||||
|
||||
// ── 组件下拉菜单 ──
|
||||
List<string> componentOptions = new List<string>();
|
||||
if (animatedObject != null)
|
||||
{
|
||||
var components = animatedObject.gameObject.GetComponents<Component>();
|
||||
foreach (var c in components)
|
||||
{
|
||||
string fullName = c.GetType().FullName;
|
||||
if (!componentOptions.Contains(fullName))
|
||||
componentOptions.Add(fullName);
|
||||
}
|
||||
componentOptions.Sort();
|
||||
}
|
||||
|
||||
// ── 属性/字段下拉菜单(基于当前 componentName) ──
|
||||
List<string> propertyOptions = new List<string>();
|
||||
if (!string.IsNullOrEmpty(componentName))
|
||||
{
|
||||
Type compType = ResolveComponentType(componentName);
|
||||
if (compType != null)
|
||||
{
|
||||
foreach (var prop in compType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (prop.CanWrite && prop.PropertyType == typeof(Vector3))
|
||||
propertyOptions.Add(prop.Name);
|
||||
}
|
||||
foreach (var field in compType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
|
||||
{
|
||||
if (field.FieldType == typeof(Vector3) && !propertyOptions.Contains(field.Name))
|
||||
propertyOptions.Add(field.Name);
|
||||
}
|
||||
propertyOptions.Sort();
|
||||
}
|
||||
}
|
||||
|
||||
InspectorBuilder.For(this)
|
||||
.Section("Property Animation Vector3")
|
||||
.InputField(nameof(componentName), "Component Name")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.InputField(nameof(propertyName), "Property Name")
|
||||
.Dropdown(nameof(componentName), componentOptions, "Component")
|
||||
.OnChanged(() => { AfterInitialize(); inspector.SetInspector(this); })
|
||||
.Dropdown(nameof(propertyName), propertyOptions, "Property")
|
||||
.OnChanged(() => AfterInitialize())
|
||||
.Button("GraphicEditor", () => insp.GenerateGraphicalFlexibleFloatWindow(this, "Property Vector3",
|
||||
new FlexibleFloat[] { propertyValueX, propertyValueY, propertyValueZ }, new string[] { "X", "Y", "Z" }))
|
||||
@@ -30,5 +69,15 @@ namespace Ichni.RhythmGame
|
||||
.Button("Vector Z", () => insp.GenerateCompositeParameterWindow(this, "Vector Z", nameof(propertyValueZ)).SetAsFlexibleFloat())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private static Type ResolveComponentType(string typeName)
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
Type type = assembly.GetType(typeName);
|
||||
if (type != null) return type;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,19 +17,19 @@ namespace Ichni.RhythmGame
|
||||
private Component targetComponent;
|
||||
private FieldInfo targetField;
|
||||
private PropertyInfo targetProperty;
|
||||
|
||||
|
||||
// 高性能赋值委托
|
||||
private Action<Color> colorSetterDelegate;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public static PropertyAnimationColor GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement animatedObject, string componentName, string propertyName,
|
||||
GameElement animatedObject, string componentName, string propertyName,
|
||||
FlexibleFloat propertyValueR, FlexibleFloat propertyValueG, FlexibleFloat propertyValueB, FlexibleFloat propertyValueA)
|
||||
{
|
||||
PropertyAnimationColor animation = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
.AddComponent<PropertyAnimationColor>();
|
||||
|
||||
|
||||
animation.Initialize(elementName, id, tags, isFirstGenerated, animatedObject);
|
||||
|
||||
animation.animatedObject = animatedObject;
|
||||
@@ -64,10 +64,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
Debug.LogWarning($"[PropertyAnimationColor] Cannot find Component '{componentName}' strictly on '{animatedObject.name}'.");
|
||||
}
|
||||
|
||||
|
||||
base.AfterInitialize();
|
||||
}
|
||||
|
||||
|
||||
private Type GetTypeFromAllAssemblies(string typeName)
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
@@ -125,7 +125,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (colorSetterDelegate != null)
|
||||
{
|
||||
colorSetterDelegate(targetColor);
|
||||
colorSetterDelegate(targetColor);
|
||||
}
|
||||
else if (targetProperty != null)
|
||||
{
|
||||
@@ -135,20 +135,24 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
targetField.SetValue(targetComponent, targetColor);
|
||||
}
|
||||
|
||||
|
||||
if (animatedObject is IHaveDirtyMarkSubmodule dirtyTarget)
|
||||
{
|
||||
dirtyTarget.dirtyMarkSubmodule.MarkDirty(propertyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
animatedObject.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyTimeOffset(float offset)
|
||||
{
|
||||
base.ApplyTimeOffset(offset);
|
||||
void ApplyOffset(FlexibleFloat ff)
|
||||
{
|
||||
if (ff == null || ff.animations == null) return;
|
||||
foreach(var a in ff.animations) { a.startTime += offset; a.endTime += offset; }
|
||||
foreach (var a in ff.animations) { a.startTime += offset; a.endTime += offset; }
|
||||
}
|
||||
ApplyOffset(propertyValueR);
|
||||
ApplyOffset(propertyValueG);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Ichni.RhythmGame
|
||||
private Component targetComponent;
|
||||
private FieldInfo targetField;
|
||||
private PropertyInfo targetProperty;
|
||||
|
||||
|
||||
// 我们尝试通过原生的 Action 来降低反射 SetValue 带来的性能损耗(装箱与GC)
|
||||
private Action<float> floatSetterDelegate;
|
||||
#endregion
|
||||
@@ -28,7 +28,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
PropertyAnimationFloat animation = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
.AddComponent<PropertyAnimationFloat>();
|
||||
|
||||
|
||||
animation.Initialize(elementName, id, tags, isFirstGenerated, animatedObject);
|
||||
|
||||
animation.animatedObject = animatedObject;
|
||||
@@ -60,10 +60,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
Debug.LogWarning($"[PropertyAnimationFloat] Cannot find Component '{componentName}' strictly on '{animatedObject.name}'.");
|
||||
}
|
||||
|
||||
|
||||
base.AfterInitialize();
|
||||
}
|
||||
|
||||
|
||||
private Type GetTypeFromAllAssemblies(string typeName)
|
||||
{
|
||||
// 对于跨程序集的搜索
|
||||
@@ -125,7 +125,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (floatSetterDelegate != null)
|
||||
{
|
||||
floatSetterDelegate(value);
|
||||
floatSetterDelegate(value);
|
||||
}
|
||||
else if (targetProperty != null)
|
||||
{
|
||||
@@ -135,19 +135,23 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
targetField.SetValue(targetComponent, value);
|
||||
}
|
||||
|
||||
|
||||
if (animatedObject is IHaveDirtyMarkSubmodule dirtyTarget)
|
||||
{
|
||||
dirtyTarget.dirtyMarkSubmodule?.MarkDirty(propertyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
animatedObject.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyTimeOffset(float offset)
|
||||
{
|
||||
base.ApplyTimeOffset(offset);
|
||||
if (propertyValue != null && propertyValue.animations != null)
|
||||
{
|
||||
foreach(var a in propertyValue.animations)
|
||||
foreach (var a in propertyValue.animations)
|
||||
{
|
||||
a.startTime += offset;
|
||||
a.endTime += offset;
|
||||
|
||||
@@ -17,19 +17,19 @@ namespace Ichni.RhythmGame
|
||||
private Component targetComponent;
|
||||
private FieldInfo targetField;
|
||||
private PropertyInfo targetProperty;
|
||||
|
||||
|
||||
// 高性能赋值委托
|
||||
private Action<Vector3> vectorSetterDelegate;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public static PropertyAnimationVector3 GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement animatedObject, string componentName, string propertyName,
|
||||
GameElement animatedObject, string componentName, string propertyName,
|
||||
FlexibleFloat propertyValueX, FlexibleFloat propertyValueY, FlexibleFloat propertyValueZ)
|
||||
{
|
||||
PropertyAnimationVector3 animation = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
.AddComponent<PropertyAnimationVector3>();
|
||||
|
||||
|
||||
animation.Initialize(elementName, id, tags, isFirstGenerated, animatedObject);
|
||||
|
||||
animation.animatedObject = animatedObject;
|
||||
@@ -63,10 +63,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
Debug.LogWarning($"[PropertyAnimationVector3] Cannot find Component '{componentName}' strictly on '{animatedObject.name}'.");
|
||||
}
|
||||
|
||||
|
||||
base.AfterInitialize();
|
||||
}
|
||||
|
||||
|
||||
private Type GetTypeFromAllAssemblies(string typeName)
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
@@ -121,7 +121,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (vectorSetterDelegate != null)
|
||||
{
|
||||
vectorSetterDelegate(targetVector);
|
||||
vectorSetterDelegate(targetVector);
|
||||
}
|
||||
else if (targetProperty != null)
|
||||
{
|
||||
@@ -131,20 +131,24 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
targetField.SetValue(targetComponent, targetVector);
|
||||
}
|
||||
|
||||
|
||||
if (animatedObject is IHaveDirtyMarkSubmodule dirtyTarget)
|
||||
{
|
||||
dirtyTarget.dirtyMarkSubmodule.MarkDirty(propertyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
animatedObject.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyTimeOffset(float offset)
|
||||
{
|
||||
base.ApplyTimeOffset(offset);
|
||||
void ApplyOffset(FlexibleFloat ff)
|
||||
{
|
||||
if (ff == null || ff.animations == null) return;
|
||||
foreach(var a in ff.animations) { a.startTime += offset; a.endTime += offset; }
|
||||
foreach (var a in ff.animations) { a.startTime += offset; a.endTime += offset; }
|
||||
}
|
||||
ApplyOffset(propertyValueX);
|
||||
ApplyOffset(propertyValueY);
|
||||
|
||||
@@ -56,6 +56,12 @@ namespace Ichni.RhythmGame
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
|
||||
// 修复 A1:当 noteVisual 为空时(useNotePrefab=false 或预制体加载失败),
|
||||
// 自动从当前已加载的主题包中查找匹配的 NoteVisual 并生成。
|
||||
// 这确保即使没有预制体系统,Note 依然有视觉表现。
|
||||
EnsureNoteVisual();
|
||||
|
||||
generateEffects = GetEffectListSafe("Generate");
|
||||
generalJudgeEffects = GetEffectListSafe("GeneralJudge");
|
||||
perfectEffects = GetEffectListSafe("Perfect");
|
||||
@@ -67,6 +73,35 @@ namespace Ichni.RhythmGame
|
||||
AddinNoteManager();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当 noteVisual 为空时,从已加载的主题包中自动查找并生成匹配的默认 NoteVisual。
|
||||
/// 修复 useNotePrefab=false 或预制体加载失败导致 Note 无视觉表现的问题。
|
||||
/// </summary>
|
||||
private void EnsureNoteVisual()
|
||||
{
|
||||
if (noteVisual != null) return;
|
||||
if (!isOnTrack || track == null) return;
|
||||
if (ThemeBundleManager.instance.loadedThemeBundleList.Count == 0) return;
|
||||
|
||||
foreach (var bundle in ThemeBundleManager.instance.loadedThemeBundleList)
|
||||
{
|
||||
foreach (var go in bundle.assetList_GameObject)
|
||||
{
|
||||
NoteVisualBase visual = go.GetComponent<NoteVisualBase>();
|
||||
if (visual == null) continue;
|
||||
|
||||
// Tap/Stay/Flick 使用非 Hold 视觉;Hold 使用 Hold 视觉
|
||||
if (this is Tap or Stay or Flick && visual is NoteVisualBaseHold) continue;
|
||||
if (this is Hold && visual is not NoteVisualBaseHold) continue;
|
||||
|
||||
// 通过工厂方法创建 NoteVisual(isFirstGenerated=true 确保效果注册和 AfterInitialize)
|
||||
SubstantialObject.GenerateElement("NoteVisual", Guid.NewGuid(),
|
||||
new List<string>(), true, bundle.themeBundleName, go.name, this);
|
||||
return; // 使用查找到的第一个匹配视觉
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule ??= new TimeDurationSubmodule(this);
|
||||
|
||||
@@ -48,11 +48,21 @@ namespace Ichni.RhythmGame
|
||||
/// <summary>
|
||||
/// NoteVisual 初始化完毕后,通知父 Note 重新缓存效果列表。
|
||||
/// 解决手动生成 NoteVisual 时,父 Note 的 generateEffects 等缓存为 null 导致特效不被驱动的问题。
|
||||
/// 同时在此延迟创建 effectSubmodule(当 BM/预制体数据缺少效果子模块时),
|
||||
/// 避免在 GenerateElement 工厂中预创建导致与后续 Submodule_BM 恢复冲突的重复断言。
|
||||
/// </summary>
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
|
||||
// 延迟初始化:在 BM 加载管线全部执行完毕后,
|
||||
// 如果 effectSubmodule 仍为 null(缺少 BM 数据),则使用空预设创建,
|
||||
// 确保后续 GetEffectListSafe 返回空列表而非 null。
|
||||
if (effectSubmodule == null)
|
||||
{
|
||||
effectSubmodule = new EffectSubmodule(this, EffectSubmodule.EffectSubmodulePreset.Note);
|
||||
}
|
||||
|
||||
if (note != null)
|
||||
{
|
||||
note.RefreshNoteVisualCaches();
|
||||
|
||||
@@ -140,6 +140,7 @@ namespace Ichni.RhythmGame
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
SetShape();
|
||||
ParticleSystemRenderer particleSystemRenderer = particle.GetComponent<ParticleSystemRenderer>();
|
||||
particleSystemRenderer.material.SetColor("_BaseColor", colorSubmodule.currentBaseColor);
|
||||
if (colorSubmodule.emissionEnabled)
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
"value" : [
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Hold_BM,Assembly-CSharp",
|
||||
"holdEndTime" : 67.2,
|
||||
"exactJudgeTime" : 64.8,
|
||||
"holdEndTime" : 6.5,
|
||||
"exactJudgeTime" : 5.333,
|
||||
"elementName" : "New Hold",
|
||||
"tags" : [
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "fdcd4684-8be2-466f-81ee-3fa55a1da334"
|
||||
"value" : "1ab39f74-8f5d-4b2b-9d97-df4f1f3e6160"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "00000000-0000-0000-0000-000000000000"
|
||||
@@ -22,7 +22,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "fdcd4684-8be2-466f-81ee-3fa55a1da334"
|
||||
"value" : "1ab39f74-8f5d-4b2b-9d97-df4f1f3e6160"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "fdcd4684-8be2-466f-81ee-3fa55a1da334"
|
||||
"value" : "1ab39f74-8f5d-4b2b-9d97-df4f1f3e6160"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
|
||||
@@ -56,11 +56,11 @@
|
||||
"DefaultStartHold"
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "fdcd4684-8be2-466f-81ee-3fa55a1da334"
|
||||
"value" : "1ab39f74-8f5d-4b2b-9d97-df4f1f3e6160"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisualHold_BM,Assembly-CSharp",
|
||||
"isHighlighted" : false,
|
||||
"isHighlighted" : true,
|
||||
"themeBundleName" : "departure_to_multiverse",
|
||||
"objectName" : "DTM_NoteVisualHold",
|
||||
"elementName" : "New Note Visual",
|
||||
@@ -68,10 +68,10 @@
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "1b722b7a-f99f-4776-80e0-7e5775edba07"
|
||||
"value" : "0949b3ce-937e-48fe-85b6-c93a7dc0fd55"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "fdcd4684-8be2-466f-81ee-3fa55a1da334"
|
||||
"value" : "1ab39f74-8f5d-4b2b-9d97-df4f1f3e6160"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
|
||||
@@ -91,7 +91,7 @@
|
||||
"z" : 1
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "1b722b7a-f99f-4776-80e0-7e5775edba07"
|
||||
"value" : "0949b3ce-937e-48fe-85b6-c93a7dc0fd55"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
|
||||
@@ -99,7 +99,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "1b722b7a-f99f-4776-80e0-7e5775edba07"
|
||||
"value" : "0949b3ce-937e-48fe-85b6-c93a7dc0fd55"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
|
||||
@@ -118,24 +118,54 @@
|
||||
},
|
||||
"originalEmissionIntensity" : 0,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "1b722b7a-f99f-4776-80e0-7e5775edba07"
|
||||
"value" : "0949b3ce-937e-48fe-85b6-c93a7dc0fd55"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
|
||||
"effectCollection" : {"Generate":[
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExtend_BM,Assembly-CSharp",
|
||||
"generateTime" : 1,
|
||||
"effectTime" : 0.5
|
||||
"generateTime" : 0.8,
|
||||
"effectTime" : 0.2
|
||||
}
|
||||
],"GeneralJudge":[
|
||||
|
||||
],"StartHold":[
|
||||
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.CameraTiltEffect_BM,Assembly-CSharp",
|
||||
"tiltValue" : {
|
||||
"x" : 0,
|
||||
"y" : 0,
|
||||
"z" : 5
|
||||
},
|
||||
"tiltCurve" : {
|
||||
"keys" : [
|
||||
{
|
||||
"time" : 0,
|
||||
"value" : 0,
|
||||
"inTangent" : 0,
|
||||
"outTangent" : 0
|
||||
},{
|
||||
"time" : 0.3,
|
||||
"value" : 1,
|
||||
"inTangent" : 0,
|
||||
"outTangent" : 0
|
||||
},{
|
||||
"time" : 1,
|
||||
"value" : 0,
|
||||
"inTangent" : 0,
|
||||
"outTangent" : 0
|
||||
}
|
||||
],
|
||||
"preWrapMode" : 8,
|
||||
"postWrapMode" : 8
|
||||
},
|
||||
"effectTime" : 1
|
||||
}
|
||||
],"Holding":[
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteHoldingBreath_BM,Assembly-CSharp",
|
||||
"effectTime" : 2.399994
|
||||
"effectTime" : 1.16699982
|
||||
}
|
||||
],"Perfect":[
|
||||
{
|
||||
@@ -162,7 +192,7 @@
|
||||
]
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "1b722b7a-f99f-4776-80e0-7e5775edba07"
|
||||
"value" : "0949b3ce-937e-48fe-85b6-c93a7dc0fd55"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
"value" : [
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Stay_BM,Assembly-CSharp",
|
||||
"exactJudgeTime" : 14.8,
|
||||
"exactJudgeTime" : 4.5,
|
||||
"elementName" : "New Stay",
|
||||
"tags" : [
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "07b1a67f-a1da-4f89-b7bb-b03168278d22"
|
||||
"value" : "0f274ac0-b556-45de-96a2-1ac5657ed809"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "00000000-0000-0000-0000-000000000000"
|
||||
@@ -21,7 +21,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "07b1a67f-a1da-4f89-b7bb-b03168278d22"
|
||||
"value" : "0f274ac0-b556-45de-96a2-1ac5657ed809"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "07b1a67f-a1da-4f89-b7bb-b03168278d22"
|
||||
"value" : "0f274ac0-b556-45de-96a2-1ac5657ed809"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "07b1a67f-a1da-4f89-b7bb-b03168278d22"
|
||||
"value" : "0f274ac0-b556-45de-96a2-1ac5657ed809"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
|
||||
@@ -67,10 +67,10 @@
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "a9bb2cc0-523f-4d40-8d90-2b553b3a4757"
|
||||
"value" : "991bdf25-b6b0-4022-a63d-e5491829c074"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "07b1a67f-a1da-4f89-b7bb-b03168278d22"
|
||||
"value" : "0f274ac0-b556-45de-96a2-1ac5657ed809"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
|
||||
@@ -90,7 +90,7 @@
|
||||
"z" : 1
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a9bb2cc0-523f-4d40-8d90-2b553b3a4757"
|
||||
"value" : "991bdf25-b6b0-4022-a63d-e5491829c074"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
|
||||
@@ -98,7 +98,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a9bb2cc0-523f-4d40-8d90-2b553b3a4757"
|
||||
"value" : "991bdf25-b6b0-4022-a63d-e5491829c074"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
|
||||
@@ -117,14 +117,14 @@
|
||||
},
|
||||
"originalEmissionIntensity" : 0,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a9bb2cc0-523f-4d40-8d90-2b553b3a4757"
|
||||
"value" : "991bdf25-b6b0-4022-a63d-e5491829c074"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
|
||||
"effectCollection" : {"Generate":[
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExpand_BM,Assembly-CSharp",
|
||||
"generateTime" : 1,
|
||||
"generateTime" : 0.8,
|
||||
"effectTime" : 0.2
|
||||
}
|
||||
],"GeneralJudge":[
|
||||
@@ -152,7 +152,7 @@
|
||||
]
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a9bb2cc0-523f-4d40-8d90-2b553b3a4757"
|
||||
"value" : "991bdf25-b6b0-4022-a63d-e5491829c074"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
"value" : [
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.Tap_BM,Assembly-CSharp",
|
||||
"exactJudgeTime" : 53.7,
|
||||
"elementName" : "Tap (53.7)",
|
||||
"exactJudgeTime" : 5,
|
||||
"elementName" : "New Tap",
|
||||
"tags" : [
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "a056c74f-c6d4-4e1a-913d-ba4b2c88ec39"
|
||||
"value" : "99e1b84c-1b00-4c4b-8d51-4a8d01411956"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "00000000-0000-0000-0000-000000000000"
|
||||
@@ -21,7 +21,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a056c74f-c6d4-4e1a-913d-ba4b2c88ec39"
|
||||
"value" : "99e1b84c-1b00-4c4b-8d51-4a8d01411956"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a056c74f-c6d4-4e1a-913d-ba4b2c88ec39"
|
||||
"value" : "99e1b84c-1b00-4c4b-8d51-4a8d01411956"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
|
||||
@@ -55,7 +55,7 @@
|
||||
}
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a056c74f-c6d4-4e1a-913d-ba4b2c88ec39"
|
||||
"value" : "99e1b84c-1b00-4c4b-8d51-4a8d01411956"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
|
||||
@@ -67,10 +67,10 @@
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "38ac8342-2a9c-4776-8c4c-7a8cf46aa96c"
|
||||
"value" : "1bbf305b-19f6-4751-9b74-97f518efff82"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "a056c74f-c6d4-4e1a-913d-ba4b2c88ec39"
|
||||
"value" : "99e1b84c-1b00-4c4b-8d51-4a8d01411956"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
|
||||
@@ -90,7 +90,7 @@
|
||||
"z" : 1
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "38ac8342-2a9c-4776-8c4c-7a8cf46aa96c"
|
||||
"value" : "1bbf305b-19f6-4751-9b74-97f518efff82"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
|
||||
@@ -98,7 +98,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "38ac8342-2a9c-4776-8c4c-7a8cf46aa96c"
|
||||
"value" : "1bbf305b-19f6-4751-9b74-97f518efff82"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
|
||||
@@ -117,15 +117,15 @@
|
||||
},
|
||||
"originalEmissionIntensity" : 0,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "38ac8342-2a9c-4776-8c4c-7a8cf46aa96c"
|
||||
"value" : "1bbf305b-19f6-4751-9b74-97f518efff82"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
|
||||
"effectCollection" : {"Generate":[
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExpand_BM,Assembly-CSharp",
|
||||
"generateTime" : 1,
|
||||
"effectTime" : 0.3
|
||||
"generateTime" : 0.8,
|
||||
"effectTime" : 0.2
|
||||
}
|
||||
],"GeneralJudge":[
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
]
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "38ac8342-2a9c-4776-8c4c-7a8cf46aa96c"
|
||||
"value" : "1bbf305b-19f6-4751-9b74-97f518efff82"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user