大修
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e991679a349479b4697ad09154830054
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTM_Ripple : MonoBehaviour, IPoolable
|
||||
{
|
||||
public ParticleSystem mainRipple;
|
||||
public ParticleSystem inRipple;
|
||||
public ParticleSystem outRipple;
|
||||
|
||||
private Renderer inRippleRenderer;
|
||||
private Renderer outRippleRenderer;
|
||||
|
||||
public void OnSpawn()
|
||||
{
|
||||
inRippleRenderer = inRipple.GetComponent<Renderer>();
|
||||
outRippleRenderer = outRipple.GetComponent<Renderer>();
|
||||
}
|
||||
|
||||
public void OnDespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetRippleTime(float time)
|
||||
{
|
||||
ParticleSystem.MainModule inRippleMain = inRipple.main;
|
||||
ParticleSystem.MainModule outRippleMain = outRipple.main;
|
||||
inRippleMain.startLifetime = time;
|
||||
outRippleMain.startLifetime = time;
|
||||
}
|
||||
|
||||
public void SetEmissionColor(Color color)
|
||||
{
|
||||
inRippleRenderer.material.SetColor("_MainColor", color);
|
||||
outRippleRenderer.material.SetColor("_MainColor", color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7b6652747cbe0c448fb3fbc0f9beda3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d35b3119313fb9041b253fa75f70d3c8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,245 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMTrail : EnvironmentObject, IHaveTrail, IHaveInteraction
|
||||
{
|
||||
#region [暴露属性字段] Exposed Fields
|
||||
public GameObject headPoint, headCircle;
|
||||
public GameObject trailBody;
|
||||
public bool isHeadEnabled;
|
||||
|
||||
public List<Renderer> renderers;
|
||||
public ParticleSystem headCircleParticle;
|
||||
public TrailRenderer trailRenderer { get; set; }
|
||||
|
||||
public FlexibleFloat visibleTimeLength;
|
||||
public FlexibleBool enableTimes;
|
||||
public float enableProcessTime = 0.5f;
|
||||
public float headSize = 1f;
|
||||
|
||||
public FlexibleFloat headRotateSpeed;
|
||||
float IHaveTrail.visibleTimeLength
|
||||
{
|
||||
get => visibleTimeLength.animations.Count > 0 ? visibleTimeLength.value : 5f;
|
||||
set => visibleTimeLength.value = value;
|
||||
}
|
||||
|
||||
public override bool haveEmissionColor => true;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public static DTMTrail GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement,
|
||||
bool isStatic, FlexibleFloat visibleTimeLength, FlexibleBool enableTimes, FlexibleFloat headRotateSpeed, float enableProcessTime,
|
||||
float headSize)
|
||||
{
|
||||
DTMTrail dtmTrail = EnvironmentObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isStatic).GetComponent<DTMTrail>();
|
||||
|
||||
dtmTrail.isHeadEnabled = false;
|
||||
dtmTrail.visibleTimeLength = visibleTimeLength;
|
||||
dtmTrail.enableTimes = enableTimes;
|
||||
dtmTrail.headRotateSpeed = headRotateSpeed;
|
||||
dtmTrail.enableProcessTime = enableProcessTime;
|
||||
dtmTrail.headSize = headSize;
|
||||
|
||||
return dtmTrail;
|
||||
}
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
base.SetDefaultSubmodules();
|
||||
colorSubmodule.emissionEnabled = true;
|
||||
colorSubmodule.originalEmissionColor = Color.white;
|
||||
colorSubmodule.originalEmissionIntensity = 1;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
enableTimes = new FlexibleBool();
|
||||
|
||||
if (parentElement is TrackHeadPoint trackHeadPoint)
|
||||
{
|
||||
enableTimes.Add(new AnimatedBool(0f, false));
|
||||
enableTimes.Add(new AnimatedBool(trackHeadPoint.trackTimeSubmoduleMovable.trackStartTime, true));
|
||||
enableTimes.Add(new AnimatedBool(trackHeadPoint.trackTimeSubmoduleMovable.trackEndTime, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
enableTimes.Add(new AnimatedBool(0f, false));
|
||||
enableTimes.Add(new AnimatedBool(1f, true));
|
||||
}
|
||||
}
|
||||
|
||||
//SetUpTweeners();
|
||||
trailRenderer = trailBody.GetComponent<TrailRenderer>();
|
||||
var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
rotationBySpeedModule.z = 0;
|
||||
headPoint.transform.localScale = Vector3.zero;
|
||||
headCircle.transform.localScale = Vector3.zero;
|
||||
|
||||
renderers.ForEach(rend => rend.InitializeShader());
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
renderers.ForEach(rend =>
|
||||
{
|
||||
if (colorSubmodule.emissionEnabled)
|
||||
{
|
||||
rend.material.EnableKeyword("_EMISSION_ON");
|
||||
// Debug.Log("Enable emission");
|
||||
}
|
||||
else
|
||||
{
|
||||
rend.material.DisableKeyword("_EMISSION_ON");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Debug.Log(rend.material.IsKeywordEnabled("_EMISSION_ON") + " " + rend.material.IsKeywordEnabled("_USEREDASALPHA_ON"));
|
||||
|
||||
rend.material.SetColor("_BaseColor", colorSubmodule.currentBaseColor);
|
||||
rend.material.SetColor("_EmissionColor", colorSubmodule.GetCurrentEmissionColor());
|
||||
});
|
||||
}
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
renderers.ForEach(rend =>
|
||||
{
|
||||
rend.material.EnableKeyword("_USEREDASALPHA_ON");
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [事件动画逻辑] Event Animation Logic
|
||||
private void Update()
|
||||
{
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
enableTimes.UpdateFlexibleBool(songTime);
|
||||
if (enableTimes.value && !isHeadEnabled)
|
||||
{
|
||||
EnableHead();
|
||||
isHeadEnabled = true;
|
||||
}
|
||||
else if (!enableTimes.value && isHeadEnabled)
|
||||
{
|
||||
DisableHead();
|
||||
isHeadEnabled = false;
|
||||
}
|
||||
|
||||
visibleTimeLength.UpdateFlexibleFloat(songTime);
|
||||
if (visibleTimeLength.animations.Count > 0 && EditorManager.instance.musicPlayer.isPlaying && trailRenderer.time != visibleTimeLength.value)//为的是接口里头那个用来set的
|
||||
{
|
||||
// Debug.Log(trailRenderer == null);
|
||||
|
||||
trailRenderer.time = visibleTimeLength.value;
|
||||
}
|
||||
|
||||
if (isHeadEnabled && headRotateSpeed.animations.Count > 0)
|
||||
{
|
||||
headRotateSpeed.UpdateFlexibleFloat(songTime);
|
||||
var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
rotationBySpeedModule.z = headRotateSpeed.value;
|
||||
}
|
||||
|
||||
if (Keyboard.current.tKey.wasPressedThisFrame)
|
||||
{
|
||||
TriggerInteraction();
|
||||
}
|
||||
}
|
||||
|
||||
private Sequence enableHeadSequence;
|
||||
private Sequence disableHeadSequence;
|
||||
private Sequence headBounceSequence;
|
||||
|
||||
private void EnableHead()
|
||||
{
|
||||
enableHeadSequence = DOTween.Sequence();
|
||||
enableHeadSequence.Append(headPoint.transform.DOScale(headSize, enableProcessTime).SetEase(Ease.OutQuad));
|
||||
enableHeadSequence.Join(headCircle.transform.DOScale(headSize, enableProcessTime).SetEase(Ease.OutQuad));
|
||||
enableHeadSequence.Play();
|
||||
}
|
||||
|
||||
private void DisableHead()
|
||||
{
|
||||
disableHeadSequence = DOTween.Sequence();
|
||||
disableHeadSequence.Append(headPoint.transform.DOScale(0, enableProcessTime).SetEase(Ease.OutQuad));
|
||||
disableHeadSequence.Join(headCircle.transform.DOScale(0, enableProcessTime).SetEase(Ease.OutQuad));
|
||||
disableHeadSequence.Play();
|
||||
}
|
||||
|
||||
public void TriggerInteraction()
|
||||
{
|
||||
headBounceSequence = DOTween.Sequence();
|
||||
headBounceSequence.Append(headPoint.transform.DOBlendableScaleBy(Vector3.one * 0.2f, 0.2f).SetEase(Ease.OutBack));
|
||||
headBounceSequence.Join(headCircle.transform.DOBlendableScaleBy(Vector3.one * 0.2f, 0.2f).SetEase(Ease.OutBack));
|
||||
headBounceSequence.Append(headPoint.transform.DOBlendableScaleBy(Vector3.one * -0.2f, 0.2f).SetEase(Ease.OutBack));
|
||||
headBounceSequence.Join(headCircle.transform.DOBlendableScaleBy(Vector3.one * -0.2f, 0.2f).SetEase(Ease.OutBack));
|
||||
headBounceSequence.Play();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public partial class DTMTrail
|
||||
{
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DTMTrail_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
themeBundleName, objectName, isStatic, visibleTimeLength, enableTimes, headRotateSpeed, enableProcessTime, headSize);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTMTrail");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
|
||||
var visibleTimeLengthButton = inspector.GenerateButton(this, subcontainer, "Visible Time Length", () =>
|
||||
{
|
||||
var ew = inspector.GenerateCompositeParameterWindow(
|
||||
this, "Visible Time Length", nameof(visibleTimeLength));
|
||||
ew.SetAsFlexibleFloat();
|
||||
});
|
||||
|
||||
var enableTimeListButton = inspector.GenerateButton(this, subcontainer, "Enable Head Time List", () =>
|
||||
{
|
||||
var ew = inspector.GenerateCompositeParameterWindow(
|
||||
this, "Enable Head Time List", nameof(enableTimes));
|
||||
ew.SetAsFlexibleBool();
|
||||
});
|
||||
|
||||
var headRotateSpeedButton = inspector.GenerateButton(this, subcontainer, "Head Rotate Speed", () =>
|
||||
{
|
||||
var ew = inspector.GenerateCompositeParameterWindow(
|
||||
this, "Head Rotate Speed", nameof(headRotateSpeed));
|
||||
ew.SetAsFlexibleFloat();
|
||||
});
|
||||
|
||||
var enableProcessTimeInputField =
|
||||
inspector.GenerateInputField(this, subcontainer, "Enable Process Time", nameof(enableProcessTime));
|
||||
|
||||
var headSizeInputField =
|
||||
inspector.GenerateInputField(this, subcontainer, "Head Size", nameof(headSize));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb907071d10d7324995ff3aefbc2f1df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84bce6d5842025f4e9ef10dfe6caa30e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cf5dab8b86224aaf98d3064f11eed8a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteBadBurst : NoteBadEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
private ParticleSystem effectParticle;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteBadBurst(NoteVisualBase noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectParticle = noteVisual.effectPrefabList[2].GetComponent<ParticleSystem>();
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Recover()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[2], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.transform.SetParent(EditorManager.instance.cameraManager.gameCamera.transform);
|
||||
effectParticle.Play();
|
||||
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(false);
|
||||
}
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new DTMNoteBadBurst_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Bad Burst");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67db7eb4fcc0349018286835cdcb09b6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteGenerateExpand : NoteGenerateEffect
|
||||
{
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteGenerateExpand(NoteVisualBase noteVisual, float generateTime, float effectTime)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.generateTime = generateTime;
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public sealed override void Recover()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
||||
{
|
||||
noteVisualHold.meshGenerator.size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
noteVisual.noteMain.transform.localScale = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
|
||||
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
||||
{
|
||||
noteVisualHold.meshGenerator.size = e;
|
||||
}
|
||||
else
|
||||
{
|
||||
noteVisual.noteMain.transform.localScale = e * Vector3.one;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
||||
{
|
||||
noteVisualHold.meshGenerator.size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
noteVisual.noteMain.transform.localScale = Vector3.one;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new Beatmap.DTMNoteGenerateExpand_BM(effectTime, generateTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Generate Expand");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
var generateTimeField = inspector.GenerateInputField(this, subcontainer, "Generate Time", nameof(generateTime));
|
||||
var effectTimeField = inspector.GenerateInputField(this, subcontainer, "Effect Time", nameof(effectTime));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69b808d97a6bb7f4aafbf1f8960fceac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,126 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteGenerateExtend : NoteGenerateEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
private Hold hold;
|
||||
private DTMNoteVisualHold noteVisualHold;
|
||||
|
||||
public float targetStartPercent, targetEndPercent;
|
||||
public float startPercent, endPercent;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteGenerateExtend(NoteVisualBase noteVisual, float generateTime, float effectTime)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.hold = note as Hold;
|
||||
this.noteVisual = noteVisual;
|
||||
this.noteVisualHold = noteVisual as DTMNoteVisualHold;
|
||||
this.generateTime = generateTime;
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
private void UpdateHold()
|
||||
{
|
||||
hold.trackPositioner.SetPercent(startPercent);
|
||||
noteVisualHold.meshGenerator.SetClipRange(startPercent, endPercent);
|
||||
noteVisualHold.headPoint.SetPercent(startPercent);
|
||||
noteVisualHold.tailPoint.SetPercent(endPercent);
|
||||
}
|
||||
public override void UpdateEffect(float triggerTime)
|
||||
{
|
||||
EffectState state = CheckEffectState(triggerTime);
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
triggerTime -= generateTime;
|
||||
|
||||
if (state == EffectState.Before)
|
||||
{
|
||||
if (nowEffectState != EffectState.Before)
|
||||
{
|
||||
nowEffectState = EffectState.Before;
|
||||
effectProgressPercent = 0;
|
||||
}
|
||||
Recover();
|
||||
}
|
||||
else if (state == EffectState.Middle)
|
||||
{
|
||||
if (nowEffectState == EffectState.Before)
|
||||
{
|
||||
PreExecute();
|
||||
}
|
||||
|
||||
nowEffectState = EffectState.Middle;
|
||||
effectProgressPercent = (songTime - triggerTime) / effectTime;
|
||||
Execute();
|
||||
}
|
||||
else if (state == EffectState.After && nowEffectState != EffectState.After)
|
||||
{
|
||||
if (nowEffectState != EffectState.Middle)
|
||||
PreExecute();
|
||||
nowEffectState = EffectState.After;
|
||||
effectProgressPercent = 1;
|
||||
Adjust();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
if (noteVisualHold.noteMain.activeSelf)
|
||||
noteVisualHold.noteMain.SetActive(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new DTMNoteGenerateExtend_BM(effectTime, generateTime);
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
TrackTimeSubmoduleMovable trackTimeSubmoduleMovable = hold.track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
|
||||
targetStartPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.exactJudgeTime);
|
||||
targetEndPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
startPercent = targetStartPercent;
|
||||
endPercent = targetStartPercent;
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
UpdateHold();
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
|
||||
startPercent = targetStartPercent;
|
||||
endPercent = Mathf.Lerp(targetStartPercent, targetEndPercent, e);
|
||||
UpdateHold();
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
startPercent = targetStartPercent;
|
||||
endPercent = targetEndPercent;
|
||||
UpdateHold();
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Generate Expand");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
var generateTimeField = inspector.GenerateInputField(this, subcontainer, "Generate Time", nameof(generateTime));
|
||||
var effectTimeField = inspector.GenerateInputField(this, subcontainer, "Effect Time", nameof(effectTime));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88fcaa4df9cf7d84f9d1849eff92321d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteGoodBurst : NoteGoodEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
private ParticleSystem effectParticle;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteGoodBurst(NoteVisualBase noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Recover()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[1], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.transform.SetParent(EditorManager.instance.cameraManager.gameCamera.transform);
|
||||
effectParticle.Play();
|
||||
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new DTMNoteGoodBurst_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Good Burst");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df5f054473b424da2a58900ad53cf508
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,110 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteHoldingBreath : NoteHoldingEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
private ParticleSystem breathParticle;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteHoldingBreath(DTMNoteVisualHold noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = GetHoldingTime();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Recover()
|
||||
{
|
||||
if (breathParticle != null)
|
||||
LeanPool.Despawn(breathParticle);
|
||||
}
|
||||
public override void UpdateEffect(float triggerTime)
|
||||
{
|
||||
EffectState state = CheckEffectState(triggerTime);
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
|
||||
if (state == EffectState.Before)
|
||||
{
|
||||
Recover();
|
||||
if (nowEffectState != EffectState.Before)
|
||||
{
|
||||
nowEffectState = EffectState.Before;
|
||||
effectProgressPercent = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else if (state == EffectState.Middle)
|
||||
{
|
||||
if (nowEffectState == EffectState.Before || nowEffectState == EffectState.After)
|
||||
{
|
||||
PreExecute();
|
||||
}
|
||||
|
||||
nowEffectState = EffectState.Middle;
|
||||
effectProgressPercent = (songTime - triggerTime) / effectTime;
|
||||
Execute();
|
||||
}
|
||||
else if (state == EffectState.After && nowEffectState != EffectState.After)
|
||||
{
|
||||
if (nowEffectState != EffectState.Middle)
|
||||
PreExecute();
|
||||
nowEffectState = EffectState.After;
|
||||
effectProgressPercent = 1;
|
||||
Adjust();
|
||||
}
|
||||
}
|
||||
public override void PreExecute()
|
||||
{
|
||||
GameObject effectPrefab = null;
|
||||
switch (EditorManager.instance.currentJudgeType)
|
||||
{
|
||||
case NoteBase.NoteJudgeType.Perfect:
|
||||
effectPrefab = noteVisual.effectPrefabList[3];
|
||||
break;
|
||||
case NoteBase.NoteJudgeType.Good:
|
||||
effectPrefab = noteVisual.effectPrefabList[4];
|
||||
break;
|
||||
case NoteBase.NoteJudgeType.Bad:
|
||||
effectPrefab = noteVisual.effectPrefabList[5];
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (breathParticle != null)
|
||||
LeanPool.Despawn(breathParticle);
|
||||
breathParticle = LeanPool.Spawn(effectPrefab, noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
breathParticle.Play();
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
if (breathParticle != null)
|
||||
breathParticle.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new Beatmap.DTMNoteHoldingBreath_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Basic Note Holding Expand");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87240dd684aa2b448b2fef479075e74a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,99 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteMissTransparent : NoteMissEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
public List<Renderer> noteRenderers;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNoteMissTransparent(NoteVisualBase noteVisual, float effectTime)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = effectTime;
|
||||
this.noteRenderers = new List<Renderer>();
|
||||
foreach (GameObject part in noteVisual.notePartList)
|
||||
{
|
||||
Renderer rend = part.GetComponent<Renderer>();
|
||||
if(rend != null)
|
||||
{
|
||||
noteRenderers.Add(rend);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Recover()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
|
||||
noteRenderers[0].materials[1].SetFloat("_GlowIntensity", 4f);
|
||||
foreach (var renderer in noteRenderers)
|
||||
{
|
||||
foreach (Material m in renderer.materials)
|
||||
{
|
||||
m.SetFloat("_MainAlpha", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
if (noteVisual is DTMNoteVisualHold)
|
||||
{
|
||||
noteRenderers[0].materials[1].SetFloat("_GlowIntensity", 0.25f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
|
||||
float alpha = (1 - e) / 4f;
|
||||
foreach (var renderer in noteRenderers)
|
||||
{
|
||||
foreach (Material m in renderer.materials)
|
||||
{
|
||||
m.SetFloat("_MainAlpha", alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
foreach (var renderer in noteRenderers)
|
||||
{
|
||||
foreach (Material m in renderer.materials)
|
||||
{
|
||||
m.SetFloat("_MainAlpha", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new DTMNoteMissTransparent_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Miss Transparent");
|
||||
var subcontainer = container.GenerateSubcontainer(3);
|
||||
var effectTimeField = inspector.GenerateInputField(this, subcontainer, "Effect Time", nameof(effectTime));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8ac43839ad4fe246a8da60557bd1991
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNotePerfectBurst : NotePerfectEffect
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
private ParticleSystem effectParticle;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMNotePerfectBurst(NoteVisualBase noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Recover()
|
||||
{
|
||||
try
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
}
|
||||
catch { }
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[0], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.transform.SetParent(EditorManager.instance.cameraManager.gameCamera.transform);
|
||||
|
||||
effectParticle.Play();
|
||||
|
||||
// effectParticle.transform.DOMove(noteVisual.noteVisualPosition, 0.2f);
|
||||
|
||||
if (note is Hold && noteVisual.isHighlighted)
|
||||
{
|
||||
noteVisual.extraPartList[0].gameObject.SetActive(false);
|
||||
}
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new DTMNotePerfectBurst_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Note Perfect Burst");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4979bd6148dc44f2c9444c1d3f663a2a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,96 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMRippleEffect : EffectBase
|
||||
{
|
||||
#region [运行时缓存数据与暴露属性] Fields
|
||||
private GameObject prefab;
|
||||
private DTM_Ripple ripple;
|
||||
|
||||
public float rippleTime;
|
||||
public Vector3 positionOffset;
|
||||
public Vector3 eulerAnglesOffset;
|
||||
public Vector3 scale;
|
||||
public Color emissionColor;
|
||||
public float emissionIntensity;
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public DTMRippleEffect(float rippleTime, Color emissionColor, float emissionIntensity)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.rippleTime = rippleTime;
|
||||
this.positionOffset = Vector3.zero;
|
||||
this.eulerAnglesOffset = Vector3.zero;
|
||||
this.scale = Vector3.one;
|
||||
this.emissionColor = emissionColor;
|
||||
this.emissionIntensity = emissionIntensity;
|
||||
prefab =
|
||||
EditorManager.instance.
|
||||
customPrefabs["departure_to_multiverse"].
|
||||
GetPrefab("DTM_Ripple");
|
||||
}
|
||||
|
||||
public DTMRippleEffect(float rippleTime, Color emissionColor, float emissionIntensity,
|
||||
Vector3 positionOffset, Vector3 eulerAnglesOffset, Vector3 scale)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.rippleTime = rippleTime;
|
||||
this.positionOffset = positionOffset;
|
||||
this.eulerAnglesOffset = eulerAnglesOffset;
|
||||
this.scale = scale;
|
||||
this.emissionColor = emissionColor;
|
||||
this.emissionIntensity = emissionIntensity;
|
||||
prefab =
|
||||
EditorManager.instance.
|
||||
customPrefabs["departure_to_multiverse"].
|
||||
GetPrefab("DTM_Ripple");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [特效逻辑] Effect Logic
|
||||
public override void Adjust()
|
||||
{
|
||||
|
||||
ripple = LeanPool.Spawn(prefab, attachedGameElement.transform).GetComponent<DTM_Ripple>();
|
||||
ripple.transform.localPosition = positionOffset;
|
||||
ripple.transform.localEulerAngles = eulerAnglesOffset;
|
||||
ripple.transform.localScale = scale;
|
||||
ripple.transform.SetParent(null);
|
||||
|
||||
ripple.SetRippleTime(rippleTime);
|
||||
ripple.SetEmissionColor(emissionColor * Mathf.Pow(2, emissionIntensity));
|
||||
ripple.mainRipple.Play();
|
||||
LeanPool.Despawn(ripple.gameObject, rippleTime);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new Beatmap.DTMRippleEffect_BM(rippleTime, emissionColor, emissionIntensity, positionOffset, eulerAnglesOffset, scale);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("DTM Ripple Effect");
|
||||
var effectSettings1 = container.GenerateSubcontainer(3);
|
||||
var rippleTimeInputField = inspector.GenerateInputField(this, effectSettings1, "Ripple Time", nameof(rippleTime));
|
||||
var effectSettings2 = container.GenerateSubcontainer(1);
|
||||
var emissionColorPicker = inspector.GenerateEmissionColorPicker(this, effectSettings2, "Color", "NULL", nameof(emissionColor), nameof(emissionIntensity));
|
||||
var positionOffsetInputField = inspector.GenerateVector3InputField(this, effectSettings2, "Position Offset", nameof(positionOffset));
|
||||
var eulerAnglesInputField = inspector.GenerateVector3InputField(this, effectSettings2, "Euler Angles", nameof(eulerAnglesOffset));
|
||||
var scaleInputField = inspector.GenerateVector3InputField(this, effectSettings2, "Scale", nameof(scale));
|
||||
SetRemove(effectSettings2);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c727da5a60404cd439460f09572a8085
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c0f6392ae97c45f381ee24438ce8157
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMNoteVisual : NoteVisualBase
|
||||
{
|
||||
#region [暴露属性字段] Exposed Fields
|
||||
public List<List<Material>> normalMaterialList;
|
||||
public List<List<Material>> highlightMaterialList;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public new static DTMNoteVisual GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement, bool isHighlighted)
|
||||
{
|
||||
DTMNoteVisual noteVisual = NoteVisualBase.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isHighlighted).GetComponent<DTMNoteVisual>();
|
||||
|
||||
return noteVisual;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
NoteBase note = parentElement as NoteBase;
|
||||
if (note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
|
||||
this.note = note;
|
||||
note.noteVisual = this;
|
||||
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
note.noteJudgeSubmodule.AddJudgeUnit("TouchArea");
|
||||
effectSubmodule.effectCollection["Generate"].Add(new DTMNoteGenerateExpand(this, 1f, 0.2f));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new DTMNotePerfectBurst(this));
|
||||
if (objectName.Contains("Tap"))
|
||||
{
|
||||
effectSubmodule.effectCollection["Good"].Add(new DTMNoteGoodBurst(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new DTMNoteBadBurst(this));
|
||||
}
|
||||
effectSubmodule.effectCollection["Miss"].Add(new DTMNoteMissTransparent(this, 0.2f));
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
Recover();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [视觉控制与恢复] Visual Controls
|
||||
public override void Recover()
|
||||
{
|
||||
foreach (GameObject part in notePartList)
|
||||
{
|
||||
Renderer rend = part.GetComponent<Renderer>();
|
||||
if (rend != null)
|
||||
{
|
||||
rend.material.SetFloat("_MainAlpha", 1f);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (EffectBase effect in effectSubmodule.effectCollection["Generate"])
|
||||
{
|
||||
effect.Recover();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public partial class DTMNoteVisual
|
||||
{
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.DTMNoteVisual_BM(elementName, elementGuid, tags,
|
||||
parentElement.matchedBM as GameElement_BM, themeBundleName, objectName, isHighlighted);
|
||||
}
|
||||
|
||||
public override void SetHighlight()
|
||||
{
|
||||
//List<Renderer> partRendererList = notePartList.Select(part => part.GetComponent<Renderer>()).ToList();
|
||||
|
||||
//partRendererList.ForEach(rend => Destroy(rend.material));
|
||||
|
||||
if (note is Tap or Hold)
|
||||
{
|
||||
extraPartList[0].gameObject.SetActive(isHighlighted);
|
||||
}
|
||||
|
||||
/*if (!isHighlighted)
|
||||
{
|
||||
for (int i = 0; i < partRendererList.Count; i++)
|
||||
{
|
||||
partRendererList[i].material = Instantiate(normalMaterialList[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < partRendererList.Count; i++)
|
||||
{
|
||||
partRendererList[i].material = Instantiate(highlightMaterialList[i]);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea0771a0c87f746769a9ffd7286a0665
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public partial class DTMNoteVisualHold : DTMNoteVisual, INoteVisualHold, IHaveTransformSubmodule
|
||||
{
|
||||
#region [运行时缓存数据与暴露属性] Fields
|
||||
public Hold hold { get; set; }
|
||||
|
||||
public MeshGenerator meshGenerator;
|
||||
public SplinePositioner headPoint, tailPoint;
|
||||
private MaterialPropertyBlock materialPropertyBlock;
|
||||
public override Vector3 noteVisualPosition => headPoint.transform.position;
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
public new static DTMNoteVisualHold GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, string themeBundleName, string objectName, GameElement parentElement, bool isHighlighted)
|
||||
{
|
||||
DTMNoteVisualHold noteVisualHold = NoteVisualBase.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement, isHighlighted).GetComponent<DTMNoteVisualHold>();
|
||||
|
||||
return noteVisualHold;
|
||||
}
|
||||
public override void Initialize(string name, Guid elementGuid, List<string> tags, bool isFirstGenerated, GameElement parentElement)
|
||||
{
|
||||
base.Initialize(name, elementGuid, tags, isFirstGenerated, parentElement);
|
||||
materialPropertyBlock = new();
|
||||
Observable.NextFrame().Subscribe(_ =>
|
||||
{
|
||||
Recover();
|
||||
}).AddTo(gameObject);
|
||||
}
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
NoteBase note = parentElement as NoteBase;
|
||||
if (note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
|
||||
if (!note.isOnTrack) throw new System.Exception("这种HoldNoteVisual只能生成在Track上。");
|
||||
|
||||
this.note = note;
|
||||
note.noteVisual = this;
|
||||
this.hold = note as Hold;
|
||||
|
||||
this.headPoint = notePartList[0].GetComponent<SplinePositioner>();
|
||||
this.meshGenerator = notePartList[1].GetComponent<MeshGenerator>();
|
||||
this.tailPoint = notePartList[2].GetComponent<SplinePositioner>();
|
||||
|
||||
this.hold.trackPositioner.autoUpdate = false;
|
||||
|
||||
headPoint.spline = hold.track.trackPathSubmodule.path;
|
||||
meshGenerator.spline = hold.track.trackPathSubmodule.path;
|
||||
tailPoint.spline = hold.track.trackPathSubmodule.path;
|
||||
|
||||
TrackTimeSubmoduleMovable trackTimeSubmoduleMovable = hold.track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
|
||||
float startPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.exactJudgeTime);
|
||||
float endPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
|
||||
hold.trackPositioner.SetPercent(startPercent);
|
||||
meshGenerator.SetClipRange(startPercent, endPercent);
|
||||
headPoint.SetPercent(startPercent);
|
||||
tailPoint.SetPercent(endPercent);
|
||||
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
note.noteJudgeSubmodule.AddJudgeUnit("TouchArea");
|
||||
effectSubmodule.effectCollection["Generate"].Add(new DTMNoteGenerateExtend(this, 1f, 0.5f));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new DTMNotePerfectBurst(this));
|
||||
effectSubmodule.effectCollection["Good"].Add(new DTMNoteGoodBurst(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new DTMNoteBadBurst(this));
|
||||
effectSubmodule.effectCollection["Miss"].Add(new DTMNoteMissTransparent(this, 0.2f));
|
||||
effectSubmodule.effectCollection["Holding"].Add(new DTMNoteHoldingBreath(this));
|
||||
}
|
||||
|
||||
// judgeEffect.transform.position = tailPoint.transform.position;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [视觉控制与恢复] Visual Controls
|
||||
public override void Recover()
|
||||
{
|
||||
foreach (GameObject part in notePartList)
|
||||
{
|
||||
Renderer rend = part.GetComponent<Renderer>();
|
||||
if (rend != null)
|
||||
{
|
||||
materialPropertyBlock.SetFloat("_MainAlpha", 1f);
|
||||
rend.SetPropertyBlock(materialPropertyBlock);
|
||||
note.track.trackPathSubmodule.path.RebuildImmediate();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (EffectBase effect in effectSubmodule.effectCollection["Generate"])
|
||||
{
|
||||
effect.Recover();
|
||||
}
|
||||
foreach (EffectBase effect in effectSubmodule.effectCollection["Holding"])
|
||||
{
|
||||
effect.Recover();
|
||||
}
|
||||
}
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
foreach (EffectBase effect in effectSubmodule.effectCollection["Generate"])
|
||||
{
|
||||
if (effect.nowEffectState == EffectBase.EffectState.Middle)
|
||||
{
|
||||
effect.Recover();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public partial class DTMNoteVisualHold
|
||||
{
|
||||
#region [数据导出与巡检] Export & UI
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new DTMNoteVisualHold_BM(elementName, elementGuid, tags,
|
||||
themeBundleName, objectName, parentElement.matchedBM as GameElement_BM, isHighlighted);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [位移更新逻辑] Positional Updates
|
||||
private float startPercent, endPercent;
|
||||
|
||||
public void UpdateHoldInMovableTrack()
|
||||
{
|
||||
if (effectSubmodule.effectCollection["Generate"].Any(e => e.nowEffectState == EffectBase.EffectState.Middle))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TrackTimeSubmoduleMovable trackTimeSubmoduleMovable = hold.track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
|
||||
startPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.exactJudgeTime);
|
||||
endPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
|
||||
if (hold.isHolding)
|
||||
{
|
||||
startPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.exactJudgeTime + hold.holdingTime);
|
||||
endPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
|
||||
}
|
||||
else if (hold.isFinalJudged)
|
||||
{
|
||||
startPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
endPercent = trackTimeSubmoduleMovable.GetTrackPercent(hold.holdEndTime);
|
||||
}
|
||||
|
||||
hold.trackPositioner.SetPercent(startPercent);
|
||||
meshGenerator.SetClipRange(startPercent, endPercent);
|
||||
headPoint.SetPercent(startPercent);
|
||||
tailPoint.SetPercent(endPercent);
|
||||
}
|
||||
|
||||
public void UpdateHoldInStaticTrack()
|
||||
{
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetTransformObserver()
|
||||
{
|
||||
Observable.EveryUpdate().Subscribe(_ =>
|
||||
{
|
||||
if (transformSubmodule == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool willRefresh = false;
|
||||
|
||||
if (transformSubmodule.positionDirtyMark)
|
||||
{
|
||||
transformSubmodule.currentPosition = transformSubmodule.originalPosition + transformSubmodule.positionOffset;
|
||||
Vector2 posOffset = new Vector2(transformSubmodule.currentPosition.x, transformSubmodule.currentPosition.y);
|
||||
hold.trackPositioner.motion.offset = posOffset;
|
||||
meshGenerator.offset = posOffset;
|
||||
headPoint.motion.offset = posOffset;
|
||||
tailPoint.motion.offset = posOffset;
|
||||
transformSubmodule.positionDirtyMark = false;
|
||||
willRefresh = true;
|
||||
transformSubmodule.positionOffset = Vector3.zero;
|
||||
}
|
||||
|
||||
if (willRefresh)
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
}).AddTo(gameObject);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b426e434ca7bbe4b9dce2a80472de6f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user