| 123456789101112131415161718192021222324252627282930313233343536 |
- using UnityEngine;
- using GadgetCore.API;
- namespace EnginesDeluxe
- {
- public static class ItemUtil
- {
- public static int CreateEngineItem(string tileImgPath, string itemImgPath, string componentName, string name, string description, string id)
- {
- Texture2D texture2D = GadgetCoreAPI.LoadTexture2D(tileImgPath);
- Texture2D texture2D2 = GadgetCoreAPI.LoadTexture2D(itemImgPath);
- GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/EnginesDeluxe/component/" + componentName));
- ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, description, texture2D2);
- itemInfo.Register(id);
- new TileInfo(TileType.NONSOLID, texture2D, gameObject, itemInfo).Register(id);
- return itemInfo.GetID();
- }
- public static int CreateOverrideEngineItem(string tileImgPath, string itemImgPath, string componentName, string name, string description, string id)
- {
- Texture2D texture2D = GadgetCoreAPI.LoadTexture2D(tileImgPath);
- Texture2D texture2D2 = GadgetCoreAPI.LoadTexture2D(itemImgPath);
- GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/EnginesDeluxe/component/" + componentName));
- ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, description, texture2D2);
- itemInfo.Register(id, 2400);
- new TileInfo(TileType.NONSOLID, texture2D, gameObject, itemInfo).Register(id, 2400);
- return itemInfo.GetID();
- }
- }
- }
|