Commit 0cf4b2c5 authored by Tommé Nöll's avatar Tommé Nöll
Browse files

Merge branch 'tomme'

parents d84163ca d25bd298
fileFormatVersion: 2
guid: c526fe1490ce03496af1e6d91ba540fa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 614e8a5273c3faf5ca1c757762551768, type: 3}
m_Name: 01_boss
m_EditorClassIdentifier:
clip: {fileID: 8300000, guid: f8033c59a96d086838a7efb6fd472a6e, type: 3}
targets: []
isLoop: 1
loopCounterpiece: {fileID: 0}
fileFormatVersion: 2
guid: 2e722e85c89001daf989843d84a26314
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f8033c59a96d086838a7efb6fd472a6e
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cc7696a6d185ddae7af0d6279f98c978
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1c9cae6a1b077f6afb14ffcb894cf4fd
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
......@@ -247,6 +247,7 @@ MonoBehaviour:
clip: {fileID: 8300000, guid: 70a430631e928114294b6a1fb960066c, type: 3}
volume: 0.5
timeUntilSoundIsPlayed: 5
timer: 0
--- !u!114 &5884834992861905281
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -307,3 +308,6 @@ MonoBehaviour:
soundVolumeScream2:
clip: {fileID: 8300000, guid: c12b13c7f6f66054f86b14e0f5331839, type: 3}
volume: 0.5
music:
- {fileID: 8300000, guid: cc7696a6d185ddae7af0d6279f98c978, type: 3}
- {fileID: 8300000, guid: 1c9cae6a1b077f6afb14ffcb894cf4fd, type: 3}
......@@ -106,7 +106,6 @@ GameObject:
- component: {fileID: 8811539149977030264}
- component: {fileID: 8811539149977030271}
- component: {fileID: 4797791628540356424}
- component: {fileID: 5104620888276671122}
- component: {fileID: 7087328957400987548}
m_Layer: 0
m_Name: MainCamera
......@@ -292,103 +291,6 @@ MonoBehaviour:
lookaheadDelay: 1
lookAheadSpeedMultiplier: 1
minSpeed: 0.05
--- !u!82 &5104620888276671122
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8811539149977030262}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -3742625869990079855, guid: 695b0927dcbd31e0bacecbafd1c34b15,
type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &7087328957400987548
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -402,5 +304,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
startMusic: {fileID: 11400000, guid: 03481490e47cb6e47b6d94c3e238efed, type: 2}
mixerGroup: {fileID: -3742625869990079855, guid: 695b0927dcbd31e0bacecbafd1c34b15,
type: 2}
startTime: 0
transitionLagOffset: 0
......@@ -8066,7 +8066,7 @@ PrefabInstance:
type: 3}
propertyPath: m_TargetTexture
value:
objectReference: {fileID: 2025839202}
objectReference: {fileID: 453277137}
- target: {fileID: 8811539149977030266, guid: 388a7af523fdebaafad4a5d1ae1a896b,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -8152,6 +8152,12 @@ PrefabInstance:
propertyPath: orthographic size
value: 7
objectReference: {fileID: 0}
- target: {fileID: 7087328957400987548, guid: 388a7af523fdebaafad4a5d1ae1a896b,
type: 3}
propertyPath: startMusic
value:
objectReference: {fileID: 11400000, guid: 2e722e85c89001daf989843d84a26314,
type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 388a7af523fdebaafad4a5d1ae1a896b, type: 3}
--- !u!1 &160827951
......@@ -331811,6 +331817,40 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!84 &453277137
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 1324
m_Height: 533
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 21
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &455893536
GameObject:
m_ObjectHideFlags: 0
......@@ -335839,6 +335879,26 @@ PrefabInstance:
propertyPath: m_Name
value: Hud Canvas
objectReference: {fileID: 0}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: pauseCan
value:
objectReference: {fileID: 1732090634}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: savepointo
value:
objectReference: {fileID: 1787965777}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: player
value:
objectReference: {fileID: 1876958555}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: optionCan
value:
objectReference: {fileID: 1598043037}
- target: {fileID: 4235653480055822335, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -335944,26 +336004,6 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: pauseCan
value:
objectReference: {fileID: 1732090634}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: savepointo
value:
objectReference: {fileID: 1787965777}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: player
value:
objectReference: {fileID: 1876958555}
- target: {fileID: 4235653480055822332, guid: 22f087369170b3c4cbbd6bd02b1c3a5a,
type: 3}
propertyPath: optionCan
value:
objectReference: {fileID: 1598043037}
- target: {fileID: 865960383, guid: 22f087369170b3c4cbbd6bd02b1c3a5a, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
......@@ -366157,6 +366197,21 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: maxStrength
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: exponent
value: 3.06
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: maxStrengthDistanceFactor
value: 0.093
objectReference: {fileID: 0}
- target: {fileID: 5546039070061430727, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -366177,21 +366232,6 @@ PrefabInstance:
propertyPath: m_LocalScale.y
value: 232.8
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: maxStrength
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: exponent
value: 3.06
objectReference: {fileID: 0}
- target: {fileID: 6635821371766515316, guid: 5f19e99694f67a245b4244a6b9f38023,
type: 3}
propertyPath: maxStrengthDistanceFactor
value: 0.093
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5f19e99694f67a245b4244a6b9f38023, type: 3}
--- !u!4 &1033755150 stripped
......@@ -445816,6 +445856,31 @@ PrefabInstance:
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Close
objectReference: {fileID: 0}
- target: {fileID: 1543663832169700656, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1543663832169700656, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1543663832169700656, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8405073730646206122, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8405073730646206122, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c40aeaa0bb0a42c48a09a6d3cb5bfbad, type: 3}
--- !u!224 &1598043036 stripped
......@@ -447562,16 +447627,16 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9062855885143663086, guid: a1e0107a2375e1140a669c1da0647f9a,
type: 3}
propertyPath: health
value:
objectReference: {fileID: 537876554}
- target: {fileID: 2369621432931620814, guid: a1e0107a2375e1140a669c1da0647f9a,
type: 3}
propertyPath: scene
value:
objectReference: {fileID: 537876553}
- target: {fileID: 9062855885143663086, guid: a1e0107a2375e1140a669c1da0647f9a,
type: 3}
propertyPath: health
value:
objectReference: {fileID: 537876554}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a1e0107a2375e1140a669c1da0647f9a, type: 3}
--- !u!1 &1632856609
......@@ -452098,6 +452163,16 @@ PrefabInstance:
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Continue
objectReference: {fileID: 0}
- target: {fileID: 5793228997577829763, guid: 850f8a4a61e474549807b0db4aa70b32,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 537876553}
- target: {fileID: 5793228997577829763, guid: 850f8a4a61e474549807b0db4aa70b32,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ReloadScene
objectReference: {fileID: 0}
- target: {fileID: 5793228997190902991, guid: 850f8a4a61e474549807b0db4aa70b32,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
......@@ -452128,16 +452203,6 @@ PrefabInstance:
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 5793228997577829763, guid: 850f8a4a61e474549807b0db4aa70b32,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 537876553}
- target: {fileID: 5793228997577829763, guid: 850f8a4a61e474549807b0db4aa70b32,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ReloadScene
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 850f8a4a61e474549807b0db4aa70b32, type: 3}
--- !u!223 &1732090634 stripped
......@@ -465507,40 +465572,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!84 &2025839202
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 500
m_Height: 233
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 21
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &2030040801
GameObject:
m_ObjectHideFlags: 0
using UnityEngine;
using UnityEngine.Audio;
public class BackgroundMusic : MonoBehaviour {
......@@ -7,6 +8,7 @@ public class BackgroundMusic : MonoBehaviour {
//public AudioClip Ambience, Combat;
public MusicObject startMusic;
public AudioMixerGroup mixerGroup;
private MusicObject currentMusic, queuedMusic;
public int startTime = 0;
public int transitionLagOffset = 2000;
......@@ -14,11 +16,14 @@ public class BackgroundMusic : MonoBehaviour {
private bool inTransition = false;
private int preTransitionSample = 0;
private double lastUpdate = 0;
private float fadePerSecond = -1f;
// Use this for initialization
void Start () {
startTime *= startMusic.clip.frequency;
AS = new AudioSource[] {gameObject.AddComponent<AudioSource>(), gameObject.AddComponent<AudioSource>()};
AS[0].outputAudioMixerGroup = mixerGroup;
AS[1].outputAudioMixerGroup = mixerGroup;
Play(startMusic, 0, startTime);
MusicObject startMusicLoop = startMusic.loopCounterpiece;
......@@ -34,10 +39,18 @@ public class BackgroundMusic : MonoBehaviour {
if (AS[current].timeSamples != preTransitionSample)
{
inTransition = false;
AS[1 - current].volume = 1;
fadePerSecond = -1;
Debug.Log("Music transition complete, playing " + AS[current].clip.name +
"\nSample new: " + AS[current].timeSamples + ", Sample old: " + AS[1-current].timeSamples +
"\nCurrent global time: " + AudioSettings.dspTime + ", Last update at " + lastUpdate);
}
if (fadePerSecond >= 0 && AS[1 - current].isPlaying)
{
AS[1 - current].volume -= fadePerSecond * Time.deltaTime;
}
/*else
{
lastUpdate = AudioSettings.dspTime;
......@@ -72,7 +85,7 @@ public class BackgroundMusic : MonoBehaviour {
"\nCurrent Global Time: " + AudioSettings.dspTime);
}
public void TransitionTo(MusicObject target)
public void TransitionTo(MusicObject target, float fadeDuration = -1)
{
if (inTransition)
{
......@@ -86,6 +99,13 @@ public class BackgroundMusic : MonoBehaviour {
}
inTransition = true;
if (fadeDuration >= 0)
{
fadePerSecond = 1 / fadeDuration;
Play(target, AS[current].timeSamples + (int)(AS[current].clip.frequency * fadeDuration), 0);
return;
}
int iTarget;
for (iTarget = 0; iTarget < currentMusic.targets.Length; iTarget++) //search for TransitionTarget that matches target
......
......@@ -20,4 +20,11 @@ public class MusicObject : ScriptableObject {
public bool isLoop = false;
[Tooltip("The non-looped version if this song is looped (required), the looped version otherwise (optional).")]
public MusicObject loopCounterpiece;
public MusicObject() {}
public MusicObject(AudioClip clip)
{
this.clip = clip;
isLoop = true;
}
}
......@@ -54,6 +54,8 @@ public class BossAI : MonoBehaviour
//CameraShake der MainCamera
public CameraShake cameraShake;
private BackgroundMusic bgMusic;
//Events, die während des Phasenwechsels screen shake den Bildschirm schwarz und wieder sichtbar machen
public UnityEvent screenShake;
public UnityEvent fadeToBlack;
......@@ -71,7 +73,8 @@ public class BossAI : MonoBehaviour
[SerializeField] private AudioSource audioSource;
[SerializeField] private SoundVolume soundVolumeHit;
[SerializeField] private SoundVolume soundVolumeScream1;