public void EnableEngageAttackSkill(bool isEnabled)
    {
        Command startBattleCommand = leaderActor.GetCommandAtSlotIndex(2);

        startBattleCommand.IsEnabled    = isEnabled;
        startBattleCommand.IsCooledDown = isEnabled;
    }
    public void InitializeSkills()
    {
        //At the beginning of a battle, starting all cooldowns
        leaderActor = GameManager.Instance.CurrentPartyMembers[0].GetComponent <RPGActor>();

        foreach (var displaySkill in ActiveSkillsUIObjects)
        {
            displaySkill.SetActive(false);
        }

        foreach (Command cmd in leaderActor.PartyMemberCommands)
        {
            ActiveSkillsUIObjects[cmd.Slot].SetActive(true);
            //cmd.ResetCommand(); //Done manually for each command in case some skills have to be active from the start etc.

            //icon
            Transform iconTransform = ActiveSkillsUIObjects[cmd.Slot].gameObject.transform.FindDeepChild("SkillIcon");

            if (iconTransform != null)
            {
                iconTransform.gameObject.GetComponent <Image>().sprite = Resources.Load <Sprite>(cmd.Illustration);
            }
        }

        SelectedIndex = 2;

        Command startBattleCommand = leaderActor.GetCommandAtSlotIndex(SelectedIndex);

        startBattleCommand.IsEnabled    = true; //enable second skill
        startBattleCommand.IsCooledDown = true;
    }
예제 #3
0
    void SetTextControl()
    {
        GetComponent <Text>().text = data.Properties.GetPropertyString(PropertyToDisplay);

        if (PropertyToDisplay == RPGPropertyType.CurrentGold)
        {
            GetComponent <Text>().text = GameManager.Instance.Gold.ToString();
        }

        if (PropertyToDisplay == RPGPropertyType.CurrentSkillName)
        {
            GameObject gO = SkillbarController.Instance.ActiveSkillsUIObjects[SkillbarController.Instance.SelectedIndex];
            if (gO != null)
            {
                RPGActor leaderActor = GameManager.Instance.GetPartyLeader().GetComponent <RPGActor>();
                Command  c           = leaderActor.GetCommandAtSlotIndex(SkillbarController.Instance.SelectedIndex);
                if (c != null)
                {
                    GetComponent <Text>().text = c.GetName();
                }
            }
        }

        if (PropertyToDisplay == RPGPropertyType.CurrentSkillDescription)
        {
            GameObject gO = SkillbarController.Instance.ActiveSkillsUIObjects[SkillbarController.Instance.SelectedIndex];

            if (gO != null)
            {
                RPGActor leaderActor = GameManager.Instance.GetPartyLeader().GetComponent <RPGActor>();
                Command  c           = leaderActor.GetCommandAtSlotIndex(SkillbarController.Instance.SelectedIndex);
                if (c != null)
                {
                    GetComponent <Text>().text = c.GetDescription();
                }
            }
        }
    }