コード例 #1
0
    void handleConnectionError(DicePlus dpf)
    {
        if (dpf.Equals(currentlyConnectedDie))
        {
            if (state == State.CONNECTING)
            {
                setState(State.DISCONNECTED);
            }
            currentlyConnectedDie = null;
        }
        if (connectedDice.Contains(dpf))
        {
            connectedDice.Remove(dpf);
        }
        if (state == State.CONNECTED)
        {
            if (connectedDice.Count < maxDiceCount)
            {
                DicePlusAnimator.Instance.runDisconnectedAnimation();
                setState(State.DISCONNECTED);
            }
        }
        else if (state != State.ROLLER)
        {
            OrbitingButtonsManager.Instance.showButtons(true);
//			triedDiceSet.Add(dpf);
        }
    }
コード例 #2
0
    public void onConnectionEstablished(DicePlus dpe)
    {
        if (dpe.Equals(currentlyConnectedDie))
        {
            currentlyConnectedDie = null;
        }

        SoftwareVersion sv = dpe.getSoftwareVersion();

        if ((sv.getMajor() > major) || (sv.getMajor() == major && sv.getMinor() >= minor))
        {
            connectedDice.Add(dpe);
            if (connectedDice.Count >= maxDiceCount)
            {
                setState(State.CONNECTED);
            }
            else
            {
                setState(State.DISCONNECTED);
            }
            DicePlusAnimator.Instance.runConnectedAnimation();
            dpe.subscribeRolls();
            dpe.subscribeBatteryState();
            dpe.registerListener(this);
            rssi = dpe.rssi;
        }
        else
        {
            setState(State.DISCONNECTED);
            DicePlusAnimator.Instance.runVersionMissmatchAnimation(false);
            dpe.disconnect();
        }
    }
コード例 #3
0
 public override void onRoll(DicePlus dicePlus, long time, int duration, int face, int invalidityFlags, string errorMsg)
 {
     // Accepting only valid rolls.
     if(invalidityFlags == 0) {
     //			RollResult.text = face.ToString();
     }
 }
コード例 #4
0
 public void onConnectionFailed(DicePlus dpf, int errorCode, string excpMsg)
 {
     if (errorCode == DicePlusConnector.ERR_VERSION_MISSMATCH)
     {
         DicePlusAnimator.Instance.runVersionMissmatchAnimation(true);
     }
     handleConnectionError(dpf);
 }
コード例 #5
0
    public override void onRoll(DicePlus dicePlus, long time, int duration, int face, int invalidityFlags, string errorMsg)
    {
        // Accepting only valid rolls.
        if (invalidityFlags == 0)
        {
//			RollResult.text = face.ToString();
        }
    }
コード例 #6
0
    public override void onOrientationReadout(DicePlus dicePlus, long time, Vector3 v, string errorMsg)
    {
        // X axis goes through 1
        // Y axis goes through 5
        // Z axis goes through 3
//		transform.rotation = Quaternion.Euler(Vector3.zero);
//		transform.Rotate(v);
        currentOrientation = v;
    }
コード例 #7
0
 public override void onOrientationReadout(DicePlus dicePlus, long time, Vector3 v, string errorMsg)
 {
     // X axis goes through 1
     // Y axis goes through 5
     // Z axis goes through 3
     //		transform.rotation = Quaternion.Euler(Vector3.zero);
     //		transform.Rotate(v);
     currentOrientation = v;
 }
コード例 #8
0
ファイル: DicePlusAdapter.cs プロジェクト: Ringgg/RiverPirate
    void IDicePlusConnectorListener.onConnectionEstablished(DicePlus dicePlus)
    {
        dicePlus.initializePStorageCommunication();
        dicePlus.registerListener(this);
        dicePlus.subscribeOrientationReadouts(20);

        myDice = dicePlus;
        DiceConnected = true;
    }
コード例 #9
0
 private void checkConnection()
 {
     if (state == State.SEARCHING)
     {
         if (rssiSearchTimoutTime < Time.time && diceSet.Count > 0)
         {
             setState(State.DISCONNECTED);
             DicePlusConnector.Instance.stopScan();
         }
     }
     if (state == State.DISCONNECTED)
     {
         if (diceSet.Count == 0)
         {
             if (scanningEnabled)
             {
                 if (DicePlusConnector.Instance.startScan())
                 {
                     rssiSearchTimoutTime = Time.time + findClosestTime;
                     setState(State.SEARCHING);
                 }
                 else
                 {
                     OrbitingButtonsManager.Instance.showButtons(true);
                     setState(State.DISCONNECTED);
                 }
             }
         }
         else
         {
             int      highestRssi   = int.MinValue;
             DicePlus toBeConnected = null;
             foreach (DicePlus dp in diceSet)
             {
                 if (dp.rssi > highestRssi)
                 {
                     highestRssi   = dp.rssi;
                     toBeConnected = dp;
                 }
             }
             if (toBeConnected != null)
             {
                 currentlyConnectedDie = toBeConnected;
                 DicePlusConnector.Instance.connect(toBeConnected);
                 setState(State.CONNECTING);
                 diceSet.Remove(toBeConnected);
             }
         }
     }
 }
コード例 #10
0
    public void onNewDie(DicePlus ndp)
    {
        if (
            !connectedDice.Contains(ndp))
        {
            diceSet.Add(ndp);

            if (ndp.rssi >= rssi - 5)
            {
                setState(State.DISCONNECTED);
                DicePlusConnector.Instance.stopScan();
            }
        }
    }
コード例 #11
0
 public override void onBatteryState(DicePlus dicePlus, DicePlusConnector.BatteryState batteryState, int percentage, bool low, string errorMsg)
 {
     if (percentage < battery && low)
     {
         if (state != State.CONNECTED)
         {
             DicePlusAnimator.Instance.runLowBatteryAnimation();
         }
         else
         {
             StartCoroutine(DicePlusAnimator.Instance.lowBatteryCorutine());
         }
         battery = percentage;
     }
 }
コード例 #12
0
    /// <summary>
    /// Subscribes to accelerometer readouts and configure sensor
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='readFrequency'>
    /// readout frequency (in Hz), values: 1 - 60
    /// </param>
    /// <param name='readoutType'>
    /// a readout filter type
    /// </param>
    public void subscribeAccelerometerReadouts(DicePlus dicePlus, int readFrequency, AccelerometerReadoutType readoutType)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_subscribeAndConfigureAccelerometerReadouts(dicePlus.address, readFrequency, (int)readoutType);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("subscribeAndConfigureAccelerometerReadouts", new object [] {dicePlus.address, readFrequency, (int)readoutType});
        }
        #endif
    }
コード例 #13
0
    /// <summary>
    /// Sends setMode packet to the given die
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='mode'>
    /// mode to set
    /// </param>
    public void setMode(DicePlus dicePlus, DieMode mode)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_setMode(dicePlus.address, (int)mode);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("setMode", new object [] {dicePlus.address, (int)mode});
        }
        #endif
    }
コード例 #14
0
    /// <summary>
    /// Sends fade LED animation request
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='ledMask'>
    /// which LEDs to run animation on
    /// </param>
    /// <param name='priority'>
    /// animation with lower value overrides other, values: 0 - 255
    /// </param>
    /// <param name='color'>
    /// color to be faded
    /// </param>
    /// <param name='fadeInOutTime'>
    /// time in ms LED is fading in/out, values: 0 - 65535
    /// </param>
    /// <param name='pauseTime'>
    /// time in ms LED stays at full bright before fading out, values: 0 - 65535
    /// </param>
    public void runFadeAnimation(DicePlus dicePlus, LedFace ledMask, int priority, 
			Color color, int fadeInOutTime, int pauseTime)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_runFadeAnimation(dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), fadeInOutTime, pauseTime);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("runFadeAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), fadeInOutTime, pauseTime});
        }
        #endif
    }
コード例 #15
0
 public virtual void onPStorageValueRead(DicePlus dicePlus, int handle, int intvalue)
 {
 }
コード例 #16
0
 public virtual void onAccelerometerReadout(DicePlus dicePlus, long time, Vector3 v, int type, string errorMsg)
 {
 }
コード例 #17
0
    /// <summary>
    /// Checks if the die is connected and authenticated
    /// </summary>
    /// <returns>
    /// true, if the die is authenticated; false otherwise.
    /// </returns>
    /// <param name='dicePlus'>
    /// the dice
    /// </param>
    public bool hasConnectionEstabilished(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        return ios_connected(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            return dmo.Call<bool>("hasConnectionEstabilished", new object [] {dicePlus.address});
        }
        #endif
        return false;
    }
コード例 #18
0
    /// <summary>
    /// Gets persistent storage record description for given handle
    /// </summary>
    /// <returns>
    /// persistent storage record description, null if handle was invalid
    /// </returns>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='handle'>
    /// the handle to requested record
    /// </param>
    public PStorageRecordDescription getPStorageRecordDescription(DicePlus dicePlus, int handle)
    {
        string result = null;
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        result = ios_getPStorageRecordDescription(dicePlus.address, handle);
        #elif UNITY_ANDROID

        if (dmo != null) {
            result = dmo.Call<string>("getPStorageRecordDescription", new object [] {dicePlus.address, handle});
        }
        #endif
        PStorageRecordDescription retVal;
        if (result == null || result.Equals("") || !PStorageRecordDescription.TryParse(result, out retVal)) {
            return null;
        } else {
            return retVal;
        }
    }
コード例 #19
0
 public void onConnectionLost(DicePlus dpl)
 {
     handleConnectionError(dpl);
 }
コード例 #20
0
 public virtual void onPowerMode(DicePlus dicePlus, long time, DicePlusConnector.PowerMode mode, string errorMsg)
 {
 }
コード例 #21
0
 public virtual void onPStorageOperationFailed(DicePlus dicePlus, string errorMsg)
 {
 }
コード例 #22
0
 public virtual void onPStorageCommunicationInitialized(DicePlus dicePlus, int count)
 {
 }
コード例 #23
0
    /// <summary>
    /// Subscribes to proximity readouts and configures sensor
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='freq'>
    /// readout frequency (in Hz), values: 1 - 10
    /// </param>
    public void subscribeProximityReadouts(DicePlus dicePlus, int freq)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_subscribeAndConfigureProximityReadouts(dicePlus.address, freq);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("subscribeAndConfigureProximityReadouts", new object [] {dicePlus.address, freq});
        }
        #endif
    }
コード例 #24
0
 public virtual void onReadoutFailed(DicePlus dicePlus, int dataSourceCode, string errorMsg)
 {
 }
コード例 #25
0
 public virtual void onPStorageValueRead(DicePlus dicePlus, int handle, String str)
 {
 }
コード例 #26
0
 public virtual void onSubscriptionChangeStatus(DicePlus dicePlus, DicePlusConnector.DataSource dataSourceCode, string errorMsg)
 {
 }
コード例 #27
0
    /// <summary>
    /// Gets the status.
    /// </summary>
    /// <returns>
    /// dies module status
    /// </returns>
    /// <param name='dicePlus'>
    /// the dice
    /// </param>
    public int? getStatus(DicePlus dicePlus)
    {
        string result = null;
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        result = ios_getStatus(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            result = dmo.Call<string>("getStatus", new object [] {dicePlus.address});
        }
        #endif
        int retVal = new int();
        if (result == null || result.Equals("") || !int.TryParse(result, out retVal)) {
            return null;
        } else {
            return retVal;
        }
    }
コード例 #28
0
 public virtual void onConnectionEstablished(DicePlus dicePlus)
 {
 }
コード例 #29
0
    /// <summary>
    /// Sends request to the given dice to get persistent storage record value
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='handle'>
    /// the handle to requested record
    /// </param>
    public void readPStorageValue(DicePlus dicePlus, int handle)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_readPStorageValue(dicePlus.address, handle);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("readPStorageValue", new object [] {dicePlus.address, handle});
        }
        #endif
    }
コード例 #30
0
 public virtual void onNewDie(DicePlus dicePlus)
 {
 }
コード例 #31
0
 public virtual void onConnectionLost(DicePlus dicePlus)
 {
 }
コード例 #32
0
 public virtual void onPStorageValueRead(DicePlus dicePlus, int handle, Vector3 vector)
 {
 }
コード例 #33
0
 public virtual void onConnectionFailed(DicePlus dicePlus, int errorCode, string excpMsg)
 {
 }
コード例 #34
0
 public virtual void onDiceStatistics(DicePlus dicePlus, DiceStatistics diceStatistics, string errorMsg)
 {
 }
