Commit c8710d30 authored by radow's avatar radow
Browse files

life Volume manipulation in menu

parent 07b4d5ef
......@@ -3701,6 +3701,11 @@ Transform:
m_Father: {fileID: 293018160}
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &360153597 stripped
AudioSource:
m_CorrespondingSourceObject: {fileID: 8641154624883585234, guid: b414bc8affebbca4a9cc33e2d82e2321, type: 3}
m_PrefabInstance: {fileID: 98125364}
m_PrefabAsset: {fileID: 0}
--- !u!1 &376370082
GameObject:
m_ObjectHideFlags: 0
......@@ -5256,6 +5261,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 2462338283760437699, guid: 4d478efeeb9ee8c47b8e7051c9447071, type: 3}
m_PrefabInstance: {fileID: 509168130}
m_PrefabAsset: {fileID: 0}
--- !u!82 &514760272 stripped
AudioSource:
m_CorrespondingSourceObject: {fileID: 8641154624883585234, guid: b414bc8affebbca4a9cc33e2d82e2321, type: 3}
m_PrefabInstance: {fileID: 97827164}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &529448127
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -5864,6 +5874,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ec4d56c95c433404da0995599ff6f4e3, type: 3}
--- !u!82 &563002548 stripped
AudioSource:
m_CorrespondingSourceObject: {fileID: 1763208653947972394, guid: 53e8dabc22ecc1046b0753f0cba82074, type: 3}
m_PrefabInstance: {fileID: 166431561}
m_PrefabAsset: {fileID: 0}
--- !u!114 &577398088 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 509352233855055092, guid: 53e8dabc22ecc1046b0753f0cba82074, type: 3}
......@@ -9479,8 +9494,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 80755317906dff249a9192e55d1700b4, type: 3}
m_Name:
m_EditorClassIdentifier:
music: {fileID: 0}
effects: {fileID: 0}
music: {fileID: 1576512286}
effects: {fileID: 1176178455}
musicSource: {fileID: 539657712}
effectSources:
- {fileID: 539657713}
- {fileID: 563002548}
- {fileID: 2033533804}
- {fileID: 1254093723}
- {fileID: 985716526}
- {fileID: 837230754}
- {fileID: 360153597}
- {fileID: 514760272}
--- !u!1 &985716524
GameObject:
m_ObjectHideFlags: 0
......@@ -11806,7 +11831,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1653343607}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 2
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 1
m_OnValueChanged:
......@@ -15107,7 +15132,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 771620934}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 2
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 1
m_OnValueChanged:
......@@ -20136,6 +20161,11 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2029435179}
m_CullTransparentMesh: 0
--- !u!82 &2033533804 stripped
AudioSource:
m_CorrespondingSourceObject: {fileID: 1763208653947972394, guid: 53e8dabc22ecc1046b0753f0cba82074, type: 3}
m_PrefabInstance: {fileID: 1325301581}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2047249427
PrefabInstance:
m_ObjectHideFlags: 0
......
......@@ -8,14 +8,34 @@ public class Settings : MonoBehaviour
public Slider music;
public Slider effects;
public AudioSource musicSource;
float originalmusicVol;
public AudioSource[] effectSources;
float[] originalEffectVol;
private void Start()
{
originalmusicVol = musicSource.volume;
originalEffectVol = new float[effectSources.Length];
for(int i = 0; i<effectSources.Length; i++)
{
originalEffectVol[i] = effectSources[i].volume;
}
}
public void ChangedMusicVolume()
{
SettingsData.musicVolume = music.value;
musicSource.volume = originalmusicVol * music.value;
}
public void ChangedEffectsVolume()
{
SettingsData.effectsVolume = effects.value;
for (int i = 0; i < effectSources.Length; i++)
{
effectSources[i].volume = originalEffectVol[i]*effects.value;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment