|
@@ -56,11 +56,14 @@ namespace KairoEngine.SFX.GameActions
|
|
|
|
|
|
public override void Start()
|
|
|
{
|
|
|
+ Debug.Log("Playing sound");
|
|
|
GameObject parentObj = GetVariable<GameObject>(parent, null);
|
|
|
+ Transform parentTransform = null;
|
|
|
+ if(parentObj != null) parentTransform = parentObj.transform;
|
|
|
Vector3 pos = new Vector3();
|
|
|
if(parentObj != null) pos = parentObj.transform.position;
|
|
|
- if(librarySfxClipName != null) SoundController.EmmitSound(librarySfxClipName, pos, parentObj.transform);
|
|
|
- else if(sfxClip != null) SoundController.EmmitSound(sfxClip, pos, parentObj.transform);
|
|
|
+ if(sfxClip != null) SoundController.EmmitSound(sfxClip, pos, parentTransform);
|
|
|
+ else if(!string.IsNullOrEmpty(librarySfxClipName)) SoundController.EmmitSound(librarySfxClipName, pos, parentTransform);
|
|
|
_done = true;
|
|
|
_started = true;
|
|
|
}
|