{"id":14960720,"url":"https://github.com/athellboy/scriptableobjectdropdown","last_synced_at":"2025-10-24T19:30:21.996Z","repository":{"id":41047454,"uuid":"191554034","full_name":"ATHellboy/ScriptableObjectDropdown","owner":"ATHellboy","description":"Dropdown for ScriptableObjects","archived":false,"fork":false,"pushed_at":"2022-06-20T21:16:58.000Z","size":747,"stargazers_count":46,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-31T03:46:11.452Z","etag":null,"topics":["dropdown","gamedev","indiedev","madewithunity","scriptableobject","unity3d","unity3d-editor","unity3d-plugin","unityeditor","unitytips"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ATHellboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-12T11:01:34.000Z","updated_at":"2024-05-07T22:19:52.000Z","dependencies_parsed_at":"2022-08-30T15:53:15.267Z","dependency_job_id":null,"html_url":"https://github.com/ATHellboy/ScriptableObjectDropdown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATHellboy%2FScriptableObjectDropdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATHellboy%2FScriptableObjectDropdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATHellboy%2FScriptableObjectDropdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATHellboy%2FScriptableObjectDropdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ATHellboy","download_url":"https://codeload.github.com/ATHellboy/ScriptableObjectDropdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238024458,"owners_count":19403837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dropdown","gamedev","indiedev","madewithunity","scriptableobject","unity3d","unity3d-editor","unity3d-plugin","unityeditor","unitytips"],"created_at":"2024-09-24T13:22:50.306Z","updated_at":"2025-10-24T19:30:16.578Z","avatar_url":"https://github.com/ATHellboy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScriptableObjectDropdown\nScriptableObjectDropdown is an attribute for the Unity Inspector.\nIt is used for showing ScriptableObjects which are created in your project, in dropdown menu and select between them in Inspector.\n\n![](Images/ScriptableObjectDropdown.gif)\n\n# Usage Example\n1. Clone this repository or download the latest [release package available](https://github.com/ATHellboy/ScriptableObjectDropdown/releases) (There isn't an example folder in `.unitypackage`).\n\n2. There are some options here:\n* Create a `ScriptableObject` class which you want to create specified objects by that.\n\n```cs\nusing UnityEngine;\n\n[CreateAssetMenu(menuName = \"Create Block\")]\npublic class Block : ScriptableObject\n{\n    // Some fields\n}\n```\n\n* Create a class that inherits another `ScriptableObject` class.\n\n```cs\nusing UnityEngine;\n\n[CreateAssetMenu(menuName = \"Blocks/Sand\")]\npublic class SandBlock : Block\n{\n    // Some fields and functions\n}\n```\n\n* Create a abstract `ScriptableObject` class then antoher class which inherits this abstract class.\n\n```cs\nusing UnityEngine;\n\npublic abstract class AbstarctBlock : ScriptableObject\n{\n    // Some fields and functions\n}\n```\n\n```cs\nusing UnityEngine;\n\n[CreateAssetMenu(menuName = \"Blocks/Water\")]\npublic class WaterBlock : AbstarctBlock\n{\n    // Some fields and functions\n}\n```\n\n* Create an interface and some `ScriptableObject` classes which inherit this interface. The interface is used for grouping.\n\n```cs\npublic interface IBlock\n{\n    // Some properties and functions signature\n}\n```\n\n```cs\nusing UnityEngine;\n\n[CreateAssetMenu(menuName = \"Blocks/Dirt\")]\npublic class DirtBlock : ScriptableObject, IBlock\n{\n    // Some fields and functions\n}\n```\n\n```cs\nusing UnityEngine;\n\n[CreateAssetMenu(menuName = \"Blocks/Snow\")]\npublic class SnowBlock : ScriptableObject, IBlock\n{\n    // Some fields and functions\n}\n```\n\n3. Create ScriptableObjects in the project.\n\n![](Images/Resources.PNG)\n\n4. Use `ScriptableObjectDropdown` attribute by setting type of specified `ScriptableObject` derived class and optional grouping (Default grouping is `None`) behind `ScriptableObjectReference` type variable like these in MonoBeahviour or ScriptableObject derived classes.\n\n**MonoBehavior**\n\n```cs\nusing ScriptableObjectDropdown;\nusing UnityEngine;\n\npublic class BlockManager : MonoBehaviour\n{\n    // Without grouping (default is None)\n    [ScriptableObjectDropdown(typeof(Block))] public ScriptableObjectReference targetBlock;\n    // By grouping\n    [ScriptableObjectDropdown(typeof(Block), grouping = ScriptableObjectGrouping.ByFolder)]\n    public ScriptableObjectReference targetBlockByGrouping;\n    // Derived class\n    [ScriptableObjectDropdown(typeof(SandBlock))] public ScriptableObjectReference derivedClassTargetBlock;\n    // Derived abstract class\n    [ScriptableObjectDropdown(typeof(AbstarctBlock))] public ScriptableObjectReference derivedAbstractClassTargetBlock;\n    // Interface\n    [ScriptableObjectDropdown(typeof(IBlock))] public ScriptableObjectReference interfaceTargetBlock;\n}\n```\n\n![](Images/MonoBehaviourInterface.png)\n\n![](Images/MonoBehaviourByFolderGrouping.png)\n\n**ScriptableObject**\n```cs\nusing UnityEngine;\nusing ScriptableObjectDropdown;\n\n[CreateAssetMenu(menuName = \"Create Block Manager Settings\")]\npublic class BlockManagerSettings : ScriptableObject\n{\n    // Without grouping (default is None)\n    [ScriptableObjectDropdown(typeof(Block))] public ScriptableObjectReference targetBlock;\n    // By grouping\n    [ScriptableObjectDropdown(typeof(Block), grouping = ScriptableObjectGrouping.ByFolder)]\n    public ScriptableObjectReference targetBlockByGrouping;\n    // Derived class\n    [ScriptableObjectDropdown(typeof(SandBlock))] public ScriptableObjectReference derivedClassTargetBlock;\n    // Derived abstract class\n    [ScriptableObjectDropdown(typeof(AbstarctBlock))] public ScriptableObjectReference derivedAbstractClassTargetBlock;\n    // Interface\n    [ScriptableObjectDropdown(typeof(IBlock))] public ScriptableObjectReference interfaceTargetBlock;\n}\n```\n\n![](Images/ScriptableObjectDerivedClass.png)\n\n![](Images/ScriptableObjectDerivedAbstractClass.png)\n\n# License\nMIT License\n\nCopyright (c) 2019 Alireza Tarahomi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathellboy%2Fscriptableobjectdropdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathellboy%2Fscriptableobjectdropdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathellboy%2Fscriptableobjectdropdown/lists"}