private void drawTestDocs() { GUILayout.Label("***** TestDocs *******"); DocsPin.DocsData data = DocsPin.DocsRoot.findData("test_docs"); if (data == null) { return; } int price = data.get <int>("object_01", "price"); GUILayout.Label(" -> Price : " + price.ToString()); int limit = data.get <int>("object_01", "limit"); GUILayout.Label(" -> LIMIT : " + limit.ToString()); string name = data.get <string>("object_01", "name"); GUILayout.Label(" -> NAME : " + name); string title = data.get <string>("object_01", "title"); GUILayout.Label(" -> TITLE : " + title); string content = data.get <string>("object_01", "content"); GUILayout.Label(" -> CONTENT : " + content); }
private void drawSample01() { GUILayout.Label("***** _gd_sample_01 *******"); DocsPin.DocsData data = DocsPin.DocsRoot.findData("_gd_sample_01"); if (data == null) { return; } int gender = data.get <int>("object_01", "gender"); GUILayout.Label(" -> Gender : " + gender.ToString()); int price = data.get <int>("object_01", "price"); GUILayout.Label(" -> Price : " + price.ToString()); int limit = data.get <int>("object_01", "limit"); GUILayout.Label(" -> Limit : " + limit.ToString()); ArrayList reward = data.get <ArrayList>("object_01", "reward"); double length = data.get <int>("object_01", "length"); GUILayout.Label(" -> Length : " + length.ToString()); string rewardString = ""; foreach (object r in reward) { rewardString += string.Format("{0} ", r); } GUILayout.Label(" -> Reward : " + rewardString); }
// Use this for initialization void Start() { // test_docs data. { DocsPin.DocsData data = DocsPin.DocsRoot.findData("test_docs"); if (data != null) { int price = data.get <int>("object_01", "price"); int limit = data.get <int>("object_01", "limit"); string name = data.get <string>("object_01", "name"); string title = data.get <string>("object_01", "title"); string content = data.get <string>("object_01", "content"); Debug.Log(string.Format("Price:{0}, Limit:{1}, Name:{2}, Title:{3}, Content:{4}", price, limit, name, title, content)); } } // _gd_sample_01 data. { DocsPin.DocsData data = DocsPin.DocsRoot.findData("_gd_sample_01"); if (data != null) { int gender = data.get <int>("object_01", "gender"); int price = data.get <int>("object_01", "price"); int limit = data.get <int>("object_01", "limit"); ArrayList reward = data.get <ArrayList>("object_01", "reward"); double length = data.get <int>("object_01", "length"); string rewardString = ""; foreach (object r in reward) { rewardString += string.Format("{0} ", r); } Debug.Log(string.Format("Gender:{0},Price:{1},Limit:{2},Reward:[{3}],Length:{4}", gender, price, limit, rewardString, length)); } } }
public void MakeSample() { if (dic_sample != null) { return; } dic_sample = new Dictionary <string, docs_sample> (); docs_sample _info = null; string _cons = "sample_"; int _idx = 0; string _key = _cons + _idx.ToString(); DocsPin.DocsData _data = DocsPin.DocsRoot.findData("sampel"); while (_data.get <string> (_key, "char0") != null) { _key = _cons + _idx.ToString(); _info = new docs_sample(); _info.char0 = _data.get <string> (_key, "char0"); _info.char1 = _data.get <string> (_key, "char1"); _info.char2 = _data.get <string> (_key, "char2"); _info.ngroup = _data.get <int> (_key, "group"); _info.arg = _data.get <string> (_key, "arg"); dic_sample.Add(_key, _info); _idx++; } }