non-strip hold完成
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public partial class BasicHoldVisualMovable : NoteVisualBaseHold
|
||||
{
|
||||
public static BasicHoldVisualMovable GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName)
|
||||
{
|
||||
BasicHoldVisualMovable holdVisualMovable = SubstantialObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement).GetComponent<BasicHoldVisualMovable>();
|
||||
|
||||
return holdVisualMovable;
|
||||
}
|
||||
|
||||
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;
|
||||
this.hold = note as Hold;
|
||||
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
effectSubmodule.effectCollection["Generate"].Add(new BasicNoteGenerateExpand(this));
|
||||
effectSubmodule.effectCollection["Holding"].Add(new BasicNoteHoldingExpand(this));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new BasicNotePerfectBurst(this));
|
||||
effectSubmodule.effectCollection["Good"].Add(new BasicNoteGoodBurst(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new BasicNoteBadShrink(this));
|
||||
effectSubmodule.effectCollection["Miss"].Add(new BasicNoteMissPale(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class BasicHoldVisualMovable
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.BasicHoldVisualMovable_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, themeBundleName, objectName);
|
||||
}
|
||||
|
||||
public override void UpdateHoldInMovableTrack()
|
||||
{
|
||||
if (hold.isHolding)
|
||||
{
|
||||
float percent = (hold.track.trackTimeSubmodule as TrackTimeSubmoduleMovable).GetTrackPercent(hold.exactJudgeTime + hold.holdingTime);
|
||||
hold.trackPositioner.SetPercent(percent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class BasicHoldVisualMovable_BM : SubstantialObject_BM
|
||||
{
|
||||
public BasicHoldVisualMovable_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BasicHoldVisualMovable_BM(string elementName, Guid id, List<string> tags,
|
||||
GameElement_BM parent, string themeBundleName, string objectName) :
|
||||
base(elementName, id, tags, parent, themeBundleName, objectName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = BasicHoldVisualMovable.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return BasicHoldVisualMovable.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent, themeBundleName, objectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user