Example #1
0
        //Handle Cube removed / added sound
        private void _chunkEntityImpactManager_BlockReplaced(object sender, LandscapeBlockReplacedEventArgs e)
        {
            BlockProfile NewBlockTypeProfile      = _visualWorldParameters.WorldParameters.Configuration.BlockProfiles[e.NewBlockType];
            BlockProfile PreviousBlockTypeProfile = _visualWorldParameters.WorldParameters.Configuration.BlockProfiles[e.PreviousBlock.Id];

            if (e.NewBlockType == WorldConfiguration.CubeId.Air && PreviousBlockTypeProfile.CubeFamilly == Shared.Enums.enuCubeFamilly.Liquid)
            {
                return;
            }
            if (NewBlockTypeProfile.CubeFamilly == Shared.Enums.enuCubeFamilly.Liquid && e.PreviousBlock.Id == WorldConfiguration.CubeId.Air)
            {
                return;
            }
            if (NewBlockTypeProfile.CubeFamilly == Shared.Enums.enuCubeFamilly.Liquid && PreviousBlockTypeProfile.CubeFamilly == Shared.Enums.enuCubeFamilly.Liquid)
            {
                return;
            }

            if (e.NewBlockType == WorldConfiguration.CubeId.Air)
            {
                PlayBlockTake(e.Position);
            }
            else
            {
                PlayBlockPut(e.Position);
            }
        }
Example #2
0
 //Adding cube particule on cube destroyed !
 private void _chunkEntityImpactManager_BlockReplaced(object sender, LandscapeBlockReplacedEventArgs e)
 {
     //Cube has been destroyed
     if (e.NewBlockType == WorldConfiguration.CubeId.Air)
     {
         //Emit Colored particules
         _cubeEmitter.EmitParticuleForCubeDestruction(40, e.PreviousBlock, e.Position, ref _cameraManager.ActiveCamera.WorldPosition.Value);
     }
 }