public static void WaapiClientTest2() { if (AkWaapiClient.Connect("127.0.0.1", 8080)) { Debug.Log("Connect Success!"); string WaapiResult = string.Empty; bool res = AkWaapiClient.Call("ak.wwise.core.remote.disconnect", "{}", "{}", out WaapiResult); if (res) { var projectInfo = ProjectInfo.Create(WaapiResult); Debug.LogWarning(projectInfo); } else { Debug.Log("Call failed :("); } var Options = new CallOptions { @return = new[] { "id" } }; ulong subId = 0; res = AkWaapiClient.Subscribe("ak.wwise.core.object.created", Options, OnObjectCreated, out subId, out WaapiResult); if (res) { Debug.Log("Subscribe success!" + WaapiResult); } else { Debug.Log("Subscribe failed :("); } } else { Debug.Log("Connect fail :("); } }
public static void WaapiClientTest() { if (AkWaapiClient.Connect("127.0.0.1", 8080)) { Debug.Log("Connect Success!"); string WaapiResult = string.Empty; MyArgument myArgument = new MyArgument(); myArgument.host = "127.0.0.1"; string json = JsonUtility.ToJson(myArgument); bool res = AkWaapiClient.Call("ak.wwise.core.remote.connect", json, "{}", out WaapiResult); //connect wwise from menu //https://docs.unity3d.com/Manual/JSONSerialization.html if (res) { var projectInfo = ProjectInfo.Create(WaapiResult); Debug.LogWarning(projectInfo); } else { Debug.Log("Call failed :("); } var Options = new CallOptions { @return = new[] { "id" } }; ulong subId = 0; res = AkWaapiClient.Subscribe("ak.wwise.core.object.created", Options, OnObjectCreated, out subId, out WaapiResult); if (res) { Debug.Log("Subscribe success!" + WaapiResult); } else { Debug.Log("Subscribe failed :("); } } else { Debug.Log("Connect fail :("); } }