The type or namespace name 'Editor' does not exist in the namespace 'GamingIsLove.Makinom' (are you missing an assembly reference?)
using UnityEditor;
using UnityEngine;
using GamingIsLove.Makinom;
using GamingIsLove.Makinom.Editor;
using GamingIsLove.ORKFramework.Components;
using GamingIsLove.ORKFramework;
public class Items : MonoBehaviour
{
public void ListItems()
{
MakinomProjectAsset project = MakinomAssetHelper.LoadProjectAsset();
ORKGenericAssetListTab<ItemAsset, Item> items = new ItemsSettings(project.Makinom);
......
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Also, you can't mix editor and gameplay stuff together :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you for telling me.
I have a another question.
I want to get an AssetList from an itemTab.
However, assetList is protected level in GenericAssetListTab.
Is there any use case in mind to customize the Editor?
I would like to create a function to read CSV and add ItemAsset to the List.
I get/set item prices on Editor mode.
below:
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using GamingIsLove.Makinom;
using GamingIsLove.ORKFramework;
public void ListItems()
{
ORKDataHandlerCache dataCache = new ORKDataHandlerCache();
ItemsSettings itemsSettings = dataCache.Items;
int num = itemsSettings.Count;
Item[] items = new Item[num];
for (int i = 0; i < num; i++)
{
items[i] = itemsSettings.Get(i);
}
foreach (Item item in items)
{
updateValue(item, 100.0f); // from csv
showItemMinimal(item);
}
}
private void showItemMinimal(Item item)
{
Debug.Log("===Item===");
Debug.Log(" Name: " + item.DataName);
Debug.Log(" Type Name: " + item.itemType.settings.EditorAsset.name);
Debug.Log(" price: " + item.price.buyPriceValue.ToString());
}
private void updateValue(Item item, float value)
{
FloatValue<GameObjectSelection> fv = new FloatValue<GameObjectSelection>(value);
item.price.buyPriceValue.SetData(fv.GetData());
}
}
GenericAssetList<T> assetList = EditorDataHandler.Instance.GetAssets<T>();
Simply replace T with the asset class you want to get, e.g. ItemAsset for items.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!