Beispiel #1
0
    public void flush()
    {
        System.Console.WriteLine("FLSH!!!!!!!!!");

        string tag = this.obj.dicTag ["tag"];

        System.Globalization.TextInfo tf = new System.Globalization.CultureInfo("en-US", false).TextInfo;

        string className = "Novel." + tf.ToTitleCase(tag) + "Component";

        Debug.Log(className);

        //Novel.Bg_removeComponent

        AbstractComponent test = new Novel.Bg_removeComponent();

        Debug.Log(test);
        Debug.Log(test.GetType().FullName);

        className = test.GetType().FullName;

        //リフレクションで動的型付け 
        Type masterType = Type.GetType(className);

        Debug.Log(masterType);

        AbstractComponent cmp;

        cmp = (AbstractComponent)Activator.CreateInstance(masterType);

        this.obj.dicParamDefault = cmp.originalParam;

        Dictionary <string, string> tmpDic = new Dictionary <string, string> ();
        List <string> l = cmp.arrayVitalParam;

        for (var i = 0; i < l.Count; i++)
        {
            string vital = l [i];
            tmpDic [vital] = "yes";
        }

        this.obj.dicParamVital = tmpDic;
        //必須パラメータとかデフォルト値を取得

        this.arrDoc.Add(this.obj);
        this.obj    = new DocObject();
        this.status = "";
    }
Beispiel #2
0
	public void flush(){
		System.Console.WriteLine ("FLSH!!!!!!!!!");

		string tag = this.obj.dicTag ["tag"];

		System.Globalization.TextInfo tf = new System.Globalization.CultureInfo ("en-US", false).TextInfo;

		string className = "Novel." + tf.ToTitleCase (tag) + "Component";

		Debug.Log (className);

		//Novel.Bg_removeComponent

		AbstractComponent test = new Novel.Bg_removeComponent ();
		Debug.Log (test);
		Debug.Log (test.GetType ().FullName);

		className = test.GetType ().FullName;

		//リフレクションで動的型付け 
		Type masterType = Type.GetType (className);

		Debug.Log (masterType);

		AbstractComponent cmp;
		cmp = (AbstractComponent)Activator.CreateInstance (masterType);

		this.obj.dicParamDefault = cmp.originalParam;

		Dictionary<string,string> tmpDic = new Dictionary<string,string> ();
		List<string> l = cmp.arrayVitalParam;
		for (var i = 0; i < l.Count; i++) {
			string vital = l [i];
			tmpDic [vital] = "yes";
		}

		this.obj.dicParamVital	= tmpDic; 
		//必須パラメータとかデフォルト値を取得
	 
		this.arrDoc.Add (this.obj);
		this.obj = new DocObject ();
		this.status = "";
	}