基础内容-7

Trail
完整Note
This commit is contained in:
SoulliesOfficial
2025-02-02 08:34:54 -05:00
parent 38ec74bfef
commit efca87e9cd
60 changed files with 1503 additions and 228 deletions

8
Assets/Materials.meta Normal file
View File

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

View File

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

View File

@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DefaultLitTransparent
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 1
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &5815930170147133817
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b39306d2c39754d0aafabe8570b8e640
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -31,6 +31,9 @@ MonoBehaviour:
type: 3}
defaultTrackMaterial: {fileID: 2100000, guid: 2424431729f1047c4b42f971c2cdd2b6,
type: 2}
trail: {fileID: 4801226466239889825, guid: a21d9cdd0e3454527bec5f2b0e9a9cae, type: 3}
defaultTrailMaterial: {fileID: 2100000, guid: 8af6dd7f0725540388b84a4697118bb9,
type: 2}
tapNote: {fileID: 8182686472733940155, guid: 9b2da5f6faa9c4d2abe557fc8f79f806, type: 3}
stayNote: {fileID: 0}
holdNote: {fileID: 0}

View File

@@ -0,0 +1,171 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DefaultTrailMaterial
m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- GRABPASS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMode: 0
- _Cull: 0
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EmissionEnabled: 0
- _EnableExternalAlpha: 0
- _EnvironmentReflections: 1
- _FlipbookMode: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossinessSource: 0
- _GlossyReflections: 0
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &2523386628062252728
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8af6dd7f0725540388b84a4697118bb9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,180 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4801226466239889825
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5989318717494774921}
- component: {fileID: 4874969544181214436}
- component: {fileID: 7085906370378666250}
m_Layer: 0
m_Name: Trail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5989318717494774921
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4801226466239889825}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4874969544181214436
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4801226466239889825}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48120e902e0734a51a10b8b4c0229afa, type: 3}
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
- Name: timeDurationSubmodule
Entry: 6
Data:
- Name: transformSubmodule
Entry: 6
Data:
- Name: colorSubmodule
Entry: 6
Data:
elementName:
serialNumber: 0
tags: []
parentElement: {fileID: 0}
childElementList: []
trailRenderer: {fileID: 7085906370378666250}
renderMaterial: {fileID: 0}
visibleTimeLength: 0
--- !u!96 &7085906370378666250
TrailRenderer:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4801226466239889825}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 8af6dd7f0725540388b84a4697118bb9, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Time: 5
m_PreviewTimeScale: 1
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
textureScale: {x: 1, y: 1}
shadowBias: 0.5
generateLightingData: 0
m_MinVertexDistance: 0.1
m_MaskInteraction: 0
m_Autodestruct: 0
m_Emitting: 1
m_ApplyActiveColorSpace: 1

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a21d9cdd0e3454527bec5f2b0e9a9cae
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -361,6 +361,7 @@ MonoBehaviour:
Data:
elementName:
serialNumber: 0
tags: []
parentElement: {fileID: 0}
childElementList: []
camera: {fileID: 330585545}
@@ -1244,8 +1245,10 @@ MonoBehaviour:
Data:
elementName:
serialNumber: 0
tags: []
parentElement: {fileID: 0}
childElementList: []
trackList: []
--- !u!4 &759707325
Transform:
m_ObjectHideFlags: 0
@@ -1631,6 +1634,7 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
currentJudgeType: 0
basePrefabs: {fileID: 11400000, guid: 266f4a39c512c46eea7e44336e4fc600, type: 2}
elementList: []
--- !u!4 &1197505579

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -12,35 +13,10 @@ namespace Ichni.RhythmGame
public FlexibleReturnType animationReturnType;
//public ICanHaveAnimation target;
public void NewInitialize(string elementName, BaseElement targetObject)
public override void Initialize(string elementName, Guid id, List<string> tags)
{
base.Initialize(elementName);
this.targetObject = targetObject;
SetParent(this.targetObject);
}
public virtual void SetTimeDuration(params FlexibleFloat[] flexibleFloats)
{
List<float> startTimes = new List<float>();
List<float> endTimes = new List<float>();
foreach (FlexibleFloat flexibleFloat in flexibleFloats)
{
flexibleFloat.Sort();
if (flexibleFloat.animations.Count > 0)
{
startTimes.Add(flexibleFloat.animations[0].startTime);
endTimes.Add(flexibleFloat.animations[^1].endTime);
}
}
timeDurationSubmodule = new TimeDurationSubmodule(this, startTimes.Min(), endTimes.Max());
}
public virtual void SetTimeDuration(float startTime, float endTime)
{
timeDurationSubmodule = new TimeDurationSubmodule(this, startTime, endTime);
base.Initialize(elementName, id, tags);
timeDurationSubmodule = new TimeDurationSubmodule(this);
}
protected abstract void UpdateAnimation(float songTime);

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -10,12 +11,15 @@ namespace Ichni.RhythmGame
public ColorSubmodule targetColorSubmodule;
public FlexibleFloat colorR, colorG, colorB, colorA;
public static BaseColorChange GenerateElement(string elementName, BaseElement targetObject,
public static BaseColorChange GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
FlexibleFloat colorR, FlexibleFloat colorG, FlexibleFloat colorB, FlexibleFloat colorA)
{
BaseColorChange baseColorChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<BaseColorChange>();
baseColorChange.NewInitialize(elementName, targetObject);
baseColorChange.Initialize(elementName, id, tags);
baseColorChange.targetObject = targetObject;
baseColorChange.colorR = colorR;
baseColorChange.colorG = colorG;
baseColorChange.colorB = colorB;
@@ -31,7 +35,8 @@ namespace Ichni.RhythmGame
throw new System.Exception("Target object does not have a ColorSubmodule");
}
baseColorChange.SetTimeDuration(colorR, colorG, colorB, colorA);
baseColorChange.SetParent(targetObject);
baseColorChange.timeDurationSubmodule.SetDuration(colorR, colorG, colorB, colorA);
return baseColorChange;
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -10,30 +11,35 @@ namespace Ichni.RhythmGame
public ColorSubmodule targetColorSubmodule;
public FlexibleFloat colorR, colorG, colorB, colorI;
public static EmissionColorChange GenerateElement(string elementName, BaseElement targetObject,
public static EmissionColorChange GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
FlexibleFloat colorR, FlexibleFloat colorG, FlexibleFloat colorB, FlexibleFloat colorI)
{
EmissionColorChange baseColorChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<EmissionColorChange>();
EmissionColorChange emissionColorChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<EmissionColorChange>();
baseColorChange.NewInitialize(elementName, targetObject);
baseColorChange.colorR = colorR;
baseColorChange.colorG = colorG;
baseColorChange.colorB = colorB;
baseColorChange.colorI = colorI;
baseColorChange.animationReturnType = FlexibleReturnType.Before;
emissionColorChange.Initialize(elementName, id, tags);
emissionColorChange.targetObject = targetObject;
emissionColorChange.colorR = colorR;
emissionColorChange.colorG = colorG;
emissionColorChange.colorB = colorB;
emissionColorChange.colorI = colorI;
emissionColorChange.animationReturnType = FlexibleReturnType.Before;
if (targetObject.colorSubmodule != null)
{
baseColorChange.targetColorSubmodule = targetObject.colorSubmodule;
emissionColorChange.targetColorSubmodule = targetObject.colorSubmodule;
}
else
{
throw new System.Exception("Target object does not have a ColorSubmodule");
}
baseColorChange.SetTimeDuration(colorR, colorG, colorB, colorI);
emissionColorChange.SetParent(targetObject);
emissionColorChange.timeDurationSubmodule.SetDuration(colorR, colorG, colorB, colorI);
return baseColorChange;
return emissionColorChange;
}
protected override void UpdateAnimation(float songTime)

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -10,10 +11,13 @@ namespace Ichni.RhythmGame
public FlexibleFloat totalTime;
public TrackTimeSubmoduleStatic targetTrackTimeSubmoduleStatic;
public static TrackTotalTimeChange GenerateElement(string elementName, Track targetTrack, FlexibleFloat totalTime)
public static TrackTotalTimeChange GenerateElement(string elementName, Guid id,
List<string> tags, Track targetTrack, FlexibleFloat totalTime)
{
TrackTotalTimeChange trackTotalTimeChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<TrackTotalTimeChange>();
trackTotalTimeChange.NewInitialize(elementName, targetTrack);
trackTotalTimeChange.Initialize(elementName, id, tags);
trackTotalTimeChange.targetObject = targetTrack;
if (targetTrack.trackTimeSubmodule is TrackTimeSubmoduleStatic submoduleStatic)
{
@@ -26,7 +30,9 @@ namespace Ichni.RhythmGame
trackTotalTimeChange.totalTime = totalTime;
trackTotalTimeChange.animationReturnType = FlexibleReturnType.Before;
trackTotalTimeChange.SetTimeDuration(totalTime);
trackTotalTimeChange.timeDurationSubmodule.SetDuration(totalTime);
trackTotalTimeChange.SetParent(targetTrack);
return trackTotalTimeChange;
}

View File

@@ -15,12 +15,15 @@ namespace Ichni.RhythmGame
public TransformSubmodule targetTransformSubmodule;
public FlexibleFloat positionX, positionY, positionZ;
public static Displacement GenerateElement(string elementName, BaseElement targetObject,
public static Displacement GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
FlexibleFloat positionX, FlexibleFloat positionY, FlexibleFloat positionZ)
{
Displacement displacement = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Displacement>();
displacement.NewInitialize(elementName, targetObject);
displacement.Initialize(elementName, id, tags);
displacement.targetObject = targetObject;
displacement.positionX = positionX;
displacement.positionY = positionY;
@@ -36,7 +39,9 @@ namespace Ichni.RhythmGame
throw new System.Exception("Target object does not have a TransformSubmodule");
}
displacement.SetTimeDuration(positionX, positionY, positionZ);
displacement.SetParent(targetObject);
displacement.timeDurationSubmodule.SetDuration(positionX, positionY, positionZ);
return displacement;
}

