110 lines
3.6 KiB
C#
110 lines
3.6 KiB
C#
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using Ichni.RhythmGame.Beatmap;
|
||
using Sirenix.OdinInspector;
|
||
using UniRx;
|
||
using UnityEngine;
|
||
|
||
namespace Ichni.RhythmGame
|
||
{
|
||
public interface IBaseElement
|
||
{
|
||
public BaseElement_BM matchedBM { get; set; }
|
||
|
||
/// <summary>
|
||
/// 用于生成存档
|
||
/// </summary>
|
||
public void SaveBM();
|
||
|
||
/// <summary>
|
||
/// 当物体被删除时执行的方法
|
||
/// </summary>
|
||
public void OnDelete();
|
||
|
||
/// <summary>
|
||
/// 删除物体,包括所有子物体
|
||
/// </summary>
|
||
public void Delete();
|
||
}
|
||
|
||
// public virtual void SetTimeDuration()
|
||
// {
|
||
//
|
||
// }
|
||
//
|
||
// public void ApplyTimeDuration()
|
||
// {
|
||
// childElementList.ForEach(x => x.ApplyTimeDuration());
|
||
// timeDurationSubmodule?.SetDurationFromChildren(
|
||
// childElementList.Select(x => x.timeDurationSubmodule).ToList());
|
||
// }
|
||
//
|
||
// /// <summary>
|
||
// /// 设置物体Transform的监听,顺序为Scale -> EulerAngles -> Position
|
||
// /// 如果有一些特殊的物体(例如Camera,ElementFolder),需要自定义监听,可以重写这个方法
|
||
// /// </summary>
|
||
// public virtual void SetTransformObserver()
|
||
// {
|
||
// Observable.EveryUpdate().Subscribe(_ =>
|
||
// {
|
||
// if (transformSubmodule == null)
|
||
// {
|
||
// return;
|
||
// }
|
||
//
|
||
// if (transformSubmodule.scaleDirtyMark)
|
||
// {
|
||
// Vector3 offset = Vector3.zero;
|
||
// foreach (Vector3 scaleOffset in transformSubmodule.scaleOffset)
|
||
// {
|
||
// offset += scaleOffset;
|
||
// }
|
||
//
|
||
// transformSubmodule.currentScale = transformSubmodule.originalScale + offset;
|
||
// transform.localScale = transformSubmodule.currentScale;
|
||
// transformSubmodule.scaleDirtyMark = false;
|
||
// }
|
||
//
|
||
// if (transformSubmodule.eulerAnglesDirtyMark)
|
||
// {
|
||
// Vector3 offset = Vector3.zero;
|
||
// foreach (Vector3 eulerOffset in transformSubmodule.eulerAnglesOffset)
|
||
// {
|
||
// offset += eulerOffset;
|
||
// }
|
||
//
|
||
// transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
|
||
// transform.localEulerAngles = transformSubmodule.currentEulerAngles;
|
||
// transformSubmodule.eulerAnglesDirtyMark = false;
|
||
// }
|
||
//
|
||
// if (transformSubmodule.positionDirtyMark)
|
||
// {
|
||
// Vector3 offset = Vector3.zero;
|
||
// foreach (Vector3 posOffset in transformSubmodule.positionOffset)
|
||
// {
|
||
// offset += posOffset;
|
||
// }
|
||
//
|
||
// transformSubmodule.currentPosition = transformSubmodule.originalPosition + offset;
|
||
// transform.localPosition = transformSubmodule.currentPosition;
|
||
// transformSubmodule.positionDirtyMark = false;
|
||
// }
|
||
//
|
||
// transformSubmodule.scaleOffset.Clear();
|
||
// transformSubmodule.eulerAnglesOffset.Clear();
|
||
// transformSubmodule.positionOffset.Clear();
|
||
// }).AddTo(gameObject);
|
||
// }
|
||
|
||
|
||
namespace Beatmap
|
||
{
|
||
public abstract class BaseElement_BM
|
||
{
|
||
|
||
}
|
||
}
|
||
} |