架构重新设计
基本重做了所有物体和次级模块代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -8,40 +9,39 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class Swirl : AnimationBase
|
||||
{
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
private TransformSubmodule targetTransformSubmodule;
|
||||
public FlexibleFloat eulerAngleX, eulerAngleY, eulerAngleZ;
|
||||
|
||||
public static Swirl GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, BaseElement targetObject,
|
||||
List<string> tags, bool isFirstGenerated, GameElement animatedObject,
|
||||
FlexibleFloat eulerAngleX, FlexibleFloat eulerAngleY, FlexibleFloat eulerAngleZ)
|
||||
{
|
||||
Swirl swirl = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Swirl>();
|
||||
|
||||
swirl.Initialize(elementName, id, tags);
|
||||
swirl.Initialize(elementName, id, tags, isFirstGenerated);
|
||||
|
||||
swirl.targetObject = targetObject;
|
||||
swirl.animatedObject = animatedObject;
|
||||
|
||||
swirl.eulerAngleX = eulerAngleX;
|
||||
swirl.eulerAngleY = eulerAngleY;
|
||||
swirl.eulerAngleZ = eulerAngleZ;
|
||||
swirl.animationReturnType = FlexibleReturnType.Before;
|
||||
|
||||
if (targetObject.transformSubmodule != null)
|
||||
{
|
||||
swirl.targetTransformSubmodule = targetObject.transformSubmodule;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
swirl.targetTransformSubmodule = (animatedObject as IHaveTransformSubmodule).transformSubmodule;
|
||||
|
||||
swirl.SetParent(animatedObject);
|
||||
|
||||
swirl.SetParent(targetObject);
|
||||
|
||||
swirl.timeDurationSubmodule.SetDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
|
||||
//swirl.timeDurationSubmodule.SetDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
|
||||
|
||||
return swirl;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
submoduleList.Add(timeDurationSubmodule);
|
||||
}
|
||||
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
{
|
||||
eulerAngleX.UpdateFlexibleFloat(songTime);
|
||||
@@ -68,14 +68,14 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.Swirl_BM(elementName, elementGuid, tags, parentElement.matchedBM,
|
||||
matchedBM = new Swirl_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
eulerAngleX.ConvertToBM(), eulerAngleY.ConvertToBM(), eulerAngleZ.ConvertToBM());
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Swirl_BM : BaseElement_BM
|
||||
public class Swirl_BM : AnimationBase_BM
|
||||
{
|
||||
public FlexibleFloat_BM eulerAngleX, eulerAngleY, eulerAngleZ;
|
||||
public Swirl_BM()
|
||||
@@ -83,8 +83,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
public Swirl_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
BaseElement_BM attachedElement, FlexibleFloat_BM eulerAngleX, FlexibleFloat_BM eulerAngleY, FlexibleFloat_BM eulerAngleZ)
|
||||
public Swirl_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
|
||||
FlexibleFloat_BM eulerAngleX, FlexibleFloat_BM eulerAngleY, FlexibleFloat_BM eulerAngleZ)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.eulerAngleX = eulerAngleX;
|
||||
@@ -94,13 +94,13 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
Swirl.GenerateElement(elementName, elementGuid, tags, GetElement(attachedElementGuid),
|
||||
Swirl.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid),
|
||||
eulerAngleX.ConvertToGameType(), eulerAngleY.ConvertToGameType(), eulerAngleZ.ConvertToGameType());
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return Swirl.GenerateElement(elementName, elementGuid, tags, parent,
|
||||
return Swirl.GenerateElement(elementName, elementGuid, tags, false, parent,
|
||||
eulerAngleX.ConvertToGameType(), eulerAngleY.ConvertToGameType(), eulerAngleZ.ConvertToGameType());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user