https://www.dotnetperls.com/getmethod

https://www.codeproject.com/Articles/19911/Dynamically-Invoke-A-Method-Given-Strings-with-Met

https://stackoverflow.com/questions/540066/calling-a-function-from-a-string-in-c-sharp


์˜์–ด๋„ ์ถฉ๊ฒฉ์ธ๋ฐ ์ดํ•ด๋ฅผ ๋ชปํ•ด์„œ ๋” ์ถฉ๊ฒฉ์ž„

GetMethod ๋ผ๋Š” ๊ฑธ ์ด์šฉํ•˜๋Š” ๊ฒƒ ๊ฐ™๊ธด ํ•œ๋ฐ...


string progress_current = ("Input_what = textlist_" + progress_main + ".GetInstance ()." + Input_main + "[0];");

Debug.Log(progress_current);

MethodInfo progress_Input = this.GetType().GetMethod(progress_current);

progress_Input.Invoke(this, null);


์ด๋Ÿฐ ์‹์œผ๋กœ ์งฐ๋”๋‹ˆ 4๋ฒˆ์งธ ์ค„์—์„œ ๋˜

NullReferenceException: Object reference not set to an instance of an object

์š” ์—๋Ÿฌ๊ฐ€ ๋œจ๋„ค...


์‚ฌ์‹ค Invoke ํ•จ์ˆ˜๊ฐ€ ๋Œ€์ฒด ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š” ๊ฑด์ง€ ๋ชจ๋ฅด๊ฒ ๋‹ค...

์ผ๋‹จ ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค๊ณค ํ•˜๋Š” ๊ฑฐ ๊ฐ™์œผ๋‹ˆ๊นŒ ์‹œ๋„๋Š” ํ•ด๋ด์•ผ๊ฒ ์Œ.