Mercurial > hg > Members > kazuma > JungleforUnity
diff Assets/Application/Scripts/Item.cs @ 12:b55d586dd4eb
change bind from fmap.
author | Kazuma Takeda |
---|---|
date | Tue, 07 Feb 2017 20:48:57 +0900 |
parents | cf20add31466 |
children |
line wrap: on
line diff
--- a/Assets/Application/Scripts/Item.cs Sat Jan 28 19:15:44 2017 +0900 +++ b/Assets/Application/Scripts/Item.cs Tue Feb 07 20:48:57 2017 +0900 @@ -3,60 +3,28 @@ using JungleDB; using System.Text; using System; + +/// <summary> +/// Base Item Class. +/// </summary> public class Item : MonoBehaviour { public string Type; - public GameObject ItemImage; - public int Broken = 2; - private int nowBroken = 2; public int indexID = 0; public int itemID = 1; - public string ColorCode = ""; - private Jungle jungle; - - public void SetItem (ItemInfo item, int index) { - this.Broken = item.Broken; - nowBroken = Broken; - Type = item.Type; - itemID = item.itemID; - indexID = index; - ColorCode = item.ColorCode; - SetColor (this.ColorCode); - } - - public void SetItem (int broken, string type, string item_id, int index, string code) { - this.Broken = broken; - nowBroken = Broken; - Type = type; - itemID = Convert.ToInt32(item_id); - indexID = index; - SetColor (code); - } + public Jungle jungle; public void SetPosition (Vector3 pos) { this.transform.position = pos; - // print ("Set (" + pos.x + ", " + pos.y + ", " + pos.z + ")"); - } - - public void SetColor (string code) { - Color color; - ColorUtility.TryParseHtmlString(code, out color); - this.GetComponent<MeshRenderer> ().material.color = color; } - public void Delete() { - if (nowBroken == 0) { - DeleteTreeNode (); - Destroy (this.gameObject); - return; - } - - nowBroken -= 1; + public virtual void Delete() { + } public void DeleteTreeNode () { - jungle = SaveDataTest.jungle; + jungle = SaveData.jungle; JungleTree tree = jungle.getTreeByName ("SceneTree"); JungleTreeEditor edt = tree.getTreeEditor (); @@ -74,7 +42,7 @@ public void SetCreateTreeNode () { - jungle = SaveDataTest.jungle; + jungle = SaveData.jungle; JungleTree tree = jungle.getTreeByName ("SceneTree"); JungleTreeEditor edt = tree.getTreeEditor ();