2025-09-25 19:04:05 +08:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Convention;
|
|
|
|
|
using Convention.WindowsUI.Variant;
|
|
|
|
|
using Dreamteck.Splines;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Demo.Game
|
|
|
|
|
{
|
|
|
|
|
public static class DefaultInstantiate
|
|
|
|
|
{
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> GameObjectInstantiate = new()
|
|
|
|
|
{
|
|
|
|
|
{ $"{nameof(Anchor)}",Anchor.Make},
|
|
|
|
|
// Camera
|
|
|
|
|
{ $"{nameof(CameraObject)}",CameraObject.MakeCameraObject},
|
|
|
|
|
// Global Env
|
|
|
|
|
{ $"{nameof(PrefabRootObject)}",PrefabRootObject.Make },
|
|
|
|
|
{ $"{nameof(SkyUpdatement)}",SkyUpdatement.Make},
|
|
|
|
|
// Sub World
|
|
|
|
|
{ $"{nameof(SubWorld)}",SubWorld.Make},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> DDTInstantiate = new()
|
|
|
|
|
{
|
|
|
|
|
{ $"{nameof(DDT)}",DDT.Make}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> TickUpdatementInstantiate = new ()
|
|
|
|
|
{
|
|
|
|
|
{ $"{nameof(LookAtAnchor)}",LookAtAnchor.Make},
|
|
|
|
|
{ $"{nameof(TickMovement)}",TickMovement.Make},
|
|
|
|
|
{ $"{nameof(TickRotation)}",TickRotation.Make},
|
|
|
|
|
{ $"{nameof(TickScaling)}",TickScaling.Make},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> MaterialUpdatementInstantiate = new()
|
|
|
|
|
{
|
|
|
|
|
{ $"{nameof(MaterialUpdatement)}",MaterialUpdatement.Make},
|
|
|
|
|
{ $"{nameof(ColorUpdatement)}",ColorUpdatement.Make},
|
|
|
|
|
{ $"{nameof(EmissionColorUpdatement)}",EmissionColorUpdatement.Make},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> SplineInstantiate = new()
|
|
|
|
|
{
|
|
|
|
|
{ $"{nameof(SplineCore)}",SplineCore.Make},
|
|
|
|
|
{ $"{nameof(SplineNode)}",SplineNode.Make},
|
|
|
|
|
{ $"{nameof(SplineAnchor)}",SplineAnchor.Make},
|
|
|
|
|
{ $"{nameof(SplineMovement)}",SplineMovement.Make},
|
|
|
|
|
{ $"{nameof(SplineRotation)}",SplineRotation.Make},
|
|
|
|
|
{ $"{nameof(SplineScaling)}",SplineScaling.Make},
|
2025-11-25 10:52:39 +08:00
|
|
|
{ $"{nameof(SplinePointerObject)}",SplinePointerObject.Make},
|
2025-09-25 19:04:05 +08:00
|
|
|
{ $"{nameof(SplineTrackRenderer)}",SplineTrackRenderer.Make},
|
|
|
|
|
{ $"{nameof(SplineTubeRenderer)}",SplineTubeRenderer.Make},
|
2025-11-26 17:59:18 +08:00
|
|
|
{ $"{nameof(SplineSurfaceRenderer)}",SplineSurfaceRenderer.Make},
|
2025-09-25 19:04:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> JudgementInstantiate = new()
|
|
|
|
|
{
|
|
|
|
|
// 可判定物只能有一个种类被使用,否则会引起输入检定冲突
|
|
|
|
|
{ $"{nameof(FullScreenInteraction)}",FullScreenInteraction.Make},
|
|
|
|
|
// Effect
|
|
|
|
|
{ $"{nameof(ParticleEffect)}",ParticleEffect.Make },
|
|
|
|
|
// JudgementEffect
|
|
|
|
|
{ $"{nameof(ParticleJudgement)}",ParticleJudgement.Make},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static void OpenInstantiateMenu(this ScriptableObject self, RectTransform item)
|
|
|
|
|
{
|
|
|
|
|
List<SharedModule.CallbackData> result = new()
|
|
|
|
|
{
|
|
|
|
|
// Show Name
|
2025-11-25 10:52:39 +08:00
|
|
|
new($"{self.ScriptName}",_=>{ }),
|
|
|
|
|
new($"{self.GetType()}",_=>{ }),
|
|
|
|
|
new($"Pos:{self.transform.position}",_=>{ }),
|
|
|
|
|
new($"xPos:{self.transform.localPosition}",_=>{ }),
|
|
|
|
|
new($"Angles:{self.transform.eulerAngles}",_=>{ }),
|
|
|
|
|
new($"xAngles:{self.transform.localEulerAngles}",_=>{ }),
|
|
|
|
|
new($"Scale:{self.transform.localScale}",_=>{ }),
|
2025-09-25 19:04:05 +08:00
|
|
|
};
|
|
|
|
|
SharedModule.instance.OpenCustomMenu(item, result.ToArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, Func<ScriptableObject>> GetScriptableObjectInstantiate()
|
|
|
|
|
{
|
2025-10-04 23:09:46 +08:00
|
|
|
return new Dictionary<string, Func<ScriptableObject>>(GameObjectInstantiate
|
|
|
|
|
.Union(DDTInstantiate)
|
|
|
|
|
.Union(TickUpdatementInstantiate)
|
|
|
|
|
.Union(MaterialUpdatementInstantiate)
|
|
|
|
|
.Union(SplineInstantiate)
|
|
|
|
|
.Union(JudgementInstantiate));
|
2025-09-25 19:04:05 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|