View File

@@ -16,29 +16,33 @@ namespace Ichni.RhythmGame
public BaseElement lookAtObject;
public FlexibleBool enabling;
public static LookAt GenerateElement(string elementName, BaseElement targetObject,
public static LookAt GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
BaseElement lookAtTarget, FlexibleBool enabling)
{
LookAt swirl = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<LookAt>();
LookAt look = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<LookAt>();
swirl.NewInitialize(elementName, targetObject);
swirl.lookAtObject = lookAtTarget;
swirl.enabling = enabling;
swirl.animationReturnType = FlexibleReturnType.Before;
look.Initialize(elementName, id, tags);
look.targetObject = targetObject;
look.lookAtObject = lookAtTarget;
look.enabling = enabling;
look.animationReturnType = FlexibleReturnType.Before;
if (targetObject.transformSubmodule != null)
{
swirl.targetTransformSubmodule = targetObject.transformSubmodule;
look.targetTransformSubmodule = targetObject.transformSubmodule;
}
else
{
throw new System.Exception("Target object does not have a TransformSubmodule");
}
look.SetParent(targetObject);
swirl.SetTimeDuration(-999, 999); //TODO: 换为(-delay, songLength)
look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
return swirl;
return look;
}
private void Start()

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -9,12 +10,15 @@ namespace Ichni.RhythmGame
public TransformSubmodule targetTransformSubmodule;
public FlexibleFloat scaleX, scaleY, scaleZ;
public static Scale GenerateElement(string elementName, BaseElement targetObject,
public static Scale GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
FlexibleFloat scaleX, FlexibleFloat scaleY, FlexibleFloat scaleZ)
{
Scale scale = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Scale>();
scale.NewInitialize(elementName, targetObject);
scale.Initialize(elementName, id, tags);
scale.targetObject = targetObject;
scale.scaleX = scaleX;
scale.scaleY = scaleY;
@@ -30,7 +34,8 @@ namespace Ichni.RhythmGame
throw new System.Exception("Target object does not have a TransformSubmodule");
}
scale.SetTimeDuration(scaleX, scaleY, scaleZ);
scale.SetParent(targetObject);
scale.timeDurationSubmodule.SetDuration(scaleX, scaleY, scaleZ);
return scale;
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -10,12 +11,15 @@ namespace Ichni.RhythmGame
public TransformSubmodule targetTransformSubmodule;
public FlexibleFloat eulerAngleX, eulerAngleY, eulerAngleZ;
public static Swirl GenerateElement(string elementName, BaseElement targetObject,
public static Swirl GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement targetObject,
FlexibleFloat eulerAngleX, FlexibleFloat eulerAngleY, FlexibleFloat eulerAngleZ)
{
Swirl swirl = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Swirl>();
swirl.NewInitialize(elementName, targetObject);
swirl.Initialize(elementName, id, tags);
swirl.targetObject = targetObject;
swirl.eulerAngleX = eulerAngleX;
swirl.eulerAngleY = eulerAngleY;
@@ -31,7 +35,9 @@ namespace Ichni.RhythmGame
throw new System.Exception("Target object does not have a TransformSubmodule");
}
swirl.SetTimeDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
swirl.SetParent(targetObject);
swirl.timeDurationSubmodule.SetDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
return swirl;
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni.RhythmGame.Beatmap;
using Sirenix.OdinInspector;
using UniRx;
using UnityEngine;
@@ -13,9 +14,6 @@ namespace Ichni.RhythmGame
{
//物体名
public string elementName;
//序列号
public int serialNumber;
//标识 GUID
public Guid elementGuid;
@@ -24,14 +22,14 @@ namespace Ichni.RhythmGame
public List<string> tags;
//存档
//public BaseElement_BM matchedBM;
public BaseElement_BM matchedBM;
//父游戏物体
public BaseElement parentElement;
//子物体列表
public List<BaseElement> childElementList = new List<BaseElement>();
//次级模块
public TimeDurationSubmodule timeDurationSubmodule;
public TransformSubmodule transformSubmodule;
@@ -41,10 +39,11 @@ namespace Ichni.RhythmGame
/// 首次初始化
/// </summary>
/// <param name="name">物体名</param>
public virtual void Initialize(string name)
public virtual void Initialize(string name, Guid elementGuid, List<string> tags)
{
this.elementName = name;
this.elementGuid = Guid.NewGuid();
this.elementGuid = elementGuid;
this.tags = tags;
EditorManager.instance.elementList.Add(this);
//GameManager.beatMapContainer.beatMapElementList.Add(this);
//serialNumber = totalSerialNumber++;
@@ -56,7 +55,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void AfterInitialize()
{
}
/// <summary>
@@ -64,15 +63,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void Refresh()
{
}
/// <summary>
/// 当物体被删除时执行的方法
/// </summary>
public virtual void OnDelete()
{
}
/// <summary>
@@ -88,25 +79,8 @@ namespace Ichni.RhythmGame
transform.SetParent(parentElement.transform);
}
}
public virtual void Delete()
{
if (this.childElementList != null)
{
for (int i = 0; i < childElementList.Count; i++)
{
childElementList[i].Delete(); //删除子GameElement、
}
}
OnDelete();
EditorManager.instance.elementList.Remove(this); //从保存列表中剔除
this.parentElement.childElementList.Remove(this);
Destroy(gameObject); //销毁
}
}
public abstract partial class BaseElement
{
private void Start()
@@ -116,15 +90,14 @@ namespace Ichni.RhythmGame
public virtual void SetTimeDuration()
{
}
[Button("Apply Time Duration From Child")]
public void ApplyTimeDuration()
{
childElementList.ForEach(x => x.ApplyTimeDuration());
timeDurationSubmodule?.SetDurationFromChildren(childElementList.Select(x=>x.timeDurationSubmodule).ToList());
timeDurationSubmodule?.SetDurationFromChildren(childElementList.Select(x => x.timeDurationSubmodule)
.ToList());
}
/// <summary>
@@ -147,11 +120,12 @@ namespace Ichni.RhythmGame
{
offset += scaleOffset;
}
transformSubmodule.currentScale = transformSubmodule.originalScale + offset;
transform.localScale = transformSubmodule.currentScale;
transformSubmodule.scaleDirtyMark = false;
}
if (transformSubmodule.eulerAnglesDirtyMark)
{
Vector3 offset = Vector3.zero;
@@ -159,11 +133,12 @@ namespace Ichni.RhythmGame
{
offset += eulerOffset;
}
transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
transform.localEulerAngles = transformSubmodule.currentEulerAngles;
transformSubmodule.eulerAnglesDirtyMark = false;
}
if (transformSubmodule.positionDirtyMark)
{
Vector3 offset = Vector3.zero;
@@ -171,15 +146,116 @@ namespace Ichni.RhythmGame
{
offset += posOffset;
}
transformSubmodule.currentPosition = transformSubmodule.originalPosition + offset;
transform.localPosition = transformSubmodule.currentPosition;
transformSubmodule.positionDirtyMark = false;
}
transformSubmodule.scaleOffset.Clear();
transformSubmodule.eulerAnglesOffset.Clear();
transformSubmodule.positionOffset.Clear();
}).AddTo(gameObject);
}
}
public abstract partial class BaseElement //存档,删除,复制,粘贴
{
/// <summary>
/// 用于生成存档
/// </summary>
public abstract void SaveBM();
/// <summary>
/// 当物体被删除时执行的方法
/// </summary>
public virtual void OnDelete()
{
}
/// <summary>
/// 删除物体,包括所有子物体
/// </summary>
[Button("Delete")]
public virtual void Delete()
{
if (this.childElementList != null)
{
for (int i = 0; i < childElementList.Count; i++)
{
childElementList[i].Delete(); //删除子GameElement、
}
}
OnDelete();
#if UNITY_EDITOR
Debug.Log("Delete " + elementName + "(" + elementGuid + ")");
#endif
EditorManager.instance.elementList.Remove(this); //从保存列表中剔除
this.parentElement.childElementList.Remove(this);
Destroy(gameObject); //销毁
}
}
namespace Beatmap
{
[System.Serializable]
public abstract class BaseElement_BM
{
[System.NonSerialized] public static Dictionary<Guid, BaseElement_BM> identifier; //存档类的标识符
[System.NonSerialized] public BaseElement matchedElement; //存档类对应的游戏物体
public string elementName;
public List<string> tags;
public Guid elementGuid;
public Guid attachedElementGuid;
public BaseElement_BM()
{
}
public BaseElement_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement)
{
this.elementName = elementName;
this.elementGuid = elementGuid;
this.tags = tags;
this.attachedElementGuid = attachedElement?.elementGuid ?? Guid.Empty;
identifier.TryAdd(this.elementGuid, this);
}
public static BaseElement_BM GetElementBM(Guid id)
{
if (identifier.TryGetValue(id, out BaseElement_BM element_BM))
{
return element_BM;
}
Debug.LogAssertion("Element not found or do not have id");
return null;
}
public static BaseElement GetElement(Guid id)
{
return GetElementBM(id)?.matchedElement;
}
/// <summary>
/// 用于从存档中生成物体
/// </summary>
public abstract void ExecuteBM();
/// <summary>
/// 用于复制物体
/// </summary>
public abstract BaseElement DuplicateBM(BaseElement parent);
}
}
}

