コード例 #1
0
 public void Load(ValuesDictionary valuesDictionary)
 {
     Name = valuesDictionary.GetValue <string>("WorldName");
     OriginalSerializationVersion = valuesDictionary.GetValue("OriginalSerializationVersion", string.Empty);
     Seed     = valuesDictionary.GetValue("WorldSeedString", string.Empty);
     GameMode = valuesDictionary.GetValue("GameMode", GameMode.Challenging);
     EnvironmentBehaviorMode              = valuesDictionary.GetValue("EnvironmentBehaviorMode", EnvironmentBehaviorMode.Living);
     TimeOfDayMode                        = valuesDictionary.GetValue("TimeOfDayMode", TimeOfDayMode.Changing);
     StartingPositionMode                 = valuesDictionary.GetValue("StartingPositionMode", StartingPositionMode.Easy);
     AreWeatherEffectsEnabled             = valuesDictionary.GetValue("AreWeatherEffectsEnabled", defaultValue: true);
     IsAdventureRespawnAllowed            = valuesDictionary.GetValue("IsAdventureRespawnAllowed", defaultValue: true);
     AreAdventureSurvivalMechanicsEnabled = valuesDictionary.GetValue("AreAdventureSurvivalMechanicsEnabled", defaultValue: true);
     AreSupernaturalCreaturesEnabled      = valuesDictionary.GetValue("AreSupernaturalCreaturesEnabled", defaultValue: true);
     IsFriendlyFireEnabled                = valuesDictionary.GetValue("IsFriendlyFireEnabled", defaultValue: true);
     TerrainGenerationMode                = valuesDictionary.GetValue("TerrainGenerationMode", TerrainGenerationMode.Continent);
     IslandSize             = valuesDictionary.GetValue("IslandSize", new Vector2(200f, 200f));
     TerrainLevel           = valuesDictionary.GetValue("TerrainLevel", 64);
     ShoreRoughness         = valuesDictionary.GetValue("ShoreRoughness", 0f);
     TerrainBlockIndex      = valuesDictionary.GetValue("TerrainBlockIndex", 8);
     TerrainOceanBlockIndex = valuesDictionary.GetValue("TerrainOceanBlockIndex", 18);
     TemperatureOffset      = valuesDictionary.GetValue("TemperatureOffset", 0f);
     HumidityOffset         = valuesDictionary.GetValue("HumidityOffset", 0f);
     SeaLevelOffset         = valuesDictionary.GetValue("SeaLevelOffset", 0);
     BiomeSize         = valuesDictionary.GetValue("BiomeSize", 1f);
     BlocksTextureName = valuesDictionary.GetValue("BlockTextureName", string.Empty);
     Palette           = new WorldPalette(valuesDictionary.GetValue("Palette", new ValuesDictionary()));
 }
コード例 #2
0
        void Reset()
        {
            contactForceMode    = ContactForceMode.UI;
            graspedMovementType = GraspedMovementType.Nonkinematic;

            startingPositionMode = StartingPositionMode.Relaxed;

            rigidbody = GetComponent <Rigidbody>();
            if (rigidbody != null)
            {
                rigidbody.useGravity = false;
            }
        }