/* * Execute * overrides Behaviour's Update() * * always returns success, calls upon another object to run a function * * @returns BehaviourReturn - always success */ public override BehaviourReturn Execute() { if (action != null) { //run the action action.Invoke(tree); //the action will modify this value return(tree.privateReturnValue); } else { //return nothing, the behaviour was improperly initialised return(BehaviourReturn.NONE); } }
private void DestroyTree() { OnTreeEmpty?.Invoke(this); transform.DOKill(); Destroy(gameObject); }