4
|
1 using UnityEngine;
|
|
2 using System.Collections;
|
|
3 using System.Collections.Generic;
|
|
4 public class ParentObject : MonoBehaviour {
|
|
5
|
|
6 public GameObject Value;
|
|
7 public NodePath Path;
|
|
8 public Dictionary<string, Component> dic = new Dictionary<string, Component>();
|
|
9
|
|
10 public ParentObject (GameObject value, NodePath path) {
|
|
11 this.Value = value;
|
|
12 this.Path = path;
|
|
13 GetComponent ();
|
|
14 Logs ();
|
|
15 }
|
|
16
|
|
17 public void GetComponent () {
|
|
18 Component[] comps = this.Value.GetComponents<Component>();
|
|
19 foreach (Component component in comps) {
|
|
20 Debug.Log(component.GetType().ToString());
|
|
21 dic.Add (component.GetType().ToString(), component);
|
|
22 }
|
|
23 }
|
|
24
|
|
25 public void Logs () {
|
|
26 string s = "<";
|
|
27 foreach (int num in Path) {
|
|
28 s += num + ",";
|
|
29 }
|
|
30 s += ">";
|
|
31 print (s);
|
|
32 }
|
|
33 }
|