63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
|
|
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()
|
|||
|
|
{
|
|||
|
|
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)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|