Example #1
0
    public void Battle(GameObject unit1, GameObject unit2) // Take two units as input, unit1 aggressor, unit2 defender. Damage unit2 by the attack stat of unit1, more detailed mechanics to be implemented later.
    {
        UnitScript unit1Script = unit1.GetComponent <UnitScript>();
        UnitScript unit2Script = unit2.GetComponent <UnitScript>();

        unit2Script.ReduceHealth(unit1Script.getAttack());
    }