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