public void OnReceived(ProjectileShotMessage projectileShotMessage) { var fix = projectileShotMessage.Fix.Value; switch (fix.Type) { case ProjectileType.Normal: if (projectileShotMessage.Ammo.HasValue) { normalProjectileAmmoText.GetComponent <Ammo>().SetAmmo(projectileShotMessage.Ammo.Value.Value); } if (projectileShotMessage.ReloadTimeRemaining.HasValue) { normalProjectileAmmoText.GetComponent <Ammo>().SetReloadTimeRemaining(projectileShotMessage.ReloadTimeRemaining.Value.Value); } break; case ProjectileType.Bouncing: if (projectileShotMessage.Ammo.HasValue) { bouncingProjectileAmmoText.GetComponent <Ammo>().SetAmmo(projectileShotMessage.Ammo.Value.Value); } if (projectileShotMessage.ReloadTimeRemaining.HasValue) { bouncingProjectileAmmoText.GetComponent <Ammo>().SetReloadTimeRemaining(projectileShotMessage.ReloadTimeRemaining.Value.Value); } break; } Action action = () => { ProcessProjectileShotMessage(fix.ProjectileId, fix.Owner, fix.Position.X, fix.Position.Y, fix.Direction, fix.Type); }; ProcessAction(action); }
public void OnReceived(ProjectileShotMessage projectileShotMessage) { if (gameState == GameState.InGame) { inGame.OnReceived(projectileShotMessage); } }