Sometimes you want to reference ORK stuff in custom scripts. Usually, you do it by ID's but referencing with names would be much simpler.

If you have Odin inspector ( this can be done easily with ValueDropdown attribute.


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;

public enum USABLETYPE { Ability, Item }
public class Usable : MonoBehaviour

public USABLETYPE UsableType;
public int ID;

ValueDropdownList<int> UsableID()
ValueDropdownList<int> _List = new ValueDropdownList<int>();
string[] _Names = UsableType == USABLETYPE.Ability ? ORKFramework.ORK.Abilities.GetNames(false) : ORKFramework.ORK.Items.GetNames(false);
for (int i = 0; i < _Names.Length; i++)
_List.Add(_Names[i], i);
return _List;

If you don't have Odin you can do same with CustomInspector or by generating ORK constants
Sign In or Register to comment.