Пример #1
0
    int enemiesNum;                                                      // para contar el número de objetos enemigos

    void Start()
    {
        ActivatePositionsForRegiments();
        storage         = FindObjectOfType <StorageMNG>();
        enemiesToDeploy = storage.currentProgress.enemies; // llena la lista con los objetos programables de los enemigos
        enemiesNum      = enemiesToDeploy.Count();         // cuenta el número de unidades enemigas
        PlaceEnemies();                                    // coloca unidades enemigas en el campo de batalla
    }
    int enemiesNum;                                                      // to count the number of enemy objects

    void Start()
    {
        ActivatePositionsForRegiments();
        storage         = FindObjectOfType <StorageMNG>();
        enemiesToDeploy = storage.currentProgress.enemies; //fill the list with enemies' scriptable objects
        enemiesNum      = enemiesToDeploy.Count();         //count the number of enemy units
        PlaceEnemies();                                    //places enemy units on the battlefield
    }
    public void IconClicked()//responds to a click on a button
    {
        StorageMNG storage = GetComponentInParent <StorageMNG>();

        if (!charAttributes.isDeployed) //evaluates if the unit is already on the battlefield
        {
            storage.TintIcon(this);     //marks a regiment to be placed on the battlefield
        }
        else
        {
            storage.RemoveRegiment(charAttributes);
            //storage.ReturnRegiment(this);//returns the hero to the storage
        }
    }
Пример #4
0
    public void IconClicked()// responde a un clic en un botón
    {
        StorageMNG storage = GetComponentInParent <StorageMNG>();

        if (!charAttributes.isDeployed) // evalúa si la unidad ya está en el campo de batalla
        {
            storage.TintIcon(this);     // marca un regimiento para colocarlo en el campo de batalla
        }
        else
        {
            storage.RemoveRegiment(charAttributes);
            //storage.ReturnRegiment(this);//returns the hero to the storage
        }
    }
 private void Start()
 {
     storage = GetComponentInParent <StorageMNG>();
     StorageMNG.OnClickOnGrayIcon += ReturnDefaultState; //subscribes the ReturnDefaultState method to an OnRemoveHero event
 }
    [SerializeField] int minimumHeroesNum; //minimum set of regiments to activate the battle

    private void Start()
    {
        storage           = GetComponent <StorageMNG>();
        OnStartingBattle += ControlStartBTN;
        startBTN.gameObject.SetActive(false);//disables the Start button before the deployment
    }
Пример #7
0
 private void Start()
 {
     storage = GetComponentInParent <StorageMNG>();
     StorageMNG.OnClickOnGrayIcon += ReturnDefaultState; // suscribe el método ReturnDefaultState a un evento OnRemoveHero
 }
Пример #8
0
    [SerializeField] int minimumHeroesNum; // conjunto mínimo de regimientos para activar la batalla

    private void Start()
    {
        storage           = GetComponent <StorageMNG>();
        OnStartingBattle += ControlStartBTN;
        startBTN.gameObject.SetActive(false);// deshabilita el botón Inicio antes de la implementación
    }