更新至unity6并且更改Scriptable完成
This commit is contained in:
@@ -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">VisibleDuration,InteractiveDuration,InteractableScoreInterval,InteractableIntervalThatCanScoreBest</param>
|
||||
[Convention.RScript.Variable.Attr.Method]
|
||||
public void SetInteractiveEffectType(string type)
|
||||
public void SetInteractiveEffectType(InteractiveEffectType type)
|
||||
{
|
||||
MyInteractiveLevel = Enum.Parse<InteractiveEffectType>(type);
|
||||
MyInteractiveLevel = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user