예제 #1
0
    void PokedexWindow()
    {
        float mx       = Input.mousePosition.x;
        float my       = Screen.height - Input.mousePosition.y;
        int   displayN = Screen.height / 64;
        float ypos     = 0;

        for (int i = pokedexEntery - displayN / 2; i <= pokedexEntery + displayN / 2; i++)
        {
            int entry = i;
            if (entry < 1)
            {
                entry += Pokedex.states.Length - 1;
            }
            if (entry > Pokedex.states.Length - 1)
            {
                entry -= Pokedex.states.Length - 1;
            }

            if (entry == pokedexEntery)
            {
                GUI.DrawTexture(new Rect(0, ypos + 16, 100, 32), GUImgr.gradRight);
            }
            if (mx < 100 && my > ypos && my < ypos + 64)
            {
                GUI.DrawTexture(new Rect(0, ypos + 16, 100, 32), GUImgr.gradRight);
                if (!Player.click && Input.GetMouseButton(0))
                {
                    Player.click  = true;
                    pokedexEntery = entry;
                }
            }
            string numberText = entry.ToString();
            if (entry < 100)
            {
                numberText = "0" + numberText;
            }
            if (entry < 10)
            {
                numberText = "0" + numberText;
            }

            if (Pokedex.states[entry] == Pokedex.State.Unknown)
            {
                GUI.Label(new Rect(64, ypos, 200, 25), "#" + numberText + " ? ? ? ? ? ? ? ? ?");
            }
            else
            {
                GUI.Label(new Rect(64, ypos, 200, 25), "#" + numberText + " " + Pokemon.GetName(entry));
            }
            ypos += 64;
        }

        if (Pokedex.states[pokedexEntery] == Pokedex.State.Captured)
        {
            GUI.Label(new Rect(250, 0, Screen.width - 400, Screen.height), Pokedex.PokeDexText(pokedexEntery));
        }
    }