基础内容-7
Trail 完整Note
This commit is contained in:
@@ -15,12 +15,15 @@ namespace Ichni.RhythmGame
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
public FlexibleFloat positionX, positionY, positionZ;
|
||||
|
||||
public static Displacement GenerateElement(string elementName, BaseElement targetObject,
|
||||
public static Displacement GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, BaseElement targetObject,
|
||||
FlexibleFloat positionX, FlexibleFloat positionY, FlexibleFloat positionZ)
|
||||
{
|
||||
Displacement displacement = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Displacement>();
|
||||
|
||||
displacement.NewInitialize(elementName, targetObject);
|
||||
displacement.Initialize(elementName, id, tags);
|
||||
|
||||
displacement.targetObject = targetObject;
|
||||
|
||||
displacement.positionX = positionX;
|
||||
displacement.positionY = positionY;
|
||||
@@ -36,7 +39,9 @@ namespace Ichni.RhythmGame
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
|
||||
displacement.SetTimeDuration(positionX, positionY, positionZ);
|
||||
displacement.SetParent(targetObject);
|
||||
|
||||
displacement.timeDurationSubmodule.SetDuration(positionX, positionY, positionZ);
|
||||
|
||||
return displacement;
|
||||
}
|
||||
|
||||
@@ -16,29 +16,33 @@ namespace Ichni.RhythmGame
|
||||
public BaseElement lookAtObject;
|
||||
public FlexibleBool enabling;
|
||||
|
||||
public static LookAt GenerateElement(string elementName, BaseElement targetObject,
|
||||
public static LookAt GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, BaseElement targetObject,
|
||||
BaseElement lookAtTarget, FlexibleBool enabling)
|
||||
{
|
||||
LookAt swirl = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<LookAt>();
|
||||
LookAt look = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<LookAt>();
|
||||
|
||||
swirl.NewInitialize(elementName, targetObject);
|
||||
|
||||
swirl.lookAtObject = lookAtTarget;
|
||||
swirl.enabling = enabling;
|
||||
swirl.animationReturnType = FlexibleReturnType.Before;
|
||||
look.Initialize(elementName, id, tags);
|
||||
|
||||
look.targetObject = targetObject;
|
||||
look.lookAtObject = lookAtTarget;
|
||||
look.enabling = enabling;
|
||||
look.animationReturnType = FlexibleReturnType.Before;
|
||||
|
||||
if (targetObject.transformSubmodule != null)
|
||||
{
|
||||
swirl.targetTransformSubmodule = targetObject.transformSubmodule;
|
||||
look.targetTransformSubmodule = targetObject.transformSubmodule;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
|
||||
look.SetParent(targetObject);
|
||||
|
||||
swirl.SetTimeDuration(-999, 999); //TODO: 换为(-delay, songLength)
|
||||
look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
|
||||
|
||||
return swirl;
|
||||
return look;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -9,12 +10,15 @@ namespace Ichni.RhythmGame
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
public FlexibleFloat scaleX, scaleY, scaleZ;
|
||||
|
||||
public static Scale GenerateElement(string elementName, BaseElement targetObject,
|
||||
public static Scale GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, BaseElement targetObject,
|
||||
FlexibleFloat scaleX, FlexibleFloat scaleY, FlexibleFloat scaleZ)
|
||||
{
|
||||
Scale scale = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Scale>();
|
||||
|
||||
scale.NewInitialize(elementName, targetObject);
|
||||
scale.Initialize(elementName, id, tags);
|
||||
|
||||
scale.targetObject = targetObject;
|
||||
|
||||
scale.scaleX = scaleX;
|
||||
scale.scaleY = scaleY;
|
||||
@@ -30,7 +34,8 @@ namespace Ichni.RhythmGame
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
|
||||
scale.SetTimeDuration(scaleX, scaleY, scaleZ);
|
||||
scale.SetParent(targetObject);
|
||||
scale.timeDurationSubmodule.SetDuration(scaleX, scaleY, scaleZ);
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Lean.Pool;
|
||||
@@ -10,12 +11,15 @@ namespace Ichni.RhythmGame
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
public FlexibleFloat eulerAngleX, eulerAngleY, eulerAngleZ;
|
||||
|
||||
public static Swirl GenerateElement(string elementName, BaseElement targetObject,
|
||||
public static Swirl GenerateElement(string elementName, Guid id,
|
||||
List<string> tags, BaseElement targetObject,
|
||||
FlexibleFloat eulerAngleX, FlexibleFloat eulerAngleY, FlexibleFloat eulerAngleZ)
|
||||
{
|
||||
Swirl swirl = Instantiate(EditorManager.instance.basePrefabs.emptyObject).AddComponent<Swirl>();
|
||||
|
||||
swirl.NewInitialize(elementName, targetObject);
|
||||
swirl.Initialize(elementName, id, tags);
|
||||
|
||||
swirl.targetObject = targetObject;
|
||||
|
||||
swirl.eulerAngleX = eulerAngleX;
|
||||
swirl.eulerAngleY = eulerAngleY;
|
||||
@@ -31,7 +35,9 @@ namespace Ichni.RhythmGame
|
||||
throw new System.Exception("Target object does not have a TransformSubmodule");
|
||||
}
|
||||
|
||||
swirl.SetTimeDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
|
||||
swirl.SetParent(targetObject);
|
||||
|
||||
swirl.timeDurationSubmodule.SetDuration(eulerAngleX, eulerAngleY, eulerAngleZ);
|
||||
|
||||
return swirl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user