Beispiel #1
0
    // Use this for initialization
    protected override void OnStart()
    {
        //need to pull Entity from GameMaster
        gm     = GameObject.Find("GameMaster").GetComponent <GameMaster>();
        entity = gm.GetPartyMemberByID(playerCombatID);

        anim = GetComponent <Animator>();
        playerBattleUIController = GameObject.FindGameObjectWithTag("PlayerBattleUIController").GetComponent <PlayerBattleUIController>();
        playerSkills             = GetComponent <PlayerSkills>();
        //playerSkills = entity.playerSkills;
    }
    public void SetupPlayerCommands(Dictionary <string, SkillDescriptor> availableCommands, PlayerBattleUIController currentPlayer)
    {
        int commandIndex = 0;
        int commandCount = availableCommands.Count;

        activePlayer = currentPlayer;

        foreach (string commandName in availableCommands.Keys)
        {
            playerCommandButtons[commandIndex].SetActive(true);
            playerCommandButtons[commandIndex].GetComponentInChildren <Text>().text = commandName;
            currentSkills[commandIndex] = availableCommands[commandName];
            if (commandIndex == 0)
            {
                playerCommandButtons[commandCount].GetComponent <Button>().Select();
            }
            commandIndex += 1;
        }
    }