Ejemplo n.º 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();
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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]);
            }
        }
Ejemplo n.º 4
0
 public void Initialize(PuzzletConnection pc)
 {
     puzzletConnection = pc;
     badConnections    = new List <string>();
 }
Ejemplo n.º 5
0
 public void Initialize(PuzzletConnection pc)
 {
     puzzletConnection = pc;
     _setupConnection();
     _setReceiver(name);
 }