2025-06-03 02:42:28 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Ichni.RhythmGame
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract partial class AnimationBase : GameElement, IHaveTimeDurationSubmodule
|
|
|
|
|
|
{
|
|
|
|
|
|
public GameElement animatedObject;
|
|
|
|
|
|
public FlexibleReturnType animationReturnType;
|
|
|
|
|
|
|
|
|
|
|
|
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public override void SetDefaultSubmodules()
|
|
|
|
|
|
{
|
|
|
|
|
|
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="songTime">歌曲时间</param>
|
|
|
|
|
|
protected abstract void UpdateAnimation(float songTime);
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void Update()
|
|
|
|
|
|
{
|
2025-07-08 14:28:40 -04:00
|
|
|
|
if (!GameManager.instance.audioManager.isUpdating)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-03 02:42:28 -04:00
|
|
|
|
if (timeDurationSubmodule.CheckTimeInDuration(GameManager.instance.songTime))
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdateAnimation(GameManager.instance.songTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 施加时间偏移,即移动所有Flexible参数的时间
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="offset"></param>
|
|
|
|
|
|
public virtual void ApplyTimeOffset(float offset)
|
|
|
|
|
|
{
|
|
|
|
|
|
timeDurationSubmodule.startTime += offset;
|
|
|
|
|
|
timeDurationSubmodule.endTime += offset;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace Beatmap
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class AnimationBase_BM : GameElement_BM
|
|
|
|
|
|
{
|
|
|
|
|
|
public AnimationBase_BM()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AnimationBase_BM(string elementName, Guid elementGuid, List<string> tags,
|
|
|
|
|
|
GameElement_BM attachedElement) : base(elementName, elementGuid, tags, attachedElement)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|