예제 #1
0
    // El método DeployRegiment crea una instancia del héroe en el campo de batalla
    public static void DeployRegiment(BattleHex parentObject)                    // el héroe aparece en parentObject
    {
        Hero regiment = readyForDeploymentIcon.charAttributes.heroSO;            // obtiene el héroe prefabricado
        Hero fighter  = Instantiate(regiment, parentObject.Landscape.transform); // crea una instancia del héroe y

        fighter.GetComponent <Move>().ManageSortingLayer(parentObject);

        parentObject.CleanUpDeploymentPosition();            // oculta la marca de verificación y deshabilita el colisionador
        readyForDeploymentIcon.HeroIsDeployed();             // marca el icono en gris
        readyForDeploymentIcon = null;                       // borra una variable para evitar que el héroe reaparezca
        storage.GetComponent <StartBTN>().ControlStartBTN(); // habilita el botón de inicio
    }
    //DeployRegiment method instantiates the hero on the battlefield
    public static void DeployRegiment(BattleHex parentObject)                    //hero appears on parentObject
    {
        Hero regiment = readyForDeploymentIcon.charAttributes.heroSO;            // gets the hero prefab
        Hero fighter  = Instantiate(regiment, parentObject.Landscape.transform); //instantiates the hero and

        fighter.GetComponent <Move>().ManageSortingLayer(parentObject);
        //returns a hero object
        parentObject.CleanUpDeploymentPosition();            //hides the checkmark and disables the collider
        readyForDeploymentIcon.HeroIsDeployed();             //marks the icon in gray
        readyForDeploymentIcon = null;                       //clears a variable to prevent the hero from reappearing
        storage.GetComponent <StartBTN>().ControlStartBTN(); //enables the start button
    }