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
    static bool onMsgBoxSystemMenuEvent(OVMsgBox hmb, string sEvent, GameObject go)
    {
        if (sEvent == "click")
        {
            if (go.name == "Yes")
            {
                ExitGame(true);
                if (!DllIsDevMode())
                {
                    MsgBox("", "", GetString("Wait"));
                }
            }
            else if (go.name == "No")
            {
                ExitGame(false);
                if (!DllIsDevMode())
                {
                    MsgBox("", "", GetString("Wait"));
                }
            }

            hmb.Close();
            return(true);
        }

        return(false);
    }
Example #3
0
    private static void onEventResumeGame(string sJson)
    {
        if (_MsgboxResumeGame)
        {
            _MsgboxResumeGame.Close();
            _MsgboxResumeGame = null;
        }

        if (!_DisableResumeGame)
        {
            _ResumeGameInfo = JsonUtility.FromJson <ResumeGameInfo>(sJson);
            string tx = string.Format(GetString("ResumeConfirm"), _ResumeGameInfo.reAmt.ToString("F2"), _ResumeGameInfo.reTicket.ToString());
            _MsgboxResumeGame          = MsgBox("ResumeGame", GetString("Resume"), tx, GetString("ResumeYes"), GetString("ResumeNo"), 15, OVMsgBoxTimeoutAct.Close);
            _MsgboxResumeGame._onEvent = onMsgBoxResumeGame;
        }
    }
Example #4
0
 bool OnClickSampleMsgBoxOK(OVMsgBox hmb, string sEvent, GameObject sender)
 {
     if (sEvent == "click")
     {
         Debug.Log("sample msgbox ok clicked.");
         hmb.Close();
         return(true);
     }
     return(false);
 }
Example #5
0
    void OnLoadGameDone(int nRetCode, string sRetMsg, IntPtr data, int len)
    {
        _MsgboxLoadingGame.Close();

        if (data != IntPtr.Zero && len == Marshal.SizeOf(typeof(GameData)))
        {
            GameData gd = (GameData)Marshal.PtrToStructure(data, typeof(GameData));

            _goRed.transform.localPosition   = gd.red.GetPosition();
            _goRed.transform.localRotation   = gd.red.GetRotation();
            _goGreen.transform.localPosition = gd.green.GetPosition();
            _goGreen.transform.localRotation = gd.green.GetRotation();
        }
    }