コード例 #35
0
    /// <summary>
    /// Sends blink LED animation request
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='ledMask'>
    /// which LEDs to run animation on
    /// </param>
    /// <param name='priority'>
    /// animation with lower value overrides other, values: 0 - 255
    /// </param>
    /// <param name='color'>
    /// color to be blinked
    /// </param>
    /// <param name='ledOnPeriod'>
    /// time in ms LED is ON, values: 0 - 65535
    /// </param>
    /// <param name='ledCyclePeriod'>
    /// time in ms one blink cycle lasts, values: 0 - 65535
    /// </param>
    /// <param name='blinkNumber'>
    /// number of blinks, values: 0 - 255
    /// </param>
    public void runBlinkAnimation(DicePlus dicePlus, LedFace ledMask, int priority, 
			Color color, int ledOnPeriod, int ledCyclePeriod, int blinkNumber)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_runBlinkAnimation(dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), ledOnPeriod, ledCyclePeriod, blinkNumber);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("runBlinkAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), ledOnPeriod, ledCyclePeriod, blinkNumber});
        }
        #endif
    }
コード例 #36
0
    /// <summary>
    /// Unsubscribes from battery state events
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void unsubscribeBatteryState(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_unsubscribeBatteryState(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("unsubscribeBatteryState", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #37
0
    /// <summary>
    /// Sends standard LED animation request
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='ledMask'>
    /// which LEDs to run animation on
    /// </param>
    /// <param name='priority'>
    /// animation with lower value overrides other, values: 0 - 255
    /// </param>
    /// <param name='animation'>
    /// standard animation type
    /// </param>
    public void runStandardAnimation(DicePlus dicePlus, LedFace ledMask, int priority, 
			DicePlusConnector.AnimationType animation)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_runStandardAnimation(dicePlus.address, (int)ledMask, priority, (int)animation);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("runStandardAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)animation});
        }
        #endif
    }
コード例 #38
0
    /// <summary>
    /// Sends request to the given dice to set persistent storage record value
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='handle'>
    /// the handle to requested record
    /// </param>
    /// <param name='x'>
    /// first vector value to be set
    /// </param>
    /// <param name='y'>
    /// second vector value to be set
    /// </param>
    /// <param name='z'>
    /// third vector value to be set
    /// </param>
    public void writePStorageValue(DicePlus dicePlus, int handle, int x, int y, int z)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_writePStorageVecValue(dicePlus.address, handle, x, y, z);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("writePStorageVecValue", new object [] {dicePlus.address, handle, x, y, z});
        }
        #endif
    }
