diff Assets/Application/Scripts/Module/ParentObject.cs @ 5:12f4f937da7f

Add BenchMark
author Kazuma
date Thu, 10 Nov 2016 04:21:19 +0900
parents
children
line wrap: on
line diff
--- /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);
+	}
+}