Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

VAUListener.cs 906 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
    void OnDestroy()
    {
        _VA.DeleteListener(Listener);
    }
32

33
34

}