修复了一些bug(包含窗口预制体中的错误与{}列表解析存在死循环的错误)
This commit is contained in:
@@ -13,9 +13,37 @@ namespace Demo.Game
|
||||
return new GameObject().AddComponent<SplineTrackRenderer>();
|
||||
}
|
||||
|
||||
public const bool DefaultIsAutoOrient = false;
|
||||
[Content] public bool IsAutoOrient = DefaultIsAutoOrient;
|
||||
|
||||
public override IEnumerator LoadScript(string script)
|
||||
{
|
||||
MyLineMaterial = Resources.Load<Material>("Line/Default");
|
||||
yield return base.LoadScript(script);
|
||||
}
|
||||
|
||||
public override void SetupMeshGenerator(SplineRenderer meshGenerater)
|
||||
{
|
||||
base.SetupMeshGenerator(meshGenerater);
|
||||
meshGenerater.autoUpdate = IsAutoOrient;
|
||||
}
|
||||
|
||||
public override IEnumerator UnloadScript()
|
||||
{
|
||||
yield return base.UnloadScript();
|
||||
// Reset
|
||||
{
|
||||
IsAutoOrient = DefaultIsAutoOrient;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开启自动面向摄像机的功能
|
||||
/// </summary>
|
||||
[ScriptableCall(@"开启自动面向摄像机的功能")]
|
||||
public void EnableAutoOrient()
|
||||
{
|
||||
IsAutoOrient = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,10 @@ namespace Demo.Game
|
||||
return new GameObject().AddComponent<SplineTubeRenderer>();
|
||||
}
|
||||
|
||||
[Content] public bool IsDoubleSide = true;
|
||||
[Content] public int SidesCount = 12;
|
||||
public const bool DefaultIsDoubleSide = true;
|
||||
public const int DefaultSidesCount = 12;
|
||||
[Content] public bool IsDoubleSide = DefaultIsDoubleSide;
|
||||
[Content] public int SidesCount = DefaultSidesCount;
|
||||
|
||||
public override IEnumerator LoadScript(string script)
|
||||
{
|
||||
@@ -31,10 +33,12 @@ namespace Demo.Game
|
||||
|
||||
public override IEnumerator UnloadScript()
|
||||
{
|
||||
if (string.IsNullOrEmpty(LinesAssetBundlePath) == false)
|
||||
yield return this.UnloadAssetBundle(LinesAssetBundlePath);
|
||||
LinesAssetBundlePath = "";
|
||||
yield return base.UnloadScript();
|
||||
// Reset
|
||||
{
|
||||
IsDoubleSide = DefaultIsDoubleSide;
|
||||
SidesCount = DefaultSidesCount;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user