public static ScriptableObjectBehaviourWrapperHelper GetOrCreateInstance()
        {
            if (_instance == null)
            {
                _instance = new GameObject(nameof(ScriptableObjectBehaviourWrapperHelper))
                            .AddComponent <ScriptableObjectBehaviourWrapperHelper>();
            }

            return(_instance);
        }
 private void Subscribe()
 {
     if (OnUpdate)
     {
         ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnUpdate += ScriptableObjectBehaviourWrapper_OnUpdate;
     }
     if (OnFixedUpdate)
     {
         ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnFixedUpdate += ScriptableObjectBehaviourWrapper_OnFixedUpdate;
     }
     if (OnLateUpdate)
     {
         ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnLateUpdate += ScriptableObjectBehaviourWrapper_OnLateUpdate;
     }
     _subscribed = true;
 }
        private void Unsubscribe()
        {
            //if helper is dead, there are no subscriptions anyways
            _subscribed = false;
            if (!ScriptableObjectBehaviourWrapperHelper.IsAlive)
            {
                return;
            }

            if (OnUpdate)
            {
                ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnUpdate -= ScriptableObjectBehaviourWrapper_OnUpdate;
            }
            if (OnFixedUpdate)
            {
                ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnFixedUpdate -= ScriptableObjectBehaviourWrapper_OnFixedUpdate;
            }
            if (OnLateUpdate)
            {
                ScriptableObjectBehaviourWrapperHelper.GetOrCreateInstance().OnLateUpdate -= ScriptableObjectBehaviourWrapper_OnLateUpdate;
            }
        }