示例#1
0
    public override void ButtonEvent(int bID)
    {
        switch (bID)
        {
        case    0:
            if (battleManager.playerList[0].nowHp > 0)
            {
                pauseMenuObject.gameObject.SetActive(false);
                GUITexture   mask  = CreateLayerMask("ItemMenu");
                BattleUIItem uitem = mask.gameObject.AddComponent <BattleUIItem> ();
                uitem.Prepare(battleManager.status, inputManager, this);
            }
            break;

        case    1:
            if (!battleManager.eventBattleflag)
            {
                this.enabled = false;
                battleManager.RestartAnimation();
                inputManager.ClearInput();
                Destroy(pauseMenuObject.gameObject);
                escapeGauge = CreateLimitGauge();
                escapeGauge.ChangeTexture(escapeGaugeImage);
                escapeGauge.Prepare(300.0f);
                battleManager.StartEscape();
            }
            break;
        }
    }
示例#2
0
    public void Prepare(StatusData sd, BattleUIItem mo, bool flag)
    {
        float ww = Screen.width / 1280.0f;
        float hw = Screen.height / 720.0f;

        targetLight            = GetComponent <GUITexture> ();
        targetLight.pixelInset = new Rect(targetLight.pixelInset.x, targetLight.pixelInset.y,
                                          targetLight.pixelInset.width * ww, targetLight.pixelInset.height * hw);
        itemMenu           = mo;
        inputManager       = sd.GetComponent <InputManager> ();
        inputManager.speed = 20;
        battleManager      = sd.GetComponent <BattleManager> ();
        deadTarget         = flag;

        target = battleManager.GetNextTarget(-1, deadTarget);
        targetLight.transform.position = new Vector3(0.15f + target * 0.24f, targetLight.transform.position.y + 0.01f, 2.5f);
        if (target == -1)
        {
            targetLight.texture = null;
        }
    }