< Summary

Class:AudioScriptableObjects
Assembly:ScriptableObjects
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/ScriptableObject/CommonScriptableObjects.cs
Covered lines:40
Uncovered lines:15
Coverable lines:55
Total lines:285
Line coverage:72.7% (40 of 55)
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;
 7    public static FloatVariable newApprovedFriends => CommonScriptableObjects.GetOrLoad(ref newApprovedFriendsValue, "Sc
 8
 9    private static FloatVariable pendingChatMessagesValue;
 10    public static FloatVariable pendingChatMessages => CommonScriptableObjects.GetOrLoad(ref pendingChatMessagesValue, "
 11
 12    private static FloatVariable pendingFriendRequestsValue;
 13    public static FloatVariable pendingFriendRequests => CommonScriptableObjects.GetOrLoad(ref pendingFriendRequestsValu
 14
 15    public static void UnloadAll()
 16    {
 17        Resources.UnloadAsset(newApprovedFriendsValue);
 18        Resources.UnloadAsset(pendingChatMessagesValue);
 19        Resources.UnloadAsset(pendingFriendRequestsValue);
 20    }
 21}
 22
 23public static class AudioScriptableObjects
 24{
 25    // Builder
 26
 27    private static AudioEvent builderEnterEvent;
 128    public static AudioEvent builderEnter => CommonScriptableObjects.GetOrLoad(ref builderEnterEvent, "ScriptableObjects
 29
 30    private static AudioEvent builderReadyEvent;
 131    public static AudioEvent builderReady => CommonScriptableObjects.GetOrLoad(ref builderReadyEvent, "ScriptableObjects
 32
 33    // Common UI
 34
 35    private static AudioEvent cameraFadeInEvent;
 036    public static AudioEvent cameraFadeIn => CommonScriptableObjects.GetOrLoad(ref cameraFadeInEvent, "ScriptableObjects
 37
 38    private static AudioEvent cameraFadeOutEvent;
 039    public static AudioEvent cameraFadeOut => CommonScriptableObjects.GetOrLoad(ref cameraFadeOutEvent, "ScriptableObjec
 40
 41    private static AudioEvent buttonHoverEvent;
 042    public static AudioEvent buttonHover => CommonScriptableObjects.GetOrLoad(ref buttonHoverEvent, "ScriptableObjects/A
 43
 44    private static AudioEvent buttonClickEvent;
 045    public static AudioEvent buttonClick => CommonScriptableObjects.GetOrLoad(ref buttonClickEvent, "ScriptableObjects/A
 46
 47    private static AudioEvent buttonReleaseEvent;
 048    public static AudioEvent buttonRelease => CommonScriptableObjects.GetOrLoad(ref buttonReleaseEvent, "ScriptableObjec
 49
 50    private static AudioEvent cancelEvent;
 051    public static AudioEvent cancel => CommonScriptableObjects.GetOrLoad(ref cancelEvent, "ScriptableObjects/AudioEvents
 52
 53    private static AudioEvent confirmEvent;
 054    public static AudioEvent confirm => CommonScriptableObjects.GetOrLoad(ref confirmEvent, "ScriptableObjects/AudioEven
 55
 56    private static AudioEvent dialogOpenEvent;
 6357    public static AudioEvent dialogOpen => CommonScriptableObjects.GetOrLoad(ref dialogOpenEvent, "ScriptableObjects/Aud
 58
 59    private static AudioEvent dialogCloseEvent;
 7560    public static AudioEvent dialogClose => CommonScriptableObjects.GetOrLoad(ref dialogCloseEvent, "ScriptableObjects/A
 61
 62    private static AudioEvent enableEvent;
 763    public static AudioEvent enable => CommonScriptableObjects.GetOrLoad(ref enableEvent, "ScriptableObjects/AudioEvents
 64
 65    private static AudioEvent errorEvent;
 066    public static AudioEvent error => CommonScriptableObjects.GetOrLoad(ref errorEvent, "ScriptableObjects/AudioEvents/H
 67
 68    private static AudioEvent disableEvent;
 32869    public static AudioEvent disable => CommonScriptableObjects.GetOrLoad(ref disableEvent, "ScriptableObjects/AudioEven
 70
 71    private static AudioEvent fadeInEvent;
 2272    public static AudioEvent fadeIn => CommonScriptableObjects.GetOrLoad(ref fadeInEvent, "ScriptableObjects/AudioEvents
 73
 74    private static AudioEvent fadeOutEvent;
 175    public static AudioEvent fadeOut => CommonScriptableObjects.GetOrLoad(ref fadeOutEvent, "ScriptableObjects/AudioEven
 76
 77    private static AudioEvent_WithPitchIncrement listItemAppearEvent;
 778    public static AudioEvent_WithPitchIncrement listItemAppear => CommonScriptableObjects.GetOrLoad(ref listItemAppearEv
 79
 80    private static AudioEvent chatReceiveGlobalEvent;
 081    public static AudioEvent chatReceiveGlobal => CommonScriptableObjects.GetOrLoad(ref chatReceiveGlobalEvent, "Scripta
 82
 83    private static AudioEvent chatReceivePrivateEvent;
 084    public static AudioEvent chatReceivePrivate => CommonScriptableObjects.GetOrLoad(ref chatReceivePrivateEvent, "Scrip
 85
 86    private static AudioEvent chatSendEvent;
 087    public static AudioEvent chatSend => CommonScriptableObjects.GetOrLoad(ref chatSendEvent, "ScriptableObjects/AudioEv
 88
 89    private static AudioEvent notificationEvent;
 5390    public static AudioEvent notification => CommonScriptableObjects.GetOrLoad(ref notificationEvent, "ScriptableObjects
 91
 92    private static AudioEvent sliderValueChangeEvent;
 4093    public static AudioEvent sliderValueChange => CommonScriptableObjects.GetOrLoad(ref sliderValueChangeEvent, "Scripta
 94
 95    private static AudioEvent inputFieldFocusEvent;
 096    public static AudioEvent inputFieldFocus => CommonScriptableObjects.GetOrLoad(ref inputFieldFocusEvent, "ScriptableO
 97
 98    private static AudioEvent inputFieldUnfocusEvent;
 099    public static AudioEvent inputFieldUnfocus => CommonScriptableObjects.GetOrLoad(ref inputFieldUnfocusEvent, "Scripta
 100
 101    private static AudioEvent UIHideEvent;
 1102    public static AudioEvent UIHide => CommonScriptableObjects.GetOrLoad(ref UIHideEvent, "ScriptableObjects/AudioEvents
 103
 104    private static AudioEvent UIShowEvent;
 0105    public static AudioEvent UIShow => CommonScriptableObjects.GetOrLoad(ref UIShowEvent, "ScriptableObjects/AudioEvents
 106
 107    private static AudioEvent tooltipPopupEvent;
 0108    public static AudioEvent tooltipPopup => CommonScriptableObjects.GetOrLoad(ref tooltipPopupEvent, "ScriptableObjects
 109
 110    public static void UnloadAll()
 111    {
 636112        Resources.UnloadAsset(builderEnterEvent);
 636113        Resources.UnloadAsset(builderReadyEvent);
 636114        Resources.UnloadAsset(cameraFadeInEvent);
 636115        Resources.UnloadAsset(cameraFadeOutEvent);
 636116        Resources.UnloadAsset(buttonHoverEvent);
 636117        Resources.UnloadAsset(buttonClickEvent);
 636118        Resources.UnloadAsset(buttonReleaseEvent);
 636119        Resources.UnloadAsset(cancelEvent);
 636120        Resources.UnloadAsset(confirmEvent);
 636121        Resources.UnloadAsset(dialogOpenEvent);
 636122        Resources.UnloadAsset(dialogCloseEvent);
 636123        Resources.UnloadAsset(enableEvent);
 636124        Resources.UnloadAsset(errorEvent);
 636125        Resources.UnloadAsset(disableEvent);
 636126        Resources.UnloadAsset(fadeInEvent);
 636127        Resources.UnloadAsset(fadeOutEvent);
 636128        Resources.UnloadAsset(listItemAppearEvent);
 636129        Resources.UnloadAsset(chatReceiveGlobalEvent);
 636130        Resources.UnloadAsset(chatReceivePrivateEvent);
 636131        Resources.UnloadAsset(chatSendEvent);
 636132        Resources.UnloadAsset(notificationEvent);
 636133        Resources.UnloadAsset(sliderValueChangeEvent);
 636134        Resources.UnloadAsset(inputFieldFocusEvent);
 636135        Resources.UnloadAsset(inputFieldUnfocusEvent);
 636136        Resources.UnloadAsset(UIHideEvent);
 636137        Resources.UnloadAsset(UIShowEvent);
 636138        Resources.UnloadAsset(tooltipPopupEvent);
 636139    }
 140}
 141
 142public static class CommonScriptableObjects
 143{
 144    private static Vector3Variable playerUnityPositionValue;
 145    public static Vector3Variable playerUnityPosition => GetOrLoad(ref playerUnityPositionValue, "ScriptableObjects/Play
 146
 147    private static Vector3Variable playerUnityEulerAnglesValue;
 148    public static Vector3Variable playerUnityEulerAngles => GetOrLoad(ref playerUnityEulerAnglesValue, "ScriptableObject
 149
 150    private static Vector3Variable worldOffsetValue;
 151    public static Vector3Variable worldOffset => GetOrLoad(ref worldOffsetValue, "ScriptableObjects/WorldOffset");
 152
 153    private static Vector2IntVariable playerCoordsValue;
 154    public static Vector2IntVariable playerCoords => GetOrLoad(ref playerCoordsValue, "ScriptableObjects/PlayerCoords");
 155
 156    private static BooleanVariable playerIsOnMovingPlatformValue;
 157    public static BooleanVariable playerIsOnMovingPlatform => GetOrLoad(ref playerIsOnMovingPlatformValue, "ScriptableOb
 158
 159    private static QuaternionVariable movingPlatformRotationDeltaValue;
 160    public static QuaternionVariable movingPlatformRotationDelta => GetOrLoad(ref movingPlatformRotationDeltaValue, "Scr
 161
 162    private static StringVariable sceneIDValue;
 163    public static StringVariable sceneID => GetOrLoad(ref sceneIDValue, "ScriptableObjects/SceneID");
 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 BooleanVariable builderInWorldNotNecessaryUIVisibilityStatusValue;
 208    public static BooleanVariable builderInWorldNotNecessaryUIVisibilityStatus => GetOrLoad(ref builderInWorldNotNecessa
 209
 210    private static LatestOpenChatsList latestOpenChatsValue;
 211    public static LatestOpenChatsList latestOpenChats => GetOrLoad(ref latestOpenChatsValue, "ScriptableObjects/LatestOp
 212
 213    private static CameraMode cameraModeValue;
 214    public static CameraMode cameraMode => GetOrLoad(ref cameraModeValue, "ScriptableObjects/CameraMode");
 215
 216    private static BooleanVariable cameraModeInputLockedValue;
 217    public static BooleanVariable cameraModeInputLocked => GetOrLoad(ref cameraModeInputLockedValue, "ScriptableObjects/
 218
 219    private static BooleanVariable isProfileHUDOpenValue;
 220    public static BooleanVariable isProfileHUDOpen => GetOrLoad(ref isProfileHUDOpenValue, "ScriptableObjects/IsProfileH
 221
 222    private static BooleanVariable isFullscreenHUDOpenValue;
 223    public static BooleanVariable isFullscreenHUDOpen => GetOrLoad(ref isFullscreenHUDOpenValue, "ScriptableObjects/IsAv
 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 emailPromptActiveValue;
 235    public static BooleanVariable emailPromptActive => GetOrLoad(ref emailPromptActiveValue, "ScriptableObjects/EmailPro
 236
 237    private static BooleanVariable voiceChatDisabledValue;
 238    public static BooleanVariable voiceChatDisabled => GetOrLoad(ref voiceChatDisabledValue, "ScriptableObjects/VoiceCha
 239
 240    public static T GetOrLoad<T>(ref T variable, string path) where T : Object
 241    {
 242        if (variable == null)
 243        {
 244            variable = Resources.Load<T>(path);
 245        }
 246
 247        return variable;
 248    }
 249
 250    public static void UnloadAll()
 251    {
 252        Resources.UnloadAsset(playerUnityPositionValue);
 253        Resources.UnloadAsset(playerUnityEulerAnglesValue);
 254        Resources.UnloadAsset(worldOffsetValue);
 255        Resources.UnloadAsset(playerCoordsValue);
 256        Resources.UnloadAsset(playerIsOnMovingPlatformValue);
 257        Resources.UnloadAsset(movingPlatformRotationDeltaValue);
 258        Resources.UnloadAsset(sceneIDValue);
 259        Resources.UnloadAsset(minimapZoomValue);
 260        Resources.UnloadAsset(characterForwardValue);
 261        Resources.UnloadAsset(cameraForwardValue);
 262        Resources.UnloadAsset(cameraPositionValue);
 263        Resources.UnloadAsset(cameraRightValue);
 264        Resources.UnloadAsset(cameraIsBlendingValue);
 265        Resources.UnloadAsset(cameraBlockedValue);
 266        Resources.UnloadAsset(playerInfoCardVisibleStateValue);
 267        Resources.UnloadAsset(forcePerformanceMeterValue);
 268        Resources.UnloadAsset(rendererStateValue);
 269        Resources.UnloadAsset(focusStateValue);
 270        Resources.UnloadAsset(lastReadChatMessagesDictionary);
 271        Resources.UnloadAsset(lastReadChatMessagesValue);
 272        Resources.UnloadAsset(allUIHiddenValue);
 273        Resources.UnloadAsset(builderInWorldNotNecessaryUIVisibilityStatusValue);
 274        Resources.UnloadAsset(latestOpenChatsValue);
 275        Resources.UnloadAsset(cameraModeValue);
 276        Resources.UnloadAsset(cameraModeInputLockedValue);
 277        Resources.UnloadAsset(isProfileHUDOpenValue);
 278        Resources.UnloadAsset(isFullscreenHUDOpenValue);
 279        Resources.UnloadAsset(isTaskbarHUDInitializedValue);
 280        Resources.UnloadAsset(tutorialActiveValue);
 281        Resources.UnloadAsset(featureKeyTriggersBlockedValue);
 282        Resources.UnloadAsset(emailPromptActiveValue);
 283        Resources.UnloadAsset(voiceChatDisabledValue);
 284    }
 285}