Пример #1
0
    void CallPauseMenu(bool inputFlag)
    {
        if (inputFlag)
        {
            if (pauseMenuObject == null)
            {
                int w = Screen.width / 2 * -1;
                int h = Screen.height / 2 * -1;

                float ww = Screen.width / 1280.0f;
                float hw = Screen.height / 720.0f;

                pauseMenuObject = CreateGUITexture("PauseMenu");
                pauseMenuObject.transform.position = new Vector3(0.5f, 0.5f, 2.0f);

                GUITexture menuFrame = CreateGUITexture("Menu_Frame", "UI/battle/battle_menu_frame",
                                                        new Rect(w + 427 * ww, h + 240 * hw, 424 * ww, 160 * hw));
                menuFrame.transform.parent        = pauseMenuObject.transform;
                menuFrame.transform.localPosition = new Vector3(0.0f, 0.0f, 2.1f);

                CursorObject co = CreateCursor(pauseMenuObject.transform);
                co.Prepare(inputManager, this, new int[2][] { new int[3] {
                                                                  2, (int)(192 * ww), (int)(w + 434 * ww)
                                                              }, new int[3] {
                                                                  1, 0, (int)(h + 273 * hw)
                                                              } }, 2);

                string[][] iPath = new string[2][] {
                    new string[2] {
                        "UI/battle/bmenu_button_item_normal", "UI/battle/bmenu_button_item_select"
                    },
                    new string[2] {
                        "UI/battle/bmenu_button_escape_normal", "UI/battle/bmenu_button_escape_select"
                    },
                };

                bool[] enableFlag = new bool[2] {
                    battleManager.playerList[0].nowHp > 0,
                    !battleManager.eventBattleflag,
                };
                for (int i = 0; i < 2; i++)
                {
                    GUITexture b = CreateGUITexture("button00" + i, iPath[i][0],
                                                    new Rect(w + 452 * ww + 192 * ww * i, h + 291 * hw, 182 * ww, 86 * hw));
                    b.transform.parent        = pauseMenuObject.transform;
                    b.transform.localPosition = new Vector3(0.0f, 0.0f, 2.2f);

                    ButtonObject mo = b.gameObject.AddComponent <ButtonObject> ();
                    mo.PrepareButton(co, i, iPath[i], b);
                    if (!enableFlag[i])
                    {
                        b.color = new Color(0.5f, 0.5f, 0.5f, 0.2f);
                    }
                }

                battleManager.StopAnimation();
            }
        }
    }
Пример #2
0
    public void Prepare(StatusData s, InputManager im, BattleGUIManager ho)
    {
        home = ho;

        float w = GetComponent <GUITexture> ().pixelInset.x;
        float h = GetComponent <GUITexture> ().pixelInset.y;

        float ww = Screen.width / 1280.0f;
        float hw = Screen.height / 720.0f;

        GUITexture itemFrame = CreateGUITexture("Item_Frame", "UI/battle/bmenu_item_frame", new Rect(w + 84 * ww, h + 15 * hw, 1072 * ww, 536 * hw));

        itemFrame.transform.parent        = transform;
        itemFrame.transform.localPosition = new Vector3(0.0f, 0.0f, 2.1f);
        status = s;

        int[][] lp = new int[2][] {
            new int[3] {
                2, (int)(505 * ww), (int)(w + 134 * ww)
            },
            new int[3] {
                status.itemList.Count / 2 + 1, (int)(-37 * hw), (int)(h + 450 * hw)
            }
        };
        CreateItemList(status.itemList, transform, lp, home.KozMinPro_Bold);

        int[][] sp = new int[2][] {
            new int[3] {
                2, (int)(505 * ww), (int)(w + 89 * ww)
            },
            new int[3] {
                status.itemList.Count / 2 + 1, (int)(-37 * hw), (int)(h + 397 * hw)
            }
        };

        cursor = CreateCursor(transform);
        cursor.Prepare(im, this, sp, status.itemList.Count);

        highLight = CreateHighLight(transform, new Vector2(cursor.cursorTexture.pixelInset.x + 45, cursor.cursorTexture.pixelInset.y + 26));

        CreateItemPreview(w + 119 * ww, h + 63 * hw);
    }
