ScriptableItem is a very simple superstructure on top of regular ScriptableObject. It can represent anything that should be clearly identifiable.
Each ScriptableItem has its own UID, Label & Description. UID is guaranteedly unique across other Scriptable Items in whole project.
ScriptableItem can be duplicated by clicking on DUPLICATE.
Project Window (Right Click) > Create > Dragon Arts > Common >
Scriptable Item
ScriptableItem has only 3 attributes, but there is no problem to extend it:
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
using DragonArts.Common;
#if UNITY_EDITOR
[CustomEditor(typeof(CurrencyItem))]
public class CurrencyItemEditor : ScriptableItemEditor {
[MenuItem("Assets/Create/Dragon Arts/Custom/Currency", false, 50)]
private static void CreateCurrencyItem() {
CurrencyItem asset = ScriptableObject.CreateInstance<CurrencyItem> ();
asset.uid = EditorUtilities.GenerateUid();
EditorUtilities.CreateScriptableObject<CurrencyItem>(asset, "New Currency");
}
}
#endif
public enum Currency { COIN, SHARD_RED, SHARD_GREEN, SHARD_BLUE, GEM_RED, GEM_GREEN, GEM_BLUE, GEM_WHITE }
public class CurrencyItem : ScriptableItem {
public Currency type;
public Sprite image;
}
Project Window (Right Click) > Create > Dragon Arts > Custom > Currency
ScriptableGroup represents a group of Scriptable Items. It is derived from class ScriptableItem, so it inherits metadata attributes (UID, Label & Description).
Each ScriptableGroup has its own Reorderable List of classes ScriptableGroupItem, which is a wrapper for ScriptableItem with own UID.
UIDs can be easily copied to clipboard by clicking on
There is also a possibility to enable quantifying of items of the list by checking the Quantified checkbox.
Project Window (Right Click) > Create > Dragon Arts > Common >
Scriptable Group
NOTE: You are free to add any derived class of ScriptableItem into the list, e.g. another ScriptableGroup, and this is how you can create hierarchical structures.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |