コード例 #1
0
        void Awake()
        {
            if (instance)
            {
                enabled = false;
                Destroy(this);
                return;
            }

            instance = this;
            DontDestroyOnLoad(gameObject);

            state = State.Disconnected;

            //when editing IOS or Android mode, comment out UNITY_EDITOR from the compile conditional
        #if UNITY_STANDALONE || UNITY_EDITOR
            puzzletInterop = gameObject.AddComponent <PuzzletConnectionUSB>();
        #elif UNITY_IOS
            puzzletInterop = gameObject.AddComponent <PuzzletConnectionIOS>();
        #elif UNITY_ANDROID
            puzzletInterop = gameObject.AddComponent <PuzzletConnectionAndroid>();
        #endif

            puzzletInterop.Initialize(this);
            puzzletInterop.Connect();
        }
コード例 #2
0
        public void Initialize(PuzzletConnection pc)
        {
            puzzletConnection = pc;

            //create the java object that will manage the bluetooth on the device side
            using (var pluginClass = new AndroidJavaClass("com.digitaldreamlabs.bleplugin.BLEManager")){
                bleManagerInstance = pluginClass.CallStatic <AndroidJavaObject>("InitializeBluetooth", name);
            }

            StartCoroutine(SetFullscreen());
        }
コード例 #3
0
        void Awake()
        {
            PuzzletConnection.RegisterReceiver(this);
            StartCoroutine(DownloadLatestVersions());

            //set texts to appropriate for device
            #if UNITY_STANDALONE || UNITY_EDITOR
            string deleteStr = "Bluetooth";
            #else
            string deleteStr = "USB";
            #endif

            for(int a = 0; a < texts.Length; ++a)
            {
                if(texts[a].name.Contains(deleteStr))
                    Destroy(texts[a]);
            }
        }
コード例 #4
0
 public void Initialize(PuzzletConnection pc)
 {
     puzzletConnection = pc;
     badConnections    = new List <string>();
 }
コード例 #5
0
 public void Initialize(PuzzletConnection pc)
 {
     puzzletConnection = pc;
     _setupConnection();
     _setReceiver(name);
 }