diff Assets/Application/Scripts/StageManager.cs @ 11:cf20add31466

change putAttribute -> use fmap.
author Kazuma Takeda
date Sat, 28 Jan 2017 19:15:44 +0900
parents 3fefb9f9025d
children b55d586dd4eb
line wrap: on
line diff
--- a/Assets/Application/Scripts/StageManager.cs	Fri Jan 20 07:30:26 2017 +0900
+++ b/Assets/Application/Scripts/StageManager.cs	Sat Jan 28 19:15:44 2017 +0900
@@ -8,19 +8,19 @@
 
 	private float _maxHeight = 10;
 
-	//パーリンノイズを使ったマップか
+	// パーリンノイズを使ったマップか
 	[SerializeField]
 	private bool _isPerlinNoiseMap = true;
 
-	//起伏の激しさ
+	// 起伏の激しさ
 	[SerializeField]
 	private float _relief = 15f;
 
-	//Y座標を滑らかにするか(小数点以下をそのままにする)
+	// Y座標を滑らかにするか(小数点以下をそのままにする)
 	[SerializeField]
 	private bool _isSmoothness = false;
 
-	//マップの大きさ
+	// マップの大きさ
 	[SerializeField]
 	private float _mapSize = 1f;
 
@@ -85,14 +85,11 @@
 		TreeNode item_node = getItem (box_node, ItemID);
 
 		attr = item_node.getAttributes ();
-		string subType = attr.getString ("Type");
-		string broken = attr.getString ("Broken");
-		string itemID = attr.getString ("ID");
-		string color_code = attr.getString ("Color");
+		ItemInfo iteminfo = attr.get<ItemInfo> ("ItemInfo");
 
 		GameObject item = Resources.Load<GameObject> ("Prefabs/" + type + "/Box");
 		GameObject obj = Instantiate (item);
-		obj.GetComponent<Item> ().SetItem (Convert.ToInt32 (broken), subType, itemID, TotalIndex, color_code);
+		obj.GetComponent<Item> ().SetItem (iteminfo ,TotalIndex);
 		obj.transform.position = new Vector3 (v.x, v.y, v.z);
 		obj.transform.SetParent (baseStage.transform);
 		obj.GetComponent<Item> ().SetCreateTreeNode ();