View File

@@ -0,0 +1,81 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ichni
{
[System.Serializable]
public class AnimatedInt
{
public int value; //值
public float time;
public AnimatedInt()
{
}
public AnimatedInt(int value, float time)
{
this.value = value;
this.time = time;
}
}
[System.Serializable]
public class FlexibleInt
{
public int value;
public List<AnimatedInt> animations;
public FlexibleInt()
{
animations = new List<AnimatedInt>();
}
public FlexibleInt(List<AnimatedInt> anim)
{
this.animations = anim;
}
public void Add(AnimatedInt animatedInt)
{
animations.Add(animatedInt);
}
/// <summary>
/// 在动画脚本的Update中更新Int Value
/// </summary>
/// <param name="歌曲时间"></param>
public FlexibleReturnType UpdateFlexibleInt(float nowTime)
{
AnimatedInt nowAnimatedInt = GetAnimatedInt(nowTime); //获取当前时间点对应的AnimatedInt
value = nowAnimatedInt.value; //更新value
return FlexibleReturnType.MiddleExecuting;
}
/// <summary>
/// 获取songTime对应的AnimatedInt的时间段
/// </summary>
/// <param name="歌曲时间"></param>
/// <returns>返回距离当前时间最近的前一个AnimatedInt</returns>
AnimatedInt GetAnimatedInt(float nowTime)
{
for (int i = 0; i < animations.Count; i++)
{
if (nowTime < animations[i].time)
{
if (i == 0)
{
return animations[i];
}
else
{
return animations[i - 1];
}
}
}
return new AnimatedInt(0, 0);
}
}
}

