Ejemplo n.º 1
0
        public void WhenNotAllDataOfCorrectSize_ReturnIsNotValid()
        {
            var emptyLevelData = LevelDataScriptable.Create(LevelData.Empty);

            var returnedValue = _service.Validate(emptyLevelData, _3X3MapConfig);

            Assert.That(returnedValue.IsValid, Is.False);
        }
Ejemplo n.º 2
0
        private static void CreateAndSaveAsset(GameEnvironment gameEnvironment,
                                               string fullPath,
                                               string levelDataFilename,
                                               string gameEnvironmentFilename,
                                               string mapConfigFilename,
                                               string worldConfigFilename,
                                               string environmentName)
        {
            //create new instances as they cannot be referencing the old configs
            var levelDataScriptable = LevelDataScriptable.Create(
                gameEnvironment.LevelData
                );
            var mapConfiguration = MapConfig.Create(
                gameEnvironment.MapConfiguration.GetMap2DActualWidth(),
                gameEnvironment.MapConfiguration.GetMap2DActualHeight()
                );
            var worldConfiguration = WorldConfig.Create(
                gameEnvironment.WorldConfiguration.UpAxis,
                gameEnvironment.WorldConfiguration.InnerRadius
                );

            var gameEnvironmentScriptable = GameEnvironmentScriptable.Create(
                environmentName,
                mapConfiguration,
                worldConfiguration,
                levelDataScriptable
                );

            AssetDatabase.CreateAsset(levelDataScriptable, $"{fullPath}/{levelDataFilename}");
            AssetDatabase.CreateAsset(mapConfiguration, $"{fullPath}/{mapConfigFilename}");
            AssetDatabase.CreateAsset(worldConfiguration, $"{fullPath}/{worldConfigFilename}");
            AssetDatabase.CreateAsset(
                gameEnvironmentScriptable,
                $"{fullPath}/{gameEnvironmentFilename}"
                );
        }
Ejemplo n.º 3
0
 public static LevelDataScriptable ToScriptable(this LevelData data) => LevelDataScriptable.Create(data);