view Assets/Application/Scripts/Module/ChildObject.cs @ 5:12f4f937da7f

Add BenchMark
author Kazuma
date Thu, 10 Nov 2016 04:21:19 +0900
parents
children
line wrap: on
line source

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);
		}
	}
}