Example #1
0
    void OnOVSDKInit()
    {
        Debug.Log("OnOVSDKInit: " + OVSDK.GetInitResult());

        OVSDK.DeviceInfo dev = OVSDK.GetDeviceInfo();
        Debug.Log("shop=" + dev.sShopName + ";shopid=" + dev.nShop + ";shop_category=" + dev.sCategory + ";device_sn=" + dev.sNo);

        OVSDK.UserInfo user = OVSDK.GetUserInfo();
        Debug.Log(string.Format("{0}name={1};id={2};phone={3};qrcode={4};balance={5}", OVSDK.IsGuest() ? "[GUEST]" : "", user.sUserName, user.nUserId, user.sUserPhone, user.sQrcode, user.nUserBalance));

        OnClickLoadGame();

//#if UNITY_EDITOR
        OVSDK.CheckOmniViveAvailable();
//#endif

        // buttons in sample-scene
        OVSDK._ControllerRay.RayVisibility = OVControllerRay.RayVisibility_AlwaysShow;

        if (_MsgboxIniting != null)
        {
            _MsgboxIniting.Close();
            _MsgboxIniting = null;
        }

        if (OVSDK.GetUserInfo().nGamePrepareLeft > 0)
        {
            //OVMsgBox hmb = OVSDK.MsgBox("prepare_game", OVSDK.GetString("PrepareStage"), OVSDK.GetString("PrepareConfirm"), OVSDK.GetString("Close"), "", OVSDK.GetUserInfo().nGamePrepareLeft);
            //hmb._onEvent = OnPrepareMsgBoxEvent;
        }
        else
        {
            //OVSDK.MsgBox("", OVSDK.GetString("InitResult"), OVSDK._sInitResult, OVSDK.GetString("Close"));
        }
    }
Example #2
0
    bool UpdateText(Text compo, string cmd)
    {
        bool need_update = false;

        char[]   sep  = { '|' };
        string[] cmds = cmd.Split(sep);
        if (cmds.Length > 1)
        {
            string           content = "";
            OVSDK.UserInfo   ui      = OVSDK.GetUserInfo();
            OVSDK.DeviceInfo di      = OVSDK.GetDeviceInfo();
            int type = cmds[0].Length == 0 ? 0 : int.Parse(cmds[0]);
            if (type == 0)
            {
                compo.text = cmds[1];
            }
            else
            {
                switch (type)
                {
                case 1:
                    content     = string.Format("{0}", ui.nGameDurationLeft);
                    need_update = true;
                    break;

                case 2:
                    content     = string.Format("{0}", ui.nGamePrepareLeft);
                    need_update = true;
                    break;

                case 3:
                    content = string.Format("{0}", ui.nUserId);
                    break;

                case 4:
                    content = ui.sUserName;
                    break;

                case 5:
                    content = string.Format("{0}", di.nShop);
                    break;

                case 6:
                    content = di.sShopName;
                    break;

                case 7:
                    content     = string.Format("{0}", ui.nGameDuration / 60);
                    need_update = true;
                    break;
                }

                compo.text = string.Format(cmds[1], content);
            }
        }
        return(need_update);
    }