更新至unity6并且更改Scriptable完成
This commit is contained in:
@@ -7,15 +7,26 @@ namespace Demo.Game
|
||||
public abstract class IJudgementHookObject : ScriptableObject, IHookInteraction
|
||||
{
|
||||
|
||||
[Content, SerializeField] private IInteraction MyInteractionModule;
|
||||
[Content, SerializeField] private IInteraction m_MyInteractionModule;
|
||||
private IInteraction MyInteractionModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_MyInteractionModule == null)
|
||||
m_MyInteractionModule = Parent.GetComponent<IInteraction>();
|
||||
return m_MyInteractionModule;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_MyInteractionModule = value;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void OnJudgement(IInteraction.JudgementLevel level);
|
||||
|
||||
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();
|
||||
MyInteractionModule.JudgementEvent.AddListener(OnJudgement);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user