|
|
@@ -18,7 +18,7 @@ namespace ShipDecorations
|
|
|
mainTexture = texture2D
|
|
|
};
|
|
|
|
|
|
- ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2D2, -1, default, null, null, null, null);
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2D2);
|
|
|
itemInfo.Register(name);
|
|
|
new TileInfo(TileType.NONSOLID, texture2D, gameObject, itemInfo).Register(name);
|
|
|
|
|
|
@@ -72,10 +72,102 @@ namespace ShipDecorations
|
|
|
|
|
|
var script = doorTrigger.gameObject.AddComponent<DoorColliderScript>();
|
|
|
|
|
|
- ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2DItem, -1, default, null, null, null, null);
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2DItem);
|
|
|
itemInfo.Register(name);
|
|
|
new TileInfo(TileType.NONSOLID, texture2D, hostObject, itemInfo).Register(name);
|
|
|
|
|
|
+ Texture2D tex = new Texture2D(2, 2, TextureFormat.ARGB32, false, true);
|
|
|
+
|
|
|
+ return itemInfo.GetID();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int CreateWallItem(string tileImgPath, string itemImgPath, string name)
|
|
|
+ {
|
|
|
+
|
|
|
+ Texture2D textureTile = GadgetCoreAPI.LoadTexture2D(tileImgPath);
|
|
|
+ Texture2D textureItem = GadgetCoreAPI.LoadTexture2D(itemImgPath);
|
|
|
+
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", textureItem);
|
|
|
+ itemInfo.Register(name);
|
|
|
+ new TileInfo(TileType.WALL, textureTile, null, itemInfo).Register(name);
|
|
|
+
|
|
|
+ return itemInfo.GetID();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int CreateBlockItem(string tileImgPath, string itemImgPath, string name)
|
|
|
+ {
|
|
|
+
|
|
|
+ Texture2D textureTile = GadgetCoreAPI.LoadTexture2D(tileImgPath);
|
|
|
+ Texture2D textureItem = GadgetCoreAPI.LoadTexture2D(itemImgPath);
|
|
|
+
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", textureItem);
|
|
|
+ itemInfo.Register(name);
|
|
|
+ new TileInfo(TileType.SOLID, textureTile, null, itemInfo).Register(name);
|
|
|
+
|
|
|
+ return itemInfo.GetID();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int CreatePlacableStairsItemL(string tileImgPath, string itemImgPath, string name)
|
|
|
+ {
|
|
|
+
|
|
|
+ Texture2D texture2DTile = GadgetCoreAPI.LoadTexture2D(tileImgPath);
|
|
|
+ Texture2D texture2DItem = GadgetCoreAPI.LoadTexture2D(itemImgPath);
|
|
|
+
|
|
|
+ GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/2501"));
|
|
|
+ Renderer renderer = gameObject.GetComponentInChildren<Renderer>();
|
|
|
+ renderer.material = new Material(Shader.Find("Transparent/Diffuse"))
|
|
|
+ {
|
|
|
+ mainTexture = texture2DTile
|
|
|
+ };
|
|
|
+
|
|
|
+ for (int i = 0; i < 14; i++)
|
|
|
+ {
|
|
|
+ GameObject colliderObject = new GameObject();
|
|
|
+ colliderObject.transform.localScale = new Vector3(4f, 4f, 5);
|
|
|
+ colliderObject.transform.localPosition = new Vector3(10f, -0.22f, 0);
|
|
|
+ colliderObject.transform.SetParent(gameObject.transform);
|
|
|
+ colliderObject.layer = 0;
|
|
|
+ BoxCollider doorTrigger = colliderObject.AddComponent<BoxCollider>();
|
|
|
+ doorTrigger.size = new Vector3(Mathf.Sqrt(2f), 0.2f, 1);
|
|
|
+ doorTrigger.transform.rotation = Quaternion.Euler(0, 0, -45);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2DItem);
|
|
|
+ itemInfo.Register(name);
|
|
|
+ new TileInfo(TileType.NONSOLID, texture2DTile, gameObject, itemInfo).Register(name);
|
|
|
+
|
|
|
+ return itemInfo.GetID();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int CreatePlacableStairsItemR(string tileImgPath, string itemImgPath, string name)
|
|
|
+ {
|
|
|
+
|
|
|
+ Texture2D texture2DTile = GadgetCoreAPI.LoadTexture2D(tileImgPath);
|
|
|
+ Texture2D texture2DItem = GadgetCoreAPI.LoadTexture2D(itemImgPath);
|
|
|
+
|
|
|
+ GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/2501"));
|
|
|
+ Renderer renderer = gameObject.GetComponentInChildren<Renderer>();
|
|
|
+ renderer.material = new Material(Shader.Find("Transparent/Diffuse"))
|
|
|
+ {
|
|
|
+ mainTexture = texture2DTile
|
|
|
+ };
|
|
|
+
|
|
|
+ for (int i = 0; i < 14; i++)
|
|
|
+ {
|
|
|
+ GameObject colliderObject = new GameObject();
|
|
|
+ colliderObject.transform.localScale = new Vector3(4f, 4f, 5);
|
|
|
+ colliderObject.transform.localPosition = new Vector3(10f, -0.22f, 0);
|
|
|
+ colliderObject.transform.SetParent(gameObject.transform);
|
|
|
+ colliderObject.layer = 0;
|
|
|
+ BoxCollider doorTrigger = colliderObject.AddComponent<BoxCollider>();
|
|
|
+ doorTrigger.size = new Vector3(Mathf.Sqrt(2f), 0.2f, 1);
|
|
|
+ doorTrigger.transform.rotation = Quaternion.Euler(0, 0, 45);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", texture2DItem);
|
|
|
+ itemInfo.Register(name);
|
|
|
+ new TileInfo(TileType.NONSOLID, texture2DTile, gameObject, itemInfo).Register(name);
|
|
|
+
|
|
|
return itemInfo.GetID();
|
|
|
}
|
|
|
}
|