For example can I show List of ORK combatants or Currencies or Certain type items, in unity inspector from custom script. So for example player can choose from the list of created currencies in Unity Inspector?
target is the component your custom inspector is editing. currencyID is an int field storing the selected currency. The GetNames function returns a name list of all available data (in this case for currencies). You can use the same functionality for other data selection (e.g. for combatants it's ORK.Combatants.GetNames(true)).
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I'm using OrkFramework namespace so this is not an issue. Also this error gets fixed if I once click play in editor but every time I change code it comes back again.
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
target.currencyID = EditorGUILayout.Popup("Currency", target.currencyID, ORK.Currencies.GetNames(true));
target is the component your custom inspector is editing.
currencyID is an int field storing the selected currency.
The GetNames function returns a name list of all available data (in this case for currencies). You can use the same functionality for other data selection (e.g. for combatants it's ORK.Combatants.GetNames(true)).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
NullReferenceException: Object reference not set to an instance of an object
ORKFramework.ORK.get_Currencies ()
for this code
public override void OnInspectorGUI()
{
DrawDefaultInspector();
Building myTarget = (Building)target;
for (int i = 0; i < myTarget.LevelingSettings.Length; i++)
{
for (int j = 0; j < myTarget.LevelingSettings[i].LevelingCost.Length; j++)
{
myTarget.LevelingSettings[i].LevelingCost[j].Value = EditorGUILayout.Popup("Currency", (int)myTarget.LevelingSettings[i].LevelingCost[j].Value, ORK.Currencies.GetNames(false));
}
}
}
Also this error gets fixed if I once click play in editor but every time I change code it comes back again.
if(!ORK.Instantiated)
{
ORK.Initialize(ORKAssetHelper.LoadORKProject());
}
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!