基础内容-8
添加BM存档类
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Ichni.RhythmGame
|
||||
/// <summary>
|
||||
/// 将物体的z轴指向目标物体,注意,LookAt的启用期间,物体的旋转将被锁定
|
||||
/// </summary>
|
||||
public class LookAt : AnimationBase
|
||||
public partial class LookAt : AnimationBase
|
||||
{
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
public BaseElement lookAtObject;
|
||||
@@ -23,7 +23,7 @@ namespace Ichni.RhythmGame
|
||||
LookAt look = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<LookAt>();
|
||||
|
||||
look.Initialize(elementName, id, tags);
|
||||
|
||||
|
||||
look.targetObject = targetObject;
|
||||
look.lookAtObject = lookAtTarget;
|
||||
look.enabling = enabling;
|
||||
@@ -37,7 +37,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
|
||||
|
||||
look.SetParent(targetObject);
|
||||
|
||||
look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
|
||||
@@ -71,5 +71,44 @@ namespace Ichni.RhythmGame
|
||||
targetTransformSubmodule.eulerAnglesOffsetLock = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.LookAt_BM(elementName, elementGuid, tags, parentElement.matchedBM,
|
||||
enabling.ConvertToBM(), lookAtObject.elementGuid);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class LookAt_BM : BaseElement_BM
|
||||
{
|
||||
public FlexibleBool_BM enabling;
|
||||
public Guid lookAtObjectGuid;
|
||||
|
||||
public LookAt_BM()
|
||||
{
|
||||
}
|
||||
|
||||
public LookAt_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
BaseElement_BM attachedElement, FlexibleBool_BM enabling, Guid lookAtObjectGuid) : base(elementName,
|
||||
elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.enabling = enabling;
|
||||
this.lookAtObjectGuid = lookAtObjectGuid;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = LookAt.GenerateElement(elementName, elementGuid, tags,
|
||||
GetElement(attachedElementGuid), GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
{
|
||||
return LookAt.GenerateElement(elementName, elementGuid, tags, parent,
|
||||
GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user