Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

How IComponentData or IBufferElementData Convert to String in Project Tiny C# ?

Discussion in 'Project Tiny' started by howonice123, Jun 20, 2019.

  1. howonice123

    howonice123

    Joined:
    Sep 27, 2018
    Posts:
    5
    IBufferElementData data = new IBufferElementData() {
    s1 = "aaaaaa",
    s2 = "bbbbbbb"
    };
    How Covert this IBufferElementDatajson to string in Project TinyC#?
    Thanks u help!!
     
    Last edited: Jun 24, 2019
  2. kfconeone

    kfconeone

    Joined:
    Oct 3, 2013
    Posts:
    7
    I don't quite understand what you want to do, but I think it's better using NatveString512,4096 to store strings in your components.
     
  3. Reborn1214

    Reborn1214

    Joined:
    Jan 19, 2019
    Posts:
    15
    EntityManager.GetBufferAsString or SetBufferFromString ?
     
  4. howonice123

    howonice123

    Joined:
    Sep 27, 2018
    Posts:
    5
    I thought
    IBufferElementData bdata = new IBufferElementData() {
    s1 = "aaaaaa",
    s2 = "bbbbbbb"
    };
    IComponentData ddata = new IComponentData() {
    s1 = "aaaaaa",
    s2 = "bbbbbbb"
    };

    like

    Data data = new Data() {
    s1 = "aaaaaa",
    s2 = "bbbbbbb"
    };

    i want convert this Data or IBufferElementData to string
    like

    string json=JsonUtility.ToJson(IBufferElementData);

    can explain this NatveString512,4096 ,how do using?
    thanks u respond ^^
     
    Last edited: Jun 25, 2019
  5. howonice123

    howonice123

    Joined:
    Sep 27, 2018
    Posts:
    5
    maybe not yet