baobao
10/27/2014 - 4:10 PM

publicフィールドとその値を取得する 途中

publicフィールドとその値を取得する 途中

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

public class PublicVariables : MonoBehaviour
{
	public TestClazz _testClazz;

	void Start ()
	{
		List<string> fieldNameList = new List<string> ();

		Type t = _testClazz.GetType ();//typeof(_testClazz);
		var members = t.GetFields ();
		foreach (var s in members) {
			Debug.Log (s.Name);
			fieldNameList.Add (s.Name);
			Debug.Log (_testClazz [s.Name]);
			_testClazz.
		}


	}
}
using UnityEngine;
using System.Collections;

public class TestClazz : MonoBehaviour
{
	public float Piyo = 100f;
	public int Bar = 99;
	public string str = "Shunsuke Ohba";
}