├── .github ├── .gitignore ├── CHANGELOG.md ├── LICENSE └── README.md ├── Scripts.meta ├── Scripts ├── _Core.meta └── _Core │ ├── Editor.meta │ ├── Editor │ ├── EditorConstants.cs │ ├── EditorConstants.cs.meta │ ├── EditorIcons.meta │ ├── EditorIcons │ │ ├── ScriptableBool_Icon.png │ │ ├── ScriptableBool_Icon.png.meta │ │ ├── ScriptableColor_Icon.png │ │ ├── ScriptableColor_Icon.png.meta │ │ ├── ScriptableFloat_Icon.png │ │ ├── ScriptableFloat_Icon.png.meta │ │ ├── ScriptableGameObject_Icon.png │ │ ├── ScriptableGameObject_Icon.png.meta │ │ ├── ScriptableGradient_Icon.png │ │ ├── ScriptableGradient_Icon.png.meta │ │ ├── ScriptableInt_Icon.png │ │ ├── ScriptableInt_Icon.png.meta │ │ ├── ScriptableSprite_Icon.png │ │ ├── ScriptableSprite_Icon.png.meta │ │ ├── ScriptableString_Icon.png │ │ └── ScriptableString_Icon.png.meta │ ├── ScriptableBool_Editor_Drawer.cs │ ├── ScriptableBool_Editor_Drawer.cs.meta │ ├── ScriptableColor_Editor_Drawer.cs │ ├── ScriptableColor_Editor_Drawer.cs.meta │ ├── ScriptableFloat_Editor_Drawer.cs │ ├── ScriptableFloat_Editor_Drawer.cs.meta │ ├── ScriptableGameObject_Editor_Drawer.cs │ ├── ScriptableGameObject_Editor_Drawer.cs.meta │ ├── ScriptableGradient_Editor_Drawer.cs │ ├── ScriptableGradient_Editor_Drawer.cs.meta │ ├── ScriptableInt_Editor_Drawer.cs │ ├── ScriptableInt_Editor_Drawer.cs.meta │ ├── ScriptableSprite_Editor_Drawer.cs │ ├── ScriptableSprite_Editor_Drawer.cs.meta │ ├── ScriptableString_Editor_Drawer.cs │ ├── ScriptableString_Editor_Drawer.cs.meta │ ├── ScriptableVariable_Editor.cs │ ├── ScriptableVariable_Editor.cs.meta │ ├── ScriptableVariable_PropertyDrawer.cs │ ├── ScriptableVariable_PropertyDrawer.cs.meta │ ├── zeshmouttsassets.unityscriptablevariables.editor.asmdef │ └── zeshmouttsassets.unityscriptablevariables.editor.asmdef.meta │ ├── MenuPathConstants.cs │ ├── MenuPathConstants.cs.meta │ ├── ScriptableBool.cs │ ├── ScriptableBool.cs.meta │ ├── ScriptableColor.cs │ ├── ScriptableColor.cs.meta │ ├── ScriptableFloat.cs │ ├── ScriptableFloat.cs.meta │ ├── ScriptableGameObject.cs │ ├── ScriptableGameObject.cs.meta │ ├── ScriptableGradient.cs │ ├── ScriptableGradient.cs.meta │ ├── ScriptableInt.cs │ ├── ScriptableInt.cs.meta │ ├── ScriptableSprite.cs │ ├── ScriptableSprite.cs.meta │ ├── ScriptableString.cs │ ├── ScriptableString.cs.meta │ ├── ScriptableVariable.cs │ └── ScriptableVariable.cs.meta ├── package.json ├── package.json.meta ├── zeshmouttsassets.unityscriptablevariables.asmdef └── zeshmouttsassets.unityscriptablevariables.asmdef.meta /.github/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Autogenerated Jetbrains Rider plugin 23 | [Aa]ssets/Plugins/Editor/JetBrains* 24 | 25 | # Visual Studio cache directory 26 | .vs/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | 64 | -------------------------------------------------------------------------------- /.github/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this package will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/), and this project *somewhat* adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 5 | 6 | ## [1.1.0] - 2021-07-02 7 | - Code cleanup and bug fixes 8 | 9 | ## [1.0.0] - 2020-06-01 10 | ### First release 11 | - Added the required parts to turn it into a valid package 12 | - Updated README.md -------------------------------------------------------------------------------- /.github/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 ZeShmoutt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/README.md: -------------------------------------------------------------------------------- 1 | # Yet another ScriptableVariable framework 2 | 3 | A way of storing common types as references in your assets. 4 | 5 | 6 | 7 | ## Uses and restrictions 8 | 9 | As per the MIT license, this is pretty much unrestricted in use and modification. 10 | 11 | I'd appreciate a lot if you could mention me somewhere if you use it, though. 12 | 13 | ## Links 14 | 15 | - [License](LICENSE) 16 | - [Changelog](CHANGELOG.md) 17 | 18 | ## Installation 19 | 20 | - Unity 2019 or newer : Open the Package manager, select and import the package with the git URL. 21 | - Unity 2018 or older : Clone/download the repo and put it in your Unity project's assets. 22 | 23 | ----- 24 | 25 | ## Why would I need to store variables in ScriptableObjects ? 26 | 27 | This git is essentially my implementation of the talk [*Game Architecture with Scriptable Objects*](https://www.youtube.com/watch?v=raQ3iHhE_Kk) by Ryan Hipple, so I highly recommend to watch it to fully understand. 28 | 29 | In short, it's about modularity. 30 | 31 | ## How to create a ScriptableVariable 32 | 33 | As usual with ScriptableObjects : 34 | 35 | * Using Unity's menu bar : `Assets/Create/ZeShmoutt's Assets/Data Containers/Scriptable Variables/` 36 | * In the Project window : `Create/ZeShmoutt's Assets/Data Containers/Scriptable Variables/` 37 | 38 | ## How to use in your scripts 39 | 40 | **Step 1 :** Add `using ZeShmouttsAssets.DataContainers;` at the top with the other `using`s. 41 | 42 | **Step 2 :** Use a ScriptableVariable like any other variable type. Please note that the generic `ScriptableVariable` type is marked as `abstract`, so use the subtypes instead (`ScriptableBool`, `ScriptableFloat`, and so on), as you can't instantiate the generic version. 43 | 44 | **Note :** 45 | 46 | This version of ScriptableVariables has been made with seamless integration in mind, so : 47 | 48 | * ScriptableVariables are affected by operators just like the type they represent : `1 + ScriptableFloatOfValue4` would result in 5 as if you directly did `1 + 4`. 49 | * The `ScriptableVariable.ToString()` method is actually a shortcut for `ScriptableVariable.value.ToString()`. 50 | * The `ScriptableGradient` subtype has a shortcut for `Evaluate()`. 51 | * **IMPORTANT :** While `if(ScriptableBool)` is usually interpreted as `if the ScriptableBool object exists`, due to the implicit conversion it will be interpreted as `if the ScriptableBool's value is true`. **This is fully intentional** (and it will also return false properly if the ScriptableBool object doesn't exist) - however it means that you can't distinguish between `the ScriptableBool object doesn't exist` and `the ScriptableBool's value is false`. I can't think of a case where the distinction might be important considering how ScriptableVariables are intended to be used, but keep that in mind anyway, okay ? 52 | 53 | On top of that, ScriptableVariables use a runtime value, that can be safely modified without touching the original value set in the editor. The original value itself is pretty much inaccessible anyway. 54 | 55 | ## How to create additional ScriptableVariable subtypes 56 | 57 | Copy any of the existing subtypes, and change the generic type and whatever else you want. As an example, a custom ScriptableTexture subtype created from a copy of the ScriptableString : 58 | 59 | using UnityEngine; 60 | 61 | namespace ZeShmouttsAssets.DataContainers 62 | { 63 | [CreateAssetMenu(menuName = EditorScripts.EditorConstants.MenuNamePath + "Texture", fileName = "New Texture")] 64 | public class ScriptableTexture : ScriptableVariable 65 | { 66 | // Whatever additional features you need. 67 | } 68 | } 69 | 70 | That's it. All the features of the base version, by replacing exactly 4 words from "String" to "Texture". 71 | 72 | Optionally, you can also duplicate the corresponding Editor script to get that fancy inspector and property drawer. 73 | 74 | using UnityEditor; 75 | using UnityEngine; 76 | 77 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 78 | { 79 | [CustomEditor(typeof(ScriptableTexture))] 80 | public class ScriptableTexture_Editor : ScriptableVariable_Editor 81 | { 82 | // Whatever additional features you need. 83 | } 84 | 85 | [CustomPropertyDrawer(typeof(ScriptableBool))] 86 | public class ScriptableTexture_Drawer : ScriptableVariable_Drawer 87 | { 88 | #region Type-specific parts 89 | 90 | protected override void DrawValueWhenNull(Rect position) 91 | { 92 | EditorGUI.LabelField(position, GUIContent.none, new GUIContent("None (Texture)")); 93 | } 94 | 95 | #endregion 96 | } 97 | } 98 | 99 | Note the `DrawValueWhenNull()` method : this is the shortcut field drawn by the property drawer when there's no ScriptableVariable assigned to get a value from. The base version from `ScriptableVariable` displays a label field with a dynamic type : 100 | 101 | EditorGUI.LabelField(position, GUIContent.none, new GUIContent(string.Format("None ({0})", typeof(T).Name))); 102 | 103 | But you might want to override it to get a custom display, like what is done for the ScriptableColor (displaying a color field) and ScriptableSprite (displaying a custom label with a sprite icon) subtypes. 104 | -------------------------------------------------------------------------------- /Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ff49315534607a48bb8087d5b544de9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/_Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13059e6dced04744ab9d06b0d38601ad 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ce36bce28d4e814b833f82eba705ff8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorConstants.cs: -------------------------------------------------------------------------------- 1 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 2 | { 3 | /// 4 | /// Editor constants used for ScriptableVariable editor stuff. 5 | /// 6 | public static class EditorConstants 7 | { 8 | internal const string FIELD_SCRIPT = "m_Script"; 9 | internal const string FIELD_VALUE_BASE = "m_valueBase"; 10 | internal const string FIELD_VALUE_RUNTIME = "m_valueRuntime"; 11 | internal const string FIELD_READ_ONLY = "m_readOnly"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorConstants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e79a7d13ecb7ed549b576ece01a751b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e54810fd81ed35e4db70edce8c95b113 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableBool_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableBool_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableBool_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce1268d5d6f6b93468b1e3a77c38136f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: ef4ba8475d039a14cb665f0d5b541835 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableColor_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableColor_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableColor_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ed31b44b7abd934ab7f92b82f6fb34a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: f3eab055134dbb14084e1ef09a7f38b3 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableFloat_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableFloat_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableFloat_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97eccd9ea95a070469abbc1a6e617d97 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 02fa77d5d0762294295ef9ebe6b1e3b0 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableGameObject_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableGameObject_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableGameObject_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83bfccc7220614145a9b7917a70c6a19 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 7a6dea5379eab844894a3e015bbccdd4 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableGradient_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableGradient_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableGradient_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8db0456621a0a5746851098b96497dd4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 27820d0320ca04c41b2901270161c5c2 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableInt_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableInt_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableInt_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29c1ae6eedbfed647a5625702a64611a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: b2e2814b53e70db4fa39e62e59570d17 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableSprite_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableSprite_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableSprite_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 918001482a6206d4e987dc56987e2fa2 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 7e7bcf54803dd604dad6bc1e62ea8d3a 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableString_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeShmoutt/Unity-ScriptableVariables/3f59064ebc91bff4d23658482ae31dcd1da4c88a/Scripts/_Core/Editor/EditorIcons/ScriptableString_Icon.png -------------------------------------------------------------------------------- /Scripts/_Core/Editor/EditorIcons/ScriptableString_Icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7526ec4f46ddf44a8e9459d66b1ffae 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 2 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 128 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 128 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 128 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 128 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 8d9f8a6e792333e46bacf48803ddbd12 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableBool_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableBool))] 7 | public class ScriptableBool_Editor : ScriptableVariable_Editor 8 | { 9 | #region Type-specific parts 10 | 11 | protected override void DrawRuntimeValueField(bool _value, string _label) 12 | { 13 | EditorGUILayout.Toggle(_label, _value); 14 | } 15 | 16 | #endregion 17 | } 18 | 19 | [CustomPropertyDrawer(typeof(ScriptableBool))] 20 | public class ScriptableBool_Drawer : ScriptableVariable_Drawer 21 | { 22 | #region Type-specific parts 23 | 24 | protected override void DrawValueWhenNull(Rect _position) 25 | { 26 | EditorGUI.Toggle(_position, GUIContent.none, default); 27 | } 28 | 29 | #endregion 30 | } 31 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableBool_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72cf532474d96d5489ab0feb6a8ec43e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableColor_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableColor))] 7 | public class ScriptableColor_Editor : ScriptableVariable_Editor 8 | { 9 | #region Type-specific parts 10 | 11 | protected override void DrawRuntimeValueField(Color _value, string _label) 12 | { 13 | EditorGUILayout.ColorField(_label, _value); 14 | } 15 | 16 | #endregion 17 | } 18 | 19 | [CustomPropertyDrawer(typeof(ScriptableColor))] 20 | public class ScriptableColor_Drawer : ScriptableVariable_Drawer 21 | { 22 | #region Type-specific parts 23 | 24 | protected override void DrawValueWhenNull(Rect _position) 25 | { 26 | EditorGUI.ColorField(_position, GUIContent.none, default); 27 | } 28 | 29 | #endregion 30 | } 31 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableColor_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c41b90cebd98ef4a8b29b32de69f90e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableFloat_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableFloat))] 7 | public class ScriptableFloat_Editor : ScriptableVariable_Editor 8 | { 9 | // No changes needed. 10 | } 11 | 12 | [CustomPropertyDrawer(typeof(ScriptableFloat))] 13 | public class ScriptableFloat_Drawer : ScriptableVariable_Drawer 14 | { 15 | #region Type-specific parts 16 | 17 | protected override void DrawValueWhenNull(Rect _position) 18 | { 19 | EditorGUI.LabelField(_position, GUIContent.none, new GUIContent(default(float).ToString())); 20 | } 21 | 22 | #endregion 23 | } 24 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableFloat_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ccc8363f050eeb4b950c4fae93e0f74 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableGameObject_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableGameObject))] 7 | public class ScriptableGameObject_Editor : ScriptableVariable_Editor 8 | { 9 | // No changes needed. 10 | } 11 | 12 | [CustomPropertyDrawer(typeof(ScriptableGameObject))] 13 | public class ScriptableGameObject_Drawer : ScriptableVariable_Drawer 14 | { 15 | #region Type-specific parts 16 | 17 | protected override void DrawValueWhenNull(Rect _position) 18 | { 19 | EditorGUI.LabelField(_position, GUIContent.none, new GUIContent("None (GameObject)")); 20 | } 21 | 22 | #endregion 23 | } 24 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableGameObject_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd486355799de9b438a6c0b99df4b0bc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableGradient_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableGradient))] 7 | public class ScriptableGradient_Editor : ScriptableVariable_Editor 8 | { 9 | #region Type-specific parts 10 | 11 | protected override void DrawRuntimeValueField(Gradient _value, string _label) 12 | { 13 | EditorGUILayout.GradientField(_label, _value); 14 | } 15 | 16 | #endregion 17 | } 18 | 19 | [CustomPropertyDrawer(typeof(ScriptableGradient))] 20 | public class ScriptableGradient_Drawer : ScriptableVariable_Drawer 21 | { 22 | #region Type-specific parts 23 | 24 | protected override void DrawValueWhenNull(Rect _position) 25 | { 26 | EditorGUI.GradientField(_position, GUIContent.none, new Gradient()); 27 | } 28 | 29 | #endregion 30 | } 31 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableGradient_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7603590460e67140a545cad71a68c5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableInt_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableInt))] 7 | public class ScriptableInt_Editor : ScriptableVariable_Editor 8 | { 9 | // No changes needed. 10 | } 11 | 12 | [CustomPropertyDrawer(typeof(ScriptableInt))] 13 | public class ScriptableInt_Drawer : ScriptableVariable_Drawer 14 | { 15 | #region Type-specific parts 16 | 17 | protected override void DrawValueWhenNull(Rect _position) 18 | { 19 | EditorGUI.LabelField(_position, GUIContent.none, new GUIContent(default(int).ToString())); 20 | } 21 | 22 | #endregion 23 | } 24 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableInt_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cca1cb74dd6d29418a59fbbabbcfca0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableSprite_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableSprite))] 7 | public class ScriptableSprite_Editor : ScriptableVariable_Editor 8 | { 9 | // No changes needed. 10 | } 11 | 12 | [CustomPropertyDrawer(typeof(ScriptableSprite))] 13 | public class ScriptableSprite_Drawer : ScriptableVariable_Drawer 14 | { 15 | #region Type-specific parts 16 | 17 | protected override void DrawValueWhenNull(Rect _position) 18 | { 19 | Rect iconRect = new Rect(_position.x, _position.y, _position.height, _position.height); 20 | Rect labelRect = new Rect(_position.x + _position.height, _position.y, _position.width - _position.height, _position.height); 21 | EditorGUI.LabelField(iconRect, EditorGUIUtility.IconContent("Sprite Icon")); 22 | EditorGUI.LabelField(labelRect, GUIContent.none, new GUIContent("None (Sprite)")); 23 | } 24 | 25 | #endregion 26 | } 27 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableSprite_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d51eeefd102b3cc4a9a29796ac9b12b3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableString_Editor_Drawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | [CustomEditor(typeof(ScriptableString))] 7 | public class ScriptableString_Editor : ScriptableVariable_Editor 8 | { 9 | // No changes needed. 10 | } 11 | 12 | [CustomPropertyDrawer(typeof(ScriptableString))] 13 | public class ScriptableString_Drawer : ScriptableVariable_Drawer 14 | { 15 | #region Type-specific parts 16 | 17 | protected override void DrawValueWhenNull(Rect _position) 18 | { 19 | EditorGUI.LabelField(_position, GUIContent.none, new GUIContent(default(string))); 20 | } 21 | 22 | #endregion 23 | } 24 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableString_Editor_Drawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e970b57d061ecb245ae187acbf0fa701 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableVariable_Editor.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 6 | { 7 | /// 8 | /// Custom inspector for ScriptableVariables. 9 | /// 10 | [CustomEditor(typeof(ScriptableVariable<>))] 11 | public abstract class ScriptableVariable_Editor : Editor 12 | { 13 | #region Variables 14 | 15 | private SerializedProperty scriptProp; 16 | private SerializedProperty valueProp; 17 | private SerializedProperty runtimeValueProp; 18 | private SerializedProperty readonlyProp; 19 | 20 | #endregion 21 | 22 | #region Base GUI method 23 | 24 | private void OnEnable() 25 | { 26 | scriptProp = serializedObject.FindProperty(EditorConstants.FIELD_SCRIPT); 27 | 28 | valueProp = serializedObject.FindProperty(EditorConstants.FIELD_VALUE_BASE); 29 | runtimeValueProp = serializedObject.FindProperty(EditorConstants.FIELD_VALUE_RUNTIME); 30 | readonlyProp = serializedObject.FindProperty(EditorConstants.FIELD_READ_ONLY); 31 | } 32 | 33 | public override void OnInspectorGUI() 34 | { 35 | serializedObject.Update(); 36 | 37 | DrawScriptField(); 38 | EditorGUILayout.Space(); 39 | 40 | EditorGUILayout.LabelField("Parameters", EditorStyles.boldLabel); 41 | EditorGUILayout.BeginVertical(GUI.skin.box); 42 | DrawTypeLabel(); 43 | DrawAccessCheckbox(); 44 | EditorGUILayout.EndVertical(); 45 | 46 | EditorGUILayout.LabelField("Value", EditorStyles.boldLabel); 47 | EditorGUILayout.BeginVertical(GUI.skin.box); 48 | DrawBaseValueField(); 49 | DrawRuntimeValueFieldInternal(); 50 | EditorGUILayout.EndVertical(); 51 | 52 | if (GUI.changed) 53 | { 54 | Undo.RecordObject(target, "Field change"); 55 | serializedObject.ApplyModifiedProperties(); 56 | } 57 | } 58 | 59 | private void OnDisable() 60 | { 61 | 62 | } 63 | 64 | #endregion 65 | 66 | #region General parts 67 | 68 | /// 69 | /// Draws a script field similar to the regular inspector, allowing quick access to the script itself. 70 | /// 71 | protected void DrawScriptField() 72 | { 73 | bool wasEnabled = GUI.enabled; 74 | 75 | GUI.enabled = false; 76 | EditorGUILayout.PropertyField(scriptProp, true); 77 | GUI.enabled = wasEnabled; 78 | } 79 | 80 | /// 81 | /// Draws a label to remind what type of variable it is. 82 | /// 83 | protected void DrawTypeLabel() 84 | { 85 | bool wasEnabled = GUI.enabled; 86 | 87 | GUI.enabled = false; 88 | EditorGUILayout.LabelField("Type", typeof(T).FullName); 89 | GUI.enabled = wasEnabled; 90 | } 91 | 92 | /// 93 | /// Draws the read only checkbox. 94 | /// 95 | protected void DrawAccessCheckbox() 96 | { 97 | EditorGUILayout.PropertyField(readonlyProp, new GUIContent("Read only", "Is this variable read only ?")); 98 | } 99 | 100 | #endregion 101 | 102 | #region Type-specific parts 103 | 104 | /// 105 | /// Draws the base value field. 106 | /// 107 | protected virtual void DrawBaseValueField() 108 | { 109 | EditorGUILayout.PropertyField(valueProp, new GUIContent("Base value")); 110 | } 111 | 112 | /// 113 | /// Internal method for drawing the runtime value field when in play mode, or a warning label when not playing. 114 | /// 115 | private void DrawRuntimeValueFieldInternal() 116 | { 117 | if (EditorApplication.isPlaying) 118 | { 119 | ScriptableVariable obj = serializedObject.targetObject as ScriptableVariable; 120 | 121 | BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; 122 | FieldInfo field = typeof(ScriptableVariable).GetField(EditorConstants.FIELD_VALUE_RUNTIME, bindFlags); 123 | 124 | T runtimeValue = (T)field.GetValue(obj); 125 | 126 | using (new EditorGUI.DisabledScope(true)) 127 | { 128 | DrawRuntimeValueField(runtimeValue, "Runtime value"); 129 | } 130 | } 131 | else 132 | { 133 | EditorGUILayout.HelpBox("The runtime value will be visible in play mode.", MessageType.Info); 134 | } 135 | } 136 | 137 | /// 138 | /// Draws the runtime value field while playing. 139 | /// 140 | protected virtual void DrawRuntimeValueField(T _value, string _label) 141 | { 142 | if (_value is Object) 143 | { 144 | EditorGUILayout.ObjectField(_label, _value as Object, typeof(Object), false); 145 | } 146 | else 147 | { 148 | EditorGUILayout.LabelField(_label, _value.ToString()); 149 | } 150 | } 151 | 152 | #endregion 153 | } 154 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableVariable_Editor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bacf9733209733549bfb368c5bf6a1c3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableVariable_PropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 5 | { 6 | /// 7 | /// Custom property drawer for ScriptableVariables. 8 | /// 9 | public abstract class ScriptableVariable_Drawer : PropertyDrawer 10 | { 11 | #region Base GUI method 12 | 13 | public override void OnGUI(Rect _position, SerializedProperty _property, GUIContent _label) 14 | { 15 | _position = EditorGUI.PrefixLabel(_position, GUIUtility.GetControlID(FocusType.Passive), _label); 16 | 17 | float halfWidth = _position.width * 0.5f; 18 | Rect valueRect = new Rect(_position.x, _position.y, halfWidth - 5f, _position.height); 19 | Rect objectRect = new Rect(_position.x + halfWidth + 5f, _position.y, halfWidth - 5f, _position.height); 20 | 21 | DrawObjectField(objectRect, _property); 22 | DrawValueField(valueRect, _property); 23 | } 24 | 25 | #endregion 26 | 27 | #region General parts 28 | 29 | /// 30 | /// Parent method for drawing both the ScriptableVariable field and its shortcut value field. 31 | /// 32 | protected virtual void DrawValueField(Rect _position, SerializedProperty _property) 33 | { 34 | ScriptableVariable scriptableObject = (ScriptableVariable)_property.objectReferenceValue; 35 | 36 | bool wasEnabled = GUI.enabled; 37 | 38 | if (scriptableObject != null) 39 | { 40 | SerializedObject ser = new SerializedObject(scriptableObject); 41 | SerializedProperty prop = ser.FindProperty(EditorConstants.FIELD_VALUE_BASE); 42 | 43 | GUI.enabled = scriptableObject.IsReadOnly; 44 | DrawValueWhenNotNull(_position, prop); 45 | GUI.enabled = wasEnabled; 46 | } 47 | else 48 | { 49 | GUI.enabled = false; 50 | DrawValueWhenNull(_position); 51 | GUI.enabled = wasEnabled; 52 | } 53 | } 54 | 55 | /// 56 | /// Draws the object selection field to pick a ScriptableVariable. 57 | /// 58 | protected virtual void DrawObjectField(Rect _position, SerializedProperty _property) 59 | { 60 | EditorGUI.PropertyField(_position, _property, GUIContent.none); 61 | } 62 | 63 | #endregion 64 | 65 | #region Type-specific parts 66 | 67 | /// 68 | /// Draws a copy of the ScriptableVariable value field, acting as a shortcut. 69 | /// 70 | protected virtual void DrawValueWhenNotNull(Rect _position, SerializedProperty _prop) 71 | { 72 | EditorGUI.PropertyField(_position, _prop, GUIContent.none); 73 | } 74 | 75 | /// 76 | /// Draws a fake field showing the default value according to the ScriptableVariable's type. 77 | /// 78 | protected virtual void DrawValueWhenNull(Rect _position) 79 | { 80 | EditorGUI.LabelField(_position, GUIContent.none, new GUIContent($"None ({typeof(T).Name})")); 81 | } 82 | 83 | #endregion 84 | } 85 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/ScriptableVariable_PropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b680276b6770b8549ad27b9765f93b82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/Editor/zeshmouttsassets.unityscriptablevariables.editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity Scriptable Variables (Editor)", 3 | "references": [ 4 | "GUID:e93819b4883485e4987a4a4d10db33ba" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [ 15 | "UNITY_2018_4_OR_NEWER" 16 | ], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Scripts/_Core/Editor/zeshmouttsassets.unityscriptablevariables.editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86733c403baaad947bb935a1727b6018 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Scripts/_Core/MenuPathConstants.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | namespace ZeShmouttsAssets.DataContainers.EditorScripts 3 | { 4 | /// 5 | /// Menu path constants used for ScriptableVariable editor stuff. 6 | /// 7 | public static class MenuPathConstants 8 | { 9 | /// 10 | /// Base menu path for creating ScriptableVariables in the editor. 11 | /// 12 | public const string MENU_NAME_PATH = "ZeShmoutt's Assets/Data Containers/Scriptable Variables/"; 13 | } 14 | } 15 | #endif -------------------------------------------------------------------------------- /Scripts/_Core/MenuPathConstants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 820ed3b03435f4f49b4954b1410d3679 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableBool.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Bool", fileName = "New Bool")] 6 | public class ScriptableBool : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fc6fa5bcbe41704f96b440d5b467347 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: ce1268d5d6f6b93468b1e3a77c38136f, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableColor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Color", fileName = "New Color")] 6 | public class ScriptableColor : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableColor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11eca2dd0353df44b8de61ca20f7db69 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 0ed31b44b7abd934ab7f92b82f6fb34a, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableFloat.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Float", fileName = "New Float")] 6 | public class ScriptableFloat : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 683c47d28a7ff474d96ece0188a6f34d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 97eccd9ea95a070469abbc1a6e617d97, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableGameObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "GameObject", fileName = "New GameObject")] 6 | public class ScriptableGameObject : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableGameObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b366bb51129a3345834cec0bf465fb8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 83bfccc7220614145a9b7917a70c6a19, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableGradient.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Gradient", fileName = "New Gradient")] 6 | public class ScriptableGradient : ScriptableVariable 7 | { 8 | #region Utility 9 | 10 | /// 11 | /// Calculate color at a given time. 12 | /// 13 | /// Time of the key (0 - 1). 14 | /// Returns a Color. 15 | public Color Evaluate(float _time) 16 | { 17 | return GetValueOrDefault(this).Evaluate(_time); 18 | } 19 | 20 | #endregion 21 | } 22 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableGradient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3417a0c5c8bcc248bbaca02fba59410 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 8db0456621a0a5746851098b96497dd4, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableInt.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Int", fileName = "New Int")] 6 | public class ScriptableInt : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableInt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b090023371f48d47a0ebecaba3ae5b9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 29c1ae6eedbfed647a5625702a64611a, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "Sprite", fileName = "New Sprite")] 6 | public class ScriptableSprite : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59cdfd0cfe07bbe41bda1938d7155181 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: 918001482a6206d4e987dc56987e2fa2, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableString.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | [CreateAssetMenu(menuName = EditorScripts.MenuPathConstants.MENU_NAME_PATH + "String", fileName = "New String")] 6 | public class ScriptableString : ScriptableVariable 7 | { 8 | // No changes needed. 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf7eddbb83e40e04daaf238d66334af3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: b7526ec4f46ddf44a8e9459d66b1ffae, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableVariable.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ZeShmouttsAssets.DataContainers 4 | { 5 | /// 6 | /// Base class for ScriptableVariables. 7 | /// 8 | [System.Serializable] 9 | public abstract class ScriptableVariable : ScriptableObject, ISerializationCallbackReceiver 10 | { 11 | #region Values 12 | 13 | /// 14 | /// Is this ScriptableVariable read only ? 15 | /// 16 | [UnityEngine.Serialization.FormerlySerializedAs("readOnly")] 17 | [SerializeField] protected bool m_readOnly = false; 18 | 19 | /// 20 | /// Base value. Will be kept in during runtime in case the ScriptableVariable needs to reset. 21 | /// 22 | [UnityEngine.Serialization.FormerlySerializedAs("value")] 23 | [SerializeField] protected T m_valueBase; 24 | 25 | /// 26 | /// Value used only at runtime. Can be safely modified as it isn't serialized. 27 | /// 28 | [System.NonSerialized] protected T m_valueRuntime; 29 | 30 | public void OnAfterDeserialize() 31 | { 32 | Reset(); 33 | } 34 | 35 | public void OnBeforeSerialize() 36 | { 37 | 38 | } 39 | 40 | #endregion 41 | 42 | #region Public value interaction 43 | 44 | /// 45 | /// Returns the stored value of a ScriptableVariable if it exists, or a default value of the corresponding type otherwise. 46 | /// 47 | public T Value 48 | { 49 | get { return GetValueOrDefault(this); } 50 | set { TrySetValue(value); } 51 | } 52 | 53 | /// 54 | /// Can other scripts modify this ScriptableVariable's content ? 55 | /// 56 | public bool IsReadOnly 57 | { 58 | get { return m_readOnly; } 59 | } 60 | 61 | /// 62 | /// Resets the runtime value to the base value. Use with caution. 63 | /// 64 | public virtual void Reset() 65 | { 66 | m_valueRuntime = m_valueBase; 67 | } 68 | 69 | #endregion 70 | 71 | #region Protected value interaction 72 | 73 | /// 74 | /// Returns the stored value of a ScriptableVariable if it exists, or a default value of the corresponding type otherwise. 75 | /// 76 | /// 77 | /// 78 | protected static T GetValueOrDefault(ScriptableVariable _target) 79 | { 80 | if (_target != null) 81 | { 82 | return _target.GetValue(); 83 | } 84 | else 85 | { 86 | Debug.LogWarning($"A ScriptableVariable of type {typeof(T).Name} has not been assigned, default value \"{default(T).ToString()}\" has been used instead."); 87 | return default; 88 | } 89 | } 90 | 91 | /// 92 | /// Returns the stored value. This will return the non-serialized runtime value only. 93 | /// 94 | /// Returns the stored value. 95 | protected virtual T GetValue() 96 | { 97 | return m_valueRuntime; 98 | } 99 | 100 | /// 101 | /// Tries to modify the ScriptableVariable's stored value. Will throw an error if the ScriptableVariable is read only. 102 | /// 103 | /// New value to assign to the ScriptableVariable. 104 | protected void TrySetValue(T _value) 105 | { 106 | if (!m_readOnly) 107 | { 108 | SetValue(_value); 109 | } 110 | else 111 | { 112 | throw new System.FieldAccessException($"The ScriptableVariable \"{this.name}\" ({typeof(T).Name}) is read only."); 113 | } 114 | } 115 | 116 | /// 117 | /// Assign a new value to the ScriptableVariable. This will modify the non-serialized runtime value only. 118 | /// 119 | /// New value to assign. 120 | protected virtual void SetValue(T _value) 121 | { 122 | this.m_valueRuntime = _value; 123 | } 124 | 125 | #endregion 126 | 127 | #region Utility 128 | 129 | /// 130 | /// Shortcut to return the stored value as a string, instead of the ScriptableVariable. 131 | /// 132 | /// Returns the stored value as a string. 133 | public override string ToString() 134 | { 135 | return Value.ToString(); 136 | } 137 | 138 | /// 139 | /// Implicit conversion to whatever type the variable is, for seamless integration. 140 | /// 141 | public static implicit operator T(ScriptableVariable _s) 142 | { 143 | return GetValueOrDefault(_s); 144 | } 145 | 146 | #endregion 147 | } 148 | } -------------------------------------------------------------------------------- /Scripts/_Core/ScriptableVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f63bc13ccab2bbb4f8aa5d50709a3a4b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.zeshmouttsassets.unityscriptablevariables", 3 | "displayName":"Unity Scriptable Variables", 4 | "version": "1.1.0", 5 | "unity": "2018.4", 6 | "unityRelease": "15f1", 7 | "description": "Assign your variables into ScriptableObjects for easier handling.", 8 | "keywords": ["unity", "scripting", "tool", "tools", "C#"], 9 | "dependencies": { } 10 | } -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 069f36904a7c0c64f993c9830d8cb2c4 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /zeshmouttsassets.unityscriptablevariables.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity Scriptable Variables", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": false, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [ 11 | "UNITY_2018_4_OR_NEWER" 12 | ], 13 | "versionDefines": [], 14 | "noEngineReferences": false 15 | } -------------------------------------------------------------------------------- /zeshmouttsassets.unityscriptablevariables.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e93819b4883485e4987a4a4d10db33ba 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------