/// <summary> /// Esegue il Setup dell'behaviour /// per aggiungere comportamenti custom sovrascrivere CustomSetup /// </summary> /// <param name="entity">entità a cui appartiene il behaviour</param> public void Setup(AbsEntity entity) { if (!hasBeenSetup) { this.entity = entity; hasBeenSetup = true; CustomSetup(); if (onSetup == null) { onSetup = new UnityEvent(); } onSetup?.Invoke(); } }
public static void SubscribeToStart(this AbsEntity entity, UnityAction action) { Start_Bh tmp = entity.GetOrAddBehaviour <Start_Bh>(true, entity.transform); tmp.onStart.AddListener(action); }
public static void SubscribeToLateUpdate(this AbsEntity entity, UnityAction action) { LateUpdate_Bh tmp = entity.GetOrAddBehaviour <LateUpdate_Bh>(true, entity.transform); tmp.onLateUpdate.AddListener(action); }