private ILevelElement CreateLevelElement(IPlacedObject actualObjectPlaced)
    {
        LevelElementData data         = ObjectToDataConverter.ObjectToLevelElement((PlacedObject)actualObjectPlaced);
        ILevelElement    levelElement = LevelElementFactory.InstantiateLevelElement(data, ((PlacedObject)actualObjectPlaced).transform);

        return(levelElement);
    }
Beispiel #2
0
    private void AddWeaponData(IPlacedObject plObject)
    {
        Weapon     weapon     = plObject.Prefab.GetComponent <Weapon>();
        WeaponData weaponData = ObjectToDataConverter.GetWeaponDataForWeapon(plObject);

        levelData.levelItemsData.Add((ItemData)weaponData);
        levelData.levelItems.Add((Item)weapon);
    }
Beispiel #3
0
    private void AddEnemyData(IPlacedObject plObject)
    {
        Enemy     enemy     = plObject.Prefab.GetComponent <Enemy>();
        EnemyData enemyData = ObjectToDataConverter.GetEnemyDataForEnemy(plObject);

        enemy.Type = enemyData.type;
        levelData.enemyData.Add(enemyData);
        levelData.enemies.Add(enemy);
    }
Beispiel #4
0
 private void AddPlayerData(IPlacedObject plObject, Level level)
 {
     levelData.playerData = ObjectToDataConverter.GetPlayerDataForPlayer(plObject);
     level.SetSpawnPosition(((PlacedObject)plObject).transform.position);
 }