コード例 #39
0
    /// <summary>
    /// Sends sleep request to the given dice
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void sleep(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_sleep(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("sleep", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #40
0
    void onNewDie(string str)
    {
        string[] words = str.Split('#');
        string addres = words[0];

        DicePlus dicePlus;
        if (dice.ContainsKey(addres)) {
            dicePlus = dice[addres];
        } else {
            dicePlus = new DicePlus(this, addres);
            dice.Add(addres, dicePlus);
        }
        dicePlus.rssi = int.Parse(words[1]);
        foreach (IDicePlusConnectorListener listener in listeners) {
            listener.onNewDie(dicePlus);
        }
    }
コード例 #41
0
    /// <summary>
    /// Subscribes to magnetometer readouts and configures sensor.
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='freq'>
    /// readout frequency (in Hz), values: 1 - 30
    /// </param>
    /// <param name='type'>
    /// a readout type
    /// </param>
    public void subscribeMagnetometerReadouts(DicePlus dicePlus, int freq, MagnetometerReadoutType type)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_subscribeAndConfigureMagnetometerReadouts(dicePlus.address, freq, (int)type);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("subscribeAndConfigureMagnetometerReadouts", new object [] {dicePlus.address, freq, (int)type});
        }
        #endif
    }
コード例 #42
0
    /// <summary>
    /// Sends the die statistics request to the given dice.
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void getDiceStatistics(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_getDiceStatistics(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("getDiceStatistics", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #43
0
    /// <summary>
    /// Subscribes to roll events
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void subscribeRolls(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_subscribeRolls(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("subscribeRolls", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #44
0
 public virtual void onPStorageReset(DicePlus dicePlus, string errorMsg)
 {
 }
コード例 #45
0
    /// <summary>
    /// Unsubscribes from touch/release state events
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void unsubscribeTouchReadouts(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_unsubscribeTouchReadouts(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("unsubscribeTouchReadouts", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #46
0
 public override void onLedState(DicePlus dicePlus, long time, DicePlusConnector.LedFace ledMask, long animationId, int type, string errorMsg)
 {
 }
コード例 #47
0
    /// <summary>
    /// Sends request to the given dice to set persistent storage record value
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    /// <param name='handle'>
    /// the handle to requested record
    /// </param>
    /// <param name='str'>
    /// string value to be set
    /// </param>
    public void writePStorageValue(DicePlus dicePlus, int handle, string str)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_writePStorageStrValue(dicePlus.address, handle, str);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("writePStorageStrValue", new object [] {dicePlus.address, handle, str});
        }
        #endif
    }
コード例 #48
0
    public void onNewDie(DicePlus dicePlus)
    {
//		throw new System.NotImplementedException ();
    }
コード例 #49
0
    /// <summary>
    /// Disconnects specified dice.
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void disconnect(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_disconnect(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("disconnect", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #50
0
 public void onConnectionLost(DicePlus dicePlus)
 {
     dicePlus.unsubscribeOrientationReadouts();
 }
コード例 #51
0
    /// <summary>
    /// Gets device model number
    /// </summary>
    /// <returns>
    /// device model model, null when die has not yet connected and authenticated connection.
    /// </returns>
    /// <param name='dicePlus'>
    /// the dice
    /// </param>
    public long? getModelNumber(DicePlus dicePlus)
    {
        string result = null;
        #if UNITY_EDITOR

        #elif UNITY_IPHONE
        result = ios_getModelNumber(dicePlus.address);
        #elif UNITY_ANDROID
        if (dmo != null) {
            result = dmo.Call<string>("getModelNumber", new object [] {dicePlus.address});
        }
        #endif
        long retVal = new long();
        if (result == null || result.Equals("") || !long.TryParse(result, out retVal)) {
            return null;
        } else {
            return retVal;
        }
    }
コード例 #52
0
    public void onConnectionEstablished(DicePlus dicePlus)
    {
        dicePlus.registerListener(this);
        dicePlus.subscribeOrientationReadouts(20);
//		dicePlus.subscribeLedState();
    }
コード例 #53
0
    /// <summary>
    /// Gets software version.
    /// </summary>
    /// <returns>
    /// number representing software version, null when die has not yet connected and authenticated connection.
    /// </returns>
    /// <param name='dicePlus'>
    /// the dice
    /// </param>
    public SoftwareVersion getSoftwareVersion(DicePlus dicePlus)
    {
        string result = null;
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        result = ios_getSoftwareVersion(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            result = dmo.Call<string>("getSoftwareVersion", new object [] {dicePlus.address});
        }
        #endif
        if (result == null || result.Equals("")) {
            return null;
        } else {
            return SoftwareVersion.Parse(result);
        }
    }
コード例 #54
0
    public void onConnectionFailed(DicePlus dicePlus, int errorCode, string excpMsg)
    {
//		throw new System.NotImplementedException ();
    }
コード例 #55
0
    /// <summary>
    /// Gets dice unique identifier
    /// </summary>
    /// <returns>
    /// unique identifier string, null when die has not yet connected and authenticated connection.
    /// </returns>
    /// <param name='dicePlus'>
    /// the die
    /// </param>
    public string getUID(DicePlus dicePlus)
    {
        string result = null;
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        result = ios_getUID(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            result = dmo.Call<string>("getUID", new object [] {dicePlus.address});
        }
        #endif
        if (result == null || result.Equals("")) {
            return null;
        } else {
            return result;
        }
    }
 public virtual void onConnectionLost(DicePlus dicePlus)
 {
 }
コード例 #57
0
    /// <summary>
    /// Sends request to the given dice to initialize persistent storage communication
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void initializePStorageCommunication(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_initializePStorageCommunication(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("initializePStorageCommunication", new object [] {dicePlus.address});
        }
        #endif
    }
 public virtual void onNewDie(DicePlus dicePlus)
 {
 }
コード例 #59
0
    /// <summary>
    /// Sends request to the given dice to reset all persistent storage settings
    /// </summary>
    /// <param name='dicePlus'>
    /// the die to which to send command/request
    /// </param>
    public void resetPStorage(DicePlus dicePlus)
    {
        #if UNITY_EDITOR

        #elif UNITY_IPHONE

        ios_resetPStorage(dicePlus.address);
        #elif UNITY_ANDROID

        if (dmo != null) {
            dmo.Call("resetPStorage", new object [] {dicePlus.address});
        }
        #endif
    }
コード例 #60
0
 public virtual void onSleepStatus(DicePlus dicePlus, string errorMsg)
 {
 }