diff --git a/Assets/Scripts/Framework/EditiorContent/EditorController.cs b/Assets/Scripts/Framework/EditiorContent/EditorController.cs index 1ac7d4e..e4b912f 100644 --- a/Assets/Scripts/Framework/EditiorContent/EditorController.cs +++ b/Assets/Scripts/Framework/EditiorContent/EditorController.cs @@ -404,6 +404,8 @@ namespace Demo.Editor Convention.RScript.Variable.CStyle.CScriptRScriptVariableGenerater.GetTypename(typeof(Spline.Type))).Register(); new Convention.RScript.Variable.CStyle.CScriptRScriptVariableGenerater(typeof(IEffectHookObject.InteractiveEffectType), null, null, Convention.RScript.Variable.CStyle.CScriptRScriptVariableGenerater.GetTypename(typeof(IEffectHookObject.InteractiveEffectType))).Register(); + new Convention.RScript.Variable.CStyle.CScriptRScriptVariableGenerater(typeof(IInteraction.JudgementLevel), null, null, + Convention.RScript.Variable.CStyle.CScriptRScriptVariableGenerater.GetTypename(typeof(IInteraction.JudgementLevel))).Register(); } private void Start() diff --git a/Assets/Scripts/Framework/ScriptableObject.cs b/Assets/Scripts/Framework/ScriptableObject.cs index 39999cc..620652b 100644 --- a/Assets/Scripts/Framework/ScriptableObject.cs +++ b/Assets/Scripts/Framework/ScriptableObject.cs @@ -85,6 +85,15 @@ namespace Demo public IEffectHookObject.InteractiveEffectType InteractableScoreInterval => IEffectHookObject.InteractiveEffectType.InteractableScoreInterval; public IEffectHookObject.InteractiveEffectType InteractableIntervalThatCanScoreBest => IEffectHookObject.InteractiveEffectType.InteractableIntervalThatCanScoreBest; } + + public class IInteractionJudgementLevelInstance + { + public static IInteractionJudgementLevelInstance instance = new(); + public IInteraction.JudgementLevel Bad => IInteraction.JudgementLevel.Bad; + public IInteraction.JudgementLevel ScoreLevel => IInteraction.JudgementLevel.ScoreLevel; + public IInteraction.JudgementLevel None => IInteraction.JudgementLevel.None; + public IInteraction.JudgementLevel BestLevel => IInteraction.JudgementLevel.BestLevel; + } } public partial class ScriptableObject : IScriptableObject @@ -509,7 +518,9 @@ namespace Demo { $"Spline{nameof(Spline.Type)}", new() { data = PrivateType.SplineTypeInstance.instance, type = typeof(PrivateType.SplineTypeInstance)} }, { nameof(IEffectHookObject.InteractiveEffectType), - new() { data = PrivateType.IEffectHookObjectInstance.instance, type = typeof(PrivateType.IEffectHookObjectInstance)} } + new() { data = PrivateType.IEffectHookObjectInstance.instance, type = typeof(PrivateType.IEffectHookObjectInstance)} }, + { nameof(IInteraction.JudgementLevel), + new() { data = PrivateType.IInteractionJudgementLevelInstance.instance, type = typeof(PrivateType.IInteractionJudgementLevelInstance) } } }; foreach (var ir in engine.RunAsync(script, importClass, variables).Yield()) diff --git a/Assets/Scripts/Interaction/JudgementEffect/ParticleJudgement.cs b/Assets/Scripts/Interaction/JudgementEffect/ParticleJudgement.cs index 8e89657..b23329b 100644 --- a/Assets/Scripts/Interaction/JudgementEffect/ParticleJudgement.cs +++ b/Assets/Scripts/Interaction/JudgementEffect/ParticleJudgement.cs @@ -26,15 +26,13 @@ namespace Demo.Game /// /// 加载预制体作为子物体 /// - /// 正整数, 0级判定为最佳判定, 判定等级对应会出现的粒子效果 + /// 设置的判定效果对应的等级 /// /// /// 判定效果会现形的持续时间 [Convention.RScript.Variable.Attr.Method] - public IEnumerator Load(string level, string ab, string prefab, string duration) + public IEnumerator Load(IInteraction.JudgementLevel levelId, string ab, string prefab, float duration) { - var levelId = (IInteraction.JudgementLevel)int.Parse(level); - AssetBundle assetBundle = null; yield return this.LoadAssetBundle(ab, x => assetBundle = x); var req = assetBundle.LoadAssetAsync(prefab); @@ -44,7 +42,7 @@ namespace Demo.Game Prefabs.Add(levelId, sub); sub.transform.SetParent(transform); AssetBundles.Add(levelId, ab); - Durations.Add(levelId, float.Parse(duration)); + Durations.Add(levelId, duration); } private void CreateParticle(GameObject prefab)