Пример #1
0
    //-------------------------------------------------------------------------
    void _initNativeMsgReceiverListener()
    {
        var native_receiver = NativeReceiver.instance();

        native_receiver.TakePhotoReceiverListener = this;
        native_receiver.AudioControlListener      = this;
        var speech_receiver = SpeechReceiver.instance();

        speech_receiver.SpeechListener = this;
        var pay_receiver = PayReceiver.instance();

        pay_receiver.PayReceiverListener = this;
    }
Пример #2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(this);
         _delegates = new Dictionary <int, Action <bool> >();
     }
     else
     {
         if (this != _instance)
         {
             Destroy(this.gameObject);
         }
     }
 }
    //-------------------------------------------------------------------------
    public static NativeReceiver instance()
    {
        mNativeReceiverName = (typeof(NativeReceiver)).Name;
        GameObject msg_receiver = GameObject.Find(mNativeReceiverName);
        if (msg_receiver == null)
        {
            msg_receiver = new GameObject(mNativeReceiverName);
            mNativeAPIMsgReceiver = msg_receiver.AddComponent<NativeReceiver>();
            GameObject.DontDestroyOnLoad(msg_receiver);
        }
        else
        {
            mNativeAPIMsgReceiver = msg_receiver.GetComponent<NativeReceiver>();
        }

        return mNativeAPIMsgReceiver;
    }
Пример #4
0
    //-------------------------------------------------------------------------
    public static NativeReceiver Instance()
    {
        mNativeReceiverName = (typeof(NativeReceiver)).Name;
        GameObject msg_receiver = GameObject.Find(mNativeReceiverName);

        if (msg_receiver == null)
        {
            msg_receiver          = new GameObject(mNativeReceiverName);
            mNativeAPIMsgReceiver = msg_receiver.AddComponent <NativeReceiver>();
            DontDestroyOnLoad(msg_receiver);
        }
        else
        {
            mNativeAPIMsgReceiver = msg_receiver.GetComponent <NativeReceiver>();
        }

        return(mNativeAPIMsgReceiver);
    }
Пример #5
0
        //---------------------------------------------------------------------
        void _initNativeMsgReceiverListener()
        {
            var native_receiver = NativeReceiver.Instance();

            native_receiver.TakePhotoReceiverListener = this;
            native_receiver.AudioControlListener      = this;
            var pay_receiver = PayReceiver.instance();

            pay_receiver.PayReceiverListener = this;
            var thirdparty_login_receiver = ThirdPartyLoginReceiver.instance();

            thirdparty_login_receiver.ThirdPartyLoginReceiverListener = this;

//#if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
//            ThirdPartyLogin.Instantce().initLogin(CasinosContext.Instance.Config.WeChatAppId);
//#endif
            //PushReceiver.instance();
            //OpenInstallReceiver.instance();
        }