Beispiel #1
0
        // Called on button down press on move from Delt's moveset
        public void MoveClick(int index)
        {
            Transform MoveOverview;
            MoveClass move = GameManager.Inst.deltPosse[overviewDeltIndex].moveset[index];

            // If move is already displayed, remove it
            if (firstMoveLoaded == index)
            {
                MoveOneOverview.gameObject.SetActiveIfChanged(false);
                firstMoveLoaded = -1;
                return;
            }
            else if (secondMoveLoaded == index)
            {
                MoveTwoOverview.gameObject.SetActiveIfChanged(false);
                secondMoveLoaded = -1;
                return;
            }

            // If first move overview already loaded, load into 2nd move overview
            if (firstMoveLoaded != -1)
            {
                MoveOverview     = MoveTwoOverview;
                secondMoveLoaded = index;
            }
            else
            {
                MoveOverview    = MoveOneOverview;
                firstMoveLoaded = index;
            }

            MoveOverview.GetComponent <Image>().color = move.majorType.background;
            MoveOverview.GetChild(0).GetComponent <Image>().sprite = move.majorType.majorImage;

            if (move.statusType != statusType.None)
            {
                MoveOverview.GetChild(1).gameObject.SetActiveIfChanged(true);
                MoveOverview.GetChild(1).GetComponent <Image>().sprite = move.status;
            }
            else
            {
                MoveOverview.GetChild(1).gameObject.SetActiveIfChanged(false);
            }

            MoveOverview.GetChild(2).GetComponent <Text>().text = move.moveName;
            MoveOverview.GetChild(3).GetComponent <Text>().text = "" + move.movType;
            MoveOverview.GetChild(4).GetComponent <Text>().text = move.moveDescription;

            MoveOverview.GetChild(5).GetComponent <Text>().text = move.PP + System.Environment.NewLine + move.damage + System.Environment.NewLine +
                                                                  move.hitChance + System.Environment.NewLine + move.statusType + System.Environment.NewLine + move.statusChance;

            MoveOverview.gameObject.SetActiveIfChanged(true);
        }
Beispiel #2
0
        // Called on button down press on move from Delt's moveset
        public void MoveClick(BaseEventData evdata)
        {
            Transform MoveOverview;
            MoveClass move;
            string    objName = evdata.selectedObject.name;
            int       moveIndex;

            // Clicked a house move
            if (objName[0] == 'H')
            {
                MoveOverview = HouseMoveOverview;
                moveIndex    = int.Parse(objName.Substring(1));

                // If move is already up, remove it
                if (moveIndex == houseMove)
                {
                    HouseMoveOverview.gameObject.SetActive(false);
                    houseMove = -1;
                    return;
                }
                else
                {
                    move      = HouseSwitchIn.moveset[moveIndex];
                    houseMove = moveIndex;
                }
            }
            // Clicked a posse move
            else
            {
                MoveOverview = PosseMoveOverview;
                moveIndex    = int.Parse(objName.Substring(1));

                // If move is already up, remove it
                if (moveIndex == posseMove)
                {
                    PosseMoveOverview.gameObject.SetActive(false);
                    posseMove = -1;
                    return;
                }
                else
                {
                    move      = GameMan.deltPosse[PosseDeltIndex].moveset[moveIndex];
                    posseMove = moveIndex;
                }
            }

            MoveOverview.GetComponent <Image>().color = move.majorType.background;
            MoveOverview.GetChild(0).GetComponent <Image>().sprite = move.majorType.majorImage;

            if (move.statusType != statusType.None)
            {
                MoveOverview.GetChild(1).gameObject.SetActive(true);
                MoveOverview.GetChild(1).GetComponent <Image>().sprite = move.status;
            }
            else
            {
                MoveOverview.GetChild(1).gameObject.SetActive(false);
            }

            MoveOverview.GetChild(2).GetComponent <Text>().text = move.moveName;
            MoveOverview.GetChild(3).GetComponent <Text>().text = move.moveDescription;

            MoveOverview.GetChild(4).GetComponent <Text>().text = move.movType + System.Environment.NewLine + move.PP + System.Environment.NewLine +
                                                                  move.damage + System.Environment.NewLine + move.hitChance + System.Environment.NewLine + move.statusType;

            MoveOverview.gameObject.SetActive(true);
        }