123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public abstract class AbstractSafetyAreaStep<T> : ISafetyAreaStep
- {
- private Action onEnterStepCallback;
- private Action onExitStepCallback;
- protected T reference;
- public AbstractSafetyAreaStep(T reference)
- {
- this.reference = reference;
- }
- public virtual void RegistOnEnterStepCallback(Action callback)
- {
- onEnterStepCallback += callback;
- }
- public virtual void UnRegistOnEnterStepCallback(Action callback)
- {
- onEnterStepCallback -= callback;
- }
- public virtual void RegistOnExitStepCallback(Action callback)
- {
- onExitStepCallback += callback;
- }
- public virtual void UnRegistOnExitStepCallback(Action callback)
- {
- onExitStepCallback -= callback;
- }
- public virtual void OnEnterStep(object data)
- {
- onEnterStepCallback?.Invoke();
- }
- public virtual void OnExitStep()
- {
- onExitStepCallback?.Invoke();
- }
- public abstract void OnUserCancel();
- public abstract SafetyAreaStepEnum GetStepEnum();
- }
|