Ejemplo n.º 1
0
    static void WrapUnityClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("Unity");

        WrapType(pWrap, typeof(UnityEngine.Time));
        WrapType(pWrap, typeof(UnityEngine.Object));
        WrapType(pWrap, typeof(UnityEngine.Component));
        WrapType(pWrap, typeof(UnityEngine.Transform));
        WrapType(pWrap, typeof(UnityEngine.Texture2D));
        WrapType(pWrap, typeof(UnityEngine.GameObject));
        WrapType(pWrap, typeof(UnityEngine.Behaviour));
        WrapType(pWrap, typeof(UnityEngine.MonoBehaviour));
        WrapType(pWrap, typeof(UnityEngine.Animation));
        WrapType(pWrap, typeof(UnityEngine.Renderer));
        WrapType(pWrap, typeof(UnityEngine.MeshRenderer));
        WrapType(pWrap, typeof(UnityEngine.SkinnedMeshRenderer));
        WrapType(pWrap, typeof(UnityEngine.Input));
        WrapType(pWrap, typeof(UnityEngine.Light));
        WrapType(pWrap, typeof(UnityEngine.Material));
        WrapType(pWrap, typeof(UnityEngine.Events.UnityEvent));
        WrapType(pWrap, typeof(UnityEngine.AsyncOperation));
        WrapType(pWrap, typeof(UnityEngine.SceneManagement.Scene));
        WrapType(pWrap, typeof(UnityEngine.SceneManagement.SceneManager));

        pWrap.EndModleWrap();
    }
Ejemplo n.º 2
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();
    }
Ejemplo n.º 3
0
    static void WrapCustomClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("Custom");

        pWrap.WrapClass(typeof(TestExport)); // 导出一个测试的类

        pWrap.EndModleWrap();
    }
Ejemplo n.º 4
0
    static void WrapUIClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("UnityUI");
        // 导出UI类
        WrapType(pWrap, typeof(UnityEngine.UI.Button));
        WrapType(pWrap, typeof(UnityEngine.UI.Text));

        pWrap.EndModleWrap();
    }
Ejemplo n.º 5
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();
    }
    static void TestExport()
    {
        Type        t1   = typeof(IEnumerable <AssetBundle>);
        FCValueType v1   = FCValueType.TransType(t1);
        string      s1   = v1.GetValueName(true);
        int         iiii = 0;

        FCClassWrap pWrap = new FCClassWrap();

        pWrap.BeginExport("");

        pWrap.BeginModleWrap("AutoClass");
        pWrap.WrapClass(typeof(UnityEngine.AssetBundle));
        pWrap.EndModleWrap();

        pWrap.EndExport();
        MakeFCProj();
    }
Ejemplo n.º 7
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();
    }
Ejemplo n.º 8
0
    // 功能:导出带有标签的类
    static void WrapCustomAttribClass(FCClassWrap pWrap)
    {
        pWrap.BeginModleWrap("AutoClass");

        Assembly assembly = Assembly.Load("Assembly-CSharp");

        Type[] types = assembly.GetExportedTypes();
        foreach (Type t in types)
        {
            if (t.IsDefined(typeof(AutoWrapAttribute), false))
            {
                pWrap.WrapClass(t, false);
            }
            else if (t.IsDefined(typeof(PartWrapAttribute), false))
            {
                pWrap.WrapClass(t, true);
            }
        }
        pWrap.EndModleWrap();
    }
    // 功能:导出这个模块下的所有类
    static void WrapAllClass(FCClassWrap pWrap, string szNamespace, List <Type> rList)
    {
        string szModleName = szNamespace.Replace('.', '_');

        pWrap.BeginModleWrap(szModleName);
        int nIndex = 0;

        foreach (Type t in rList)
        {
            ++nIndex;
            try
            {
                PrepareWrap(pWrap, t);
                pWrap.WrapClass(t);
            }
            catch (Exception e)
            {
                Debug.LogError("导出异常, nIndex = " + nIndex);
                Debug.LogException(e);
            }
        }
        pWrap.EndModleWrap();
    }