/// <summary> /// 构建远程方法列表. /// </summary> private void RebuildMethodList() { mRFCs.Clear(); MethodInfo[] methods = this.GetType().GetMethods( BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); for (int b = 0; b < methods.Length; ++b) { if (methods[b].IsDefined(typeof(RFC), true)) { CachedRFC ent = new CachedRFC(); ent.func = methods[b]; RFC tnc = (RFC)ent.func.GetCustomAttributes(typeof(RFC), true)[0]; ent.type = tnc.Type; ent.Param = tnc.Param; mRFCs.Add(ent); } } }
/// <summary> /// 设置代理对象 /// </summary> /// <param name="target">代理对象.</param> public void SetProxy(MonoBehaviour target) { mProxyTarget = target; Name = target.transform.name; mRFCs.Clear(); MethodInfo[] methods = target.GetType().GetMethods( BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); for (int b = 0; b < methods.Length; ++b) { if (methods[b].IsDefined(typeof(RFC), true)) { CachedRFC ent = new CachedRFC(); ent.func = methods[b]; RFC tnc = (RFC)ent.func.GetCustomAttributes(typeof(RFC), true)[0]; ent.type = tnc.Type; ent.Param = tnc.Param; mRFCs.Add(ent); } } }