//public static T LogSignalREvent<T>(this IEventPayload eventPayload) where T : IEventPayload { // if (IsVerbose) Logger?.LogDebug($"{Environment} : {eventPayload.GetType().Name}"); // return (T)eventPayload; //} // public virtual void ComponentStateChangeFiring<T>(ComponentStateChange<T> componentStateChange) where T : ComponentState { // _eventAggregator.GetEvent<ComponentStateChangeEvent<ComponentStateChange<T>>>().Publish(componentStateChange); //} public static T LogLocalEvent <T>(this IEventPayload eventPayload) where T : IEventPayload { if (IsVerbose) { Logger?.LogDebug($"{Environment} : {eventPayload.GetType().Name}"); } return((T)eventPayload); }
public void OnPowerUpExpired(IEventPayload genericPayload) { if (genericPayload.GetType() == typeof(PowerUpExpiredPayload)) { PowerUpExpiredPayload pwrUpExpiredPayload = (PowerUpExpiredPayload)genericPayload; activePowerUps.Remove(pwrUpExpiredPayload.PowerUp); } }
public void OnScore(IEventPayload genericPayload) { if (genericPayload.GetType() == typeof(ScorePayload)) { ScorePayload scorePayload = (ScorePayload)genericPayload; totalScore += scorePayload.Score; UpdateScoreDisplay(); } }
public void OnPuckReset(IEventPayload genericPayload) { if (genericPayload.GetType() == typeof(PuckResetPayload)) { launchState = LaunchState.LAUNCH_READY; puckBody.bodyType = RigidbodyType2D.Kinematic; LaunchAimStart = Vector2.zero; LaunchAimEnd = Vector2.zero; transform.position = new Vector2(startLaunchXPos, launchYPos); } }
/* ~~~~~~~~~~~~~~~~~~~~ Unity Event Handlers ~~~~~~~~~~~~~~~~~~~~ */ public void OnPowerUpAcquired(IEventPayload genericPayload) { if (genericPayload.GetType() == typeof(PowerUpAcquiredPayload)) { PowerUpAcquiredPayload pwrUpAcquiredPayload = (PowerUpAcquiredPayload)genericPayload; if (pwrUpAcquiredPayload.Type == ActivationType.IMMEDIATE) { ActivatePowerUp(pwrUpAcquiredPayload.PowerUp); } else { storedPowerUps.Enqueue(pwrUpAcquiredPayload.PowerUp); } } }