diff --git a/blueberryPeak/Assets/Prefabs/Char/Fox.prefab b/blueberryPeak/Assets/Prefabs/Char/Fox.prefab index 6c43f97..0ac1967 100644 --- a/blueberryPeak/Assets/Prefabs/Char/Fox.prefab +++ b/blueberryPeak/Assets/Prefabs/Char/Fox.prefab @@ -1,5 +1,101 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &5702588849178857392 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5083671953233951116} + - component: {fileID: 3243503616957313541} + - component: {fileID: 8423478738728291841} + - component: {fileID: 4515311524599380322} + m_Layer: 0 + m_Name: WindTrigger + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5083671953233951116 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5702588849178857392} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -321.15366, y: 0.28400004, z: -221.23799} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 235347041090592828} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3243503616957313541 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5702588849178857392} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 260ee457da111cf43a3f6f7b710b080f, type: 3} + m_Name: + m_EditorClassIdentifier: + windSpeedStep: 0.5 + initWindSpeed: 0 +--- !u!54 &8423478738728291841 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5702588849178857392} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!135 &4515311524599380322 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5702588849178857392} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &7412162412318340438 GameObject: m_ObjectHideFlags: 0 @@ -100,7 +196,6 @@ GameObject: - component: {fileID: 7486215183385803752} - component: {fileID: 3740866600301396226} - component: {fileID: 4006268237752810497} - - component: {fileID: 1700798004617451800} - component: {fileID: 7428965207623524320} m_Layer: 0 m_Name: Fox @@ -124,6 +219,7 @@ Transform: m_Children: - {fileID: 9079022367831066997} - {fileID: 1192606695672832816} + - {fileID: 5083671953233951116} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2136891312007936662 @@ -3008,20 +3104,6 @@ MonoBehaviour: scalingFactor: 1 m_posOffsetData: {fileID: 0} listenerMask: 1 ---- !u!114 &1700798004617451800 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7563270112099016041} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 260ee457da111cf43a3f6f7b710b080f, type: 3} - m_Name: - m_EditorClassIdentifier: - windSpeedStep: 0.5 - initWindSpeed: 0 --- !u!114 &7428965207623524320 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/blueberryPeak/Assets/Scenes/Market.unity b/blueberryPeak/Assets/Scenes/Market.unity index d536163..c8b172f 100644 --- a/blueberryPeak/Assets/Scenes/Market.unity +++ b/blueberryPeak/Assets/Scenes/Market.unity @@ -5128,10 +5128,34 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1700798004617451800, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: windSpeedStep + value: 40 + objectReference: {fileID: 0} + - target: {fileID: 3243503616957313541, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: initWindSpeed + value: 55 + objectReference: {fileID: 0} + - target: {fileID: 3243503616957313541, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: windSpeedStep + value: 5 + objectReference: {fileID: 0} - target: {fileID: 3740866600301396226, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} propertyPath: cameraTransform value: objectReference: {fileID: 1755022767} + - target: {fileID: 5083671953233951116, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5083671953233951116, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5083671953233951116, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7563270112099016041, guid: 5704dc66b89074156933e2ba70d2d2d7, type: 3} propertyPath: m_Name value: Fox diff --git a/blueberryPeak/Assets/Scripts/Wind.cs b/blueberryPeak/Assets/Scripts/Wind.cs index 3c62608..81af843 100644 --- a/blueberryPeak/Assets/Scripts/Wind.cs +++ b/blueberryPeak/Assets/Scripts/Wind.cs @@ -8,9 +8,13 @@ public class Wind : MonoBehaviour private GameObject Player; [SerializeField] float windSpeedStep = 0.1f; [SerializeField] float initWindSpeed; + + private float currentWindSpeed; // Declare and will be initialized in Start + // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { + currentWindSpeed = initWindSpeed; // Initialize currentWindSpeed AkSoundEngine.SetRTPCValue("WindSpeed", initWindSpeed); } @@ -20,37 +24,41 @@ public class Wind : MonoBehaviour } - Coroutine currentCoroutine; + private void OnTriggerEnter(Collider other) { - print("gnuisd "+other.tag); - - if (other.tag == "fastWind") + if (other.CompareTag("fastWind")) // Using CompareTag is more efficient { - ChangeWindSpeed(90); + StartCoroutine(ChangeWindSpeed(90)); Debug.Log("fast"); } - if (other.tag == "slowWind") + if (other.CompareTag("slowWind")) { - ChangeWindSpeed(20); + StartCoroutine(ChangeWindSpeed(20)); Debug.Log("slow"); } - if (other.tag == "midWind") + if (other.CompareTag("midWind")) { - ChangeWindSpeed(55); + StartCoroutine(ChangeWindSpeed(55)); Debug.Log("mid"); } } - - private float currentWindSpeed; + IEnumerator ChangeWindSpeed(float val) { - while (currentWindSpeed != val) + + while (!Mathf.Approximately(currentWindSpeed, val)) { - AkSoundEngine.SetRTPCValue("WindSpeed", currentWindSpeed+windSpeedStep); + print(val+ " " +currentWindSpeed); + // Move currentWindSpeed towards val by windSpeedStep * Time.deltaTime + currentWindSpeed = Mathf.MoveTowards(currentWindSpeed, val, windSpeedStep * Time.deltaTime); + AkSoundEngine.SetRTPCValue("WindSpeed", currentWindSpeed); yield return null; } + // Ensure the value is exactly 'val' when the loop finishes, to prevent minor floating point inaccuracies + currentWindSpeed = val; + AkSoundEngine.SetRTPCValue("WindSpeed", currentWindSpeed); } -} +} \ No newline at end of file diff --git a/blueberryPeak/blueberryPeak_WwiseProject/Actor-Mixer Hierarchy/Default Work Unit.wwu b/blueberryPeak/blueberryPeak_WwiseProject/Actor-Mixer Hierarchy/Default Work Unit.wwu index bea3422..7249103 100644 --- a/blueberryPeak/blueberryPeak_WwiseProject/Actor-Mixer Hierarchy/Default Work Unit.wwu +++ b/blueberryPeak/blueberryPeak_WwiseProject/Actor-Mixer Hierarchy/Default Work Unit.wwu @@ -43,135 +43,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 5 - - - 100 - 0 - 37 - - - - - - - - - - - - SFX - - - - - - - - - - 0 - 0 - 5 - - - 10 - 0 - 37 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1570,8 +1441,8 @@ - - + + SFX SoftWind.wav diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.bnk b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.bnk index 314bb65..ef526f1 100644 Binary files a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.bnk and b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.bnk differ diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.json b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.json index 0ddc106..35b0e84 100644 --- a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.json +++ b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.json @@ -10,7 +10,7 @@ "Type": "User", "GUID": "{06908B47-1934-4D5A-A87A-85E27E5AD6F8}", "Language": "SFX", - "Hash": "{D3B8101B-F763-3D1A-1A44-958084577EF0}", + "Hash": "{2B749381-907A-696D-D9DA-630B8D395DE1}", "ObjectPath": "\\SoundBanks\\Default Work Unit\\DefaultSoundBank", "ShortName": "DefaultSoundBank", "Path": "DefaultSoundBank.bnk", @@ -85,7 +85,7 @@ "Streaming": "false", "Location": "Memory", "ShortName": "SoftWind.wav", - "CachePath": "F1/{F1E6323C-D888-B79E-8632-B791040A772E}.wem" + "CachePath": "21/{2106DC81-4285-29C8-F3C1-BA5DC8310FC2}.wem" }, { "Id": "332011047", @@ -883,6 +883,6 @@ ] } ], - "FileHash": "{D0C4C5D9-B173-D76F-113C-6E0348512AEF}" + "FileHash": "{0155BD7D-0872-4822-89CD-05C27D7BFC5E}" } } \ No newline at end of file diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.txt b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.txt index 0008689..02fd5d2 100644 --- a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.txt +++ b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Mac/DefaultSoundBank.txt @@ -49,7 +49,7 @@ In Memory Audio ID Name Audio source file Wwise Object Path Notes Data Size 149370429 Ocean C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\9A\{9A20A00E-CF74-AAC0-2071-9616030414B1}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Ocean 1453244 215837708 Bird4 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\CA\{CA80A857-564A-BEA7-3893-199107722CFF}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Birds\Bird4 3776468 228784554 midWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\1E\{1E622216-ADC3-782E-2C15-9E4D80A76C33}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\midWind 39381736 - 242625633 SoftWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\F1\{F1E6323C-D888-B79E-8632-B791040A772E}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\SoftWind 2754376 + 242625633 SoftWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\21\{2106DC81-4285-29C8-F3C1-BA5DC8310FC2}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\SoftWind 289644 332011047 BackgroundMusic C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\F4\{F40AB1E6-0237-0E7B-3433-3BCE46BD83B6}.wem \Actor-Mixer Hierarchy\Default Work Unit\Music\BackgroundMusic 5646524 349722559 SandStep5 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\2F\{2FB1FCA9-B154-98C7-E813-B012DEA951A3}.wem \Actor-Mixer Hierarchy\Default Work Unit\Footsteps\SandFootsteps\SandStep5 27174 383621867 click1 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\2C\{2CB00E5D-AF6D-773B-FF21-C4D3E079FEF2}.wem \Actor-Mixer Hierarchy\Default Work Unit\UI\click1 15712 diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.bnk b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.bnk index 314bb65..ef526f1 100644 Binary files a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.bnk and b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.bnk differ diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.json b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.json index 84975f6..38511eb 100644 --- a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.json +++ b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.json @@ -10,7 +10,7 @@ "Type": "User", "GUID": "{06908B47-1934-4D5A-A87A-85E27E5AD6F8}", "Language": "SFX", - "Hash": "{D3B8101B-F763-3D1A-1A44-958084577EF0}", + "Hash": "{2B749381-907A-696D-D9DA-630B8D395DE1}", "ObjectPath": "\\SoundBanks\\Default Work Unit\\DefaultSoundBank", "ShortName": "DefaultSoundBank", "Path": "DefaultSoundBank.bnk", @@ -85,7 +85,7 @@ "Streaming": "false", "Location": "Memory", "ShortName": "SoftWind.wav", - "CachePath": "F1/{F1E6323C-D888-B79E-8632-B791040A772E}.wem" + "CachePath": "21/{2106DC81-4285-29C8-F3C1-BA5DC8310FC2}.wem" }, { "Id": "332011047", @@ -883,6 +883,6 @@ ] } ], - "FileHash": "{510129D9-7980-0F42-023D-E83ED1C2DA0C}" + "FileHash": "{B7C23E59-29E2-690C-204A-52572C8B5941}" } } \ No newline at end of file diff --git a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.txt b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.txt index 0008689..02fd5d2 100644 --- a/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.txt +++ b/blueberryPeak/blueberryPeak_WwiseProject/GeneratedSoundBanks/Windows/DefaultSoundBank.txt @@ -49,7 +49,7 @@ In Memory Audio ID Name Audio source file Wwise Object Path Notes Data Size 149370429 Ocean C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\9A\{9A20A00E-CF74-AAC0-2071-9616030414B1}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Ocean 1453244 215837708 Bird4 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\CA\{CA80A857-564A-BEA7-3893-199107722CFF}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Birds\Bird4 3776468 228784554 midWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\1E\{1E622216-ADC3-782E-2C15-9E4D80A76C33}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\midWind 39381736 - 242625633 SoftWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\F1\{F1E6323C-D888-B79E-8632-B791040A772E}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\SoftWind 2754376 + 242625633 SoftWind C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\21\{2106DC81-4285-29C8-F3C1-BA5DC8310FC2}.wem \Actor-Mixer Hierarchy\Default Work Unit\Environment\Wind\SoftWind 289644 332011047 BackgroundMusic C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\F4\{F40AB1E6-0237-0E7B-3433-3BCE46BD83B6}.wem \Actor-Mixer Hierarchy\Default Work Unit\Music\BackgroundMusic 5646524 349722559 SandStep5 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\2F\{2FB1FCA9-B154-98C7-E813-B012DEA951A3}.wem \Actor-Mixer Hierarchy\Default Work Unit\Footsteps\SandFootsteps\SandStep5 27174 383621867 click1 C:\stPoelten\sem4\CCL4\ccl4NEW\blueberryPeak\blueberryPeak_WwiseProject\.cache\2C\{2CB00E5D-AF6D-773B-FF21-C4D3E079FEF2}.wem \Actor-Mixer Hierarchy\Default Work Unit\UI\click1 15712