示例#1
0
文件: OVSDK.cs 项目: HeroVR/Omniverse
    private static bool onMsgBoxResumeGame(OVMsgBox hmb, string sEvent, GameObject sender)
    {
        if (sEvent == "click")
        {
            if (sender.name == "Yes")
            {
                if (hmb == _MsgboxResumeGame)
                {
                    if (_ResumeGameInfo.isAgain != 0)
                    {
                        DllSendCommand(3, "", 0);
                        hmb.Reset(null, "", GetString("Wait"));
                        return(true);
                    }
                    else
                    {
                        hmb.Reset(null, "", GetString("ResumeError"), "", "", 5, OVMsgBoxTimeoutAct.QuitGame);
                        return(true);
                    }
                }
            }
            else if (sender.name == "No")
            {
                if (hmb == _MsgboxResumeGame)
                {
                    hmb.Reset(null, "", GetString("Bye"), "", "", 3, OVMsgBoxTimeoutAct.QuitGame);
                    return(true);
                }
            }
        }
        else if (sEvent == "destroy")
        {
            if (hmb == _MsgboxResumeGame)
            {
                _MsgboxResumeGame = null;
            }
        }

        return(false);
    }
示例#2
0
文件: Main.cs 项目: HeroVR/Omniverse
    bool OnPrepareMsgBoxEvent(OVMsgBox hmb, string sEvent, GameObject sender)
    {
        if (sEvent == "timeout")
        {
            hmb.Reset("prepare_game_done", null, OVSDK.GetString("PrepareEnd"), OVSDK.GetString("OK"));
            return(true);
        }

        if (sEvent == "click" && sender.name == "OK" && hmb.usage == "prepare_game")
        {
            OVSDK.ConfirmPlayGame();
        }
        return(false);
    }
示例#3
0
文件: OVSDK.cs 项目: HeroVR/Omniverse
    public static OVMsgBox MsgBox(string sUsage = "", string sTitle = "", string sContent = "", string sYes = "", string sNo = "", int nTimeout = 0, OVMsgBoxTimeoutAct nTimeoutAct = OVMsgBoxTimeoutAct.Close)
    {
        OVMsgBox   hmb = null;
        GameObject mb  = GameObject.Instantiate(Resources.Load("OVSDK_MsgBox"), Vector3.zero, Quaternion.identity) as GameObject;

        if (mb)
        {
            hmb = mb.GetComponentInChildren <OVMsgBox>();
            if (hmb)
            {
                hmb.Reset(sUsage, sTitle, sContent, sYes, sNo, nTimeout, nTimeoutAct);
            }
        }
        return(hmb);
    }
示例#4
0
文件: OVSDK.cs 项目: HeroVR/Omniverse
    static bool onMsgBoxBuy(OVMsgBox hmb, string sEvent, GameObject go)
    {
        if (hmb.usage == "buy.confirm" && sEvent == "click" && go.name == "Yes")
        {
            DllBuy(_BuyParam.sItem, _BuyParam.nPrice, _BuyParam.sOutTradeNo);
            hmb.Reset("buy.request", "", GetString("Wait"));
            return(true);
        }

        if (sEvent == "destroy")
        {
            if (hmb == _MsgboxBuy)
            {
                _MsgboxBuy = null;
            }
        }

        return(false);
    }
示例#5
0
文件: OVSDK.cs 项目: HeroVR/Omniverse
    private static void onEventBuy(string sRet)
    {
        BuyResult res = new BuyResult();

        res.intradeno = "";
        res.retCode   = -1;
        res.retMsg    = GetString("PurchaseConnectFailed");
        try {
            res = JsonUtility.FromJson <BuyResult>(sRet);
        }
        catch (Exception)
        {
            Debug.Log("onEventBuy " + sRet);
        }

        string txt;

        if (res.retCode != 0)
        {
            txt = String.Format(GetString("PurchaseFailed"), res.retMsg);
        }
        else
        {
            txt = String.Format(GetString("PurchaseSuccess"), res.intradeno);
        }

        if (_MsgboxBuy)
        {
            _MsgboxBuy.Reset("buy.done", GetString("Purchase"), txt, GetString("Close"), "");
        }
        else
        {
            MsgBox("buy.done", GetString("Purchase"), txt, GetString("Close"));
        }

        if (_BuyParam.cb != null)
        {
            _BuyParam.cb(_BuyParam.sItem, _BuyParam.sOutTradeNo, res.intradeno, res.retMsg);
        }
    }