public void addUpdate(OnUpdateDelegate update) { onUpdate += update; }
public void removeUpdate(OnUpdateDelegate update) { onUpdate -= update; }
/// <summary> /// Removes a OnDetectedDelegate /// See docs for () /// </summary> /// <param name="del">An OnUpdateDelegate</param> public void RemoveOnUpdateDelegate(OnUpdateDelegate del) { this.onUpdateDelegates -= del; }
/// <summary> /// This replaces all older delegates rather than adding a new one to the list. /// See docs for () /// </summary> /// <param name="del">An OnUpdateDelegate</param> public void SetOnUpdateDelegate(OnUpdateDelegate del) { this.onUpdateDelegates = del; }
public void Register(IBaseModuleManager baseManager) { _onUpdateDelegate += baseManager.OnUpdate; _onDrawDelegate += baseManager.OnDraw; _onDestroyDelegate += baseManager.OnDestroy; }
/// <summary> /// Add a new delegate to be triggered everyframe while active, no matter what. /// There are two events which are more specific to the two states of the system: /// 1. When Idle (No Target) - See the docs for OnIdleUpdateDelegate() /// 2. When There IS a target - See the docs for OnTargetUpdateDelegate() /// The delegate signature is: delegate() /// </summary> /// <param name="del">An OnUpdateDelegate</param> public void AddOnUpdateDelegate(OnUpdateDelegate del) { this.onUpdateDelegates += del; }
/// <summary> /// Add a new delegate to be triggered everyframe while active, no matter what. /// There are two events which are more specific to the two states of the system: /// 1. When Idle (No Target) - See the docs for OnIdleUpdateDelegate() /// 2. When There IS a target - See the docs for OnTargetUpdateDelegate() /// The delegate signature is: delegate() /// **This will only allow a delegate to be added once.** /// </summary> /// <param name="del">An OnUpdateDelegate</param> public void AddOnUpdateDelegate(OnUpdateDelegate del) { this.onUpdateDelegates -= del; // Cheap way to ensure unique (add only once) this.onUpdateDelegates += del; }
public void SetOnUpdateFunction(OnUpdateDelegate function) { onUpdateFunction = function; }
public override void Update() { OnUpdateDelegate?.Invoke(); }