< 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:288
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    {
 46317        Resources.UnloadAsset(newApprovedFriendsValue);
 46318        Resources.UnloadAsset(pendingChatMessagesValue);
 46319        Resources.UnloadAsset(pendingFriendRequestsValue);
 46320    }
 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    public static void UnloadAll()
 109    {
 110        Resources.UnloadAsset(cameraFadeInEvent);
 111        Resources.UnloadAsset(cameraFadeOutEvent);
 112        Resources.UnloadAsset(buttonHoverEvent);
 113        Resources.UnloadAsset(buttonClickEvent);
 114        Resources.UnloadAsset(buttonReleaseEvent);
 115        Resources.UnloadAsset(cancelEvent);
 116        Resources.UnloadAsset(confirmEvent);
 117        Resources.UnloadAsset(dialogOpenEvent);
 118        Resources.UnloadAsset(dialogCloseEvent);
 119        Resources.UnloadAsset(enableEvent);
 120        Resources.UnloadAsset(errorEvent);
 121        Resources.UnloadAsset(disableEvent);
 122        Resources.UnloadAsset(fadeInEvent);
 123        Resources.UnloadAsset(fadeOutEvent);
 124        Resources.UnloadAsset(listItemAppearEvent);
 125        Resources.UnloadAsset(chatReceiveGlobalEvent);
 126        Resources.UnloadAsset(chatReceivePrivateEvent);
 127        Resources.UnloadAsset(chatSendEvent);
 128        Resources.UnloadAsset(joinChannelEvent);
 129        Resources.UnloadAsset(leaveChannelEvent);
 130        Resources.UnloadAsset(notificationEvent);
 131        Resources.UnloadAsset(sliderValueChangeEvent);
 132        Resources.UnloadAsset(inputFieldFocusEvent);
 133        Resources.UnloadAsset(inputFieldUnfocusEvent);
 134        Resources.UnloadAsset(UIHideEvent);
 135        Resources.UnloadAsset(UIShowEvent);
 136        Resources.UnloadAsset(tooltipPopupEvent);
 137    }
 138}
 139
 140public static class CommonScriptableObjects
 141{
 142    private static Vector3Variable playerUnityPositionValue;
 143    public static Vector3Variable playerUnityPosition => GetOrLoad(ref playerUnityPositionValue, "ScriptableObjects/Play
 144
 145    private static Vector3Variable playerUnityEulerAnglesValue;
 146    public static Vector3Variable playerUnityEulerAngles => GetOrLoad(ref playerUnityEulerAnglesValue, "ScriptableObject
 147
 148    private static Vector3Variable worldOffsetValue;
 149    public static Vector3Variable worldOffset => GetOrLoad(ref worldOffsetValue, "ScriptableObjects/WorldOffset");
 150
 151    private static Vector2IntVariable playerCoordsValue;
 152    public static Vector2IntVariable playerCoords => GetOrLoad(ref playerCoordsValue, "ScriptableObjects/PlayerCoords");
 153
 154    private static BooleanVariable playerIsOnMovingPlatformValue;
 155    public static BooleanVariable playerIsOnMovingPlatform => GetOrLoad(ref playerIsOnMovingPlatformValue, "ScriptableOb
 156
 157    private static QuaternionVariable movingPlatformRotationDeltaValue;
 158    public static QuaternionVariable movingPlatformRotationDelta => GetOrLoad(ref movingPlatformRotationDeltaValue, "Scr
 159
 160    // private static StringVariable sceneIDValue;
 161    // public static StringVariable sceneID => GetOrLoad(ref sceneIDValue, "ScriptableObjects/SceneID");
 162    private static IntVariable sceneNumbervalue;
 163    public static IntVariable sceneNumber => GetOrLoad(ref sceneNumbervalue, "ScriptableObjects/SceneNumber");
 164
 165    private static FloatVariable minimapZoomValue;
 166    public static FloatVariable minimapZoom => GetOrLoad(ref minimapZoomValue, "ScriptableObjects/MinimapZoom");
 167
 168    private static Vector3NullableVariable characterForwardValue;
 169    public static Vector3NullableVariable characterForward => GetOrLoad(ref characterForwardValue, "ScriptableObjects/Ch
 170
 171    private static Vector3Variable cameraForwardValue;
 172    public static Vector3Variable cameraForward => GetOrLoad(ref cameraForwardValue, "ScriptableObjects/CameraForward");
 173
 174    private static Vector3Variable cameraPositionValue;
 175    public static Vector3Variable cameraPosition => GetOrLoad(ref cameraPositionValue, "ScriptableObjects/CameraPosition
 176
 177    private static Vector3Variable cameraRightValue;
 178    public static Vector3Variable cameraRight => GetOrLoad(ref cameraRightValue, "ScriptableObjects/CameraRight");
 179
 180    private static BooleanVariable cameraIsBlendingValue;
 181    public static BooleanVariable cameraIsBlending => GetOrLoad(ref cameraIsBlendingValue, "ScriptableObjects/CameraIsBl
 182
 183    private static BooleanVariable cameraBlockedValue;
 184    public static BooleanVariable cameraBlocked => GetOrLoad(ref cameraBlockedValue, "ScriptableObjects/CameraBlocked");
 185
 186    private static BooleanVariable playerInfoCardVisibleStateValue;
 187    public static BooleanVariable playerInfoCardVisibleState => GetOrLoad(ref playerInfoCardVisibleStateValue, "Scriptab
 188
 189    private static BooleanVariable forcePerformanceMeterValue;
 190    public static BooleanVariable forcePerformanceMeter => GetOrLoad(ref forcePerformanceMeterValue, "ScriptableObjects/
 191
 192    public static RendererState rendererState => GetOrLoad(ref rendererStateValue, "ScriptableObjects/RendererState");
 193    private static RendererState rendererStateValue;
 194
 195    public static BooleanVariable focusState => GetOrLoad(ref focusStateValue, "ScriptableObjects/FocusState");
 196    private static BooleanVariable focusStateValue;
 197
 198    private static ReadMessagesDictionary lastReadChatMessagesDictionary;
 199    public static ReadMessagesDictionary lastReadChatMessages => GetOrLoad(ref lastReadChatMessagesDictionary, "Scriptab
 200
 201    private static LongVariable lastReadChatMessagesValue;
 202    public static LongVariable lastReadWorldChatMessages => GetOrLoad(ref lastReadChatMessagesValue, "ScriptableObjects/
 203
 204    private static BooleanVariable allUIHiddenValue;
 205    public static BooleanVariable allUIHidden => GetOrLoad(ref allUIHiddenValue, "ScriptableObjects/AllUIHidden");
 206
 207    private static LatestOpenChatsList latestOpenChatsValue;
 208    public static LatestOpenChatsList latestOpenChats => GetOrLoad(ref latestOpenChatsValue, "ScriptableObjects/LatestOp
 209
 210    private static CameraMode cameraModeValue;
 211    public static CameraMode cameraMode => GetOrLoad(ref cameraModeValue, "ScriptableObjects/CameraMode");
 212
 213    private static BooleanVariable cameraModeInputLockedValue;
 214    public static BooleanVariable cameraModeInputLocked => GetOrLoad(ref cameraModeInputLockedValue, "ScriptableObjects/
 215
 216    private static BooleanVariable isProfileHUDOpenValue;
 217    public static BooleanVariable isProfileHUDOpen => GetOrLoad(ref isProfileHUDOpenValue, "ScriptableObjects/IsProfileH
 218
 219    private static BooleanVariable isFullscreenHUDOpenValue;
 220    public static BooleanVariable isFullscreenHUDOpen => GetOrLoad(ref isFullscreenHUDOpenValue, "ScriptableObjects/IsAv
 221
 222    private static BooleanVariable isLoadingHUDOpenValue;
 223    public static BooleanVariable isLoadingHUDOpen => GetOrLoad(ref isLoadingHUDOpenValue, "ScriptableObjects/IsLoadingH
 224
 225    private static BooleanVariable isTaskbarHUDInitializedValue;
 226    public static BooleanVariable isTaskbarHUDInitialized => GetOrLoad(ref isTaskbarHUDInitializedValue, "ScriptableObje
 227
 228    private static BooleanVariable tutorialActiveValue;
 229    public static BooleanVariable tutorialActive => GetOrLoad(ref tutorialActiveValue, "ScriptableObjects/TutorialActive
 230
 231    private static BooleanVariable featureKeyTriggersBlockedValue;
 232    public static BooleanVariable featureKeyTriggersBlocked => GetOrLoad(ref featureKeyTriggersBlockedValue, "Scriptable
 233
 234    private static BooleanVariable userMovementKeysBlockedValue;
 235    public static BooleanVariable userMovementKeysBlocked => GetOrLoad(ref userMovementKeysBlockedValue, "ScriptableObje
 236
 237    private static BooleanVariable emailPromptActiveValue;
 238    public static BooleanVariable emailPromptActive => GetOrLoad(ref emailPromptActiveValue, "ScriptableObjects/EmailPro
 239
 240    private static BooleanVariable voiceChatDisabledValue;
 241    public static BooleanVariable voiceChatDisabled => GetOrLoad(ref voiceChatDisabledValue, "ScriptableObjects/VoiceCha
 242
 243    public static T GetOrLoad<T>(ref T variable, string path) where T : Object
 244    {
 245        if (variable == null)
 246        {
 247            variable = Resources.Load<T>(path);
 248        }
 249
 250        return variable;
 251    }
 252
 253    public static void UnloadAll()
 254    {
 255        Resources.UnloadAsset(playerUnityPositionValue);
 256        Resources.UnloadAsset(playerUnityEulerAnglesValue);
 257        Resources.UnloadAsset(worldOffsetValue);
 258        Resources.UnloadAsset(playerCoordsValue);
 259        Resources.UnloadAsset(playerIsOnMovingPlatformValue);
 260        Resources.UnloadAsset(movingPlatformRotationDeltaValue);
 261        Resources.UnloadAsset(sceneNumbervalue);
 262        Resources.UnloadAsset(minimapZoomValue);
 263        Resources.UnloadAsset(characterForwardValue);
 264        Resources.UnloadAsset(cameraForwardValue);
 265        Resources.UnloadAsset(cameraPositionValue);
 266        Resources.UnloadAsset(cameraRightValue);
 267        Resources.UnloadAsset(cameraIsBlendingValue);
 268        Resources.UnloadAsset(cameraBlockedValue);
 269        Resources.UnloadAsset(playerInfoCardVisibleStateValue);
 270        Resources.UnloadAsset(forcePerformanceMeterValue);
 271        Resources.UnloadAsset(rendererStateValue);
 272        Resources.UnloadAsset(focusStateValue);
 273        Resources.UnloadAsset(lastReadChatMessagesDictionary);
 274        Resources.UnloadAsset(lastReadChatMessagesValue);
 275        Resources.UnloadAsset(allUIHiddenValue);
 276        Resources.UnloadAsset(latestOpenChatsValue);
 277        Resources.UnloadAsset(cameraModeValue);
 278        Resources.UnloadAsset(cameraModeInputLockedValue);
 279        Resources.UnloadAsset(isProfileHUDOpenValue);
 280        Resources.UnloadAsset(isFullscreenHUDOpenValue);
 281        Resources.UnloadAsset(isTaskbarHUDInitializedValue);
 282        Resources.UnloadAsset(tutorialActiveValue);
 283        Resources.UnloadAsset(featureKeyTriggersBlockedValue);
 284        Resources.UnloadAsset(userMovementKeysBlockedValue);
 285        Resources.UnloadAsset(emailPromptActiveValue);
 286        Resources.UnloadAsset(voiceChatDisabledValue);
 287    }
 288}