static void AddTemplateSurport(FCClassWrap pWrap)
    {
        List <Type> aSupportType = FCExclude.SupportTemplateTypes;

        pWrap.PushTemplateFuncWrapSupport("AddComponent", aSupportType);
        pWrap.PushTemplateFuncWrapSupport("GetComponent", aSupportType);
    }
Esempio n. 2
0
    static void AddTemplateSurport(FCClassWrap pWrap)
    {
        List <Type> aSupportType = new List <Type>();

        aSupportType.Add(typeof(UnityEngine.SkinnedMeshRenderer));
        aSupportType.Add(typeof(UnityEngine.MeshRenderer));
        aSupportType.Add(typeof(UnityEngine.Animation));
        aSupportType.Add(typeof(UnityEngine.Light));

        aSupportType.Add(typeof(UnityEngine.UI.Button));
        aSupportType.Add(typeof(UnityEngine.UI.Text));
        // 在这里添加其他的类的吧

        pWrap.PushTemplateFuncWrapSupport("AddComponent", aSupportType);
        pWrap.PushTemplateFuncWrapSupport("GetComponent", aSupportType);
    }
    static void PrepareWrap(FCClassWrap pWrap, Type nClassType)
    {
        // 添加黑名单函数
        List <string> rList = FCExclude.GetClassBlackList(nClassType);

        if (rList != null)
        {
            foreach (string funcName in rList)
            {
                pWrap.PushCurrentDontWrapName(funcName);
            }
        }
        // 目前只有两个类型支持模板函数,其他的需要用户自己扩展
        if (nClassType == typeof(UnityEngine.Component) ||
            nClassType == typeof(UnityEngine.GameObject))
        {
            List <Type> aSupportType = FCExclude.SupportTemplateTypes;
            pWrap.PushTemplateFuncWrapSupport("AddComponent", aSupportType);
            pWrap.PushTemplateFuncWrapSupport("GetComponent", aSupportType);
        }
    }