Exemplo n.º 1
0
    public void Destroy()
    {
        if (_SDK == null)
        {
            return;
        }

        _SDK.Destroy();
        _SDK = null;
    }
Exemplo n.º 2
0
    public void GlobalInit()
    {
        if (IS_DISABLED_SDK)
        {
            IS_SDK_CHANNEL = false;
            SDK_TYPE       = SdkType.SDK_SELF;
            PACKAGE_NAME   = "com.leduo.buyu.self";
            byte[] data2 = System.Text.Encoding.ASCII.GetBytes(PACKAGE_NAME);
            PACKAGE_NAME_CRC = Crc.Crc32(data2, 0, data2.Length);
            m_Interface      = null;
            m_Interface      = new SDKBaseNoSDK();
            return;
        }
        IS_SDK_CHANNEL = SDK_TYPE == SdkType.SDK_CHANNEL;
        if (IS_SDK_CHANNEL)
        {
#if DOME
            m_Interface  = new SDKChannelDome();
            CHANNEL_TYPE = ChannelType.Dome_ChannelType;
#elif TW
            m_Interface  = new SDKChannelTW();
            CHANNEL_TYPE = ChannelType.TW_ChannelType;
#else
            m_Interface = new SDKChannel();
#endif
            m_SceneCallbackObj      = new GameObject();
            m_SceneCallbackObj.name = "SDKCallbackObj";
            m_SceneCallback         = m_SceneCallbackObj.AddComponent <SDKSceneCallback>();
        }
        else
        {
            if (SDK_TYPE == SdkType.SDK_DERIVED)
            {
                m_Interface = new SDKDerived();
            }
            else
            {
                m_Interface = new SDKBase();
            }
        }
        PACKAGE_NAME = NativeInterface.GetPackageName();
        byte[] data = System.Text.Encoding.ASCII.GetBytes(PACKAGE_NAME);
        PACKAGE_NAME_CRC = Crc.Crc32(data, 0, data.Length);

        //SDK初始化
#if UNITY_IOS
        IS_APP_STORE_VER = NativeInterface.IsAppStoreVer();
#endif
        LogMgr.Log("包名:" + PACKAGE_NAME + "|类型:" + SDK_TYPE + "|官网:" + IsOfficialVersion);
        m_LoginData.Result = LoginState.LOGIN_NONE;
        m_Interface.GlobalInit();
    }
Exemplo n.º 3
0
    public void Initialize(string gameId, Action <int, string, NameValueCollection> callback)
    {
        if (_SDK != null)
        {
            return;
        }

        CreateObj();


#if UNITY_IPHONE
        _SDK = new IOSBridge(Constants.MESSAGE_RECEIVER_NAME);
#endif

#if UNITY_ANDROID
        _SDK = new AndroidBridge(Constants.MESSAGE_RECEIVER_NAME);
#endif

        _GHCallback.InitializeCallback = callback;
        _SDK.Initialize(gameId);
    }