View File

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

View File

@@ -29,6 +29,32 @@ namespace Ichni.RhythmGame
{
return time >= startTime - offset && time <= endTime + offset;
}
public void SetDuration(float startTime, float endTime)
{
this.startTime = startTime;
this.endTime = endTime;
}
public void SetDuration(params FlexibleFloat[] flexibleFloats)
{
List<float> startTimes = new List<float>();
List<float> endTimes = new List<float>();
foreach (FlexibleFloat flexibleFloat in flexibleFloats)
{
flexibleFloat.Sort();
if (flexibleFloat.animations.Count > 0)
{
startTimes.Add(flexibleFloat.animations[0].startTime);
endTimes.Add(flexibleFloat.animations[^1].endTime);
}
}
startTime = startTimes.Min();
endTime = endTimes.Max();
}
public void SetDurationFromChildren(List<TimeDurationSubmodule> children)
{

View File

@@ -15,6 +15,10 @@ public class BasePrefabsCollection : SerializedScriptableObject
public GameObject track;
public GameObject pathNode;
public Material defaultTrackMaterial;
[Title("Trail相关")]
public GameObject trail;
public Material defaultTrailMaterial;
[Title("Note 相关")]
public GameObject tapNote;
@@ -27,8 +31,7 @@ public class BasePrefabsCollection : SerializedScriptableObject
public AudioClip holdNoteLoopSound;
public AudioClip holdNoteEndSound;
public AudioClip flickNoteSound;
[Title("Effect相关")]
public GameObject bloomShake;
}

View File

@@ -11,10 +11,11 @@ namespace Ichni
public class EditorManager : SerializedMonoBehaviour
{
public static EditorManager instance;
public SongModule songModule;
public BasePrefabsCollection basePrefabs;
public SongModule songModule;
public NoteBase.NoteJudgeType currentJudgeType;
public BasePrefabsCollection basePrefabs;
public List<BaseElement> elementList = new List<BaseElement>();
private void Awake()
@@ -24,19 +25,28 @@ namespace Ichni
private void Start()
{
var f0 = ElementFolder.GenerateElement("Folder", null);
var dis0 = Displacement.GenerateElement("Displacement-0", f0,
new FlexibleFloat(),
new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,2, AnimationCurveType.Linear)}),
new FlexibleFloat());
var t0 = Track.GenerateElement("Track", f0, Vector3.left * 5f);
t0.trackPathSubmodule = new TrackPathSubmodule(t0, Track.TrackSpaceType.Linear, Track.TrackSamplingType.TimeDistributed, false);
t0.trackTimeSubmodule = new TrackTimeSubmoduleMovable(t0, 0, 2, 1, AnimationCurveType.Linear);
t0.trackRendererSubmodule = new TrackRendererSubmoduleAutoOrient(t0);
var p0 = PathNode.GenerateElement("PathNode-0", t0, 0, new Vector3(-5,5,10), Vector3.forward, 1, Color.white);
var p1 = PathNode.GenerateElement("PathNode-1", t0, 1, new Vector3(5,-5,10), Vector3.forward, 0, Color.red);
var n0 = Tap.GenerateElement("Note-0", 1f, t0);
var n0v = BasicNoteVisual.GenerateElement("Note-0-V", "basic", "BasicNoteTap3D", Vector3.zero, Vector3.zero, Vector3.one, n0);
//currentJudgeType = NoteBase.NoteJudgeType.Perfect;
var f0 = ElementFolder.GenerateElement("Folder", Guid.NewGuid(), new List<string>(), null);
// var dis0 = Displacement.GenerateElement("Displacement-0", f0,
// new FlexibleFloat(),
// new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,2, AnimationCurveType.Linear)}),
// new FlexibleFloat());
var t0 = Track.GenerateElement("Track", Guid.NewGuid(), new List<string>(), f0, Vector3.left * 5f);
t0.trackPathSubmodule = new TrackPathSubmodule(t0, Track.TrackSpaceType.Linear,
Track.TrackSamplingType.TimeDistributed, false);
t0.trackTimeSubmodule = new TrackTimeSubmoduleMovable(t0, 0, 2, 1, AnimationCurveType.OutQuad);
var pp0 = TrackPercentPoint.GenerateElement("TrackPercentPoint-0", Guid.NewGuid(), new List<string>(), t0,
new FlexibleFloat(new List<AnimatedFloat>() { new(0, 2, 0, 1, AnimationCurveType.OutQuad) }));
var tr0 = Trail.GenerateElement("Trail-0", Guid.NewGuid(), new List<string>(), pp0, 5);
// t0.trackRendererSubmodule = new TrackRendererSubmoduleAutoOrient(t0);
var p0 = PathNode.GenerateElement("PathNode-0", Guid.NewGuid(), new List<string>(), t0,
new Vector3(-5, 5, 10), Vector3.forward, 1, Color.white);
var p1 = PathNode.GenerateElement("PathNode-1", Guid.NewGuid(), new List<string>(), t0,
new Vector3(5, -5, 10), Vector3.forward, 0, Color.red);
var n0 = Tap.GenerateElement("Note-0", Guid.NewGuid(), new List<string>(), 1f, t0);
var n0v = BasicNoteVisual.GenerateElement("Note-0-V", Guid.NewGuid(), new List<string>(), "basic",
"BasicNoteTap3D", Vector3.zero, Vector3.zero, Vector3.one, n0);
elementList.ForEach(e => e.AfterInitialize());
}