Пример #3
0
    void CreateMainMenu(Transform t)
    {
        float wm = Screen.width / 1280.0f;
        float wh = Screen.height / 720.0f;

        GUITexture gt = CreateGUITexture("frame_under", fieldPath + "main_menu", new Rect(102 * wm, 68 * wh, 1078.0f * wm, 580.0f * wh));

        gt.transform.parent        = t;
        gt.transform.localPosition = new Vector3(0.0f, 0.0f, 2.1f);

        for (int i = 0; i < 4; i++)
        {
            int mem = status.partyMember[i];
            if (mem > -1)
            {
                gt = CreateGUITexture("chara_img", status.playersData[mem].charaImage[0], new Rect(385 * wm + 200 * wm * i, 75 * wh, 188.0f * wm, 572.0f * wh));
                gt.transform.parent        = t;
                gt.transform.localPosition = new Vector3(0.0f, 0.0f, 2.2f);
            }
        }

        highLight = CreateGUITexture("high_light", fieldPath + "main_button_select", new Rect(105 * wm, 567 * wh, 266.0f * wm, 80.0f * wh));
        highLight.transform.parent        = t;
        highLight.transform.localPosition = new Vector3(0.0f, 0.0f, 2.2f);

        gt = CreateGUITexture("frame_front", fieldPath + "main_menu_front", new Rect(102 * wm, 68 * wh, 1078.0f * wm, 580.0f * wh));
        gt.transform.parent        = t;
        gt.transform.localPosition = new Vector3(0.0f, 0.0f, 2.3f);

        for (int i = 0; i < 4; i++)
        {
            int mem = status.partyMember[i];
            if (mem > -1)
            {
                gt = CreateGUITexture("chara_name", status.playersData[mem].nameFolder, new Rect(400 * wm + 200.0f * wm * i, 620 * wh, 420.0f * wm * 0.36f, 64.0f * wh * 0.36f));
                gt.transform.parent        = t;
                gt.transform.localPosition = new Vector3(0.0f, 0.0f, 2.4f);

                GUIText text = CreateGUIText("level", status.playersData[mem].status.level.ToString(), (int)(64.0f * wm),
                                             new Vector2(550 * wm + 200.0f * wm * i, 236 * wh), KozMinPro_Bold);
                text.transform.parent        = t;
                text.transform.localPosition = new Vector3(0.0f, 0.0f, 2.4f);
                text.anchor    = TextAnchor.UpperRight;
                text.fontStyle = FontStyle.Italic;
                text.color     = new Color(1.0f, 0.98f, 0.8f);

                CreateStatusGauge(t, new Vector2(565 * wm + 200 * wm * i, 155 * wh), KozMinPro_Medium,
                                  new Rect(567 * wm + 200.0f * wm * i, 134 * wh, -176.0f * wm, 5.0f * wh), -27 * wh, status.playersData[mem].status,
                                  (int)(14.0f * wm), 2.4f, -176.0f * wm);
            }
        }

        CreateGUIText("money", status.Money.ToString(), (int)(17.0f * wm), new Vector2(346 * wm, 172 * wh),
                      KozMinPro_Heavy, t, 2.4f, TextAnchor.UpperRight);

        CreateGUIText("time", Time.realtimeSinceStartup.ToString(), (int)(17.0f * wm), new Vector2(346 * wm, 140 * wh),
                      KozMinPro_Heavy, t, 2.4f, TextAnchor.UpperRight);

        CreateGUIText("stage", status.stageData[sceneManager.nowStage].name, (int)(17.0f * wm), new Vector2(346 * wm, 108 * wh),
                      KozMinPro_Heavy, t, 2.4f, TextAnchor.UpperRight);

        int[][] st = new int[2][] {
            new int[3] {
                1, 0, (int)(105 * wm)
            },
            new int[3] {
                5, (int)(-92 * wh), (int)(567 * wh)
            },
        };
        cursor = CreateCursor(t);
        cursor.Prepare(inputManager, this, st, 5);

        nowSelect = CreateGUITexture("nowSelect", nowSelectImage[0], new Rect(200 * wm, 672 * wh, 546 * wm, 42 * wh));
        nowSelect.transform.parent        = t;
        nowSelect.transform.localPosition = new Vector3(0.0f, 0.0f, 2.2f);

        CreateGUITexture("Indication", fieldPath + "ui_Indication_1", new Rect(415 * wm, 3 * wh, 450 * wm, 52 * wh), t, 2.2f);
    }