All Projects → ATHellboy → ScriptableObjectDropdown

ATHellboy / ScriptableObjectDropdown

Licence: MIT license
Dropdown for ScriptableObjects

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to ScriptableObjectDropdown

ScriptableObjectMultiSelectDropdown
Multi Select Dropdown for ScriptableObjects
Stars: ✭ 18 (-55%)
Mutual labels:  dropdown, unity3d-plugin, indiedev, unityeditor, scriptableobject, unitytips
UITKEditorAid
Elements and scripts that help in making Unity editors with UIToolkit.
Stars: ✭ 31 (-22.5%)
Mutual labels:  unity3d-plugin, unity3d-editor, unityeditor
UnityTexture3DAtlasImportPipeline
A Texture3D Atlas Import Pipeline for Unity 2019.3 and newer.
Stars: ✭ 24 (-40%)
Mutual labels:  unity3d-plugin, unity3d-editor
first-person-controller-for-unity
A First-Person Controller for Unity.
Stars: ✭ 18 (-55%)
Mutual labels:  indiedev, madewithunity
unityAndroidSensors
Access to android sensors for Unity
Stars: ✭ 14 (-65%)
Mutual labels:  unity3d-plugin, scriptableobject
MultiGame
MultiGame is a tool for rapid development in Unity
Stars: ✭ 16 (-60%)
Mutual labels:  unity3d-plugin, unity3d-editor
CategoryTool
Unity Editor tool to create Categories in the Hierarchy. The Categories work as dividers between GameObjects.
Stars: ✭ 47 (+17.5%)
Mutual labels:  unity3d-plugin, unity3d-editor
Naughtyattributes
Attribute Extensions for Unity
Stars: ✭ 2,641 (+6502.5%)
Mutual labels:  unity3d-plugin, unity3d-editor
Ifmmenu
仿微信添加菜单
Stars: ✭ 235 (+487.5%)
Mutual labels:  dropdown
Semantic Ui
Semantic is a UI component framework based around useful principles from natural language.
Stars: ✭ 49,729 (+124222.5%)
Mutual labels:  dropdown
Angular2 Multiselect Dropdown
Angular 2 Dropdown Multiselect
Stars: ✭ 225 (+462.5%)
Mutual labels:  dropdown
React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: ✭ 230 (+475%)
Mutual labels:  dropdown
template-unity-package
A Github template for creating a new Unity Package. Hit the green "User this template" next to "Clone or download" to get started!
Stars: ✭ 50 (+25%)
Mutual labels:  unity3d-plugin
React Dropdown Select
Customisable dropdown select for react
Stars: ✭ 227 (+467.5%)
Mutual labels:  dropdown
react-picky
Yet another React multiselect. With checkbox support instead of tags.
Stars: ✭ 78 (+95%)
Mutual labels:  dropdown
Expandabletable
AZExpandable is a lightweight proxy for UITableView to expand cells.
Stars: ✭ 218 (+445%)
Mutual labels:  dropdown
React Native In App Notification
🔔 Customisable in-app notification component for React Native
Stars: ✭ 206 (+415%)
Mutual labels:  dropdown
ar-simulation
AR Simulation for Unity • Right in the Editor • Minimally Invasive
Stars: ✭ 101 (+152.5%)
Mutual labels:  unity3d-plugin
BGSDK-Foundation
Heathen Engineering's BGSDK Foundation allows you to manage in-game items as blockchain assets. It is a complete wrapper around Venly's Web API. The tool simplifies integration with Venly API exposing all features and functions to C# classes and includes Editor extensions to aid in design and deployment of Contracts and Tokens.
Stars: ✭ 59 (+47.5%)
Mutual labels:  unity3d-plugin
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (+515%)
Mutual labels:  dropdown

ScriptableObjectDropdown

ScriptableObjectDropdown is an attribute for the Unity Inspector. It is used for showing ScriptableObjects which are created in your project, in dropdown menu and select between them in Inspector.

Usage Example

  1. Clone this repository or download the latest release package available (There isn't an example folder in .unitypackage).

  2. There are some options here:

  • Create a ScriptableObject class which you want to create specified objects by that.
using UnityEngine;

[CreateAssetMenu(menuName = "Create Block")]
public class Block : ScriptableObject
{
    // Some fields
}
  • Create a class that inherits another ScriptableObject class.
using UnityEngine;

[CreateAssetMenu(menuName = "Blocks/Sand")]
public class SandBlock : Block
{
    // Some fields and functions
}
  • Create a abstract ScriptableObject class then antoher class which inherits this abstract class.
using UnityEngine;

public abstract class AbstarctBlock : ScriptableObject
{
    // Some fields and functions
}
using UnityEngine;

[CreateAssetMenu(menuName = "Blocks/Water")]
public class WaterBlock : AbstarctBlock
{
    // Some fields and functions
}
  • Create an interface and some ScriptableObject classes which inherit this interface. The interface is used for grouping.
public interface IBlock
{
    // Some properties and functions signature
}
using UnityEngine;

[CreateAssetMenu(menuName = "Blocks/Dirt")]
public class DirtBlock : ScriptableObject, IBlock
{
    // Some fields and functions
}
using UnityEngine;

[CreateAssetMenu(menuName = "Blocks/Snow")]
public class SnowBlock : ScriptableObject, IBlock
{
    // Some fields and functions
}
  1. Create ScriptableObjects in the project.

  1. 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.

MonoBehavior

using ScriptableObjectDropdown;
using UnityEngine;

public class BlockManager : MonoBehaviour
{
    // Without grouping (default is None)
    [ScriptableObjectDropdown(typeof(Block))] public ScriptableObjectReference targetBlock;
    // By grouping
    [ScriptableObjectDropdown(typeof(Block), grouping = ScriptableObjectGrouping.ByFolder)]
    public ScriptableObjectReference targetBlockByGrouping;
    // Derived class
    [ScriptableObjectDropdown(typeof(SandBlock))] public ScriptableObjectReference derivedClassTargetBlock;
    // Derived abstract class
    [ScriptableObjectDropdown(typeof(AbstarctBlock))] public ScriptableObjectReference derivedAbstractClassTargetBlock;
    // Interface
    [ScriptableObjectDropdown(typeof(IBlock))] public ScriptableObjectReference interfaceTargetBlock;
}

ScriptableObject

using UnityEngine;
using ScriptableObjectDropdown;

[CreateAssetMenu(menuName = "Create Block Manager Settings")]
public class BlockManagerSettings : ScriptableObject
{
    // Without grouping (default is None)
    [ScriptableObjectDropdown(typeof(Block))] public ScriptableObjectReference targetBlock;
    // By grouping
    [ScriptableObjectDropdown(typeof(Block), grouping = ScriptableObjectGrouping.ByFolder)]
    public ScriptableObjectReference targetBlockByGrouping;
    // Derived class
    [ScriptableObjectDropdown(typeof(SandBlock))] public ScriptableObjectReference derivedClassTargetBlock;
    // Derived abstract class
    [ScriptableObjectDropdown(typeof(AbstarctBlock))] public ScriptableObjectReference derivedAbstractClassTargetBlock;
    // Interface
    [ScriptableObjectDropdown(typeof(IBlock))] public ScriptableObjectReference interfaceTargetBlock;
}

License

MIT License

Copyright (c) 2019 Alireza Tarahomi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].