예제 #1
0
    static void WrapUnityClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("Unity");

        //pWrap.WrapClass(typeof(System.Type));
        pWrap.WrapClass(typeof(UnityEngine.Time));
        pWrap.WrapClass(typeof(UnityEngine.Object));
        AddTemplateSurport(pWrap); // 添加模板函数的wrap支持
        pWrap.WrapClass(typeof(UnityEngine.Component));
        pWrap.WrapClass(typeof(UnityEngine.Transform));
        pWrap.PushCurrentDontWrapName("alphaIsTransparency");
        pWrap.WrapClass(typeof(UnityEngine.Texture2D));
        AddTemplateSurport(pWrap); // 添加模板函数的wrap支持
        pWrap.WrapClass(typeof(UnityEngine.GameObject));
        pWrap.WrapClass(typeof(UnityEngine.Behaviour));
        pWrap.PushCurrentDontWrapName("Item");
        pWrap.WrapClass(typeof(UnityEngine.Animation));
        pWrap.WrapClass(typeof(UnityEngine.Transform));
        pWrap.WrapClass(typeof(UnityEngine.Renderer));
        pWrap.WrapClass(typeof(UnityEngine.MeshRenderer));
        pWrap.WrapClass(typeof(UnityEngine.SkinnedMeshRenderer));
        pWrap.PushCurrentDontWrapName("IsJoystickPreconfigured");
        pWrap.WrapClass(typeof(UnityEngine.Input));
        pWrap.PushCurrentDontWrapName("areaSize");
        pWrap.PushCurrentDontWrapName("lightmapBakeType");
        pWrap.WrapClass(typeof(UnityEngine.Light));
        pWrap.WrapClass(typeof(UnityEngine.Material));
        pWrap.WrapClass(typeof(UnityEngine.Events.UnityEvent));

        pWrap.EndModleWrap();
    }
예제 #2
0
    static void WrapUIClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("UnityUI");
        // 导出UI类
        pWrap.WrapClass(typeof(UnityEngine.UI.Button));
        pWrap.PushCurrentDontWrapName("OnRebuildRequested");
        pWrap.WrapClass(typeof(UnityEngine.UI.Text));

        pWrap.EndModleWrap();
    }
예제 #3
0
    static void WrapUnityClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("Unity");

        //pWrap.WrapClass(typeof(System.Type));
        pWrap.WrapClass(typeof(UnityEngine.Object));
        pWrap.WrapClass(typeof(UnityEngine.Transform));
        pWrap.WrapClass(typeof(UnityEngine.Component));
        pWrap.WrapClass(typeof(UnityEngine.Texture2D));
        pWrap.WrapClass(typeof(UnityEngine.GameObject));
        pWrap.WrapClass(typeof(UnityEngine.Behaviour));
        pWrap.PushCurrentDontWrapName("Item");
        pWrap.WrapClass(typeof(UnityEngine.Animation));
        pWrap.WrapClass(typeof(UnityEngine.Transform));
        pWrap.WrapClass(typeof(UnityEngine.SkinnedMeshRenderer));
        pWrap.WrapClass(typeof(UnityEngine.Input));

        pWrap.EndModleWrap();
    }
    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);
        }
    }