changeset 5:12f4f937da7f

Add BenchMark
author Kazuma
date Thu, 10 Nov 2016 04:21:19 +0900
parents 2878be4487ec
children 9be20fcffaac
files Assets/Application/BenchMarkTest.cs Assets/Application/BenchMarkTest.cs.meta Assets/Application/Scenes/Test/BenchMarkTest.unity Assets/Application/Scenes/Test/BenchMarkTest.unity.meta Assets/Application/Scripts/Debug.meta Assets/Application/Scripts/Debug/DebugCommon.cs Assets/Application/Scripts/Debug/DebugCommon.cs.meta Assets/Application/Scripts/Module.meta Assets/Application/Scripts/Module/ChildObject.cs Assets/Application/Scripts/Module/ChildObject.cs.meta Assets/Application/Scripts/Module/ConvertObject.cs Assets/Application/Scripts/Module/ConvertObject.cs.meta Assets/Application/Scripts/Module/ParentObject.cs Assets/Application/Scripts/Module/ParentObject.cs.meta Assets/Application/Scripts/SaveData.cs Assets/Application/Scripts/Test/SaveDataTest.cs Assets/jungle-sharp.meta obj/Debug/Assembly-CSharp.dll obj/Debug/Assembly-CSharp.dll.mdb
diffstat 19 files changed, 603 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/BenchMarkTest.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,44 @@
+using UnityEngine;
+using System.Collections;
+
+public class BenchMarkTest : MonoBehaviour {
+
+	public static string key = "KEY";
+	public static string indexKey = "INDEXKEY";
+	// Use this for initialization
+	void Start () {
+		System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
+		sw.Start ();
+		Jungle jungle = new DefaultJungle(new NullJournal(), "hoge", new DefaultTreeEditor(new DefaultTraverser()));
+		jungle.createNewTree("TestTree");
+		JungleTree tree = jungle.getTreeByName("TestTree");
+		JungleTreeEditor editor = tree.getTreeEditor();
+		editor = createTree(editor, 0, 3, new DefaultNodePath());
+		Either<Error, JungleTreeEditor> either = editor.success();
+		DebugCommon.Assert (either.isA (), "[Error]" + either.a());
+		sw.Stop ();
+		print ("[Time]"  + sw.Elapsed);
+	}
+
+	public JungleTreeEditor createTree(JungleTreeEditor editor, int _curY, int _maxHeight, NodePath path) {
+
+		if (_curY == _maxHeight) {
+			return editor;
+		}
+		for (int i = 0; i < 3; i++) {
+			Either<Error, JungleTreeEditor> either = editor.addNewChildAt (path, _curY);
+			DebugCommon.Assert (either.isA (), "Error");
+			editor = either.b ();
+			string value = path.add (_curY).ToString ();
+			either = editor.putAttribute (path.add (_curY), key, System.Text.Encoding.ASCII.GetBytes (value));
+			DebugCommon.Assert (either.isA (), "Error");
+			editor = either.b ();
+			string value2 = value + "+ index";
+			either = editor.putAttribute (path.add (_curY), indexKey, System.Text.Encoding.ASCII.GetBytes (value2));
+			DebugCommon.Assert (either.isA (), "Error");
+			editor = either.b ();
+			editor = createTree (editor, _curY + 1, _maxHeight, path);
+		}
+		return editor;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/BenchMarkTest.cs.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8c3220ff9547d411e8b3344d575295d0
+timeCreated: 1478674034
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scenes/Test/BenchMarkTest.unity	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,295 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+SceneSettings:
+  m_ObjectHideFlags: 0
+  m_PVSData: 
+  m_PVSObjectsArray: []
+  m_PVSPortalsArray: []
+  m_OcclusionBakeSettings:
+    smallestOccluder: 5
+    smallestHole: 0.25
+    backfaceThreshold: 100
+--- !u!104 &2
+RenderSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 7
+  m_Fog: 0
+  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  m_FogMode: 3
+  m_FogDensity: 0.01
+  m_LinearFogStart: 0
+  m_LinearFogEnd: 300
+  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+  m_AmbientIntensity: 1
+  m_AmbientMode: 0
+  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+  m_HaloStrength: 0.5
+  m_FlareStrength: 1
+  m_FlareFadeSpeed: 3
+  m_HaloTexture: {fileID: 0}
+  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+  m_DefaultReflectionMode: 0
+  m_DefaultReflectionResolution: 128
+  m_ReflectionBounces: 1
+  m_ReflectionIntensity: 1
+  m_CustomReflection: {fileID: 0}
+  m_Sun: {fileID: 0}
+  m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
+--- !u!157 &3
+LightmapSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 7
+  m_GIWorkflowMode: 1
+  m_GISettings:
+    serializedVersion: 2
+    m_BounceScale: 1
+    m_IndirectOutputScale: 1
+    m_AlbedoBoost: 1
+    m_TemporalCoherenceThreshold: 1
+    m_EnvironmentLightingMode: 0
+    m_EnableBakedLightmaps: 1
+    m_EnableRealtimeLightmaps: 1
+  m_LightmapEditorSettings:
+    serializedVersion: 4
+    m_Resolution: 2
+    m_BakeResolution: 40
+    m_TextureWidth: 1024
+    m_TextureHeight: 1024
+    m_AO: 0
+    m_AOMaxDistance: 1
+    m_CompAOExponent: 1
+    m_CompAOExponentDirect: 0
+    m_Padding: 2
+    m_LightmapParameters: {fileID: 0}
+    m_LightmapsBakeMode: 1
+    m_TextureCompression: 1
+    m_DirectLightInLightProbes: 1
+    m_FinalGather: 0
+    m_FinalGatherFiltering: 1
+    m_FinalGatherRayCount: 256
+    m_ReflectionCompression: 2
+  m_LightingDataAsset: {fileID: 0}
+  m_RuntimeCPUUsage: 25
+--- !u!196 &4
+NavMeshSettings:
+  serializedVersion: 2
+  m_ObjectHideFlags: 0
+  m_BuildSettings:
+    serializedVersion: 2
+    agentRadius: 0.5
+    agentHeight: 2
+    agentSlope: 45
+    agentClimb: 0.4
+    ledgeDropHeight: 0
+    maxJumpAcrossDistance: 0
+    accuratePlacement: 0
+    minRegionArea: 2
+    cellSize: 0.16666667
+    manualCellSize: 0
+  m_NavMeshData: {fileID: 0}
+--- !u!1 &950973495
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 4
+  m_Component:
+  - 4: {fileID: 950973500}
+  - 20: {fileID: 950973499}
+  - 92: {fileID: 950973498}
+  - 124: {fileID: 950973497}
+  - 81: {fileID: 950973496}
+  m_Layer: 0
+  m_Name: Main Camera
+  m_TagString: MainCamera
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!81 &950973496
+AudioListener:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 950973495}
+  m_Enabled: 1
+--- !u!124 &950973497
+Behaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 950973495}
+  m_Enabled: 1
+--- !u!92 &950973498
+Behaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 950973495}
+  m_Enabled: 1
+--- !u!20 &950973499
+Camera:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 950973495}
+  m_Enabled: 1
+  serializedVersion: 2
+  m_ClearFlags: 1
+  m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+  m_NormalizedViewPortRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+  near clip plane: 0.3
+  far clip plane: 1000
+  field of view: 60
+  orthographic: 0
+  orthographic size: 5
+  m_Depth: -1
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_RenderingPath: -1
+  m_TargetTexture: {fileID: 0}
+  m_TargetDisplay: 0
+  m_TargetEye: 3
+  m_HDR: 0
+  m_OcclusionCulling: 1
+  m_StereoConvergence: 10
+  m_StereoSeparation: 0.022
+  m_StereoMirrorMode: 0
+--- !u!4 &950973500
+Transform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 950973495}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 1, z: -10}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+--- !u!1 &1375432743
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 4
+  m_Component:
+  - 4: {fileID: 1375432745}
+  - 108: {fileID: 1375432744}
+  m_Layer: 0
+  m_Name: Directional Light
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!108 &1375432744
+Light:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1375432743}
+  m_Enabled: 1
+  serializedVersion: 7
+  m_Type: 1
+  m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+  m_Intensity: 1
+  m_Range: 10
+  m_SpotAngle: 30
+  m_CookieSize: 10
+  m_Shadows:
+    m_Type: 2
+    m_Resolution: -1
+    m_CustomResolution: -1
+    m_Strength: 1
+    m_Bias: 0.05
+    m_NormalBias: 0.4
+    m_NearPlane: 0.2
+  m_Cookie: {fileID: 0}
+  m_DrawHalo: 0
+  m_Flare: {fileID: 0}
+  m_RenderMode: 0
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_Lightmapping: 4
+  m_AreaSize: {x: 1, y: 1}
+  m_BounceIntensity: 1
+  m_ShadowRadius: 0
+  m_ShadowAngle: 0
+--- !u!4 &1375432745
+Transform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1375432743}
+  m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
+  m_LocalPosition: {x: 0, y: 3, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 1
+--- !u!1 &1449524982
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 4
+  m_Component:
+  - 4: {fileID: 1449524983}
+  - 114: {fileID: 1449524984}
+  - 114: {fileID: 1449524985}
+  m_Layer: 0
+  m_Name: BenchMark
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1449524983
+Transform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1449524982}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 2
+--- !u!114 &1449524984
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1449524982}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 8c3220ff9547d411e8b3344d575295d0, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+--- !u!114 &1449524985
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1449524982}
+  m_Enabled: 0
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 4a08a29d6175c934e88cd50ebb80aaf9, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  key: moumou
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scenes/Test/BenchMarkTest.unity.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 37511f3b7190f49a883fd162e18d50e4
+timeCreated: 1478674000
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Debug.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: c0f7f268a5a88443e9f45abad8ec5635
+folderAsset: yes
+timeCreated: 1478719207
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Debug/DebugCommon.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,45 @@
+using System;
+
+/// <summary>
+/// Debugクラスに関する汎用関数
+/// </summary>
+public static class DebugCommon
+{
+	/// <summary>
+	/// 条件をチェックし、その条件が true の場合は例外を投げます
+	/// </summary>
+	/// <param name="condition">評価する条件式</param>
+	public static void Assert(bool condition)
+	{
+		if (condition)
+		{
+			throw new Exception();
+		}
+	}
+
+	/// <summary>
+	/// 条件をチェックし、その条件が true の場合は例外を投げます
+	/// </summary>
+	/// <param name="condition">評価する条件式</param>
+	/// <param name="message">送信するメッセージ</param>
+	public static void Assert(bool condition, string message)
+	{
+		if (condition)
+		{
+			throw new Exception(message);
+		}
+	}
+
+	/// <summary>
+	/// 条件をチェックし、その条件が true の場合は例外を投げます
+	/// </summary>
+	/// <param name="condition">評価する条件式</param>
+	/// <param name="getMessage">送信するメッセージを返す関数</param>
+	public static void Assert(bool condition, Func<string> getMessage)
+	{
+		if (condition)
+		{
+			throw new Exception(getMessage());
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Debug/DebugCommon.cs.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4a93c85dfa1944b158d4b35d3e586d3b
+timeCreated: 1478674707
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ab9b968d3adb243fdad42cf266226efa
+folderAsset: yes
+timeCreated: 1478719221
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ChildObject.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,25 @@
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+
+public class ChildObject : MonoBehaviour {
+
+	public ParentObject Parent;
+	public GameObject Value;
+	public NodePath Path;
+	public Dictionary<string, Component> dic = new Dictionary<string, Component>();
+
+	public ChildObject (ParentObject parent, GameObject value, NodePath path) {
+		this.Parent = parent;
+		this.Value = value;
+		this.Path = path;
+	}
+
+	public void GetComponent () {
+		Component[] comps = this.Value.GetComponents<Component>();
+		foreach (Component component in comps) {
+			Debug.Log(component.GetType().ToString());
+			dic.Add (component.GetType().ToString(), component);
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ChildObject.cs.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 2ef61e4e590984e4795981e606e77db5
+timeCreated: 1478587815
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ConvertObject.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,28 @@
+using UnityEngine;
+using System.Collections;
+using System;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Runtime.Serialization;
+using System.IO;
+[Serializable]
+public class ConvertObject : MonoBehaviour {
+
+	public static byte[] Convert (object target) {
+		IFormatter formatter = new BinaryFormatter();
+		MemoryStream ms = new MemoryStream();
+		formatter.Serialize(ms, target);
+		byte[] myByteArray = ms.ToArray();
+		return myByteArray;
+	}
+
+	public static object UnConvert(byte[] target) {
+		using (var memStream = new MemoryStream())
+		{
+			var binForm = new BinaryFormatter();
+			memStream.Write(target, 0, target.Length);
+			memStream.Seek(0, SeekOrigin.Begin);
+			var obj = binForm.Deserialize(memStream);
+			return obj;
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ConvertObject.cs.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f7fd35791c1034f51871065c4525e4a9
+timeCreated: 1478450159
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ParentObject.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+public class ParentObject : MonoBehaviour {
+
+	public GameObject Value;
+	public NodePath Path;
+	public Dictionary<string, Component> dic = new Dictionary<string, Component>();
+
+	public ParentObject (GameObject value, NodePath path) {
+		this.Value = value;
+		this.Path = path;
+		GetComponent ();
+		Logs ();
+	}
+
+	public void GetComponent () {
+		Component[] comps = this.Value.GetComponents<Component>();
+		foreach (Component component in comps) {
+			if (component.GetType ().ToString () != "UnityEngine.Transform") {
+				Debug.Log (component.GetType ().ToString ());
+				dic.Add (component.GetType ().ToString (), component);
+			}
+		}
+	}
+
+	public void Logs () {
+		string s = "<";
+		foreach (int num in Path) {
+			s += num + ",";
+		}
+		s += ">";
+		print (s);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Module/ParentObject.cs.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 977fdfa4a9f894f42a675c4f6542c04b
+timeCreated: 1478588350
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
--- a/Assets/Application/Scripts/SaveData.cs	Tue Nov 08 17:07:48 2016 +0900
+++ b/Assets/Application/Scripts/SaveData.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -26,7 +26,8 @@
 	}
 
 	public void CreateTree (string name) {
-		mainTree = mainScene.createNewTree (name);
+		mainScene.createNewTree (name);
+		mainTree = mainScene.getTreeByName (name);
 		Debug.Log ("[Jungle] Create " + name + " Tree");
 		EditorMode ();
 	}
@@ -36,26 +37,48 @@
 		Debug.Log ("[Jungle] Editor Mode" + TreeEditor.ToString());
 	}
 
-	public void PutAttribute (NodePath path, string key, byte[] value) {
-		Either<Error, JungleTreeEditor> either = TreeEditor.putAttribute (path, key, value);
+	public void createTree (int pos, NodePath path, string key, byte[] value) {
+		Either<Error, JungleTreeEditor> either = TreeEditor.addNewChildAt(path, pos);
 		if (either.isA ()) {
-			Debug.LogError ("[Error]" + either.a());
+			Debug.LogError ("[Error]" + either.a ());
 		} else {
-			Debug.Log ("[Success]");
-			either.b ();
+			TreeEditor = either.b ();
+			Either<Error, JungleTreeEditor> eitherput = TreeEditor.putAttribute (path.add(pos), key, value);
+			if (eitherput.isA ()) {
+				Debug.LogError ("[Error]" + eitherput.a());
+			} else {
+				Debug.Log ("[Success]");
+				TreeEditor = eitherput.b ();
+			}
 		}
 	}
 
+//	public void PutAttribute (NodePath path, string key, byte[] value) {
+//		Either<Error, JungleTreeEditor> either = TreeEditor.putAttribute (path, key, value);
+//		if (either.isA ()) {
+//			Debug.LogError ("[Error]" + either.a());
+//		} else {
+//			Debug.Log ("[Success]");
+//			either.b ();
+//		}
+//	}
+
 	public void GetAttribute (NodePath path, string key) {
-		node = mainTree.getNodeOfPath (path).b ();
-		byte[] target = node.getAttributes ().get (key);
-		var obj = ConvertObject.UnConvert (target);
-		print (obj);
+		Either<Error, TreeNode> either =  mainTree.getNodeOfPath (path);
+		if (either.isA ()) {
+			Debug.LogError ("[Error]");
+		} else {
+			node = either.b ();
+			print (key);
+			byte[] target = node.getAttributes ().get (key);
+			var obj = ConvertObject.UnConvert (target);
+			print (obj);
+		}
 	}
  
 	public void Push() {
 		Either<Error, JungleTreeEditor> r = TreeEditor.success();
-		if (!r.isA ()) {
+		if (r.isA ()) {
 			Debug.LogError ("[Error]");
 		} else {
 			Debug.Log ("[Success]");
--- a/Assets/Application/Scripts/Test/SaveDataTest.cs	Tue Nov 08 17:07:48 2016 +0900
+++ b/Assets/Application/Scripts/Test/SaveDataTest.cs	Thu Nov 10 04:21:19 2016 +0900
@@ -21,23 +21,23 @@
 		}
 
 		if (Input.GetKeyDown (KeyCode.S)) {
-			int i = 1;
+			int i = 0;
 			foreach (var parent in ParentList) {
 				foreach (var comp in parent.dic) {
-					Mapping (comp.Key, comp.Value);
+					Mapping (i, root, comp.Key, comp.Value);
 				}
-//				SaveData.Instance.GetAttribute (path);
-				path = path.last ().rights();
-				path = path.add (i);
 				i++;
-				SaveData.Instance.EditorMode ();
 			}
 		}
+
+		if (Input.GetKeyDown (KeyCode.D)) {
+			SaveData.Instance.Push ();
+		}
 	}
 
-	private void Mapping(string key, Component value) {
-		byte[] array = ConvertObject.Convert (value);
-		SaveData.Instance.PutAttribute (path, key , array);
+	private void Mapping(int pos, NodePath path, string key, Component value) {
+		byte[] array = ConvertObject.Convert (value.ToString());
+		SaveData.Instance.createTree (pos, path, key , array);
 	}
 
 	private void Check () {
@@ -56,6 +56,7 @@
 			if (isScene) { // このシーンの中のオブジェクトかどうか。
 				if (obj.transform.childCount == 0 && obj.transform.parent == null || obj.transform.childCount > 0 && obj.transform.parent == null) { // 親を取得
 					ParentObject parent = new ParentObject (obj, root.add (i));
+					ParentList.Add (parent);
 					i++;
 				}
 			}
--- a/Assets/jungle-sharp.meta	Tue Nov 08 17:07:48 2016 +0900
+++ b/Assets/jungle-sharp.meta	Thu Nov 10 04:21:19 2016 +0900
@@ -1,7 +1,7 @@
 fileFormatVersion: 2
 guid: 3a1d9219ce0684237b9c7d89e12240c5
 folderAsset: yes
-timeCreated: 1478448102
+timeCreated: 1478689729
 licenseType: Free
 DefaultImporter:
   userData: 
Binary file obj/Debug/Assembly-CSharp.dll has changed
Binary file obj/Debug/Assembly-CSharp.dll.mdb has changed