UnityOSC icon indicating copy to clipboard operation
UnityOSC copied to clipboard

receive "string"

Open freekatet opened this issue 6 years ago • 6 comments

Hello, is it possible to receive strings ? I couldn't find anything.

thanks!

freekatet avatar May 03 '18 16:05 freekatet

I believe I did not implement that.

thomasfredericks avatar May 03 '18 21:05 thomasfredericks

Hey! I just added it no problem. Thanks! On Thu, May 3, 2018 at 14:19 Thomas O Fredericks [email protected] wrote:

I believe I did not implement that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasfredericks/UnityOSC/issues/8#issuecomment-386439993, or mute the thread https://github.com/notifications/unsubscribe-auth/ACweTMQcL0YmNpXhXnYhlo5hO8SYkUWoks5tu3RkgaJpZM4TxaSP .

freekatet avatar May 03 '18 22:05 freekatet

Do you mind sharing your implementation? Thanks.

thomasfredericks avatar Jul 05 '18 18:07 thomasfredericks

sorry, i dont have the files with me atm, i will forward as soon i have my end on it. but it was literally one line..

On Thu, Jul 5, 2018 at 2:29 PM Thomas O Fredericks [email protected] wrote:

Do you mind sharing your implementation? Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasfredericks/UnityOSC/issues/8#issuecomment-402812964, or mute the thread https://github.com/notifications/unsubscribe-auth/ACweTINot_13VUp8SSVBFdIeBmnEmEYXks5uDlsQgaJpZM4TxaSP .

freekatet avatar Jul 24 '18 19:07 freekatet

hi freekatet, if you manage to find the lines you were talking about to receive string objects, i'd be really interested, thanks !

Loupv avatar Apr 10 '19 12:04 Loupv

nevermind, just add the following in the OscMessage class (after GetInt and GetFloat) and it should work

public string GetString(int index)
    {

        if (values[index].GetType() == typeof(string))
        {
            string data = (string)values[index];
            //if (Double.IsNaN(data)) return 0f;
            return data;
        }
        else
        {
            Debug.Log("Wrong type");
            return "";
        }
    }

Loupv avatar Apr 10 '19 13:04 Loupv