View File

@@ -15,7 +15,7 @@ namespace Ichni.Editor
SetUpFunctions();
//Test
functionInterpreter.Eval("Log(\"Hello World!\")");
//functionInterpreter.Eval("Log(\"Hello World!\")");
}
}

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class ElementFolder : BaseElement
{
public static ElementFolder GenerateElement(string name, BaseElement parentElement)
{
ElementFolder elementFolder = Instantiate(EditorManager.instance.basePrefabs.elementFolder).GetComponent<ElementFolder>();
elementFolder.Initialize(name);
elementFolder.SetParent(parentElement);
elementFolder.transformSubmodule = new TransformSubmodule(elementFolder);
elementFolder.timeDurationSubmodule = new TimeDurationSubmodule(elementFolder);
//elementFolder.GenerateTab(parentElement);
elementFolder.SetTransformObserver();
return elementFolder;
}
}
}

View File

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

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class ElementFolder : BaseElement
{
public List<Track> trackList;
public static ElementFolder GenerateElement(string name, Guid id, List<string> tags, BaseElement parentElement)
{
ElementFolder elementFolder = Instantiate(EditorManager.instance.basePrefabs.elementFolder).GetComponent<ElementFolder>();
elementFolder.Initialize(name, id, tags);
elementFolder.SetParent(parentElement);
elementFolder.transformSubmodule = new TransformSubmodule(elementFolder);
elementFolder.timeDurationSubmodule = new TimeDurationSubmodule(elementFolder);
//elementFolder.GenerateTab(parentElement);
elementFolder.SetTransformObserver();
return elementFolder;
}
}
public partial class ElementFolder
{
public override void SaveBM()
{
matchedBM = new Beatmap.ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM);
}
}
namespace Beatmap
{
public class ElementFolder_BM : BaseElement_BM
{
public ElementFolder_BM()
{
}
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement)
: base(elementName, elementGuid, tags, attachedElement)
{
}
public override void ExecuteBM()
{
matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags, GetElement(attachedElementGuid));
}
public override BaseElement DuplicateBM(BaseElement parent)
{
return ElementFolder.GenerateElement(elementName, elementGuid, tags, parent);
}
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -9,13 +10,14 @@ namespace Ichni.RhythmGame
{
public bool isStatic;
public static SubstantialObject GenerateElement(string elementName, string themeBundleName,
string objectName, Vector3 position, Vector3 eulerAngles, Vector3 scale, BaseElement parent,
public static SubstantialObject GenerateElement(string elementName, Guid id, List<string> tags,
string themeBundleName, string objectName, BaseElement parent,
Vector3 position, Vector3 eulerAngles, Vector3 scale,
bool isStatic, bool isFirstGenerated = true)
{
EnvironmentObject themeBundleObject = ThemeBundleManager.instance.GetObject<EnvironmentObject>(themeBundleName, objectName);
EnvironmentObject environmentObject = Instantiate(themeBundleObject, parent.transform).GetComponent<EnvironmentObject>();
environmentObject.Initialize(elementName);
environmentObject.Initialize(elementName, id, tags);
environmentObject.isStatic = isStatic;
return environmentObject;
}

View File

@@ -20,13 +20,14 @@ namespace Ichni.RhythmGame
public float perspectiveAngle;
public float orthographicSize;
public static GameCamera GenerateElement(string elementName, BaseElement parentElement,
public static GameCamera GenerateElement(string elementName, Guid id,
List<string> tags, BaseElement parentElement,
CameraViewType cameraViewType, float perspectiveAngle, float orthographicSize,
Vector3 initialPosition, Vector3 initialEulerAngles)
{
GameCamera gameCamera = Instantiate(EditorManager.instance.basePrefabs.gameCamera).GetComponent<GameCamera>();
gameCamera.Initialize(elementName);
gameCamera.Initialize(elementName, id, tags);
gameCamera.parentElement = parentElement;
gameCamera.cameraViewType = cameraViewType;
gameCamera.camera.orthographic = cameraViewType == CameraViewType.Orthographic;

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
@@ -7,13 +8,14 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public class Flick : NoteBase
public partial class Flick : NoteBase
{
public List<Vector2> availableFlickDirections;
public static Flick GenerateElement(string elementName, float exactJudgeTime, BaseElement attach, List<Vector2> directions)
public static Flick GenerateElement(string elementName, Guid id, List<string> tags,
float exactJudgeTime, BaseElement attach, List<Vector2> directions)
{
Flick flick = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Flick>();
flick.Initialize(elementName);
flick.Initialize(elementName, id, tags);
flick.exactJudgeTime = exactJudgeTime;
flick.availableFlickDirections = directions;
flick.transformSubmodule = new TransformSubmodule(flick);
@@ -44,4 +46,42 @@ namespace Ichni.RhythmGame
return flick;
}
}
public partial class Flick
{
public override void SaveBM()
{
matchedBM = new Beatmap.Flick_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime, availableFlickDirections);
}
}
namespace Beatmap
{
public class Flick_BM : BaseElement_BM
{
public float exactJudgeTime;
public List<Vector2> availableFlickDirections;
public Flick_BM()
{
}
public Flick_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime, List<Vector2> directions)
: base(elementName, elementGuid, tags, attachedElement)
{
this.exactJudgeTime = exactJudgeTime;
availableFlickDirections = directions;
}
public override void ExecuteBM()
{
matchedElement = Flick.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid), availableFlickDirections);
}
public override BaseElement DuplicateBM(BaseElement parent)
{
return Flick.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent, availableFlickDirections);
}
}
}
}

