void _playerCharacter_HealthChanged(object sender, Shared.Entities.Events.EntityHealthChangeEventArgs e) { if (e.Change < -2) { //Only if first person mode ! if (_cameraManager.ActiveCamera.CameraType == S33M3CoreComponents.Cameras.CameraType.FirstPerson) { //Damage indicator in case of First Person damage received UtopiaParticuleEngine.AddDynamicEntityParticules(_cameraManager.ActiveCamera.WorldPosition.Value, _entityRotations.LookAt, UtopiaParticuleEngine.DynamicEntityParticuleType.Blood); } if (e.Change < -20) { _soundEngine.StartPlay2D("Hurt", 1.0f); } else { _soundEngine.StartPlay2D("Hurt", 0.3f); } } }
public DynamicEntityManager(D3DEngine d3DEngine, VoxelModelManager voxelModelManager, CameraManager <ICameraFocused> camManager, WorldFocusManager worldFocusManager, VisualWorldParameters visualWorldParameters, SingleArrayChunkContainer chunkContainer, IPlayerManager playerEntityManager, ISkyDome skyDome, SharedFrameCB sharedFrameCB, IWorldChunks worldChunks, ISoundEngine soundEngine, UtopiaParticuleEngine utopiaParticuleEngine ) { _d3DEngine = d3DEngine; _voxelModelManager = voxelModelManager; _camManager = camManager; _chunkContainer = chunkContainer; _soundEngine = soundEngine; _worldFocusManager = worldFocusManager; _visualWorldParameters = visualWorldParameters; _playerEntityManager = playerEntityManager; _playerEntityManager.UtopiaParticuleEngine = utopiaParticuleEngine; _skyDome = skyDome; _sharedFrameCB = sharedFrameCB; _worldChunks = worldChunks; _utopiaParticuleEngine = utopiaParticuleEngine; _voxelModelManager.VoxelModelAvailable += VoxelModelManagerVoxelModelReceived; _camManager.ActiveCameraChanged += CamManagerActiveCameraChanged; _playerEntityManager.PlayerEntityChanged += _playerEntityManager_PlayerEntityChanged; DynamicEntities = new List <VisualVoxelEntity>(); DrawOrders.UpdateIndex(VOXEL_DRAW, 99, "VOXEL_DRAW"); SPRITENAME_DRAW = DrawOrders.AddIndex(1060, "NAME_DRAW"); this.IsDefferedLoadContent = true; }