1.修复多处错误2.SplineNode依然存在设置不生效的错误
This commit is contained in:
@@ -26,19 +26,24 @@ namespace Demo.Editor
|
|||||||
{
|
{
|
||||||
typeName = typeName[..typeName.LastIndexOf('`')];
|
typeName = typeName[..typeName.LastIndexOf('`')];
|
||||||
}
|
}
|
||||||
stream.Write($"#include \"{currentType.BaseType.Name}.helper.h\"\n\n#define {typeName}\n\n");
|
string baseTypeName = currentType.BaseType.Name;
|
||||||
|
if (baseTypeName.Contains('`'))
|
||||||
|
{
|
||||||
|
baseTypeName = baseTypeName[..baseTypeName.LastIndexOf('`')];
|
||||||
|
}
|
||||||
|
stream.Write($"#include \"{baseTypeName}.helper.h\"\n\n#define {typeName}\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteCPPStyleFunction(StreamWriter stream, string name, IEnumerable<string> paramList, string description)
|
private static void WriteCPPStyleFunction(StreamWriter stream, string name, IEnumerable<string> paramList, string description)
|
||||||
{
|
{
|
||||||
if (name == nameof(ScriptableObject.LoadSubScript))
|
if (name == nameof(ScriptableObject.LoadSubScript))
|
||||||
{
|
{
|
||||||
// stream.WriteLine("#define __build_in_pragma #");
|
stream.WriteLine("#define __build_in_pragma #");
|
||||||
// stream.WriteLine("#define __build_in_to_text(x) #x");
|
stream.WriteLine("#define __build_in_to_text(x) #x");
|
||||||
|
|
||||||
// stream.Write("/*\n" + description + "\n*/\n");
|
stream.Write("/*\n" + description + "\n*/\n");
|
||||||
// stream.Write($"#define {name}({string.Join(',', paramList)}) __build_in_pragma include __build_in_to_text(./##{paramList.First()})\n\n");
|
stream.Write($"#define {name}({string.Join(',', paramList)}) __build_in_pragma include {paramList.ToArray()[1]}\n\n");
|
||||||
stream.Write($"#define {name}({string.Join(',', paramList)})\n\n");
|
//stream.Write($"#define {name}({string.Join(',', paramList)})\n\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -394,6 +394,11 @@ namespace Demo
|
|||||||
{
|
{
|
||||||
// 先天支持的工具函数
|
// 先天支持的工具函数
|
||||||
|
|
||||||
|
[Content, SerializeField] private Vector3
|
||||||
|
EnterGameLocalPosition = Vector3.zero,
|
||||||
|
EnterGameEulerAngles = Vector3.zero,
|
||||||
|
EnterGameLocalScaling = Vector3.one;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置坐标
|
/// 设置坐标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -410,7 +415,7 @@ namespace Demo
|
|||||||
")]
|
")]
|
||||||
public void SetLocalPosition(string x, string y, string z)
|
public void SetLocalPosition(string x, string y, string z)
|
||||||
{
|
{
|
||||||
transform.localPosition = new(Parse(x), Parse(y), Parse(z));
|
EnterGameLocalPosition = new(Parse(x), Parse(y), Parse(z));
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置欧拉角
|
/// 设置欧拉角
|
||||||
@@ -428,7 +433,7 @@ namespace Demo
|
|||||||
")]
|
")]
|
||||||
public void SetLocalEulerAngles(string x, string y, string z)
|
public void SetLocalEulerAngles(string x, string y, string z)
|
||||||
{
|
{
|
||||||
transform.localEulerAngles = new(Parse(x), Parse(y), Parse(z));
|
EnterGameEulerAngles = new(Parse(x), Parse(y), Parse(z));
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置缩放
|
/// 设置缩放
|
||||||
@@ -446,7 +451,14 @@ namespace Demo
|
|||||||
")]
|
")]
|
||||||
public void SetLocalScaling(string x, string y, string z)
|
public void SetLocalScaling(string x, string y, string z)
|
||||||
{
|
{
|
||||||
transform.localScale = new(Parse(x), Parse(y), Parse(z));
|
EnterGameLocalScaling = new(Parse(x), Parse(y), Parse(z));
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void ResetEnterGameStatus()
|
||||||
|
{
|
||||||
|
transform.localPosition = EnterGameLocalPosition;
|
||||||
|
transform.localEulerAngles = EnterGameEulerAngles;
|
||||||
|
transform.localScale = EnterGameLocalScaling;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -473,13 +485,13 @@ namespace Demo
|
|||||||
/// 指定多少个<see cref="TickType.Update"/>状态的<see cref="UpdateTicks(float, float, TickType)"/>执行一次更新,不会影响到子物体
|
/// 指定多少个<see cref="TickType.Update"/>状态的<see cref="UpdateTicks(float, float, TickType)"/>执行一次更新,不会影响到子物体
|
||||||
/// 属于性能优化的高级选项
|
/// 属于性能优化的高级选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="frame">间隔帧数, 小于等于1的值代表无论如何都会更新</param>
|
/// <param name="frame">每frame帧更新一次, 等于0代表不会在<see cref="TickType.Update"/>状态运行</param>
|
||||||
[ScriptableCall(@"
|
[ScriptableCall(@"
|
||||||
<summary>
|
<summary>
|
||||||
指定多少个Update状态的UpdateTicks执行一次更新,不会影响到子物体
|
指定多少个Update状态的UpdateTicks执行一次更新,不会影响到子物体
|
||||||
属于性能优化的高级选项
|
属于性能优化的高级选项
|
||||||
</summary>
|
</summary>
|
||||||
<param name=""frame"">间隔帧数, 小于等于1的值代表无论如何都会更新</param>
|
<param name=""frame"">每frame帧更新一次, 等于0代表不会在Update状态运行</param>
|
||||||
")]
|
")]
|
||||||
public void SetUpdatePerFrame(string frame)
|
public void SetUpdatePerFrame(string frame)
|
||||||
{
|
{
|
||||||
@@ -571,18 +583,24 @@ namespace Demo
|
|||||||
|
|
||||||
// GetParent
|
// GetParent
|
||||||
ScriptableObject result = Parent;
|
ScriptableObject result = Parent;
|
||||||
|
if (path[0] == '/' || path[0]=='\\')
|
||||||
|
{
|
||||||
|
result = GetRoot();
|
||||||
|
}
|
||||||
|
|
||||||
if (Parent == null)
|
if (Parent == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"Root is nosupport to {nameof(FindWithPath)}");
|
throw new InvalidOperationException($"Root is nosupport to {nameof(FindWithPath)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find
|
||||||
var components = path.Split('/', '\\');
|
var components = path.Split('/', '\\');
|
||||||
components[^1] = new ToolFile(components[^1]).GetFilename(true);
|
components[^1] = new ToolFile(components[^1]).GetFilename(true);
|
||||||
foreach (var component in components)
|
foreach (var component in components)
|
||||||
{
|
{
|
||||||
if (component == "..")
|
if (component == "..")
|
||||||
result = result.Parent;
|
result = result.Parent;
|
||||||
else if (component == ".")
|
else if (component == "." || string.IsNullOrEmpty(component))
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -590,7 +608,7 @@ namespace Demo
|
|||||||
string targetScriptObjectPath = component;
|
string targetScriptObjectPath = component;
|
||||||
Regex regex = new(@"^(.*)\[(\d*)\]$");
|
Regex regex = new(@"^(.*)\[(\d*)\]$");
|
||||||
var match = regex.Match(component);
|
var match = regex.Match(component);
|
||||||
if(match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
targetScriptObjectPath = match.Groups[1].Value;
|
targetScriptObjectPath = match.Groups[1].Value;
|
||||||
index = int.Parse(match.Groups[2].Value);
|
index = int.Parse(match.Groups[2].Value);
|
||||||
@@ -901,7 +919,12 @@ namespace Demo
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
s_PreparePerfMarker.Begin(this);
|
s_PreparePerfMarker.Begin(this);
|
||||||
#endif
|
#endif
|
||||||
|
if (tickType == TickType.Reset)
|
||||||
|
{
|
||||||
|
ResetEnterGameStatus();
|
||||||
|
}
|
||||||
// UpdateTicks
|
// UpdateTicks
|
||||||
|
if (UpdatePerFrame > 0)
|
||||||
{
|
{
|
||||||
if (ScriptUpdateCounter % UpdatePerFrame == 0)
|
if (ScriptUpdateCounter % UpdatePerFrame == 0)
|
||||||
UpdateTicks(currentTime, deltaTime, tickType);
|
UpdateTicks(currentTime, deltaTime, tickType);
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ namespace Demo.Game
|
|||||||
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
|
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
|
||||||
{
|
{
|
||||||
base.UpdateTicks(currentTime, deltaTime, tickType);
|
base.UpdateTicks(currentTime, deltaTime, tickType);
|
||||||
|
|
||||||
|
float GetPercentValue()
|
||||||
|
{
|
||||||
|
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
|
||||||
|
}
|
||||||
|
|
||||||
if (Entries.Count == 0)
|
if (Entries.Count == 0)
|
||||||
return;
|
return;
|
||||||
if (Entries.Count == 1)
|
if (Entries.Count == 1)
|
||||||
@@ -72,22 +78,20 @@ namespace Demo.Game
|
|||||||
UpdateEntry(0, 0);
|
UpdateEntry(0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// TODO : 删除后存在问题
|
||||||
if (Entries[0].TimePoint <= 0 && tickType == TickType.Reset)
|
if (Entries[0].TimePoint <= 0 && tickType == TickType.Reset)
|
||||||
{
|
{
|
||||||
UpdateEntry(0, 0);
|
UpdateEntry(0, 0);
|
||||||
}
|
}
|
||||||
switch (tickType)
|
switch (tickType)
|
||||||
{
|
{
|
||||||
case TickType.Pause:
|
|
||||||
//case TickType.LateUpdate:
|
|
||||||
break;
|
|
||||||
case TickType.Reset:
|
case TickType.Reset:
|
||||||
case TickType.Start:
|
case TickType.Start:
|
||||||
{
|
{
|
||||||
Content = 0;
|
Content = 0;
|
||||||
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
|
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
|
||||||
Content++;
|
Content++;
|
||||||
UpdateEntry(Content, 0);
|
UpdateEntry(Content, GetPercentValue());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -100,7 +104,7 @@ namespace Demo.Game
|
|||||||
if (Content + 1 >= Entries.Count)
|
if (Content + 1 >= Entries.Count)
|
||||||
UpdateEntry(Content, 1);
|
UpdateEntry(Content, 1);
|
||||||
else
|
else
|
||||||
UpdateEntry(Content, (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint));
|
UpdateEntry(Content, GetPercentValue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ namespace Demo.Game
|
|||||||
public void AddTo(SplineCore core)
|
public void AddTo(SplineCore core)
|
||||||
{
|
{
|
||||||
MyNodeContent = core.NodeContent;
|
MyNodeContent = core.NodeContent;
|
||||||
MyNode.AddConnection(core.MySplineComputer, MyNodeContent);
|
|
||||||
core.MySplineComputer.SetPointSize(MyNodeContent, NodeSize);
|
|
||||||
core.MySplineComputer.SetPointColor(MyNodeContent, NodeColor);
|
core.MySplineComputer.SetPointColor(MyNodeContent, NodeColor);
|
||||||
|
core.MySplineComputer.SetPointSize(MyNodeContent, NodeSize);
|
||||||
core.MySplineComputer.SetPointNormal(MyNodeContent, IsSetupNodeRotation ? NodeRotation.normalized : transform.up);
|
core.MySplineComputer.SetPointNormal(MyNodeContent, IsSetupNodeRotation ? NodeRotation.normalized : transform.up);
|
||||||
|
MyNode.AddConnection(core.MySplineComputer, MyNodeContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -44,9 +44,9 @@ namespace Demo.Game
|
|||||||
</summary>
|
</summary>
|
||||||
<param name=""size""></param>
|
<param name=""size""></param>
|
||||||
")]
|
")]
|
||||||
public void SetNoteSize(string size)
|
public void SetNodeSize(string size)
|
||||||
{
|
{
|
||||||
NodeSize = float.Parse(size);
|
NodeSize = Parse(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -65,9 +65,9 @@ namespace Demo.Game
|
|||||||
<param name=""b""></param>
|
<param name=""b""></param>
|
||||||
<param name=""a""></param>
|
<param name=""a""></param>
|
||||||
")]
|
")]
|
||||||
public void SetNoteColor(string r, string g, string b, string a)
|
public void SetNodeColor(string r, string g, string b, string a)
|
||||||
{
|
{
|
||||||
NodeColor = new(float.Parse(r), float.Parse(g), float.Parse(b), float.Parse(a));
|
NodeColor = new(Parse(r), Parse(g), Parse(b), Parse(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -84,10 +84,10 @@ namespace Demo.Game
|
|||||||
<param name=""y""></param>
|
<param name=""y""></param>
|
||||||
<param name=""z""></param>
|
<param name=""z""></param>
|
||||||
")]
|
")]
|
||||||
public void SetNoteRotation(string x, string y, string z)
|
public void SetNodeRotation(string x, string y, string z)
|
||||||
{
|
{
|
||||||
IsSetupNodeRotation = true;
|
IsSetupNodeRotation = true;
|
||||||
this.transform.localEulerAngles = NodeRotation = new(float.Parse(x), float.Parse(y), float.Parse(z));
|
this.transform.localEulerAngles = NodeRotation = new(Parse(x), Parse(y), Parse(z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Demo.Game
|
|||||||
public override void SetupMeshGenerator(SplineRenderer meshGenerater)
|
public override void SetupMeshGenerator(SplineRenderer meshGenerater)
|
||||||
{
|
{
|
||||||
base.SetupMeshGenerator(meshGenerater);
|
base.SetupMeshGenerator(meshGenerater);
|
||||||
meshGenerater.autoUpdate = IsAutoOrient;
|
meshGenerater.autoOrient = IsAutoOrient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerator UnloadScript()
|
public override IEnumerator UnloadScript()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Demo.Game
|
|||||||
{
|
{
|
||||||
var sample = MySplineCore.MySplineComputer.Evaluate(data);
|
var sample = MySplineCore.MySplineComputer.Evaluate(data);
|
||||||
Cache = sample.percent;
|
Cache = sample.percent;
|
||||||
UpdateTarget.transform.SetLocalPositionAndRotation(sample.position, sample.rotation);
|
UpdateTarget.transform.SetPositionAndRotation(sample.position, sample.rotation);
|
||||||
//UpdateTarget.transform.localScale = Vector3.one * sample.size;
|
//UpdateTarget.transform.localScale = Vector3.one * sample.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
set(CMAKE_BINARY_DIR E:\[TEMP])
|
|
||||||
project(ProjectHelper)
|
|
||||||
include_directories(Helper)
|
|
||||||
add_executable(ProjectHelper ProjectHelper.cpp)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: caa319b6f626575468d5a22968abd31f
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"configurePresets": [
|
|
||||||
{
|
|
||||||
"name": "virtual-base",
|
|
||||||
"hidden": true,
|
|
||||||
"generator": "Ninja",
|
|
||||||
"binaryDir": "E:\\Downloads\\.build",
|
|
||||||
"installDir": "E:\\Downloads\\.install",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
|
|
||||||
"PLATFORM_EXTENSION": "no"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "virtual-debug",
|
|
||||||
"hidden": true,
|
|
||||||
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "virtual-windows",
|
|
||||||
"hidden": true,
|
|
||||||
"cacheVariables": {
|
|
||||||
"PLATFORM_NAME": "Windows",
|
|
||||||
"CMAKE_C_COMPILER": "cl.exe",
|
|
||||||
"CMAKE_CXX_COMPILER": "cl.exe"
|
|
||||||
},
|
|
||||||
"condition": {
|
|
||||||
"type": "equals",
|
|
||||||
"lhs": "Windows",
|
|
||||||
"rhs": "Windows"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "virtual-x64",
|
|
||||||
"hidden": true,
|
|
||||||
"architecture": {
|
|
||||||
"value": "x64",
|
|
||||||
"strategy": "external"
|
|
||||||
},
|
|
||||||
"cacheVariables": {
|
|
||||||
"PLATFORM_VERSION": "x64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "windows-x64-debug",
|
|
||||||
"inherits": [
|
|
||||||
"virtual-base",
|
|
||||||
"virtual-windows",
|
|
||||||
"virtual-x64",
|
|
||||||
"virtual-debug"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 446bd1d115349fc4e8ff7a753c4f8253
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5b2b99f9313f15644a6fcb7754cfe8cf
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define Anchor
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8444d0278637d09479486d189127ec65
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define BaseOnMaterialUpdatement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
绑定到允许的渲染器
|
|
||||||
</summary>
|
|
||||||
<param name="path">脚本位置</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(path)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3f320bdad28bfa440946d2cdbf0c76a6
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define BasicSplineJustFollow
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
新增
|
|
||||||
</summary>
|
|
||||||
<param name="time">插值时间</param>
|
|
||||||
<param name="value"></param>
|
|
||||||
<param name="curveType">可取值为30种缓动曲线</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,value,curveType)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
如未加载则加载,然后绑定到样条线
|
|
||||||
</summary>
|
|
||||||
<param name="path">脚本位置</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(path)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c9379e999fe839a4299645c8b475f826
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define BasicSplineRenderer
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
新增
|
|
||||||
</summary>
|
|
||||||
<param name="time">插值时间</param>
|
|
||||||
<param name="from"></param>
|
|
||||||
<param name="to"></param>
|
|
||||||
<param name="curveType">可取值为30种缓动曲线</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,from,to,curveType)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载并绑定到新样条线
|
|
||||||
</summary>
|
|
||||||
<param name="path">对象相对路径,若对象不存在则作为脚本相对路径加载</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadSpline(path)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载对应ab包并加载指定材质
|
|
||||||
</summary>
|
|
||||||
<param name="ab"></param>
|
|
||||||
<param name="material"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadMaterial(ab,material)
|
|
||||||
|
|
||||||
#include "BasicSplineRenderer.helper.h"
|
|
||||||
|
|
||||||
#define BasicSplineRenderer
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置材质UV映射
|
|
||||||
</summary>
|
|
||||||
<param name="mode">Clip, UniformClip, Clamp, UniformClamp</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetUVMode(mode)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f9fef1eefba151544bf86abbb7ccbb3f
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define CameraObject
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置是否为正交相机
|
|
||||||
</summary>
|
|
||||||
<param name="arg"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetOrthographic(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置相机视野角度
|
|
||||||
</summary>
|
|
||||||
<param name="arg">视野角度值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetFieldOfView(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置正交相机的尺寸
|
|
||||||
</summary>
|
|
||||||
<param name="arg">正交相机尺寸值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetOrthographicSize(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置近裁剪面距离
|
|
||||||
</summary>
|
|
||||||
<param name="arg">近裁剪面距离值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetNearClipPlane(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置远裁剪面距离
|
|
||||||
</summary>
|
|
||||||
<param name="arg">远裁剪面距离值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetFarClipPlane(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置相机深度
|
|
||||||
</summary>
|
|
||||||
<param name="arg">相机深度值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetDepth(arg)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置虚拟相机跟随目标
|
|
||||||
</summary>
|
|
||||||
<param name="targetName">对象相对路径</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVirtualCameraFollow(targetName)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置虚拟相机观察目标
|
|
||||||
</summary>
|
|
||||||
<param name="targetName">对象相对路径</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVirtualCameraLookAt(targetName)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置虚拟相机跟随偏移
|
|
||||||
</summary>
|
|
||||||
<param name="x">X轴偏移</param>
|
|
||||||
<param name="y">Y轴偏移</param>
|
|
||||||
<param name="z">Z轴偏移</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVirtualCameraFollowOffset(x,y,z)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置虚拟相机跟随阻尼
|
|
||||||
</summary>
|
|
||||||
<param name="x">X轴阻尼</param>
|
|
||||||
<param name="y">Y轴阻尼</param>
|
|
||||||
<param name="z">Z轴阻尼</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVirtualCameraFollowDamping(x,y,z)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置虚拟相机观察阻尼
|
|
||||||
</summary>
|
|
||||||
<param name="x">X轴阻尼</param>
|
|
||||||
<param name="y">Y轴阻尼</param>
|
|
||||||
<param name="z">Z轴阻尼</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVirtualCameraLookAtDamping(x,y,z)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a250708085f3cf04cbb75d1624c80c11
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "BaseOnMaterialUpdatement.helper.h"
|
|
||||||
|
|
||||||
#define ColorUpdatement
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 592a3c681ade5c6409436c3b62a543ce
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define DDT
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
添加float数据, 随后可以用对象路径+索引获取变量值,
|
|
||||||
e.g: CameraObject/DDT[3], 获取CameraObject/DDT对象路径下DDT数据中的第四个值
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
从特定的json中读取数据
|
|
||||||
*/
|
|
||||||
#define Load()
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2973b3a6cf8b3bd4a8d990b7a70a88c9
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "BaseOnMaterialUpdatement.helper.h"
|
|
||||||
|
|
||||||
#define EmissionColorUpdatement
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 46db8a6233d6da14db4d0bcdb1ca32d6
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "IInteraction.helper.h"
|
|
||||||
|
|
||||||
#define FullScreenInteraction
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6515b1e604e3f3f4f96fca78db823502
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define IEffectHookObject
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
绑定IInteraction对象,若不手动绑定则会自动绑定到父物体的IInteraction
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Bind(path)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置监听状态,当目标进入指定监听的状态时触发启动事件,退出时触发结束事件
|
|
||||||
</summary>
|
|
||||||
<param name="type">VisibleDuration,InteractiveDuration,InteractableScoreInterval,InteractableIntervalThatCanScoreBest</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractiveEffectType(type)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6c040d74f33d0e141bdea00298f691be
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
#include "TimelineScriptObject.helper.h"
|
|
||||||
|
|
||||||
#define IInteraction
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
通过传递对称区间进行初始化
|
|
||||||
</summary>
|
|
||||||
<param name="bestJudgementTimePoint">最佳判定点</param>
|
|
||||||
<param name="interactableIntervalThatCanScoreBest">区间时长,最终结果为
|
|
||||||
(bestJudgementTimePoint-interactableIntervalThatCanScoreBest/2,bestJudgementTimePoint+interactableIntervalThatCanScoreBest/2)</param>
|
|
||||||
<param name="interactableScoreInterval">区间时长,最终结果为
|
|
||||||
(bestJudgementTimePoint-interactableScoreInterval/2,bestJudgementTimePoint+interactableScoreInterval/2)</param>
|
|
||||||
<param name="interactiveDuration">区间时长,最终结果为
|
|
||||||
(bestJudgementTimePoint-interactiveDuration/2,bestJudgementTimePoint+interactiveDuration/2)</param>
|
|
||||||
<param name="visibleDuration">区间时长,最终结果为
|
|
||||||
(bestJudgementTimePoint-visibleDuration/2,bestJudgementTimePoint+visibleDuration/2)</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetupJudgementLevels(bestJudgementTimePoint,interactableIntervalThatCanScoreBest,interactableScoreInterval,interactiveDuration,visibleDuration)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置可见区间(显现但不可判定,3级判定区间)开始时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVisibleDurationBegin(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置可见区间(显现但不可判定,3级判定区间)结束时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetVisibleDurationEnd(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置2级判定区间(可判定但错误的)开始时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractiveDurationBegin(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置2级判定区间(可判定但错误的)结束时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractiveDurationEnd(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置1级判定区间(可判定的)开始时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractableScoreIntervalBegin(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置1级判定区间(可判定的)结束时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractableScoreIntervalEnd(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置0级判定区间(最佳判定)开始时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractableIntervalThatCanScoreBestBegin(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置0级判定区间(最佳判定)结束时间
|
|
||||||
</summary>
|
|
||||||
<param name="value"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetInteractableIntervalThatCanScoreBestEnd(value)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f98e2b0f2d7a07643990ba5727c3ba6f
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define IJudgementHookObject
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
绑定IInteraction对象,若不手动绑定则会自动绑定到父物体的IInteraction
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Bind(path)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f020094d932901c4298ae797f9f2b45e
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define LookAtAnchor
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
在指定时刻切换面向的物体,并尝试一次更新
|
|
||||||
</summary>
|
|
||||||
<param name="time"></param>
|
|
||||||
<param name="target"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,target)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
启动自动更新,将持续锁定面向的物体并更新
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define EnableUpdateEveryTick()
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 63e39fd35ba9d6f41b4387d1e35cfa21
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define MaterialUpdatement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
对应ab包名称,自动匹配对应平台
|
|
||||||
</summary>
|
|
||||||
<param name="ab"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(ab)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
在指定时刻切换父物体上的MeshRenderer.material
|
|
||||||
</summary>
|
|
||||||
<param name="time"></param>
|
|
||||||
<param name="material"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,material)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e15049878c91eb8468fc85288b4e54fe
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#include "IEffectHookObject.helper.h"
|
|
||||||
|
|
||||||
#define ParticleEffect
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载预制体作为子物体
|
|
||||||
</summary>
|
|
||||||
<param name="ab"></param>
|
|
||||||
<param name="prefab"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(ab,prefab)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 045f24c4c7b9f914489a2d1f774f8e51
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#include "IJudgementHookObject.helper.h"
|
|
||||||
|
|
||||||
#define ParticleJudgement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载预制体作为子物体
|
|
||||||
</summary>
|
|
||||||
<param name="level">判定等级对应会出现的粒子效果,若没有对应的则向更低的值寻找</param>
|
|
||||||
<param name="ab"></param>
|
|
||||||
<param name="prefab"></param>
|
|
||||||
<param name="duration">判定效果的持续时间</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(level,ab,prefab,duration)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 739b4b9b9f01c684c8267f90c251a295
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define PrefabRootObject
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载预制体作为子物体
|
|
||||||
</summary>
|
|
||||||
<param name="ab"></param>
|
|
||||||
<param name="prefab"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(ab,prefab)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e7fd21d310ee4d94c9a688db8ae382ca
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define RootObject
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dfa234b92798a79459a04aadd25226a0
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
重设指定时间线
|
|
||||||
</summary>
|
|
||||||
<param name="id">时间线ID,若不存在则创建</param>
|
|
||||||
<param name="delta">当每次调用NextTimePoint函数时使用的单位值</param>
|
|
||||||
<param name="value">初始化时间</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define ResetTimePoint(id,delta,value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
推动时间线前进
|
|
||||||
</summary>
|
|
||||||
<param name="id">时间线ID</param>
|
|
||||||
<param name="times">前进次数,最终时间的增量为前进次数乘该时间线的单位值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define NextTimePoint(id,times)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置时间线的值
|
|
||||||
</summary>
|
|
||||||
<param name="id">时间线ID</param>
|
|
||||||
<param name="value">次数,时间线的值将被设置为次数乘该时间线的单位值</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetTimePoint(id,value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置局部上下文变量,将会传递给子物体使用
|
|
||||||
</summary>
|
|
||||||
<param name="name">字符串</param>
|
|
||||||
<param name="value">浮点数</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetContext(name,value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置坐标
|
|
||||||
</summary>
|
|
||||||
<param name="result"></param>
|
|
||||||
<param name="y"></param>
|
|
||||||
<param name="z"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetLocalPosition(x,y,z)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置欧拉角
|
|
||||||
</summary>
|
|
||||||
<param name="result"></param>
|
|
||||||
<param name="y"></param>
|
|
||||||
<param name="z"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetLocalEulerAngles(x,y,z)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置缩放
|
|
||||||
</summary>
|
|
||||||
<param name="result"></param>
|
|
||||||
<param name="y"></param>
|
|
||||||
<param name="z"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetLocalScaling(x,y,z)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
关闭该物体,
|
|
||||||
在面对如多Game场景时关闭某些GameWorld中默认存在的全局灯光等场景时非常有用
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetObjectDisable()
|
|
||||||
|
|
||||||
#define __build_in_pragma #
|
|
||||||
#define __build_in_to_text(x) #x
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载子脚本
|
|
||||||
</summary>
|
|
||||||
<param name="type">指定类型</param>
|
|
||||||
<param name="path">指定脚本,可用决定路径或与当前脚本目录的相对路径</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadSubScript(type,path) __build_in_pragma include __build_in_to_text(./##type)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ffcb5fc7a6d58bc45af2f2dc9033db76
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define SkyUpdatement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
对应ab包名称,自动匹配对应平台
|
|
||||||
</summary>
|
|
||||||
<param name="ab"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(ab)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
在指定时刻切换天空
|
|
||||||
</summary>
|
|
||||||
<param name="time"></param>
|
|
||||||
<param name="sky"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,sky)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f93d535b9ce7cfd42be306766bce5ebd
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define SplineAnchor
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载并绑定到新样条线
|
|
||||||
</summary>
|
|
||||||
<param name="path">对象相对路径,若对象不存在则作为脚本相对路径加载</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadSpline(path)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
必须先执行LoadSpline加载样条线
|
|
||||||
</summary>
|
|
||||||
<param name="value">百分比所在位置,取值范围是[0,1]</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define EvaluatePosition(value)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
绑定到样条线渲染器上(必须已经加载),
|
|
||||||
并设置位置为指定时间的时刻渲染器所生成的头部位置
|
|
||||||
</summary>
|
|
||||||
<param name="path">对象路径, 不存在时则立刻加载</param>
|
|
||||||
<param name="time">时刻</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadSplineRenderer(path,time)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 0a6ffb0a4a419774681ba46af610100a
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define SplineCore
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置样条线类型
|
|
||||||
</summary>
|
|
||||||
<param name="mode">CatmullRom, BSpline, Bezier, Linear </param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetType(mode)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置采样类型
|
|
||||||
</summary>
|
|
||||||
<param name="mode">Default, Uniform, Optimized</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetSampleMode(mode)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
闭环曲线
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetClose()
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载并加入新节点
|
|
||||||
</summary>
|
|
||||||
<param name="path">脚本位置</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define LoadNode(path)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加入已加载的节点,如果目标脚本不是SplineNode,
|
|
||||||
那么为其添加SplineNode组件
|
|
||||||
</summary>
|
|
||||||
<param name="path">脚本位置</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define AddNode(path)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: de36bb50641485344bb37dd3fc8f26b6
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "BasicSplineJustFollow.helper.h"
|
|
||||||
|
|
||||||
#define SplineHeadObject
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置为仅跟随,将会被动的跟随spline运动,
|
|
||||||
这在多个脚本都绑定在同一个spline计算核心上时非常有用
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define JustFollow()
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: aee05617c4c971d42bc2dfdde557d836
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "BasicSplineJustFollow.helper.h"
|
|
||||||
|
|
||||||
#define SplineMovement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置为仅跟随,将会被动的跟随spline运动,
|
|
||||||
这在多个脚本都绑定在同一个spline计算核心上时非常有用
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define JustFollow()
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ec01448b7be56ed44a9c1cd763a1c461
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define SplineNode
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置节点大小,默认为1
|
|
||||||
</summary>
|
|
||||||
<param name="size"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetNoteSize(size)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置节点颜色,默认为(1,1,1,1)
|
|
||||||
</summary>
|
|
||||||
<param name="r"></param>
|
|
||||||
<param name="g"></param>
|
|
||||||
<param name="b"></param>
|
|
||||||
<param name="a"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetNoteColor(r,g,b,a)
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置节点旋转,节点正面forward向量为法线
|
|
||||||
</summary>
|
|
||||||
<param name="x"></param>
|
|
||||||
<param name="y"></param>
|
|
||||||
<param name="z"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetNoteRotation(x,y,z)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dfe84ad975e44cd40b5c7061ee2621b0
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "BasicSplineJustFollow.helper.h"
|
|
||||||
|
|
||||||
#define SplineRotation
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ee1e7c4f60be1e949a1cb2fe6d595d68
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "BasicSplineJustFollow.helper.h"
|
|
||||||
|
|
||||||
#define SplineScaling
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b6711757b0184a1409af1cea057e3138
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "BasicSplineRenderer`1.helper.h"
|
|
||||||
|
|
||||||
#define SplineTrackRenderer
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ac8ca5da17cd34a48b911b9266ff9c3b
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include "BasicSplineRenderer`1.helper.h"
|
|
||||||
|
|
||||||
#define SplineTubeRenderer
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
禁用双面渲染,用于优化性能
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define DisableDoubleSide()
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置面数,越高越圆润
|
|
||||||
</summary>
|
|
||||||
<param name="sides"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetSides(sides)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9b3c8b0bde99a8d4eaefb2e479dc04c5
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define SubWorld
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
加载附属场景
|
|
||||||
</summary>
|
|
||||||
<param name="project"></param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Load(project)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2e7da0254e799714d8e80c6bd975fc0e
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define TickMovement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
新增
|
|
||||||
</summary>
|
|
||||||
<param name="time">插值时间</param>
|
|
||||||
<param name="x">x</param>
|
|
||||||
<param name="y">y</param>
|
|
||||||
<param name="z">z</param>
|
|
||||||
<param name="curveType">可取值为30种缓动曲线</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,x,y,z,curveType)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b9e4cad5b570e02419c03ae8bbdf3a80
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define TickRotation
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
新增
|
|
||||||
</summary>
|
|
||||||
<param name="time">插值时间</param>
|
|
||||||
<param name="x">x</param>
|
|
||||||
<param name="y">y</param>
|
|
||||||
<param name="z">z</param>
|
|
||||||
<param name="curveType">可取值为30种缓动曲线</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,x,y,z,curveType)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: af9d3f3f4025d7949b705b5d98e13525
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#include "Updatement`1.helper.h"
|
|
||||||
|
|
||||||
#define TickScaling
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
新增
|
|
||||||
</summary>
|
|
||||||
<param name="time">插值时间</param>
|
|
||||||
<param name="x">x</param>
|
|
||||||
<param name="y">y</param>
|
|
||||||
<param name="z">z</param>
|
|
||||||
<param name="curveType">可取值为30种缓动曲线</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define Add(time,x,y,z,curveType)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e8d85ca636740424b9c63310ef85f9fa
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define TimelineScriptObject
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 99b6f8195ad78d548a4d2049a150a958
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "TimelineScriptObject.helper.h"
|
|
||||||
|
|
||||||
#define Updatement
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<summary>
|
|
||||||
设置更新对象
|
|
||||||
</summary>
|
|
||||||
<param name="path">脚本的相对路径</param>
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define SetUpdateTarget(path)
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8a43591229b4dcd4aa367fd7b7af6e9b
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#include "ScriptableObject.helper.h"
|
|
||||||
|
|
||||||
#define WorldLightObject
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1867acb1a09c899438f49803555a5abf
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3413fd20a60537b48afc7d4fffc8c26a
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#define __build_in_pragma #
|
|
||||||
#define __build_in_to_text(x) #x
|
|
||||||
#define imp(x) __build_in_pragma include __build_in_to_text(./##x)
|
|
||||||
|
|
||||||
imp(Tutorial/root.h)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c35860b3acaa4484e8c242d94930665b
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# 项目
|
# 项目
|
||||||
|
|
||||||
项目的位置全部位于StreamingAssets文件夹内
|
项目的位置全部位于Unity持久化文件夹的Project文件夹内, 如C:\Users\ASUS\AppData\LocalLow\LiuBai\Murmur-Resonance-Editor\Projects
|
||||||
|
|
||||||
## 打开
|
## 打开
|
||||||
|
|
||||||
@@ -25,7 +25,9 @@ find中包含的内容是被尝试读取但不存在的内容,值为读取时
|
|||||||
|
|
||||||
# 初次运行
|
# 初次运行
|
||||||
|
|
||||||
StreamingAssets中包含两个特殊的文件夹(AssetBundle与Helper)与辅助编辑的CMake项目结构
|
在Unity持久化文件夹中会生成Helper文件夹, 包含可调用函数的注释
|
||||||
|
|
||||||
|
下载需要的AssetBundle到StreamingAssets/AssetBundle
|
||||||
|
|
||||||
## AssetBundle
|
## AssetBundle
|
||||||
|
|
||||||
@@ -37,17 +39,13 @@ StreamingAssets中包含两个特殊的文件夹(AssetBundle与Helper)与辅
|
|||||||
|
|
||||||
## CMake辅助编辑
|
## CMake辅助编辑
|
||||||
|
|
||||||
脚本风格默认采用c风格,因此利用CMake与.h文件关联应用可以快速编写物体脚本
|
脚本风格默认采用c++风格,因此利用CMake与.h文件关联应用可以快速编写物体脚本
|
||||||
|
|
||||||
|
如在Unity持久化文件夹, 添加以下文本到CMakeLists.txt, 使用vs打开即可
|
||||||
```
|
```
|
||||||
set(CMAKE_BINARY_DIR TEMP_PATH)
|
|
||||||
project(ProjectHelper)
|
|
||||||
include_directories(Helper)
|
include_directories(Helper)
|
||||||
add_executable(ProjectHelper ProjectHelper.cpp)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
如VS,更改其中的ProjectHelper.cpp所包含的项目root.h以获取编辑器的智能引擎的支持
|
|
||||||
|
|
||||||
# 快捷键
|
# 快捷键
|
||||||
|
|
||||||
## 音频播放控制快捷键
|
## 音频播放控制快捷键
|
||||||
@@ -119,32 +117,50 @@ add_executable(ProjectHelper ProjectHelper.cpp)
|
|||||||
|
|
||||||
每个文件包含可调用的类成员函数,include的头文件是父类,可通过其查看其他可调用的父类成员函数
|
每个文件包含可调用的类成员函数,include的头文件是父类,可通过其查看其他可调用的父类成员函数
|
||||||
|
|
||||||
## RootObject
|
## ScriptableObject
|
||||||
|
|
||||||
每个项目都从RootObject开始,唯一且不可再生成
|
所有类都从ScriptableObject派生,了解其中的关键函数,
|
||||||
|
之后便可以编写灵活的脚本以实现行为
|
||||||
## TimelineScriptObject
|
|
||||||
|
|
||||||
许多类都从TimelineScriptObject派生,此处额外讲解其中的关键函数,
|
|
||||||
之后便可以编写如
|
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
//SkyUpdatement
|
// 在任一ScriptableObject中设置Var变量为0,
|
||||||
Add(Timeline-Sky, sky)
|
// 此后在该脚本以及该处之后加载的子脚本都会含有Var=0的上下文
|
||||||
|
SetContext("Var", 0);
|
||||||
|
// 如在DDT中, 使用花括号包裹的正整型三元组表示时间点,
|
||||||
|
// 形式为: {该小节划分的节拍数, 小节数, 位于该小节的节拍数}
|
||||||
|
// 如在BPM=60的情况下, 下例将会被翻译为(4+1/8)*1s=4.125s
|
||||||
|
Add({8,4,1});
|
||||||
```
|
```
|
||||||
|
|
||||||
的脚本代码,而Timeline-Sky的值可由全体脚本动态指定
|
通过脚本实现模板对象
|
||||||
|
|
||||||
### ResetTimeline
|
例如在
|
||||||
|
- root.cpp
|
||||||
|
- root
|
||||||
|
- TemplateLine.h(加载类型为SplineCore的脚本对象)
|
||||||
|
- TemplateLine
|
||||||
|
- ...(TemplateLine的子脚本)
|
||||||
|
- A-Anchor.h(加载类型为Anchor的脚本对象)
|
||||||
|
- B-Anchor.h(加载类型为Anchor的脚本对象)
|
||||||
|
|
||||||
重置时间线,不存在时生成,通过时间线变量来灵活获取浮点型的变量,
|
```cpp
|
||||||
如分别生成1/4分音单位的时间线与1/8分音的时间线,
|
// A-Anchor.h
|
||||||
并配合SetTimePoint与NextTimePoint获取第几个音符的时间
|
// 将自身在父脚本对象的坐标系中设置为x=-2的偏移
|
||||||
|
SetLocalPosition(-2,0,0);
|
||||||
|
// 设置上下文变量
|
||||||
|
...
|
||||||
|
// 加载
|
||||||
|
LoadSubScript(SplineCore, "TemplateLine.h")
|
||||||
|
```
|
||||||
|
|
||||||
### NextTimePoint
|
```cpp
|
||||||
|
// B-Anchor.h
|
||||||
|
// 将自身在父脚本对象的坐标系中设置为x=2的偏移
|
||||||
|
SetLocalPosition(2,0,0);
|
||||||
|
// 设置上下文变量
|
||||||
|
...
|
||||||
|
// 也加载
|
||||||
|
LoadSubScript(SplineCore, "TemplateLine.h")
|
||||||
|
```
|
||||||
|
|
||||||
每次都将时间线变量向前推进times个单位,总计会增加times*delta
|
自此实现了以脚本TemplateLine.h为根的预制体
|
||||||
|
|
||||||
### SetTimePoint
|
|
||||||
|
|
||||||
重新赋值时间线变量,该函数不能生成时间线
|
|
||||||
Binary file not shown.
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: eadb111e7ecacb24d9e1f6a728ce6aae
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Reference in New Issue
Block a user