< 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:300
Line coverage:57.1% (4 of 7)
Covered branches:0
Total branches:0

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