View File

@@ -7,7 +7,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public abstract class NoteBase : BaseElement
public abstract partial class NoteBase : BaseElement
{
[Title("Basic Info")]
public float exactJudgeTime;
@@ -41,9 +41,9 @@ namespace Ichni.RhythmGame
public Vector2 noteScreenPosition;
public bool isJudged;
public override void Initialize(string name)
public override void Initialize(string name, Guid id, List<string> tags)
{
base.Initialize(name);
base.Initialize(name, id, tags);
generateEffects = new EffectSubmodule(this);
generalJudgeEffects = new EffectSubmodule(this);
perfectJudgeEffects = new EffectSubmodule(this);
@@ -113,14 +113,23 @@ namespace Ichni.RhythmGame
isJudged = true;
}
}
generateEffects.effectList.ForEach(e => e.UpdateEffect());
foreach (var effect in generateEffects.effectList)
switch (EditorManager.instance.currentJudgeType)
{
effect.UpdateEffect();
}
foreach (var effect in perfectJudgeEffects.effectList)
{
effect.UpdateEffect();
case NoteJudgeType.Perfect:
perfectJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
break;
case NoteJudgeType.Good:
goodJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
break;
case NoteJudgeType.Bad:
badJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
break;
case NoteJudgeType.Miss:
missJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
break;
}
}
@@ -144,4 +153,15 @@ namespace Ichni.RhythmGame
}
}
}
public abstract partial class NoteBase
{
public enum NoteJudgeType
{
Perfect,
Good,
Bad,
Miss
}
}
}

View File

