Ejemplo n.º 1
0
        //---- Override basic action, to be able to use Merge actions are regular ones

        //Do the action using the nearest selectable
        public override void DoAction(PlayerCharacter character, ItemSlot slot)
        {
            Selectable select = Selectable.GetNearestGroup(merge_target, character.transform.position);

            if (select != null)
            {
                DoAction(character, slot, select);
            }
        }
Ejemplo n.º 2
0
        public override bool CanDoAction(PlayerCharacter character, ItemSlot slot)
        {
            Selectable select = Selectable.GetNearestGroup(merge_target, character.transform.position);

            if (select != null && select.IsInUseRange(character.transform.position))
            {
                return(CanDoAction(character, slot, select));
            }
            return(false);
        }
        //---- Getters ----

        //Check if character is near an object of that group
        public bool IsNearGroup(GroupData group)
        {
            Selectable group_select = Selectable.GetNearestGroup(group, transform.position);

            return(group_select != null && group_select.IsInUseRange(transform.position));
        }