Commit d377a4c8 authored by Soraphis's avatar Soraphis

optimizing, reducing GC

death scenarios, reduced stuttering on UI updates
parent cbe2c22c
Pipeline #3139 failed with stages
in 28 minutes and 43 seconds
......@@ -185,11 +185,15 @@ namespace Hellmade.Sound
/// Updates the state of all audios of an audio dictionary
/// </summary>
/// <param name="audioDict">The audio dictionary to update</param>
private static List<int> _cachedKeys = new List<int>();
private static void UpdateAllAudio(Dictionary<int, Audio> audioDict)
{
_cachedKeys.Clear();
_cachedKeys.AddRange(audioDict.Keys);
// Go through all audios and update them
List<int> keys = new List<int>(audioDict.Keys);
foreach (int key in keys)
// List<int> keys = new List<int>(audioDict.Keys);
foreach (int key in _cachedKeys)
{
Audio audio = audioDict[key];
audio.Update();
......@@ -902,4 +906,4 @@ namespace Hellmade.Sound
#endregion
}
}
\ No newline at end of file
}
%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: 5e97038fbaadd4f51b86bcd30d2e76d4, type: 3}
m_Name: BatteryChanged
m_EditorClassIdentifier:
fileFormatVersion: 2
guid: c4f9b6ae6a518bb488cc2db565eba619
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -12,12 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0a0a93b9e675cc6429623243ce9245ab, type: 3}
m_Name: PlayerBattery
m_EditorClassIdentifier:
DeveloperDescription:
value: 75
developerDescription:
initialValue: 75
initialMin: 0
initialMax: 100
ValueChanged: {fileID: 0}
ValueChanged: {fileID: 11400000, guid: c4f9b6ae6a518bb488cc2db565eba619, type: 2}
MinChanged: {fileID: 0}
MaxChanged: {fileID: 0}
ValueChangedWithHistory: {fileID: 0}
......
......@@ -14718,9 +14718,9 @@ MonoBehaviour:
shipReference: {fileID: 11400000, guid: 312ddbab280ba9b4f8f02fb132e40fb2, type: 2}
hullHP: {fileID: 11400000, guid: b5cd1fd024a022546bbe3f0d244d052f, type: 2}
battery: {fileID: 11400000, guid: 23e0a70054e2e1d47b314e68ba44ee91, type: 2}
explosionPrefab: {fileID: 1521864103941165908, guid: dfdf597edc4dcab4eaaa0440dc3278e5,
type: 3}
movementController: {fileID: 2035417152135541231}
orientationController: {fileID: 0}
lightController: {fileID: 0}
rigidbody: {fileID: 2652880145155376905}
--- !u!54 &2652880145155376905
Rigidbody:
......@@ -14730,8 +14730,8 @@ Rigidbody:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2652880145155376907}
serializedVersion: 2
m_Mass: 1
m_Drag: 1.5
m_Mass: 3
m_Drag: 0.5
m_AngularDrag: 1.5
m_UseGravity: 0
m_IsKinematic: 0
......@@ -31490,6 +31490,10 @@ PrefabInstance:
propertyPath: m_Layer
value: 12
objectReference: {fileID: 0}
- target: {fileID: 9500000, guid: d76f60c259f93604c9a71e8b332fbb9a, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: 958263440bf6f63459088aeaafa34a45, type: 2}
- target: {fileID: 400086, guid: d76f60c259f93604c9a71e8b332fbb9a, type: 3}
propertyPath: m_LocalPosition.x
value: 0
......@@ -31534,10 +31538,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9500000, guid: d76f60c259f93604c9a71e8b332fbb9a, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: 958263440bf6f63459088aeaafa34a45, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d76f60c259f93604c9a71e8b332fbb9a, type: 3}
--- !u!1 &7815159424775506780 stripped
......
......@@ -277,6 +277,26 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &19913052 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 1691991535}
m_PrefabAsset: {fileID: 0}
--- !u!64 &19913053
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19913052}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &37723268
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -1806,6 +1826,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 138897034}
m_PrefabAsset: {fileID: 0}
--- !u!1 &143097558 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 368542384}
m_PrefabAsset: {fileID: 0}
--- !u!64 &143097559
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 143097558}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &149160600
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -3796,7 +3836,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.33056593, g: 0.33962262, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -4227,7 +4267,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.14578141, g: 0.23993288, b: 0.33962262, a: 0.5372549}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -5914,10 +5954,10 @@ Light:
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_Type: 1
m_Resolution: 0
m_CustomResolution: -1
m_Strength: 1
m_Strength: 0.657
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
......@@ -8912,7 +8952,7 @@ MonoBehaviour:
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
......@@ -9182,6 +9222,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 3
disableGameObject: 1
componentToDisable: {fileID: 0}
--- !u!1 &545219456
GameObject:
m_ObjectHideFlags: 0
......@@ -9677,6 +9719,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 564668263}
m_PrefabAsset: {fileID: 0}
--- !u!1 &568328352 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 1264462042}
m_PrefabAsset: {fileID: 0}
--- !u!64 &568328353
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 568328352}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &584549596
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -12689,6 +12751,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 734458963}
m_PrefabAsset: {fileID: 0}
--- !u!1 &742769826 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 661880624}
m_PrefabAsset: {fileID: 0}
--- !u!64 &742769827
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 742769826}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &749484075
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -13885,13 +13967,14 @@ GameObject:
- component: {fileID: 800640390}
- component: {fileID: 800640389}
- component: {fileID: 800640388}
- component: {fileID: 800640391}
m_Layer: 5
m_Name: ResearchBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &800640387
RectTransform:
m_ObjectHideFlags: 0
......@@ -13931,6 +14014,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 3
disableGameObject: 0
componentToDisable: {fileID: 800640391}
--- !u!114 &800640389
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -13978,6 +14063,27 @@ MonoBehaviour:
emptyBarImage: {fileID: 1402387729}
fullBarImage: {fileID: 1329709244}
progress: {fileID: 1114302345}
--- !u!223 &800640391
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 800640386}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!1001 &803163821
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -14260,7 +14366,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.28773582, g: 0.8853134, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -15751,7 +15857,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8018868, g: 0.8018868, b: 0.8018868, a: 0.39215687}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -16092,6 +16198,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 908015142}
m_PrefabAsset: {fileID: 0}
--- !u!1 &909912828 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 1984778350}
m_PrefabAsset: {fileID: 0}
--- !u!64 &909912829
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 909912828}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1 &919973627
GameObject:
m_ObjectHideFlags: 0
......@@ -16714,7 +16840,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -17442,6 +17568,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 3
disableGameObject: 1
componentToDisable: {fileID: 0}
--- !u!4 &990955357 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7769176216564966288, guid: 36ac39c8d6fe8d645958a6cf0e71da9f,
......@@ -18320,6 +18448,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1051899378}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1053878985 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 2089515983}
m_PrefabAsset: {fileID: 0}
--- !u!64 &1053878986
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1053878985}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &1055809163
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -19677,7 +19825,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -20799,7 +20947,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -21948,6 +22096,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1204883272}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1221487041 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 485394377}
m_PrefabAsset: {fileID: 0}
--- !u!64 &1221487042
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221487041}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &1225797475
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -24016,6 +24184,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1316623894}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1318327146 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 1508379299}
m_PrefabAsset: {fileID: 0}
--- !u!64 &1318327147
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1318327146}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &1324060694
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -24202,7 +24390,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.28773582, g: 0.8853134, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -24501,8 +24689,8 @@ MeshRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1347027921}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
......@@ -24719,7 +24907,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.9692263, b: 0.25943398, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -25155,6 +25343,26 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1378373369}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1383343260 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6747152089961565473, guid: c18e6e89073226547be11540698d2734,
type: 3}
m_PrefabInstance: {fileID: 764916712}
m_PrefabAsset: {fileID: 0}
--- !u!64 &1383343261
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1383343260}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: 0b7e04496e1704097823924870e74e6d, type: 3}
--- !u!1001 &1384298796
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -25350,7 +25558,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.13643645, g: 0.3543958, b: 0.3962264, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -26047,7 +26255,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.13643645, g: 0.3543958, b: 0.3962264, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -27113,7 +27321,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.3647059}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -28262,7 +28470,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -31944,6 +32152,7 @@ GameObject:
- component: {fileID: 1735783810}
- component: {fileID: 1735783812}
- component: {fileID: 1735783811}
- component: {fileID: 1735783813}
m_Layer: 5
m_Name: EnergyProgressbar
m_TagString: Untagged
......@@ -32023,6 +32232,27 @@ MonoBehaviour:
redBarImage: {fileID: 773622748}
delay: 1
changeSpeed: 1
--- !u!223 &1735783813
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1735783809}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!1 &1741210254
GameObject:
m_ObjectHideFlags: 0
......@@ -32444,7 +32674,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
......@@ -32845,6 +33075,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 3
disableGameObject: 1
componentToDisable: {fileID: 0}
--- !u!1 &1779656644
GameObject:
m_ObjectHideFlags: 0
......@@ -33303,6 +33535,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 3
disableGameObject: 1
componentToDisable: {fileID: 0}
--- !u!1001 &1790936219
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -35707,6 +35941,8 @@ MonoBehaviour:
ConstantValue: 0
Variable: {fileID: 0}
operator: 2
disableGameObject: 1
componentToDisable: {fileID: 0}
--- !u!1001 &1920317747
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -10,7 +10,6 @@ using _Game.ScriptsRefactored.General;
public class PauseMenuScript : MonoBehaviour, IInitable {
private const String MAIN_MENU = "MainMenuScene";
private const String PAUSE_MENU = "PauseMenuScene";
public TMP_Text inputScheme;
......@@ -35,10 +34,22 @@ public class PauseMenuScript : MonoBehaviour, IInitable {
input.enabled = true;
input.togglePauseMenu += TogglePanel;
hullIntegrity.ValueChanged.OnEvent += CheckForGameOver;
batteryCapacity.ValueChanged.OnEvent += CheckForGameOver;
}
private void CheckForGameOver(float value) {
if (value <= float.Epsilon) {
if(!gameObject.activeSelf) TogglePanel();
Time.timeScale = 1;
}
}
private void OnDestroy() {
input.togglePauseMenu -= TogglePanel;
hullIntegrity.ValueChanged.OnEvent -= CheckForGameOver;
batteryCapacity.ValueChanged.OnEvent -= CheckForGameOver;
}
private void TogglePanel() {
......