Пример #1
0
    /// <summary>
    /// <summary>Read Double from message. Don't forget read user id first (long)</summary>
    /// </summary>
    /// <param name="msg"></param>
    /// <returns></returns>
    public SharingData ReadDouble(NetworkInMessage msg, bool onlyValue = false)
    {
        long   userId = 0;
        string tag    = "";

        // firstly we read user_id and message tag if onlyValue == false
        ReadIdAndTag(msg, onlyValue, out userId, out tag);

        var value = msg.ReadDouble(); // lastly we read value

        return(new SharingData(userId, tag, value));
    }
Пример #2
0
    //Function that provides Haptic Feedback
    void HapticFeedback(NetworkInMessage msg)
    {
        Debug.Log("Get Threshold Data");
        msg.ReadInt64();
        double volumeScale = msg.ReadDouble();

        Debug.Log("Subpack should start vibrating");
        AudioSource source;

        source = GetComponent <AudioSource>();
        source.PlayOneShot(hapticSound, (float)volumeScale);
    }
Пример #3
0
 public double ReadSize(NetworkInMessage msg)
 {
     return(msg.ReadDouble());
 }