Commit f2eb1803 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding simpler way to add search paths by a dedicated class

parent 019e15e7
...@@ -7,14 +7,13 @@ using VA; ...@@ -7,14 +7,13 @@ using VA;
// Adapter to VA (singleton) // Adapter to VA (singleton)
/** /**
* Drop this file onto any GameObject. Add a VAUConfig script to the same object for special settings. Add VAUControl to control the running core. * Drop this file onto any GameObject. Add a VAUConfig script to the same object to control parameters.
* */ * */
public class VAUAdapter : MonoBehaviour public class VAUAdapter : MonoBehaviour
{ {
public static string Server = "localhost"; public static string Server = "localhost";
public static int Port = 12340; public static int Port = 12340;
public static string AdditionalSearchPath = ""; // Provide further paths where VA should look for audio files, directivities and HRIRs.
public static bool ResetOnStart = true; public static bool ResetOnStart = true;
public static bool ResetOnStop = true; public static bool ResetOnStop = true;
public static bool DeactivateUnitySoundOnAwake = true; public static bool DeactivateUnitySoundOnAwake = true;
...@@ -51,12 +50,6 @@ public class VAUAdapter : MonoBehaviour ...@@ -51,12 +50,6 @@ public class VAUAdapter : MonoBehaviour
// Add Asset folder as search path for VA (only works if VA is running on same host PC) // Add Asset folder as search path for VA (only works if VA is running on same host PC)
if (!VA.AddSearchPath(Application.dataPath)) if (!VA.AddSearchPath(Application.dataPath))
Debug.LogError("Could not add application assets folder to VA search path, VA server running on remote host?"); Debug.LogError("Could not add application assets folder to VA search path, VA server running on remote host?");
if (AdditionalSearchPath.Length > 0)
{
VA.AddSearchPath(AdditionalSearchPath);
// ... append more if required.
}
} }
// Use this for initialization // Use this for initialization
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VAUAdditionalSearchPath : MonoBehaviour
{
public string Path = "";
void Start ()
{
VAUAdapter.VA.AddSearchPath( Path );
}
}
...@@ -10,9 +10,6 @@ public class VAUConfig : MonoBehaviour { ...@@ -10,9 +10,6 @@ public class VAUConfig : MonoBehaviour {
[Tooltip("TCP/IP port where the VA server is communicating.")] [Tooltip("TCP/IP port where the VA server is communicating.")]
public int Port = VAUAdapter.Port; public int Port = VAUAdapter.Port;
[Tooltip("Add an additional path where to find files")]
public string AdditionalSearchPath = "";
[Tooltip("Resets server on startup")] [Tooltip("Resets server on startup")]
public bool ResetOnStart = true; public bool ResetOnStart = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment