更新至unity6并且更改Scriptable完成

This commit is contained in:
2025-11-25 10:52:39 +08:00
parent 2e0d16db49
commit 5d6acc1001
482 changed files with 2314 additions and 47257 deletions

View File

@@ -15,18 +15,30 @@ namespace Demo.Game
InteractableIntervalThatCanScoreBest = 0
}
[Content, SerializeField] private IInteraction MyInteractionModule;
[Content, SerializeField] private IInteraction m_MyInteractionModule;
[Content, SerializeField] private InteractiveEffectType MyInteractiveLevel = default;
private IInteraction MyInteractionModule
{
get
{
if (m_MyInteractionModule == null)
m_MyInteractionModule = Parent.GetComponent<IInteraction>();
return m_MyInteractionModule;
}
set
{
m_MyInteractionModule = value;
}
}
public abstract void OnInit();
public abstract void OnBegin();
public abstract void OnEnd();
public override IEnumerator LoadScript(string script)
protected override IEnumerator DoSomethingDuringApplyScript()
{
yield return base.LoadScript(script);
if (MyInteractionModule == null)
MyInteractionModule = Parent.GetComponent<IInteraction>();
yield return base.DoSomethingDuringApplyScript();
switch (MyInteractiveLevel)
{
case InteractiveEffectType.VisibleDuration:
@@ -96,7 +108,6 @@ namespace Demo.Game
}
break;
}
MyInteractionModule = null;
yield return base.UnloadScript();
}
@@ -115,9 +126,9 @@ namespace Demo.Game
/// </summary>
/// <param name="type">VisibleDurationInteractiveDurationInteractableScoreIntervalInteractableIntervalThatCanScoreBest</param>
[Convention.RScript.Variable.Attr.Method]
public void SetInteractiveEffectType(string type)
public void SetInteractiveEffectType(InteractiveEffectType type)
{
MyInteractiveLevel = Enum.Parse<InteractiveEffectType>(type);
MyInteractiveLevel = type;
}
}
}