I have an actionlist which saves an audioclip as a global variable (unity object). But how do I get the audio clip in my script?
You first get a reference to the variable's GVar class using GetVariable, and then cast its UnityObjectValue to an AudioClip:
AC.GVar myVariable = AC.GlobalVariables.GetVariable ("MyVariableName"); AudioClip audioClip = (AudioClip) myVariable.UnityObjectValue;
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You first get a reference to the variable's GVar class using GetVariable, and then cast its UnityObjectValue to an AudioClip: