Exemple #1
0
 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 :(");
     }
 }
Exemple #2
0
    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 :(");
        }
    }
Exemple #3
0
    public static void OnObjectCreated(ulong subID, string Json)
    {
        ObjectCreatedJsonObject CreatedObject = ObjectCreatedJsonObject.Create(Json);

        if (CreatedObject != null)
        {
            string Result;
            var    Args = new ObjectGetArgs {
                from = new ObjectGetArgs.From {
                    id = new[] { [email protected] }
                }
            };
            var Options = new CallOptions {
                @return = new[] { "name", "type", "path" }
            };
            AkWaapiClient.Call("ak.wwise.core.object.get", Args, Options, out Result);
            var ReturnedObject = CallReturn.Create(Result);
            Debug.Log("New object of type " + ReturnedObject.@return[0].type + " named " + ReturnedObject.@return[0].name + " with ID " + [email protected] + " created at path " + ReturnedObject.@return[0].path);
        }
    }