public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     base.Load(valuesDictionary, idToEntityMap);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemMovingBlocks       = base.Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     BoxSize                  = valuesDictionary.GetValue <Vector3>("BoxSize");
     Mass                     = valuesDictionary.GetValue <float>("Mass");
     Density                  = valuesDictionary.GetValue <float>("Density");
     AirDrag                  = valuesDictionary.GetValue <Vector2>("AirDrag");
     WaterDrag                = valuesDictionary.GetValue <Vector2>("WaterDrag");
     WaterSwayAngle           = valuesDictionary.GetValue <float>("WaterSwayAngle");
     WaterTurnSpeed           = valuesDictionary.GetValue <float>("WaterTurnSpeed");
     Velocity                 = valuesDictionary.GetValue <Vector3>("Velocity");
     MaxSmoothRiseHeight      = valuesDictionary.GetValue <float>("MaxSmoothRiseHeight");
     ParentBody               = valuesDictionary.GetValue <EntityReference>("ParentBody").GetComponent <ComponentBody>(base.Entity, idToEntityMap, throwIfNotFound: false);
     ParentBodyPositionOffset = valuesDictionary.GetValue <Vector3>("ParentBodyPositionOffset");
     ParentBodyRotationOffset = valuesDictionary.GetValue <Quaternion>("ParentBodyRotationOffset");
     IsSmoothRiseEnabled      = true;
     IsGravityEnabled         = true;
     IsGroundDragEnabled      = true;
     IsWaterDragEnabled       = true;
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemPlayers            = base.Project.FindSubsystem <SubsystemPlayers>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemSky                = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemExplosions         = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFireBlockBehavior  = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     foreach (ValuesDictionary item in valuesDictionary.GetValue <ValuesDictionary>("Pickables").Values.Where((object v) => v is ValuesDictionary))
     {
         Pickable pickable = new Pickable();
         pickable.Value        = item.GetValue <int>("Value");
         pickable.Count        = item.GetValue <int>("Count");
         pickable.Position     = item.GetValue <Vector3>("Position");
         pickable.Velocity     = item.GetValue <Vector3>("Velocity");
         pickable.CreationTime = item.GetValue("CreationTime", 0.0);
         if (item.ContainsKey("StuckMatrix"))
         {
             pickable.StuckMatrix = item.GetValue <Matrix>("StuckMatrix");
         }
         m_pickables.Add(pickable);
     }
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials     = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemPickables          = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemSky                = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemNoise              = base.Project.FindSubsystem <SubsystemNoise>(throwOnError: true);
     m_subsystemExplosions         = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     m_subsystemFireBlockBehavior  = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     foreach (ValuesDictionary item in valuesDictionary.GetValue <ValuesDictionary>("Projectiles").Values.Where((object v) => v is ValuesDictionary))
     {
         Projectile projectile = new Projectile();
         projectile.Value        = item.GetValue <int>("Value");
         projectile.Position     = item.GetValue <Vector3>("Position");
         projectile.Velocity     = item.GetValue <Vector3>("Velocity");
         projectile.CreationTime = item.GetValue <double>("CreationTime");
         m_projectiles.Add(projectile);
     }
 }
Beispiel #4
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemTimeOfDay          = base.Project.FindSubsystem <SubsystemTimeOfDay>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemWeather            = base.Project.FindSubsystem <SubsystemWeather>(throwOnError: true);
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     m_sunTexture    = ContentManager.Get <Texture2D>("Textures/Sun");
     m_glowTexture   = ContentManager.Get <Texture2D>("Textures/SkyGlow");
     m_cloudsTexture = ContentManager.Get <Texture2D>("Textures/Clouds");
     for (int i = 0; i < 8; i++)
     {
         m_moonTextures[i] = ContentManager.Get <Texture2D>("Textures/Moon" + (i + 1).ToString(CultureInfo.InvariantCulture));
     }
     UpdateLightAndViewParameters();
     Display.DeviceReset += Display_DeviceReset;
 }