@@ -13,11 +13,5 @@ namespace Ichni.RhythmGame
public List<GameObject> notePartList;
public List<GameObject> effectPartList;
public void NewInitialize(NoteBase note)
{
base.Initialize(note.elementName + " Note Visual");
this.note = note;
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
@@ -7,12 +8,13 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public class Stay : NoteBase
public partial class Stay : NoteBase
{
public static Stay GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
public static Stay GenerateElement(string elementName, Guid id, List<string> tags,
float exactJudgeTime, BaseElement attach)
{
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
stay.Initialize(elementName);
stay.Initialize(elementName, id, tags);
stay.exactJudgeTime = exactJudgeTime;
stay.transformSubmodule = new TransformSubmodule(stay);
stay.timeDurationSubmodule = new TimeDurationSubmodule(stay);
@@ -42,4 +44,41 @@ namespace Ichni.RhythmGame
return stay;
}
}
public partial class Stay
{
public override void SaveBM()
{
matchedBM = new Beatmap.Stay_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime);
}
}
namespace Beatmap
{
public class Stay_BM : BaseElement_BM
{
public float exactJudgeTime;
public Stay_BM()
{
}
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime)
: base(elementName, elementGuid, tags, attachedElement)
{
this.exactJudgeTime = exactJudgeTime;
}
public override void ExecuteBM()
{
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid));
}
public override BaseElement DuplicateBM(BaseElement parent)
{
return Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent);
}
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
@@ -7,12 +8,13 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public class Tap : NoteBase
public partial class Tap : NoteBase
{
public static Tap GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
public static Tap GenerateElement(string elementName, Guid id, List<string> tags,
float exactJudgeTime, BaseElement attach)
{
Tap tap = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
tap.Initialize(elementName);
tap.Initialize(elementName, id, tags);
tap.exactJudgeTime = exactJudgeTime;
tap.transformSubmodule = new TransformSubmodule(tap);
tap.timeDurationSubmodule = new TimeDurationSubmodule(tap);
@@ -42,4 +44,41 @@ namespace Ichni.RhythmGame
return tap;
}
}
public partial class Tap
{
public override void SaveBM()
{
matchedBM = new Beatmap.Tap_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime);
}
}
namespace Beatmap
{
public class Tap_BM : BaseElement_BM
{
public float exactJudgeTime;
public Tap_BM()
{
}
public Tap_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime)
: base(elementName, elementGuid, tags, attachedElement)
{
this.exactJudgeTime = exactJudgeTime;
}
public override void ExecuteBM()
{
matchedElement = Tap.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid));
}
public override BaseElement DuplicateBM(BaseElement parent)
{
return Tap.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent);
}
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -9,13 +10,13 @@ namespace Ichni.RhythmGame
{
public string themeBundleName, objectName;
public static SubstantialObject GenerateElement(string elementName, string themeBundleName,
string objectName, Vector3 position, Vector3 eulerAngles, Vector3 scale, BaseElement parent,
bool isFirstGenerated = true)
public static SubstantialObject GenerateElement(string elementName, Guid id, List<string> tags,
string themeBundleName, string objectName, Vector3 position, Vector3 eulerAngles, Vector3 scale,
BaseElement parent, bool isFirstGenerated = true)
{
GameObject themeBundleObject = ThemeBundleManager.instance.GetObject<GameObject>(themeBundleName, objectName);
SubstantialObject substantialObject = Instantiate(themeBundleObject, parent.transform).GetComponent<SubstantialObject>();
substantialObject.Initialize(elementName);
substantialObject.Initialize(elementName, id, tags);
substantialObject.transformSubmodule = new TransformSubmodule(substantialObject, position, eulerAngles, scale);
substantialObject.timeDurationSubmodule = new TimeDurationSubmodule(substantialObject);

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
@@ -18,12 +19,12 @@ namespace Ichni.RhythmGame
public SplinePoint node;
public static PathNode GenerateElement(string elementName, Track track, int index, Vector3 nodePosition,
Vector3 nodeNormal, float nodeSize, Color nodeColor)
public static PathNode GenerateElement(string elementName, Guid id, List<string> tags,
Track track, Vector3 nodePosition, Vector3 nodeNormal, float nodeSize, Color nodeColor)
{
PathNode pathNode = Instantiate(EditorManager.instance.basePrefabs.pathNode, track.transform).GetComponent<PathNode>();
pathNode.Initialize(elementName);
pathNode.Initialize(elementName, id, tags);
pathNode.track = track;
//pathNode.index = index;

View File

@@ -12,11 +12,12 @@ namespace Ichni.RhythmGame
public TrackTimeSubmodule trackTimeSubmodule;
public TrackRendererSubmodule trackRendererSubmodule;
public static Track GenerateElement(string elementName, BaseElement parent, Vector3 position)
public static Track GenerateElement(string elementName, Guid id, List<string> tags,
BaseElement parent, Vector3 position)
{
Track track = Instantiate(EditorManager.instance.basePrefabs.track, parent.transform).GetComponent<Track>();
track.Initialize(elementName);
track.Initialize(elementName, id, tags);
track.SetParent(parent);
track.transformSubmodule = new TransformSubmodule(track, position, Vector3.zero, Vector3.one);
@@ -47,9 +48,9 @@ namespace Ichni.RhythmGame
public partial class Track
{
public override void Refresh()
public override void SaveBM()
{
matchedBM = new Beatmap.Track_BM(elementName, elementGuid, tags, parentElement.matchedBM);
}
}
@@ -68,4 +69,31 @@ namespace Ichni.RhythmGame
DistanceDistributed = 1
}
}
namespace Beatmap
{
public class Track_BM : BaseElement_BM
{
public Track_BM()
{
}
public Track_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement)
: base(elementName, elementGuid, tags, attachedElement)
{
}
public override void ExecuteBM()
{
matchedElement = Track.GenerateElement(elementName, elementGuid, tags, GetElement(attachedElementGuid), Vector3.zero);
}
public override BaseElement DuplicateBM(BaseElement parent)
{
return Track.GenerateElement(elementName, elementGuid, tags, parent, Vector3.zero);
}
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
using Ichni.RhythmGame;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class CrossTrackPoint : BaseElement
{
public ElementFolder trackListFolder;
public Track nowAttachedTrack;
private int nowAttachedTrackIndex;
public SplinePositioner trackPositioner;
public FlexibleInt trackSwitch;
public FlexibleFloat trackPercent;
public static CrossTrackPoint GenerateElement(string elementName, Guid id, List<string> tags,
ElementFolder elementFolder, FlexibleInt trackSwitch, FlexibleFloat trackPercent)
{
CrossTrackPoint point = Instantiate(EditorManager.instance.basePrefabs.emptyObject, elementFolder.transform).AddComponent<CrossTrackPoint>();
point.Initialize(elementName, id, tags);
point.trackPositioner = point.gameObject.AddComponent<SplinePositioner>();
point.nowAttachedTrackIndex = -1;
point.trackListFolder = elementFolder;
point.trackSwitch = trackSwitch;
point.trackPercent = trackPercent;
point.transformSubmodule = new TransformSubmodule(point);
point.timeDurationSubmodule = new TimeDurationSubmodule(point);
point.SetParent(elementFolder);
return point;
}
private void Update()
{
if (trackPercent.animations.Count > 0)
{
trackSwitch.UpdateFlexibleInt(EditorManager.instance.songModule.songTime);
trackPercent.UpdateFlexibleFloat(EditorManager.instance.songModule.songTime);
SetPoint();
}
}
private void SetPoint()
{
if (nowAttachedTrackIndex != trackSwitch.value && trackSwitch.value >= 0 && trackSwitch.value < trackListFolder.trackList.Count)
{
nowAttachedTrack = trackListFolder.trackList[trackSwitch.value];
nowAttachedTrackIndex = trackSwitch.value;
trackPositioner.spline = trackListFolder.trackList[trackSwitch.value].trackPathSubmodule.path;
}
trackPositioner.SetPercent(trackPercent.value);
}
}
}

View File

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

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
@@ -12,24 +13,19 @@ namespace Ichni.RhythmGame
public TrackTimeSubmoduleMovable trackTimeSubmoduleMovable;
public SplinePositioner trackPositioner;
public static TrackHeadPoint GenerateElement(string elementName, Track track)
public static TrackHeadPoint GenerateElement(string elementName, Guid id, List<string> tags, Track track)
{
TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform).AddComponent<TrackHeadPoint>();
head.NewInitialize(elementName, track);
head.Initialize(elementName, id, tags);
head.track = track;
head.trackPositioner = head.gameObject.AddComponent<SplinePositioner>();
head.trackPositioner.spline = track.trackPathSubmodule.path;
head.trackTimeSubmoduleMovable = track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
head.SetParent(track);
return head;
}
private void NewInitialize(string elementName, Track track)
{
base.Initialize(elementName);
this.track = track;
this.trackPositioner = gameObject.AddComponent<SplinePositioner>();
this.trackPositioner.spline = track.trackPathSubmodule.path;
this.trackTimeSubmoduleMovable = track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
}
public void Update()
{
if (track.timeDurationSubmodule.CheckTimeInDuration(EditorManager.instance.songModule.songTime))

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -19,27 +20,23 @@ namespace Ichni.RhythmGame
private bool isBeyond1 = false;
public static TrackPercentPoint GenerateElement(string elementName, Track track, FlexibleFloat trackPercent)
public static TrackPercentPoint GenerateElement(string elementName, Guid id, List<string> tags,
Track track, FlexibleFloat trackPercent)
{
TrackPercentPoint point = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform).AddComponent<TrackPercentPoint>();
point.NewInitialize(elementName, track, trackPercent);
point.Initialize(elementName, id, tags);
point.track = track;
point.trackPositioner = point.gameObject.AddComponent<SplinePositioner>();
point.trackPositioner.spline = track.trackPathSubmodule.path;
point.trackPercent = trackPercent;
point.SetParent(track);
point.isBeyond1 = trackPercent.animations.Any(animation => animation.endValue > 1);//判断是否有超过1的动画超过1将会循环
return point;
}
private void NewInitialize(string elementName, Track track, FlexibleFloat trackPercent)
{
base.Initialize(elementName);
this.track = track;
this.trackPositioner = gameObject.AddComponent<SplinePositioner>();
this.trackPositioner.spline = track.trackPathSubmodule.path;
this.trackPercent = trackPercent;
}
public void Update()
{
if (trackPercent.animations.Count > 0)

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class Trail : BaseElement
{
public TrailRenderer trailRenderer;
public Material renderMaterial;
public float visibleTimeLength;
public static Trail GenerateElement(string name, Guid id, List<string> tags,
BaseElement parentElement, float visibleTimeLength, Material material = null)
{
Trail trail = Instantiate(EditorManager.instance.basePrefabs.trail).GetComponent<Trail>();
trail.trailRenderer = trail.GetComponent<TrailRenderer>();
trail.Initialize(name, id, tags);
trail.renderMaterial = material == null ? EditorManager.instance.basePrefabs.defaultTrailMaterial : material;
trail.trailRenderer.material = trail.renderMaterial;
trail.visibleTimeLength = visibleTimeLength;
trail.SetParent(parentElement);
trail.transformSubmodule = new TransformSubmodule(trail);
return trail;
}
}
}

View File

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

View File

@@ -1,5 +1,5 @@
ManifestFileVersion: 0
CRC: 2320234516
CRC: 3910270382
AssetBundleManifest:
AssetBundleInfos:
Info_0:

View File

@@ -1,15 +1,15 @@
ManifestFileVersion: 0
CRC: 3644372668
CRC: 3370319538
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 110d4740b29ef7da3aa800ad69f39ffe
Hash: 49bd9bdbb89b1cab8e0110743b991ce3
TypeTreeHash:
serializedVersion: 2
Hash: 0b29093cb0b98a6a3edca231f6a05b16
Hash: 14b925367e650018329ce40d4f1a1124
IncrementalBuildHash:
serializedVersion: 2
Hash: 110d4740b29ef7da3aa800ad69f39ffe
Hash: 49bd9bdbb89b1cab8e0110743b991ce3
HashAppended: 0
ClassTypes:
- Class: 1

View File

@@ -145,7 +145,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
- {fileID: 2100000, guid: b39306d2c39754d0aafabe8570b8e640, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -538,6 +538,7 @@ MonoBehaviour:
Data:
elementName:
serialNumber: 0
tags: []
parentElement: {fileID: 0}
childElementList: []
themeBundleName: basic

View File

@@ -0,0 +1,54 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNoteBadExpand : NoteEffectBase
{
Renderer noteMainRenderer;
public BasicNoteBadExpand(NoteBase note)
{
this.note = note;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
this.noteMainRenderer = noteVisual.noteMain.GetComponent<Renderer>();
}
public override void Recover()
{
noteVisual.noteMain.SetActive(true);
noteVisual.noteMain.transform.localScale = Vector3.one;
noteMainRenderer.material.SetColor("_BaseColor", Color.white);
}
public override void Adjust()
{
noteMainRenderer.material.DOColor(Color.clear, 0.2f).SetEase(Ease.OutQuad);
noteVisual.noteMain.transform.DOScale(Vector3.one * 1.5f, 0.2f).SetEase(Ease.OutQuad).OnComplete(() => noteVisual.noteMain.SetActive(false));
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime )
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime &&
songTime <= note.exactJudgeTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}

View File

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

View File

@@ -0,0 +1,58 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNoteGoodBurst : NoteEffectBase
{
private GameObject effectRing;
public BasicNoteGoodBurst(NoteBase note)
{
this.note = note;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
this.effectRing = noteVisual.effectPartList[0];
}
public override void Recover()
{
effectRing.SetActive(false);
effectRing.transform.localScale = Vector3.zero;
effectRing.GetComponent<SpriteRenderer>().color = Color.white;
noteVisual.noteMain.SetActive(true);
}
public override void Adjust()
{
effectRing.gameObject.SetActive(true);
effectRing.transform.DOScale(Vector3.one * 0.5f, 0.1f).SetEase(Ease.OutQuad);
effectRing.GetComponent<SpriteRenderer>().DOFade(0, 0.1f).SetEase(Ease.OutQuad).OnComplete(() => effectRing.SetActive(false));
noteVisual.noteMain.SetActive(false);
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime )
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime &&
songTime <= note.exactJudgeTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}

View File

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

View File

@@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNoteMissPale : NoteEffectBase
{
Renderer noteMainRenderer;
public BasicNoteMissPale(NoteBase note)
{
this.note = note;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
this.noteMainRenderer = noteVisual.noteMain.GetComponent<Renderer>();
}
public override void Recover()
{
noteVisual.noteMain.SetActive(true);
noteMainRenderer.material.SetColor("_BaseColor", Color.white);
}
public override void Adjust()
{
noteVisual.noteMain.SetActive(true);
noteMainRenderer.material.SetColor("_BaseColor", Color.white / 2f);
noteMainRenderer.material.DOColor(Color.clear, 0.2f).SetEase(Ease.OutQuad);
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime )
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime &&
songTime <= note.exactJudgeTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}

View File

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

View File

@@ -27,8 +27,8 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
public override void Adjust()
{
effectRing.gameObject.SetActive(true);
effectRing.transform.DOScale(Vector3.one, 0.1f).SetEase(Ease.OutBack);
effectRing.GetComponent<SpriteRenderer>().DOFade(0, 0.1f).SetEase(Ease.OutBack).OnComplete(() => effectRing.SetActive(false));
effectRing.transform.DOScale(Vector3.one, 0.1f).SetEase(Ease.OutQuad);
effectRing.GetComponent<SpriteRenderer>().DOFade(0, 0.1f).SetEase(Ease.OutQuad).OnComplete(() => effectRing.SetActive(false));
noteVisual.noteMain.SetActive(false);
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
@@ -7,12 +8,12 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNoteVisual : NoteVisualBase
{
public new static BasicNoteVisual GenerateElement(string elementName, string themeBundleName,
string objectName, Vector3 position, Vector3 eulerAngles, Vector3 scale, BaseElement parent,
bool isFirstGenerated = true)
public new static BasicNoteVisual GenerateElement(string elementName, Guid id, List<string> tags,
string themeBundleName, string objectName,
Vector3 position, Vector3 eulerAngles, Vector3 scale, BaseElement parent, bool isFirstGenerated = true)
{
BasicNoteVisual noteVisual = SubstantialObject
.GenerateElement(elementName, themeBundleName, objectName, position, eulerAngles, scale, parent, isFirstGenerated)
.GenerateElement(elementName, id, tags, themeBundleName, objectName, position, eulerAngles, scale, parent, isFirstGenerated)
.GetComponent<BasicNoteVisual>();
NoteBase note = parent as NoteBase;
@@ -24,6 +25,9 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
{
note.generateEffects.effectList.Add(new BasicNoteGenerateExpand(noteVisual.note));
note.perfectJudgeEffects.effectList.Add(new BasicNotePerfectBurst(noteVisual.note));
note.goodJudgeEffects.effectList.Add(new BasicNoteGoodBurst(noteVisual.note));
note.badJudgeEffects.effectList.Add(new BasicNoteBadExpand(noteVisual.note));
note.missJudgeEffects.effectList.Add(new BasicNoteMissPale(noteVisual.note));
}
return noteVisual;