Esempio n. 1
0
    void AnimUpdate()
    {
        currentFormationName = armyScript.activeFormation.Designation;

        anim.SetBool("Cover", currentFormationName == EnumArmyFormations.Cover);
        anim.SetBool("Moving", currentFormationName == EnumArmyFormations.March);
        anim.SetBool("Charging", currentFormationName == EnumArmyFormations.Charge);
        anim.SetBool("Bracing", currentFormationName
                     == EnumArmyFormations.Brace);

        anim.SetBool("Attack", armyScript.isAttacking);
    }
    void AnimUpdate()
    {
        currentFormationName = armyScript.activeFormation.Designation;

        anim.SetBool("Cover", currentFormationName == EnumArmyFormations.Cover);
        anim.SetBool("Moving", currentFormationName == EnumArmyFormations.March);
        anim.SetBool("Charging", currentFormationName == EnumArmyFormations.Charge);
        anim.SetBool("Bracing", currentFormationName == EnumArmyFormations.Brace);
        anim.SetBool("Attack", armyScript.isAttacking || currentFormationName == EnumArmyFormations.Attack);
        if (currentFormationName == EnumArmyFormations.Attack)
        {
            armyScript.activeFormation = controller.idle;
        }
        armyScript.isAttacking = false;
    }
    void Update()
    {
        if (armyScript == null || armyScript.activeFormation == null)
        {
            return;
        }

        currentFormationName = armyScript.activeFormation.Designation;

        anim.SetBool("Cover", currentFormationName == EnumArmyFormations.Cover);
        anim.SetBool("Moving", currentFormationName == EnumArmyFormations.March);
        anim.SetBool("Charging", currentFormationName == EnumArmyFormations.Charge);
        anim.SetBool("Bracing", currentFormationName == EnumArmyFormations.Brace);

        //anim.SetBool("Attack", armyScript.isAttacking);
    }