效果模块,以及代码位置整理
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class TrackTotalTimeChange : AnimationBase
|
||||
{
|
||||
public FlexibleFloat totalTime;
|
||||
public TrackTimeSubmoduleStatic targetTrackTimeSubmoduleStatic;
|
||||
|
||||
public static TrackTotalTimeChange GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, bool isFirstGenerated, Track animatedTrack, FlexibleFloat totalTime)
|
||||
{
|
||||
TrackTotalTimeChange trackTotalTimeChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
|
||||
.AddComponent<TrackTotalTimeChange>();
|
||||
trackTotalTimeChange.Initialize(elementName, id, tags, isFirstGenerated, animatedTrack);
|
||||
|
||||
trackTotalTimeChange.animatedObject = animatedTrack;
|
||||
|
||||
trackTotalTimeChange.targetTrackTimeSubmoduleStatic = animatedTrack.trackTimeSubmodule as TrackTimeSubmoduleStatic;
|
||||
|
||||
trackTotalTimeChange.totalTime = totalTime;
|
||||
trackTotalTimeChange.animationReturnType = FlexibleReturnType.Before;
|
||||
//trackTotalTimeChange.timeDurationSubmodule.SetDuration(totalTime);
|
||||
|
||||
return trackTotalTimeChange;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
submoduleList.Add(timeDurationSubmodule);
|
||||
}
|
||||
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
{
|
||||
totalTime.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (totalTime.returnType == FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
targetTrackTimeSubmoduleStatic.trackTotalTime = totalTime.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class TrackTotalTimeChange
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new TrackTotalTimeChange_BM(elementName, elementGuid, tags, animatedObject.matchedBM as Track_BM, totalTime.ConvertToBM());
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class TrackTotalTimeChange_BM : GameElement_BM
|
||||
{
|
||||
public FlexibleFloat_BM totalTime;
|
||||
|
||||
public TrackTotalTimeChange_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TrackTotalTimeChange_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
GameElement_BM attachedElement, FlexibleFloat_BM totalTime) :
|
||||
base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.totalTime = totalTime;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track, totalTime.ConvertToGameType());
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags, false,
|
||||
parent as Track, totalTime.ConvertToGameType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2eec4a2a4ac744e0ca183d59c465c4e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user