Skip to content
Snippets Groups Projects
Select Git revision
  • Topic/1227-frontendPerformance
  • master default protected
  • Issue/2960-infiniteLoop
  • Issue/2960-fixValidationForAP
  • dev protected
  • Issue/2920-fixRemovingValues
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/2955-storingFail
  • Issue/2943-uiFeedback
  • Issue/2551-enhanceSymbolDescriptionsInApplicationProfile
  • Issue/2598-vue3
  • Issue/2804-templateUI
  • Issue/2805-ignoreTemplatingValues
  • Issue/2851-fixBooleanInFormGenerator
  • Issue/2759-showMissingField
  • Issue/2703-vocabularyList
  • Issue/2729-fixSlowLoadingOfInstances
  • Issue/2525-fixedFixValues
  • Hotfix/2681-validationErrors
  • testing
  • Issue/2408-hasValue
  • v4.0.5
  • v4.0.4
  • v4.0.3
  • v4.0.2
  • v4.0.1
  • v4.0.0
  • v3.6.3
  • v3.6.2
  • v3.6.1
  • v3.6.0
  • v3.5.7
  • v3.5.6
  • v3.5.5
  • v3.5.4
  • v3.5.3
  • v3.5.2
  • v3.5.1
  • v3.5.0
  • v3.4.0
  • v3.3.0
41 results

coscine.d.ts

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    VAUSoundSource.cs 1.85 KiB
    using UnityEngine;
    using UnityEditor;
    using System.Collections;
    using System.Collections.Generic;
    using VA;
    
    public class VAUSoundSource : MonoBehaviour {
        
        public int AuralizationMode = 1;
        [Range(0.0f, 100.0f)]
        public int Volume = 70;
        public string SignalSource = "";
        private VANet _VA = null;
        private int SoundSource;
        private bool islooping;
        private bool ismuted;
    
        // Use this for initialization
        void Start()
        {
            _VA = VAUAdapter.VA;
            SoundSource = _VA.CreateSoundSource(this.name, AuralizationMode, Volume);
            islooping = GetComponent<AudioSource>().loop;
            if (GetComponent<AudioSource>() != null)
            {
                SignalSource = _VA.CreateAudiofileSignalSource( AssetDatabase.GetAssetPath(GetComponent<AudioSource>().clip), this.name + "_signal");
                _VA.SetSoundSourceSignalSource(SoundSource, SignalSource);
                Debug.Log(SignalSource + " connected to SoundSource " + SoundSource);
                _VA.SetAudiofileSignalSourcePlaybackAction(SignalSource, 2);
                _VA.SetAudiofileSignalSourceIsLooping(SignalSource, islooping);
            }
        }
    
        // Update is called once per frame
        void Update()
        {
            //position and oritentation -> VA
            Transform t = GetComponent<Transform>();
            _VA.SetSoundSourcePosition(SoundSource, t.transform.position.x, t.transform.position.y, -t.transform.position.z);
            _VA.SetSoundSourceOrientationYPR(SoundSource, -t.transform.rotation.eulerAngles.x, -t.transform.rotation.y, t.transform.rotation.eulerAngles.z);
            ismuted = GetComponent<AudioSource>().mute;
            _VA.SetSoundSourceMuted(SoundSource, ismuted);
            //_VA.NativeSetSoundSourceVolume(SoundSource, Volume);
            
        }
    
        void OnDestroy()
        {
            //_VA.DeleteSoundSource(SoundSource);
            //_VA.DeleteSignalSource(SignalSource);
        }
    
    }