Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VAUnity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
VAUnity
Commits
7060d7c0
Commit
7060d7c0
authored
8 years ago
by
Maurice Tayeb Andreas
Browse files
Options
Downloads
Patches
Plain Diff
SoundSource Seite des Menüs
parent
29ff099e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
LHMAuraMenuSoundSource.cs
+243
-0
243 additions, 0 deletions
LHMAuraMenuSoundSource.cs
VAUListener.cs
+1
-0
1 addition, 0 deletions
VAUListener.cs
with
244 additions
and
0 deletions
LHMAuraMenuSoundSource.cs
0 → 100644
+
243
−
0
View file @
7060d7c0
using
UnityEngine
;
using
System.Collections
;
using
VA
;
using
UnityEngine.UI
;
public
class
LHMAuraMenuSoundSource
:
MonoBehaviour
{
public
Color
setcolor
;
public
Color
notsetcolor
;
private
VAUAuralizationMode
auralizationMode
;
private
string
auraMode
;
private
bool
DS
;
private
bool
ER
;
private
bool
DD
;
private
bool
DIR
;
private
bool
AA
;
private
bool
TV
;
private
bool
SC
;
private
bool
DIF
;
private
bool
NF
;
private
bool
DP
;
private
bool
SL
;
void
Start
()
{
auralizationMode
=
FindObjectOfType
<
VAUSoundSource
>().
gameObject
.
GetComponent
<
VAUAuralizationMode
>();
if
(
auralizationMode
==
null
)
Debug
.
Log
(
"[VAU] No SoundSources in Scene."
);
auralizationMode
.
AuraStringChanged
+=
AuralizationMode_AuraStringChanged
;
GetComponentInChildren
<
LHMSoundSourceSlider
>().
ActSoundSourceChanged
+=
LHMAuraMenuSoundSource_ActSoundSourceChanged
;
RefreshAuraMode
();
}
private
void
LHMAuraMenuSoundSource_ActSoundSourceChanged
(
VAUSoundSource
actSoundSource
)
{
auralizationMode
=
actSoundSource
.
gameObject
.
GetComponent
<
VAUAuralizationMode
>();
RefreshAuraMode
();
}
private
void
AuralizationMode_AuraStringChanged
(
string
sAuraString
)
{
RefreshAuraMode
();
}
void
RefreshAuraMode
()
{
DS
=
auralizationMode
.
DirectSound
;
ER
=
auralizationMode
.
EarlyReflections
;
DD
=
auralizationMode
.
DiffuseDecay
;
DIR
=
auralizationMode
.
SourceDirectivity
;
AA
=
auralizationMode
.
AirAbsorption
;
TV
=
auralizationMode
.
AtmosphericTemporalVariations
;
SC
=
auralizationMode
.
Scattering
;
DIF
=
auralizationMode
.
Diffraction
;
NF
=
auralizationMode
.
NearFielEffects
;
DP
=
auralizationMode
.
DopplerShifts
;
SL
=
auralizationMode
.
SphericalSpreadingLoss
;
gameObject
.
transform
.
FindChild
(
"DSButton"
).
GetComponent
<
Image
>().
color
=
(
DS
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"ERButton"
).
GetComponent
<
Image
>().
color
=
(
ER
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"DDButton"
).
GetComponent
<
Image
>().
color
=
(
DD
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"DIRButton"
).
GetComponent
<
Image
>().
color
=
(
DIR
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"AAButton"
).
GetComponent
<
Image
>().
color
=
(
AA
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"TVButton"
).
GetComponent
<
Image
>().
color
=
(
TV
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"SCButton"
).
GetComponent
<
Image
>().
color
=
(
SC
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"DIFButton"
).
GetComponent
<
Image
>().
color
=
(
DIF
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"NFButton"
).
GetComponent
<
Image
>().
color
=
(
NF
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"DPButton"
).
GetComponent
<
Image
>().
color
=
(
DP
)
?
setcolor
:
notsetcolor
;
gameObject
.
transform
.
FindChild
(
"SLButton"
).
GetComponent
<
Image
>().
color
=
(
SL
)
?
setcolor
:
notsetcolor
;
}
public
void
AllClicked
()
{
auralizationMode
.
TriggerAuraStringChanged
(
"all"
);
}
public
void
DefaultClicked
()
{
auralizationMode
.
TriggerAuraStringChanged
(
"default"
);
}
public
void
DSClicked
()
{
if
(
DS
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-DS"
);
DS
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+DS"
);
DS
=
true
;
}
gameObject
.
transform
.
Find
(
"DSButton"
).
GetComponent
<
Image
>().
color
=
(
DS
)
?
setcolor
:
notsetcolor
;
}
public
void
DDClicked
()
{
if
(
DD
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-DD"
);
DD
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+DD"
);
DD
=
true
;
}
gameObject
.
transform
.
Find
(
"DDButton"
).
GetComponent
<
Image
>().
color
=
(
DD
)
?
setcolor
:
notsetcolor
;
}
public
void
DIRClicked
()
{
if
(
DIR
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-DIR"
);
DIR
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+DIR"
);
DIR
=
true
;
}
gameObject
.
transform
.
Find
(
"DIRButton"
).
GetComponent
<
Image
>().
color
=
(
DIR
)
?
setcolor
:
notsetcolor
;
}
public
void
AAClicked
()
{
if
(
AA
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-AA"
);
AA
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+AA"
);
AA
=
true
;
}
gameObject
.
transform
.
Find
(
"AAButton"
).
GetComponent
<
Image
>().
color
=
(
AA
)
?
setcolor
:
notsetcolor
;
}
public
void
TVClicked
()
{
if
(
TV
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-TV"
);
TV
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+TV"
);
TV
=
true
;
}
gameObject
.
transform
.
Find
(
"TVButton"
).
GetComponent
<
Image
>().
color
=
(
TV
)
?
setcolor
:
notsetcolor
;
}
public
void
SCClicked
()
{
if
(
SC
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-SC"
);
SC
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+SC"
);
SC
=
true
;
}
gameObject
.
transform
.
Find
(
"SCButton"
).
GetComponent
<
Image
>().
color
=
(
SC
)
?
setcolor
:
notsetcolor
;
}
public
void
DIFClicked
()
{
if
(
DIF
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-DIF"
);
DIF
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+DIF"
);
DIF
=
true
;
}
gameObject
.
transform
.
Find
(
"DIFButton"
).
GetComponent
<
Image
>().
color
=
(
DIF
)
?
setcolor
:
notsetcolor
;
}
public
void
NFClicked
()
{
if
(
NF
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-NF"
);
NF
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+NF"
);
NF
=
true
;
}
gameObject
.
transform
.
Find
(
"NFButton"
).
GetComponent
<
Image
>().
color
=
(
NF
)
?
setcolor
:
notsetcolor
;
}
public
void
DPClicked
()
{
if
(
DP
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-DP"
);
DP
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+DP"
);
DP
=
true
;
}
gameObject
.
transform
.
Find
(
"DPButton"
).
GetComponent
<
Image
>().
color
=
(
DP
)
?
setcolor
:
notsetcolor
;
}
public
void
SLClicked
()
{
if
(
SL
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-SL"
);
SL
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+SL"
);
SL
=
true
;
}
gameObject
.
transform
.
Find
(
"SLButton"
).
GetComponent
<
Image
>().
color
=
(
SL
)
?
setcolor
:
notsetcolor
;
}
public
void
ERClicked
()
{
if
(
ER
)
{
auralizationMode
.
TriggerAuraStringChanged
(
"-ER"
);
ER
=
false
;
}
else
{
auralizationMode
.
TriggerAuraStringChanged
(
"+ER"
);
ER
=
true
;
}
gameObject
.
transform
.
Find
(
"ERButton"
).
GetComponent
<
Image
>().
color
=
(
ER
)
?
setcolor
:
notsetcolor
;
}
}
This diff is collapsed.
Click to expand it.
VAUListener.cs
+
1
−
0
View file @
7060d7c0
...
...
@@ -58,6 +58,7 @@ public class VAUListener : MonoBehaviour {
//uses the View- and Up-Vector to transmit the position of the listener to VA
void
SetListenerPositionOrientation
()
{
_VA
=
VAUAdapter
.
VA
;
t
=
GetComponent
<
Transform
>();
q
=
t
.
rotation
;
Vector3
up
=
q
*
Vector3
.
up
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment