Example #1
0
    private void InitBattleUnitAttributes()
    {
        battleUnit = new BaseCharacter();

        int attributesCount = Enum.GetValues(typeof(AttributeName)).Length;
        int[] attributes = new int[attributesCount];

        //Randomly Generate Attributes
        for (int i = 0; i < TOTAL_ATTRIBUTES; i++)
        {
            attributes[UnityEngine.Random.Range(0, attributesCount)]++;
        }

        //Set Attributes to Character
        for (int i = 0; i < attributesCount; i++)
        {
            battleUnit.GetAttribute(i).Add(attributes[i]);
        }
    }