public MethodBase GetMethod(string pFunctionName, int pPramCount = 0) { string tkey = pFunctionName + pPramCount; MethodBase ret = null; if (!mMethodCache.ContainsKey(tkey)) { ret = mCodeTool.GetLMethod(mScriptType, mObject, pFunctionName, pPramCount); mMethodCache.Add(tkey, ret); } ret = mMethodCache[tkey]; return(ret); }
virtual public object CallScriptFunctionByNameParams(string _FunctionName, params object[] _prams) { try { if (mObject == null || mScriptType == null || mCodeTool == null) { return(null); } int tpramcount = _prams != null ? _prams.Length : 0; object tmethod = mCodeTool.GetLMethod(mScriptType, _FunctionName, tpramcount); if (tmethod == null) { return(null); } return(mCodeTool.CallMethodNoTry(tmethod, mObject, _prams)); } catch (Exception _erro) { DLog.LogError(string.Format("[{0}:{1}->{2}] [GameObject:{3}] Error:{4}", mAppName, mScriptClass, _FunctionName, gameObject.name, _erro.ToString())); } return(null); }