Пример #1
0
    private void Start()
    {
        sceneManager = SceneManager.Instance;

        if (sceneManager == null)
        {
            throw new Exception("No se encontro el SceneManager");
        }

        recordManager = new RecordManager();

        currentPlayerController = FindObjectOfType <PlayerController>();

        userInferfaceController.LifesToShow(PlayerLifes);

        OnPlayerDestroy    += PlayerDestroy;
        OnAlienDestroy     += Score;
        OnAllAliensDestroy += RestartLevel;
        OnAliensTouchFloor += ResetAndLoseALife;

        OnReturnToMenu += ReturnToMenu;

        AlienInstancerConfiguration config = new AlienInstancerConfiguration(columns, rows, pandding);

        alienInstancer.SetConfiguration(config);
        alienInstancer.CreateAliens();


        userInferfaceController.SetScore(currentScore);
    }
Пример #2
0
    public void SetConfiguration(AlienInstancerConfiguration config)
    {
        configuration = config;

        totalAliens = config.total;

        alienControllers = new AlienController[configuration.columns, configuration.rows];

        AlienController alienController = alien.GetComponent <AlienController>();

        width  = alienController.Width;
        height = alienController.Height;

        totalWidth  = width * configuration.columns + configuration.pandding * (configuration.columns - 1);
        totalHeight = height * configuration.rows + configuration.pandding * (configuration.rows - 1);
    }
Пример #3
0
 public void SetAlienInstancerConfiguration(AlienInstancerConfiguration configuration)
 {
     this.configuration = configuration;
 }