예제 #1
0
        public void HighlightFieldTargets(BattlePosition userPos, List <BattlePosition> targetPositions)
        {
            backBtn.UnselectSelf();
            promptText.text = "Choose a target by scrolling left or right.";
            List <Panels.FieldTargetButton> fieldTargetBtns = activeTargetBtns;

            for (int i = 0; i < fieldTargetBtns.Count; i++)
            {
                bool posWasTargeted             = false;
                Panels.FieldTargetButton curBtn = fieldTargetBtns[i];
                BattlePosition           curPos = fieldTargetBtns[i].position;

                for (int k = 0; k < targetPositions.Count; k++)
                {
                    if (targetPositions[k].IsTheSameAs(curPos))
                    {
                        posWasTargeted = true;
                        break;
                    }
                }

                if (posWasTargeted)
                {
                    curBtn.SelectSelf();
                }
                else
                {
                    curBtn.UnselectSelf();
                    if (userPos.IsTheSameAs(curPos))
                    {
                        curBtn.image.color = curBtn.colorUser;
                    }
                }
            }
        }
예제 #2
0
        public void HideAllButtons()
        {
            List <Panels.FieldTargetButton> allBtns = GetAllFieldTargetButtons();

            for (int i = 0; i < allBtns.Count; i++)
            {
                Panels.FieldTargetButton curBtn = allBtns[i];
                curBtn.UnselectSelf();
                curBtn.gameObject.SetActive(false);
            }
        }