perf
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
@@ -14,19 +15,20 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectParticle = noteVisual.effectPartList[2].GetComponent<ParticleSystem>();
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
effectParticle.Stop();
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[2], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.Play();
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteGenerateExtend : NoteGenerateEffect
|
||||
{
|
||||
private Hold hold;
|
||||
private DTMNoteVisualHold noteVisualHold;
|
||||
public float targetStartPercent, targetEndPercent;
|
||||
public float startPercent, endPercent;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private void UpdateHold()
|
||||
{
|
||||
hold.trackPositioner.SetPercent(startPercent);
|
||||
noteVisualHold.meshGenerator.SetClipRange(startPercent, endPercent);
|
||||
noteVisualHold.headPoint.SetPercent(startPercent);
|
||||
noteVisualHold.tailPoint.SetPercent(endPercent);
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
noteVisualHold.noteMain.SetActive(false);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class DTMNoteGenerateExtend_BM : NoteGenerateEffect_BM
|
||||
{
|
||||
public DTMNoteGenerateExtend_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DTMNoteGenerateExtend_BM(float effectTime, float generateTime) :
|
||||
base(effectTime, generateTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new DTMNoteGenerateExtend(attachedGameElement as NoteVisualBase, generateTime, effectTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88fcaa4df9cf7d84f9d1849eff92321d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,6 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
@@ -14,19 +15,19 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectParticle = noteVisual.effectPartList[1].GetComponent<ParticleSystem>();
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
public override void Recover()
|
||||
{
|
||||
effectParticle.Stop();
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[1], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.Play();
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public class DTMNoteHoldingBreath : NoteHoldingEffect
|
||||
{
|
||||
private ParticleSystem breathParticle;
|
||||
|
||||
public DTMNoteHoldingBreath(DTMNoteVisualHold noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = GetHoldingTime();
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
if(breathParticle != null) LeanPool.Despawn(breathParticle.gameObject);
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
breathParticle = LeanPool.Spawn(noteVisual.effectPrefabList[3], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
breathParticle.Play();
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
breathParticle.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new Beatmap.DTMNoteHoldingBreath_BM(effectTime);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class DTMNoteHoldingBreath_BM : NoteHoldingEffect_BM
|
||||
{
|
||||
public DTMNoteHoldingBreath_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DTMNoteHoldingBreath_BM(float effectTime) : base(effectTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new DTMNoteHoldingBreath(attachedGameElement as DTMNoteVisualHold);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87240dd684aa2b448b2fef479075e74a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,9 +16,14 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = effectTime;
|
||||
this.noteRenderers = new List<Renderer>();
|
||||
foreach (Renderer renderer in noteVisual.notePartList.Select(part => part.GetComponent<Renderer>()))
|
||||
|
||||
foreach (GameObject part in noteVisual.notePartList)
|
||||
{
|
||||
noteRenderers.Add(renderer);
|
||||
Renderer rend = part.GetComponent<Renderer>();
|
||||
if(rend != null)
|
||||
{
|
||||
noteRenderers.Add(rend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
@@ -12,19 +13,20 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectParticle = noteVisual.effectPartList[0].GetComponent<ParticleSystem>();
|
||||
this.effectTime = 0f;
|
||||
}
|
||||
public override void Recover()
|
||||
{
|
||||
effectParticle.Stop();
|
||||
//effectParticle.Stop();
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
effectParticle = LeanPool.Spawn(noteVisual.effectPrefabList[0], noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
effectParticle.Play();
|
||||
noteVisual.noteMain.SetActive(false);
|
||||
LeanPool.Despawn(effectParticle.gameObject, 1);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
|
||||
Reference in New Issue
Block a user