< Summary

Class:NotificationScriptableObjects
Assembly:ScriptableObjects
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/ScriptableObject/CommonScriptableObjects.cs
Covered lines:4
Uncovered lines:3
Coverable lines:7
Total lines:323
Line coverage:57.1% (4 of 7)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:4
Method coverage:25% (1 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UnloadAll()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/ScriptableObject/CommonScriptableObjects.cs

#LineLine coverage
 1using DCL.CameraTool;
 2using UnityEngine;
 3
 4public static class NotificationScriptableObjects
 5{
 6    private static FloatVariable newApprovedFriendsValue;
 07    public static FloatVariable newApprovedFriends => CommonScriptableObjects.GetOrLoad(ref newApprovedFriendsValue, "Sc
 8
 9    private static FloatVariable pendingChatMessagesValue;
 010    public static FloatVariable pendingChatMessages => CommonScriptableObjects.GetOrLoad(ref pendingChatMessagesValue, "
 11
 12    private static FloatVariable pendingFriendRequestsValue;
 013    public static FloatVariable pendingFriendRequests => CommonScriptableObjects.GetOrLoad(ref pendingFriendRequestsValu
 14
 15    public static void UnloadAll()
 16    {
 36317        Resources.UnloadAsset(newApprovedFriendsValue);
 36318        Resources.UnloadAsset(pendingChatMessagesValue);
 36319        Resources.UnloadAsset(pendingFriendRequestsValue);
 36320    }
 21}
 22
 23public static class AudioScriptableObjects
 24{
 25    // Common UI
 26
 27    private static AudioEvent cameraFadeInEvent;
 28    public static AudioEvent cameraFadeIn => CommonScriptableObjects.GetOrLoad(ref cameraFadeInEvent, "ScriptableObjects
 29
 30    private static AudioEvent cameraFadeOutEvent;
 31    public static AudioEvent cameraFadeOut => CommonScriptableObjects.GetOrLoad(ref cameraFadeOutEvent, "ScriptableObjec
 32
 33    private static AudioEvent buttonHoverEvent;
 34    public static AudioEvent buttonHover => CommonScriptableObjects.GetOrLoad(ref buttonHoverEvent, "ScriptableObjects/A
 35
 36    private static AudioEvent buttonClickEvent;
 37    public static AudioEvent buttonClick => CommonScriptableObjects.GetOrLoad(ref buttonClickEvent, "ScriptableObjects/A
 38
 39    private static AudioEvent equipEvent;
 40    public static AudioEvent equip => CommonScriptableObjects.GetOrLoad(ref equipEvent, "ScriptableObjects/AudioEvents/H
 41
 42    private static AudioEvent unequipEvent;
 43    public static AudioEvent unequip => CommonScriptableObjects.GetOrLoad(ref unequipEvent, "ScriptableObjects/AudioEven
 44
 45    private static AudioEvent hideEvent;
 46    public static AudioEvent hide => CommonScriptableObjects.GetOrLoad(ref hideEvent, "ScriptableObjects/AudioEvents/HUD
 47
 48    private static AudioEvent showEvent;
 49    public static AudioEvent show => CommonScriptableObjects.GetOrLoad(ref showEvent, "ScriptableObjects/AudioEvents/HUD
 50
 51    private static AudioEvent_WithRandomPitch inputEvent;
 52    public static AudioEvent_WithRandomPitch input => CommonScriptableObjects.GetOrLoad(ref inputEvent, "ScriptableObjec
 53
 54    private static AudioEvent buttonReleaseEvent;
 55    public static AudioEvent buttonRelease => CommonScriptableObjects.GetOrLoad(ref buttonReleaseEvent, "ScriptableObjec
 56
 57    private static AudioEvent cancelEvent;
 58    public static AudioEvent cancel => CommonScriptableObjects.GetOrLoad(ref cancelEvent, "ScriptableObjects/AudioEvents
 59
 60    private static AudioEvent confirmEvent;
 61    public static AudioEvent confirm => CommonScriptableObjects.GetOrLoad(ref confirmEvent, "ScriptableObjects/AudioEven
 62
 63    private static AudioEvent dialogOpenEvent;
 64    public static AudioEvent dialogOpen => CommonScriptableObjects.GetOrLoad(ref dialogOpenEvent, "ScriptableObjects/Aud
 65
 66    private static AudioEvent dialogCloseEvent;
 67    public static AudioEvent dialogClose => CommonScriptableObjects.GetOrLoad(ref dialogCloseEvent, "ScriptableObjects/A
 68
 69    private static AudioEvent enableEvent;
 70    public static AudioEvent enable => CommonScriptableObjects.GetOrLoad(ref enableEvent, "ScriptableObjects/AudioEvents
 71
 72    private static AudioEvent errorEvent;
 73    public static AudioEvent error => CommonScriptableObjects.GetOrLoad(ref errorEvent, "ScriptableObjects/AudioEvents/H
 74
 75    private static AudioEvent disableEvent;
 76    public static AudioEvent disable => CommonScriptableObjects.GetOrLoad(ref disableEvent, "ScriptableObjects/AudioEven
 77
 78    private static AudioEvent fadeInEvent;
 79    public static AudioEvent fadeIn => CommonScriptableObjects.GetOrLoad(ref fadeInEvent, "ScriptableObjects/AudioEvents
 80
 81    private static AudioEvent fadeOutEvent;
 82    public static AudioEvent fadeOut => CommonScriptableObjects.GetOrLoad(ref fadeOutEvent, "ScriptableObjects/AudioEven
 83
 84    private static AudioEvent_WithPitchIncrement listItemAppearEvent;
 85    public static AudioEvent_WithPitchIncrement listItemAppear => CommonScriptableObjects.GetOrLoad(ref listItemAppearEv
 86
 87    private static AudioEvent chatReceiveGlobalEvent;
 88    public static AudioEvent chatReceiveGlobal => CommonScriptableObjects.GetOrLoad(ref chatReceiveGlobalEvent, "Scripta
 89
 90    private static AudioEvent chatReceivePrivateEvent;
 91    public static AudioEvent chatReceivePrivate => CommonScriptableObjects.GetOrLoad(ref chatReceivePrivateEvent, "Scrip
 92
 93    private static AudioEvent chatReceiveMentionEvent;
 94    public static AudioEvent ChatReceiveMentionEvent => CommonScriptableObjects.GetOrLoad(ref chatReceiveMentionEvent, "
 95
 96    private static AudioEvent chatSendEvent;
 97    public static AudioEvent chatSend => CommonScriptableObjects.GetOrLoad(ref chatSendEvent, "ScriptableObjects/AudioEv
 98
 99    private static AudioEvent joinChannelEvent;
 100    public static AudioEvent joinChannel => CommonScriptableObjects.GetOrLoad(ref joinChannelEvent, "ScriptableObjects/A
 101
 102    private static AudioEvent leaveChannelEvent;
 103    public static AudioEvent leaveChannel => CommonScriptableObjects.GetOrLoad(ref leaveChannelEvent, "ScriptableObjects
 104
 105    private static AudioEvent notificationEvent;
 106    public static AudioEvent notification => CommonScriptableObjects.GetOrLoad(ref notificationEvent, "ScriptableObjects
 107
 108    private static AudioEvent sliderValueChangeEvent;
 109    public static AudioEvent sliderValueChange => CommonScriptableObjects.GetOrLoad(ref sliderValueChangeEvent, "Scripta
 110
 111    private static AudioEvent inputFieldFocusEvent;
 112    public static AudioEvent inputFieldFocus => CommonScriptableObjects.GetOrLoad(ref inputFieldFocusEvent, "ScriptableO
 113
 114    private static AudioEvent inputFieldUnfocusEvent;
 115    public static AudioEvent inputFieldUnfocus => CommonScriptableObjects.GetOrLoad(ref inputFieldUnfocusEvent, "Scripta
 116
 117    private static AudioEvent UIHideEvent;
 118    public static AudioEvent UIHide => CommonScriptableObjects.GetOrLoad(ref UIHideEvent, "ScriptableObjects/AudioEvents
 119
 120    private static AudioEvent UIShowEvent;
 121    public static AudioEvent UIShow => CommonScriptableObjects.GetOrLoad(ref UIShowEvent, "ScriptableObjects/AudioEvents
 122
 123    private static AudioEvent tooltipPopupEvent;
 124    public static AudioEvent tooltipPopup => CommonScriptableObjects.GetOrLoad(ref tooltipPopupEvent, "ScriptableObjects
 125
 126    private static AudioEvent friendRequestEvent;
 127    public static AudioEvent FriendRequestEvent => CommonScriptableObjects.GetOrLoad(ref friendRequestEvent, "Scriptable
 128
 129    private static AudioEvent takeScreenshotEvent;
 130    public static AudioEvent takeScreenshot => CommonScriptableObjects.GetOrLoad(ref takeScreenshotEvent, "ScriptableObj
 131
 132    public static void UnloadAll()
 133    {
 134        Resources.UnloadAsset(cameraFadeInEvent);
 135        Resources.UnloadAsset(cameraFadeOutEvent);
 136        Resources.UnloadAsset(buttonHoverEvent);
 137        Resources.UnloadAsset(buttonClickEvent);
 138        Resources.UnloadAsset(equipEvent);
 139        Resources.UnloadAsset(unequipEvent);
 140        Resources.UnloadAsset(buttonReleaseEvent);
 141        Resources.UnloadAsset(cancelEvent);
 142        Resources.UnloadAsset(confirmEvent);
 143        Resources.UnloadAsset(dialogOpenEvent);
 144        Resources.UnloadAsset(dialogCloseEvent);
 145        Resources.UnloadAsset(enableEvent);
 146        Resources.UnloadAsset(errorEvent);
 147        Resources.UnloadAsset(disableEvent);
 148        Resources.UnloadAsset(fadeInEvent);
 149        Resources.UnloadAsset(fadeOutEvent);
 150        Resources.UnloadAsset(listItemAppearEvent);
 151        Resources.UnloadAsset(chatReceiveGlobalEvent);
 152        Resources.UnloadAsset(chatReceivePrivateEvent);
 153        Resources.UnloadAsset(chatReceiveMentionEvent);
 154        Resources.UnloadAsset(chatSendEvent);
 155        Resources.UnloadAsset(joinChannelEvent);
 156        Resources.UnloadAsset(leaveChannelEvent);
 157        Resources.UnloadAsset(notificationEvent);
 158        Resources.UnloadAsset(sliderValueChangeEvent);
 159        Resources.UnloadAsset(inputFieldFocusEvent);
 160        Resources.UnloadAsset(inputFieldUnfocusEvent);
 161        Resources.UnloadAsset(UIHideEvent);
 162        Resources.UnloadAsset(UIShowEvent);
 163        Resources.UnloadAsset(tooltipPopupEvent);
 164        Resources.UnloadAsset(friendRequestEvent);
 165    }
 166}
 167
 168public static class CommonScriptableObjects
 169{
 170    private static Vector3Variable playerUnityPositionValue;
 171    public static Vector3Variable playerUnityPosition => GetOrLoad(ref playerUnityPositionValue, "ScriptableObjects/Play
 172
 173    private static Vector3Variable playerUnityEulerAnglesValue;
 174    public static Vector3Variable playerUnityEulerAngles => GetOrLoad(ref playerUnityEulerAnglesValue, "ScriptableObject
 175
 176    private static Vector3Variable worldOffsetValue;
 177    public static Vector3Variable worldOffset => GetOrLoad(ref worldOffsetValue, "ScriptableObjects/WorldOffset");
 178
 179    private static Vector2IntVariable playerCoordsValue;
 180    public static Vector2IntVariable playerCoords => GetOrLoad(ref playerCoordsValue, "ScriptableObjects/PlayerCoords");
 181
 182    private static BooleanVariable playerIsOnMovingPlatformValue;
 183    public static BooleanVariable playerIsOnMovingPlatform => GetOrLoad(ref playerIsOnMovingPlatformValue, "ScriptableOb
 184
 185    private static QuaternionVariable movingPlatformRotationDeltaValue;
 186    public static QuaternionVariable movingPlatformRotationDelta => GetOrLoad(ref movingPlatformRotationDeltaValue, "Scr
 187
 188    // private static StringVariable sceneIDValue;
 189    // public static StringVariable sceneID => GetOrLoad(ref sceneIDValue, "ScriptableObjects/SceneID");
 190    private static IntVariable sceneNumbervalue;
 191    public static IntVariable sceneNumber => GetOrLoad(ref sceneNumbervalue, "ScriptableObjects/SceneNumber");
 192
 193    private static FloatVariable minimapZoomValue;
 194    public static FloatVariable minimapZoom => GetOrLoad(ref minimapZoomValue, "ScriptableObjects/MinimapZoom");
 195
 196    private static Vector3NullableVariable characterForwardValue;
 197    public static Vector3NullableVariable characterForward => GetOrLoad(ref characterForwardValue, "ScriptableObjects/Ch
 198
 199    private static Vector3Variable cameraForwardValue;
 200    public static Vector3Variable cameraForward => GetOrLoad(ref cameraForwardValue, "ScriptableObjects/CameraForward");
 201
 202    private static Vector3Variable cameraPositionValue;
 203    public static Vector3Variable cameraPosition => GetOrLoad(ref cameraPositionValue, "ScriptableObjects/CameraPosition
 204
 205    private static Vector3Variable cameraRightValue;
 206    public static Vector3Variable cameraRight => GetOrLoad(ref cameraRightValue, "ScriptableObjects/CameraRight");
 207
 208    private static BooleanVariable cameraIsBlendingValue;
 209    public static BooleanVariable cameraIsBlending => GetOrLoad(ref cameraIsBlendingValue, "ScriptableObjects/CameraIsBl
 210
 211    private static BooleanVariable cameraBlockedValue;
 212    public static BooleanVariable cameraBlocked => GetOrLoad(ref cameraBlockedValue, "ScriptableObjects/CameraBlocked");
 213
 214    private static BooleanVariable playerInfoCardVisibleStateValue;
 215    public static BooleanVariable playerInfoCardVisibleState => GetOrLoad(ref playerInfoCardVisibleStateValue, "Scriptab
 216
 217    private static BooleanVariable forcePerformanceMeterValue;
 218    public static BooleanVariable forcePerformanceMeter => GetOrLoad(ref forcePerformanceMeterValue, "ScriptableObjects/
 219
 220    public static RendererState rendererState => GetOrLoad(ref rendererStateValue, "ScriptableObjects/RendererState");
 221    private static RendererState rendererStateValue;
 222
 223    public static BooleanVariable focusState => GetOrLoad(ref focusStateValue, "ScriptableObjects/FocusState");
 224    private static BooleanVariable focusStateValue;
 225
 226    private static ReadMessagesDictionary lastReadChatMessagesDictionary;
 227    public static ReadMessagesDictionary lastReadChatMessages => GetOrLoad(ref lastReadChatMessagesDictionary, "Scriptab
 228
 229    private static LongVariable lastReadChatMessagesValue;
 230    public static LongVariable lastReadWorldChatMessages => GetOrLoad(ref lastReadChatMessagesValue, "ScriptableObjects/
 231
 232    private static BooleanVariable allUIHiddenValue;
 233    public static BooleanVariable allUIHidden => GetOrLoad(ref allUIHiddenValue, "ScriptableObjects/AllUIHidden");
 234
 235    private static LatestOpenChatsList latestOpenChatsValue;
 236    public static LatestOpenChatsList latestOpenChats => GetOrLoad(ref latestOpenChatsValue, "ScriptableObjects/LatestOp
 237
 238    private static CameraMode cameraModeValue;
 239    public static CameraMode cameraMode => GetOrLoad(ref cameraModeValue, "ScriptableObjects/CameraMode");
 240
 241    private static BooleanVariable cameraModeInputLockedValue;
 242    public static BooleanVariable cameraModeInputLocked => GetOrLoad(ref cameraModeInputLockedValue, "ScriptableObjects/
 243
 244    private static BooleanVariable isProfileHUDOpenValue;
 245    public static BooleanVariable isProfileHUDOpen => GetOrLoad(ref isProfileHUDOpenValue, "ScriptableObjects/IsProfileH
 246
 247    private static BooleanVariable isFullscreenHUDOpenValue;
 248    public static BooleanVariable isFullscreenHUDOpen => GetOrLoad(ref isFullscreenHUDOpenValue, "ScriptableObjects/IsAv
 249
 250    private static BooleanVariable isLoadingHUDOpenValue;
 251    public static BooleanVariable isLoadingHUDOpen => GetOrLoad(ref isLoadingHUDOpenValue, "ScriptableObjects/IsLoadingH
 252
 253    private static BooleanVariable isTaskbarHUDInitializedValue;
 254    public static BooleanVariable isTaskbarHUDInitialized => GetOrLoad(ref isTaskbarHUDInitializedValue, "ScriptableObje
 255
 256    private static BooleanVariable tutorialActiveValue;
 257    public static BooleanVariable tutorialActive => GetOrLoad(ref tutorialActiveValue, "ScriptableObjects/TutorialActive
 258
 259    private static BooleanVariable featureKeyTriggersBlockedValue;
 260    public static BooleanVariable featureKeyTriggersBlocked => GetOrLoad(ref featureKeyTriggersBlockedValue, "Scriptable
 261
 262    private static BooleanVariable userMovementKeysBlockedValue;
 263    public static BooleanVariable userMovementKeysBlocked => GetOrLoad(ref userMovementKeysBlockedValue, "ScriptableObje
 264
 265    private static BooleanVariable emailPromptActiveValue;
 266    public static BooleanVariable emailPromptActive => GetOrLoad(ref emailPromptActiveValue, "ScriptableObjects/EmailPro
 267
 268    private static BooleanVariable voiceChatDisabledValue;
 269    public static BooleanVariable voiceChatDisabled => GetOrLoad(ref voiceChatDisabledValue, "ScriptableObjects/VoiceCha
 270
 271    private static BooleanVariable isScreenshotCameraActiveValue;
 272    public static BooleanVariable isScreenshotCameraActive => GetOrLoad(ref isScreenshotCameraActiveValue, "ScriptableOb
 273
 274    private static BooleanVariable adultContentSettingDeactivatedValue;
 275    public static BooleanVariable adultContentSettingDeactivated => GetOrLoad(ref adultContentSettingDeactivatedValue, "
 276
 277    public static T GetOrLoad<T>(ref T variable, string path) where T : Object
 278    {
 279        if (variable == null)
 280        {
 281            variable = Resources.Load<T>(path);
 282        }
 283
 284        return variable;
 285    }
 286
 287    public static void UnloadAll()
 288    {
 289        Resources.UnloadAsset(playerUnityPositionValue);
 290        Resources.UnloadAsset(playerUnityEulerAnglesValue);
 291        Resources.UnloadAsset(worldOffsetValue);
 292        Resources.UnloadAsset(playerCoordsValue);
 293        Resources.UnloadAsset(playerIsOnMovingPlatformValue);
 294        Resources.UnloadAsset(movingPlatformRotationDeltaValue);
 295        Resources.UnloadAsset(sceneNumbervalue);
 296        Resources.UnloadAsset(minimapZoomValue);
 297        Resources.UnloadAsset(characterForwardValue);
 298        Resources.UnloadAsset(cameraForwardValue);
 299        Resources.UnloadAsset(cameraPositionValue);
 300        Resources.UnloadAsset(cameraRightValue);
 301        Resources.UnloadAsset(cameraIsBlendingValue);
 302        Resources.UnloadAsset(cameraBlockedValue);
 303        Resources.UnloadAsset(playerInfoCardVisibleStateValue);
 304        Resources.UnloadAsset(forcePerformanceMeterValue);
 305        Resources.UnloadAsset(rendererStateValue);
 306        Resources.UnloadAsset(focusStateValue);
 307        Resources.UnloadAsset(lastReadChatMessagesDictionary);
 308        Resources.UnloadAsset(lastReadChatMessagesValue);
 309        Resources.UnloadAsset(allUIHiddenValue);
 310        Resources.UnloadAsset(latestOpenChatsValue);
 311        Resources.UnloadAsset(cameraModeValue);
 312        Resources.UnloadAsset(cameraModeInputLockedValue);
 313        Resources.UnloadAsset(isProfileHUDOpenValue);
 314        Resources.UnloadAsset(isFullscreenHUDOpenValue);
 315        Resources.UnloadAsset(isTaskbarHUDInitializedValue);
 316        Resources.UnloadAsset(tutorialActiveValue);
 317        Resources.UnloadAsset(featureKeyTriggersBlockedValue);
 318        Resources.UnloadAsset(userMovementKeysBlockedValue);
 319        Resources.UnloadAsset(emailPromptActiveValue);
 320        Resources.UnloadAsset(voiceChatDisabledValue);
 321        Resources.UnloadAsset(adultContentSettingDeactivatedValue);
 322    }
 323}