Mercurial > hg > Members > kazuma > JungleforUnity
changeset 9:bbab930748c4
no use path ver.
author | Kazuma Takeda |
---|---|
date | Wed, 18 Jan 2017 22:00:24 +0900 |
parents | 599bd8ddb72b |
children | 3fefb9f9025d |
files | Assets/Application/Scripts/StageManager.cs Assets/Application/Scripts/Test/SaveDataTest.cs obj/Debug/Assembly-CSharp.dll obj/Debug/Assembly-CSharp.dll.mdb |
diffstat | 4 files changed, 22 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/Assets/Application/Scripts/StageManager.cs Tue Jan 17 19:57:19 2017 +0900 +++ b/Assets/Application/Scripts/StageManager.cs Wed Jan 18 22:00:24 2017 +0900 @@ -121,7 +121,6 @@ jungle = SaveDataTest.jungle; JungleTree tree = jungle.getTreeByName ("ItemTree"); TreeNode node = tree.getRootNode (); - Attributes attr = node.getAttributes (); Children child = node.getChildren (); return child.at (typeID).b (); }
--- a/Assets/Application/Scripts/Test/SaveDataTest.cs Tue Jan 17 19:57:19 2017 +0900 +++ b/Assets/Application/Scripts/Test/SaveDataTest.cs Wed Jan 18 22:00:24 2017 +0900 @@ -35,7 +35,7 @@ rootPath = new DefaultNodePath (); // 編集を可能にする editor = tree.getTreeEditor (); - editor = editor.addNewChildAt (rootPath, 0).b(); + // editor = editor.addNewChildAt (rootPath, 0).b(); } private void Awake () { @@ -114,39 +114,38 @@ edt = edt.putAttribute (rootPath, "TreeName", Encoding.UTF8.GetBytes ("Item")).b (); edt = edt.addNewChildAt (rootPath, 0).b (); - edt = edt.putAttribute (rootPath.add (0), "Category", Encoding.UTF8.GetBytes ("Box")).b (); + edt = edt.putAttribute ("Category", Encoding.UTF8.GetBytes ("Box")).b (); edt = edt.addNewChildAt (rootPath, 1).b (); - edt = edt.putAttribute (rootPath.add (1), "Category", Encoding.UTF8.GetBytes ("Food")).b (); - + edt = edt.putAttribute ("Category", Encoding.UTF8.GetBytes ("Food")).b (); NodePath path = rootPath.add(0); edt = edt.addNewChildAt (path, 0).b (); - edt = edt.putAttribute (path.add (0), "ID", Encoding.UTF8.GetBytes ("1")).b (); - edt = edt.putAttribute (path.add (0), "Type", Encoding.UTF8.GetBytes ("Grass")).b (); - edt = edt.putAttribute (path.add (0), "Broken", Encoding.UTF8.GetBytes ("2")).b (); - edt = edt.putAttribute (path.add (0), "Color", Encoding.UTF8.GetBytes ("#019540FF")).b (); + edt = edt.putAttribute ("ID", Encoding.UTF8.GetBytes ("1")).b (); + edt = edt.putAttribute ("Type", Encoding.UTF8.GetBytes ("Grass")).b (); + edt = edt.putAttribute ("Broken", Encoding.UTF8.GetBytes ("2")).b (); + edt = edt.putAttribute ("Color", Encoding.UTF8.GetBytes ("#019540FF")).b (); edt = edt.addNewChildAt (path, 1).b (); - edt = edt.putAttribute (path.add (1), "ID", Encoding.UTF8.GetBytes ("2")).b (); - edt = edt.putAttribute (path.add (1), "Type", Encoding.UTF8.GetBytes ("Wood")).b (); - edt = edt.putAttribute (path.add (1), "Broken", Encoding.UTF8.GetBytes ("4")).b (); - edt = edt.putAttribute (path.add (1), "Color", Encoding.UTF8.GetBytes ("#7F3C01FF")).b (); + edt = edt.putAttribute ("ID", Encoding.UTF8.GetBytes ("2")).b (); + edt = edt.putAttribute ("Type", Encoding.UTF8.GetBytes ("Wood")).b (); + edt = edt.putAttribute ("Broken", Encoding.UTF8.GetBytes ("4")).b (); + edt = edt.putAttribute ("Color", Encoding.UTF8.GetBytes ("#7F3C01FF")).b (); edt = edt.addNewChildAt (path, 2).b (); - edt = edt.putAttribute (path.add (2), "ID", Encoding.UTF8.GetBytes ("3")).b (); - edt = edt.putAttribute (path.add (2), "Type", Encoding.UTF8.GetBytes ("Sand")).b (); - edt = edt.putAttribute (path.add (2), "Broken", Encoding.UTF8.GetBytes ("1")).b (); - edt = edt.putAttribute (path.add (2), "Color", Encoding.UTF8.GetBytes ("#D4500EFF")).b (); + edt = edt.putAttribute ("ID", Encoding.UTF8.GetBytes ("3")).b (); + edt = edt.putAttribute ("Type", Encoding.UTF8.GetBytes ("Sand")).b (); + edt = edt.putAttribute ("Broken", Encoding.UTF8.GetBytes ("1")).b (); + edt = edt.putAttribute ("Color", Encoding.UTF8.GetBytes ("#D4500EFF")).b (); edt = edt.addNewChildAt (path, 3).b (); - edt = edt.putAttribute (path.add (3), "ID", Encoding.UTF8.GetBytes ("4")).b (); - edt = edt.putAttribute (path.add (3), "Type", Encoding.UTF8.GetBytes ("Water")).b (); - edt = edt.putAttribute (path.add (3), "Broken", Encoding.UTF8.GetBytes ("5")).b (); - edt = edt.putAttribute (path.add (3), "Color", Encoding.UTF8.GetBytes ("#2432ADFF")).b (); + edt = edt.putAttribute ("ID", Encoding.UTF8.GetBytes ("4")).b (); + edt = edt.putAttribute ("Type", Encoding.UTF8.GetBytes ("Water")).b (); + edt = edt.putAttribute ("Broken", Encoding.UTF8.GetBytes ("5")).b (); + edt = edt.putAttribute ("Color", Encoding.UTF8.GetBytes ("#2432ADFF")).b (); edt.commit (); StageManager.Instance.Init (); @@ -157,15 +156,15 @@ JungleTreeEditor edt = tree.getTreeEditor (); edt = edt.addNewChildAt (rootPath, 0).b (); - edt = edt.putAttribute (rootPath.add (0), "NodeName", Encoding.UTF8.GetBytes ("Player")).b (); + edt = edt.putAttribute ("NodeName", Encoding.UTF8.GetBytes ("Player")).b (); NodePath playerpath = rootPath.add (0); edt = edt.addNewChildAt (playerpath, 0).b(); - edt = edt.putAttribute (playerpath.add (0), "NodeName", Encoding.UTF8.GetBytes ("HaveItems")).b(); + edt = edt.putAttribute ("NodeName", Encoding.UTF8.GetBytes ("HaveItems")).b(); edt = edt.addNewChildAt (rootPath, 1).b (); - edt = edt.putAttribute (rootPath.add (1), "NodeName", Encoding.UTF8.GetBytes ("Stage")).b (); + edt = edt.putAttribute ("NodeName", Encoding.UTF8.GetBytes ("Stage")).b (); edt = edt.commit ().b(); }