diff --git a/Assets/Prefabs/BasePrefabsCollection.asset b/Assets/Prefabs/BasePrefabsCollection.asset
index 24e5d6b2..883d2602 100644
--- a/Assets/Prefabs/BasePrefabsCollection.asset
+++ b/Assets/Prefabs/BasePrefabsCollection.asset
@@ -28,3 +28,5 @@ MonoBehaviour:
track: {fileID: 8828428123186639208, guid: 20234a708961745eeafa459c79524348, type: 3}
pathNode: {fileID: 7248180033186031075, guid: 609cdf441cd2f4c78a430e7df78a40f4,
type: 3}
+ defaultTrackMaterial: {fileID: 2100000, guid: 2424431729f1047c4b42f971c2cdd2b6,
+ type: 2}
diff --git a/Assets/Prefabs/DefaultTrackMaterial.mat b/Assets/Prefabs/DefaultTrackMaterial.mat
new file mode 100644
index 00000000..753d7b7f
--- /dev/null
+++ b/Assets/Prefabs/DefaultTrackMaterial.mat
@@ -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: DefaultTrackMaterial
+ 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
diff --git a/Assets/Prefabs/DefaultTrackMaterial.mat.meta b/Assets/Prefabs/DefaultTrackMaterial.mat.meta
new file mode 100644
index 00000000..48fc2e0a
--- /dev/null
+++ b/Assets/Prefabs/DefaultTrackMaterial.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2424431729f1047c4b42f971c2cdd2b6
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 2100000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Base/FlexibleTypes/FlexibleFloat.cs b/Assets/Scripts/Base/FlexibleTypes/FlexibleFloat.cs
index d0e3a630..2d87e007 100644
--- a/Assets/Scripts/Base/FlexibleTypes/FlexibleFloat.cs
+++ b/Assets/Scripts/Base/FlexibleTypes/FlexibleFloat.cs
@@ -19,7 +19,8 @@ namespace Ichni
public float totalTime; //总时间
public AnimationCurveType animationCurveType; //动画曲线类型
- public AnimatedFloat(float startTime, float endTime, float startValue, float endValue, AnimationCurveType animationCurveType)
+ public AnimatedFloat(float startTime, float endTime, float startValue, float endValue,
+ AnimationCurveType animationCurveType)
{
this.startValue = startValue;
this.endValue = endValue;
@@ -66,8 +67,8 @@ namespace Ichni
{
animations.Sort();
}
-
-
+
+
///
/// 在动画脚本的Update中更新value
///
@@ -78,7 +79,8 @@ namespace Ichni
if (nowAnimatedFloat != null) //如果能获取到,表明当前时间点存在动画
{
//获取songTime时间点时,基于动画曲线的AnimatedFloat比例点->(0,1)。
- float nowPercent = AnimationCurveEvaluator.Evaluate(nowAnimatedFloat.animationCurveType, (nowTime - nowAnimatedFloat.startTime) / nowAnimatedFloat.totalTime);
+ float nowPercent = AnimationCurveEvaluator.Evaluate(nowAnimatedFloat.animationCurveType,
+ (nowTime - nowAnimatedFloat.startTime) / nowAnimatedFloat.totalTime);
value = nowAnimatedFloat.startValue + nowPercent * nowAnimatedFloat.differenceValue; //计算value
returnType = FlexibleReturnType.MiddleExecuting;
return;
@@ -98,10 +100,11 @@ namespace Ichni
{
value = nowAnimatedFloat.startValue;
}
+
returnType = FlexibleReturnType.Before;
return;
}
-
+
if (nowTime > finalEndTime) //如果当前时间大于最后一个动画的结束时间
{
nowAnimatedFloat = animations[animations.Count - 1];
@@ -111,14 +114,16 @@ namespace Ichni
{
value = nowAnimatedFloat.endValue;
}
+
returnType = FlexibleReturnType.After;
return;
}
- if (currentAnimationIndex >= 0)//如果当前时间点在动画之间
+ if (currentAnimationIndex >= 0) //如果当前时间点在动画之间
{
value = animations[currentAnimationIndex].endValue;
}
+
returnType = FlexibleReturnType.MiddleInterval;
return;
}
@@ -147,88 +152,5 @@ namespace Ichni
return null;
}
-
-
- // [BurstCompile]
- // public void UpdateFlexibleFloat(float nowTime)
- // {
- // var animationData = new NativeArray(animations.ToArray(), Allocator.TempJob);
- // var result = new NativeArray(1, Allocator.TempJob);
- // var returnTypeResult = new NativeArray(1, Allocator.TempJob);
- //
- // var job = new FlexibleFloatJob
- // {
- // nowTime = nowTime,
- // animationData = animationData,
- // result = result,
- // returnTypeResult = returnTypeResult
- // };
- //
- // var handle = job.Schedule();
- // handle.Complete();
- //
- // value = result[0];
- // returnType = returnTypeResult[0];
- //
- // animationData.Dispose();
- // result.Dispose();
- // returnTypeResult.Dispose();
- // }
-
}
- /*
- [BurstCompile]
- struct FlexibleFloatJob : IJob
- {
- public float nowTime;
- [ReadOnly] public NativeArray animationData;
- public NativeArray result;
- public NativeArray returnTypeResult;
-
- public void Execute()
- {
- FlexibleReturnType currentReturnType = FlexibleReturnType.None;
- float outputValue = 0;
-
- if(animationData.Length == 0)
- {
- result[0] = outputValue;
- returnTypeResult[0] = currentReturnType;
- return;
- }
-
- if (nowTime < animationData[0].startTime)
- {
- outputValue = animationData[0].startValue;
- currentReturnType = FlexibleReturnType.Before;
- }
- else if (nowTime > animationData[animationData.Length - 1].endTime)
- {
- outputValue = animationData[animationData.Length - 1].endValue;
- currentReturnType = FlexibleReturnType.After;
- }
-
- for (int i = 0; i < animationData.Length; i++)
- {
- var anim = animationData[i];
-
- if (nowTime >= anim.startTime && nowTime <= anim.endTime)
- {
- float nowPercent = AnimationCurveEvaluator.Evaluate(anim.animationCurveType,(nowTime - anim.startTime) / anim.totalTime);
- outputValue = anim.startValue + nowPercent * anim.differenceValue;
- currentReturnType = FlexibleReturnType.MiddleExecuting;
- break;
- }
- }
-
- if (currentReturnType == FlexibleReturnType.None)
- {
- currentReturnType = FlexibleReturnType.MiddleInterval;
- }
-
- result[0] = outputValue;
- returnTypeResult[0] = currentReturnType;
- }
-
- }*/
}
\ No newline at end of file
diff --git a/Assets/Scripts/Base/GeneralSubmodules/ColorSubmodule.cs b/Assets/Scripts/Base/GeneralSubmodules/ColorSubmodule.cs
index 7c3f7732..04cf32c9 100644
--- a/Assets/Scripts/Base/GeneralSubmodules/ColorSubmodule.cs
+++ b/Assets/Scripts/Base/GeneralSubmodules/ColorSubmodule.cs
@@ -28,6 +28,10 @@ namespace Ichni.RhythmGame
this.emissionEnabled = false;
this.originalEmissionColor = Color.black;
this.originalEmissionIntensity = 0;
+
+ this.currentBaseColor = originalBaseColor;
+ this.currentEmissionColor = Color.black;
+ this.currentEmissionIntensity = 0;
}
public ColorSubmodule(Color originalBaseColor, bool emissionEnabled, Color originalEmissionColor, float originalEmissionIntensity)
@@ -36,6 +40,10 @@ namespace Ichni.RhythmGame
this.emissionEnabled = emissionEnabled;
this.originalEmissionColor = originalEmissionColor;
this.originalEmissionIntensity = originalEmissionIntensity;
+
+ this.currentBaseColor = originalBaseColor;
+ this.currentEmissionColor = originalEmissionColor;
+ this.currentEmissionIntensity = originalEmissionIntensity;
}
}
}
\ No newline at end of file
diff --git a/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs b/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs
new file mode 100644
index 00000000..9d2b3518
--- /dev/null
+++ b/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs
@@ -0,0 +1,16 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Ichni.RhythmGame
+{
+ public class EffectSubmodule : SubmoduleBase
+ {
+ public List effectList;
+ }
+
+ public abstract class EffectBase
+ {
+ public abstract void Execute();
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs.meta b/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs.meta
new file mode 100644
index 00000000..eceafe54
--- /dev/null
+++ b/Assets/Scripts/Base/GeneralSubmodules/EffectSubmodule.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 67578ca8780234f6d9108a4ea88a5c82
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Base/Manager/BasePrefabsCollection.cs b/Assets/Scripts/Base/Manager/BasePrefabsCollection.cs
index d276a855..f5015a60 100644
--- a/Assets/Scripts/Base/Manager/BasePrefabsCollection.cs
+++ b/Assets/Scripts/Base/Manager/BasePrefabsCollection.cs
@@ -9,6 +9,9 @@ public class BasePrefabsCollection : SerializedScriptableObject
[Title("基础预制体")]
public GameObject emptyObject;
public GameObject elementFolder;
+
+ [Title("Track相关")]
public GameObject track;
public GameObject pathNode;
+ public Material defaultTrackMaterial;
}
diff --git a/Assets/Scripts/Base/Manager/EditorManager.cs b/Assets/Scripts/Base/Manager/EditorManager.cs
index 96833a76..0897a6b6 100644
--- a/Assets/Scripts/Base/Manager/EditorManager.cs
+++ b/Assets/Scripts/Base/Manager/EditorManager.cs
@@ -30,7 +30,7 @@ namespace Ichni
(t0.trackTimeSubmodule as TrackTimeSubmoduleMovable).NewInitialize(t0, 0, 1, 1, AnimationCurveType.Linear);
(t0.trackRendererSubmodule as TrackRendererSubmoduleAutoOrient).NewInitialize(t0);
var p0 = PathNode.GeneratePathNode("PathNode-0", t0, 0, Vector3.zero, Vector3.forward, 1, Color.white);
- var p1 = PathNode.GeneratePathNode("PathNode-1", t0, 1, Vector3.one * 10f, Vector3.left, 0, Color.white);
+ var p1 = PathNode.GeneratePathNode("PathNode-1", t0, 1, Vector3.one * 10f, Vector3.left, 0, Color.red);
t0.AfterInitialize();
}
diff --git a/Assets/Scripts/Base/Manager/PostProcessingManager.cs b/Assets/Scripts/Base/Manager/PostProcessingManager.cs
new file mode 100644
index 00000000..55919944
--- /dev/null
+++ b/Assets/Scripts/Base/Manager/PostProcessingManager.cs
@@ -0,0 +1,18 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PostProcessingManager : MonoBehaviour
+{
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+}
diff --git a/Assets/Scripts/Base/Manager/PostProcessingManager.cs.meta b/Assets/Scripts/Base/Manager/PostProcessingManager.cs.meta
new file mode 100644
index 00000000..6d33b054
--- /dev/null
+++ b/Assets/Scripts/Base/Manager/PostProcessingManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8b242683d247c4ee59ef50fd8ef06701
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/EnvironmentObjects.meta b/Assets/Scripts/GameElements/EnvironmentObjects.meta
new file mode 100644
index 00000000..32d0cba5
--- /dev/null
+++ b/Assets/Scripts/GameElements/EnvironmentObjects.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2f9d3b833668d4a309f2dc75315c18e8
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/Notes.meta b/Assets/Scripts/GameElements/Notes.meta
new file mode 100644
index 00000000..d3982328
--- /dev/null
+++ b/Assets/Scripts/GameElements/Notes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 62e1a33dede934d3fb2c3282b6641d59
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/Notes/NoteBase.cs b/Assets/Scripts/GameElements/Notes/NoteBase.cs
new file mode 100644
index 00000000..effb868d
--- /dev/null
+++ b/Assets/Scripts/GameElements/Notes/NoteBase.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using Dreamteck.Splines;
+using Sirenix.OdinInspector;
+using UnityEngine;
+
+namespace Ichni.RhythmGame
+{
+ public class NoteBase : BaseElement
+ {
+ [Title("Basic Info")]
+ public float exactJudgeTime;
+
+ [Title("Track Info")]
+ public bool isOnTrack;
+ public Track track;
+ public SplinePositioner trackPositioner;
+
+ // [Title("NoteVisual")]
+ // public GeneralNoteVisual noteVisual;
+ //
+ // [Title("NoteEffect")]
+ // public List noteEffectGenerateList;
+ // public List noteEffectPerfectList;
+ // public List noteEffectGoodList;
+ // public List noteEffectMissList;
+
+ [Title("In-Game Info")]
+ public Vector2 noteScreenPosition;
+ public bool isJudged;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/GameElements/Notes/NoteBase.cs.meta b/Assets/Scripts/GameElements/Notes/NoteBase.cs.meta
new file mode 100644
index 00000000..0a32b17e
--- /dev/null
+++ b/Assets/Scripts/GameElements/Notes/NoteBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 95d3a881bc3654f05ba69138e8c703cb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/PathNode.cs b/Assets/Scripts/GameElements/Track/PathNode.cs
similarity index 90%
rename from Assets/Scripts/GameElements/PathNode.cs
rename to Assets/Scripts/GameElements/Track/PathNode.cs
index 6baf17d9..06501e0c 100644
--- a/Assets/Scripts/GameElements/PathNode.cs
+++ b/Assets/Scripts/GameElements/Track/PathNode.cs
@@ -34,11 +34,6 @@ namespace Ichni.RhythmGame
this.track = track;
this.index = index;
- if (track.trackPathSubmodule.pathNodeList.Count > index)
- {
- this.index = track.trackPathSubmodule.pathNodeList.Count;
- }
-
this.transformSubmodule = new TransformSubmodule(nodePosition, Quaternion.LookRotation(nodeNormal, Vector3.up).eulerAngles, Vector3.one * nodeSize);
this.colorSubmodule = new ColorSubmodule(nodeColor);
diff --git a/Assets/Scripts/GameElements/PathNode.cs.meta b/Assets/Scripts/GameElements/Track/PathNode.cs.meta
similarity index 100%
rename from Assets/Scripts/GameElements/PathNode.cs.meta
rename to Assets/Scripts/GameElements/Track/PathNode.cs.meta
diff --git a/Assets/Scripts/GameElements/Track/Track.cs b/Assets/Scripts/GameElements/Track/Track.cs
index 822c7faf..ef620107 100644
--- a/Assets/Scripts/GameElements/Track/Track.cs
+++ b/Assets/Scripts/GameElements/Track/Track.cs
@@ -40,8 +40,7 @@ namespace Ichni.RhythmGame
public override void AfterInitialize()
{
- trackPathSubmodule.path.RebuildImmediate();
- //Refresh();
+
}
private void Update()
diff --git a/Assets/Scripts/GameElements/Track/TrackPoints.meta b/Assets/Scripts/GameElements/Track/TrackPoints.meta
new file mode 100644
index 00000000..55f7280a
--- /dev/null
+++ b/Assets/Scripts/GameElements/Track/TrackPoints.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 50c407d9db7cf4ed096db0106bdc3c0c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs b/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs
new file mode 100644
index 00000000..a0655f3f
--- /dev/null
+++ b/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs
@@ -0,0 +1,41 @@
+using System.Collections;
+using System.Collections.Generic;
+using Dreamteck.Splines;
+using Lean.Pool;
+using UnityEngine;
+
+namespace Ichni.RhythmGame
+{
+ public class TrackHeadPoint : BaseElement
+ {
+ public Track track;
+ public TrackTimeSubmoduleMovable trackTimeSubmoduleMovable;
+ public SplinePositioner trackPositioner;
+
+ public static TrackHeadPoint GenerateElement(string elementName, Track track)
+ {
+ TrackHeadPoint head = LeanPool.Spawn(EditorManager.instance.basePrefabs.emptyObject, track.transform).AddComponent();
+
+ head.NewInitialize(elementName, track);
+ head.SetParent(track);
+ return head;
+ }
+
+ private void NewInitialize(string elementName, Track track)
+ {
+ base.NewInitialize(elementName);
+ this.track = track;
+ this.trackPositioner = gameObject.AddComponent();
+ this.trackPositioner.spline = track.trackPathSubmodule.path;
+ this.trackTimeSubmoduleMovable = track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
+ }
+
+ public void Update()
+ {
+ if (track.timeDurationSubmodule.CheckTimeInDuration(EditorManager.instance.songModule.songTime))
+ {
+ trackPositioner.SetPercent(trackTimeSubmoduleMovable.headPercent);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs.meta b/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs.meta
new file mode 100644
index 00000000..a3b25c1f
--- /dev/null
+++ b/Assets/Scripts/GameElements/Track/TrackPoints/TrackHeadPoint.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d5925af6db50645cdaf05d9fbb53f751
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs b/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs
new file mode 100644
index 00000000..83dd7cc5
--- /dev/null
+++ b/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs
@@ -0,0 +1,50 @@
+using System.Collections;
+using System.Collections.Generic;
+using Dreamteck.Splines;
+using Lean.Pool;
+using UniRx;
+using UnityEngine;
+
+namespace Ichni.RhythmGame
+{
+ ///
+ /// 在轨道上根据百分比进行运动的点
+ ///
+ public class TrackPercentPoint : BaseElement
+ {
+ public Track track;
+ public SplinePositioner trackPositioner;
+ public FlexibleFloat trackPercent;
+
+ public static TrackPercentPoint GenerateElement(string elementName, Track track, FlexibleFloat trackPercent)
+ {
+ TrackPercentPoint point = LeanPool.Spawn(EditorManager.instance.basePrefabs.emptyObject, track.transform).AddComponent();
+
+ point.NewInitialize(elementName, track, trackPercent);
+ point.SetParent(track);
+
+ return point;
+ }
+
+ private void NewInitialize(string elementName, Track track, FlexibleFloat trackPercent)
+ {
+ base.NewInitialize(elementName);
+ this.track = track;
+ this.trackPositioner = gameObject.AddComponent();
+ this.trackPositioner.spline = track.trackPathSubmodule.path;
+ this.trackPercent = trackPercent;
+ }
+
+ public void Update()
+ {
+ if (trackPercent.animations.Count > 0)
+ {
+ trackPercent.UpdateFlexibleFloat(EditorManager.instance.songModule.songTime);
+ if (trackPercent.returnType == FlexibleReturnType.MiddleExecuting)
+ {
+ trackPositioner.SetPercent(trackPercent.value);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs.meta b/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs.meta
new file mode 100644
index 00000000..78a65b76
--- /dev/null
+++ b/Assets/Scripts/GameElements/Track/TrackPoints/TrackPercentPoint.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6150424209395469db7104ccaa18bffd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackRendererSubmodule.cs b/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackRendererSubmodule.cs
index 0ad86ef5..6186f0c4 100644
--- a/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackRendererSubmodule.cs
+++ b/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackRendererSubmodule.cs
@@ -11,25 +11,29 @@ namespace Ichni.RhythmGame
public Track track;
public MeshGenerator meshGenerator;
public MeshRenderer meshRenderer;
+ public Material renderMaterial;
}
public class TrackRendererSubmoduleAutoOrient : TrackRendererSubmodule
{
public SplineRenderer splineRenderer;
- public void NewInitialize(Track track)
+ public void NewInitialize(Track track, Material material = null)
{
this.track = track;
this.track.trackRendererSubmodule = this;
this.splineRenderer = track.AddComponent();
+ this.meshRenderer = splineRenderer.GetComponent();
this.meshGenerator = splineRenderer;
+ this.renderMaterial = material == null ? EditorManager.instance.basePrefabs.defaultTrackMaterial : material;
this.splineRenderer.spline = track.trackPathSubmodule.path;
this.splineRenderer.clipFrom = 0;
this.splineRenderer.clipTo = 1;
+ this.meshRenderer.material = renderMaterial;
Debug.Log(splineRenderer.clipFrom + " " + splineRenderer.clipTo);
this.splineRenderer.color = Color.white;
}
-
+
public override void InitialRefresh()
{
if (track.trackTimeSubmodule is TrackTimeSubmoduleMovable)
diff --git a/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackTimeSubmodule.cs b/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackTimeSubmodule.cs
index 60981eca..64d9f899 100644
--- a/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackTimeSubmodule.cs
+++ b/Assets/Scripts/GameElements/Track/TrackSubmodules/TrackTimeSubmodule.cs
@@ -37,9 +37,7 @@ namespace Ichni.RhythmGame
headPercent = GetTrackPercent(songTime);
tailPercent = GetTrackPercent(songTime - visibleTrackTimeLength);
-
- Debug.Log("Head: " + headPercent + " Tail: " + tailPercent);
-
+
if (track.trackRendererSubmodule != null)
{
track.trackRendererSubmodule.meshGenerator.clipFrom = tailPercent;