VAUListener.cs 914 Bytes
Newer Older
1 2 3 4 5 6 7 8
using UnityEngine;
using System;
using System.Collections;
using VA;


public class VAUListener : MonoBehaviour {

9 10 11 12
    public string listenername = "MyListener";
    public int auramode = 123;
    private int Listener;
    private VANet _VA = null;
13 14 15
    // Use this for initialization
    void Start()
    {
16 17
        _VA = VAUAdapter.VA;
        Listener = _VA.CreateListener(listenername, auramode, VAUAdapter.DefaultHRIR);
18 19 20 21 22 23 24 25 26 27
    }
	
	// Update is called once per frame
	void Update ()
    {
        Transform t = GetComponent<Transform>();        
        _VA.SetListenerPosition(Listener, t.transform.position.x, t.transform.position.y, -t.transform.position.z);
        _VA.SetListenerOrientationYPR(Listener, -t.transform.rotation.eulerAngles.x, -t.transform.rotation.eulerAngles.y, t.transform.rotation.eulerAngles.z);
    }

28 29 30 31 32
    //void OnDestroy()
    //{
    //    _VA.DeleteListener(Listener);
    //}

33 34

}