/// <summary> /// 体型スクリプトを読み込みtpoを追加します。 /// </summary> public void Load() { ProportionList pro_list = ProportionList.Instance; pro_list.Load(); SetProportionList(pro_list); }
/// <summary> /// 体型リストを設定します。 /// </summary> /// <param name="pro_list">体型リスト</param> public void SetProportionList(ProportionList pro_list) { Clear(); foreach (IProportion pro in pro_list.items) { TPOFile tpo = new TPOFile(); tpo.Proportion = pro; Add(tpo); } }
/// <summary> /// 体型スクリプトを読み込みます。 /// </summary> public static void Load(this TDCG.ProportionList pl, string folder) { string proportion_path = Path.Combine(Application.StartupPath, folder); if (!Directory.Exists(proportion_path)) { return; } string[] script_files = Directory.GetFiles(proportion_path, "*.cs"); foreach (string script_file in script_files) { string class_name = "TDCG.Proportion." + Path.GetFileNameWithoutExtension(script_file); var script = CSScript.Load(script_file).CreateInstance(class_name).AlignToInterface <IProportion>(); pl.items.Add(script); } }
/// <summary> /// 体型リストを元にtpoを追加します。 /// </summary> /// <param name="pro_list">体型リスト</param> public void SetProportionList(ProportionList pro_list) { Clear(); if (pro_list == null) return; foreach (IProportion pro in pro_list.items) { TPOFile tpo = new TPOFile(); tpo.Proportion = pro; Add(tpo); } }