国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

[游戲開發(fā)][Unity] Xlua生成wrap文件報錯、打AB包Wrap報錯

這篇具有很好參考價值的文章主要介紹了[游戲開發(fā)][Unity] Xlua生成wrap文件報錯、打AB包Wrap報錯。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

?Xlua生成wrap文件,自帶添加了ref字段報錯

例如Material生成MaterialWrap時,EnableKeyword(in LocalKeyword keyword);帶著in關鍵字,所以在Wrap文件中會自動在參數(shù)前生成ref關鍵字導致編譯不過

解決辦法:

換Xlua版本就好了,也不知道我xlua當時從哪個版本copy過來的,換了xlua-master里的Xlua源碼,再次生成wrap就沒問題了。

?打包時Xlua Wrap文件報錯:

Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(169,57): error CS1061: 'AudioSource' does not contain a definition for 'PlayOnGamepad' and no accessible extension method 'PlayOnGamepad' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(197,57): error CS1061: 'AudioSource' does not contain a definition for 'DisableGamepadOutput' and no accessible extension method 'DisableGamepadOutput' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(227,57): error CS1061: 'AudioSource' does not contain a definition for 'SetGamepadSpeakerMixLevel' and no accessible extension method 'SetGamepadSpeakerMixLevel' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(256,57): error CS1061: 'AudioSource' does not contain a definition for 'SetGamepadSpeakerMixLevelDefault' and no accessible extension method 'SetGamepadSpeakerMixLevelDefault' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(286,57): error CS1061: 'AudioSource' does not contain a definition for 'SetGamepadSpeakerRestrictedAudio' and no accessible extension method 'SetGamepadSpeakerRestrictedAudio' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(311,33): error CS0234: The type or namespace name 'GamepadSpeakerOutputType' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(313,63): error CS0117: 'AudioSource' does not contain a definition for 'GamepadSpeakerSupportsOutputType'
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(982,54): error CS1061: 'AudioSource' does not contain a definition for 'gamepadSpeakerOutputType' and no accessible extension method 'gamepadSpeakerOutputType' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(1396,29): error CS0234: The type or namespace name 'GamepadSpeakerOutputType' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\XLua\Gen\UnityEngine_AudioSourceWrap.cs(1397,23): error CS1061: 'AudioSource' does not contain a definition for 'gamepadSpeakerOutputType' and no accessible extension method 'gamepadSpeakerOutputType' accepting a first argument of type 'AudioSource' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(137,60): error CS1061: 'MeshRenderer' does not contain a definition for 'scaleInLightmap' and no accessible extension method 'scaleInLightmap' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(151,54): error CS1061: 'MeshRenderer' does not contain a definition for 'receiveGI' and no accessible extension method 'receiveGI' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(165,61): error CS1061: 'MeshRenderer' does not contain a definition for 'stitchLightmapSeams' and no accessible extension method 'stitchLightmapSeams' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(211,35): error CS1061: 'MeshRenderer' does not contain a definition for 'scaleInLightmap' and no accessible extension method 'scaleInLightmap' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(227,23): error CS1061: 'MeshRenderer' does not contain a definition for 'receiveGI' and no accessible extension method 'receiveGI' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Assets\XLua\Gen\UnityEngine_MeshRendererWrap.cs(242,35): error CS1061: 'MeshRenderer' does not contain a definition for 'stitchLightmapSeams' and no accessible extension method 'stitchLightmapSeams' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)
Error building Player because scripts had compiler errors

解決方法

?Xlua的配置文件有個專門添加[LuaCallCSharp]、[CSharpCallLua]、[BlackList]的方法,在xlua-master源碼里是ExampleGenConfig.cs或者ExampleConfig.cs

BlackList的作用:生成的wrap文件中屏蔽字段和方法

BlackList如何配置:

屏蔽變量和方法的方式如下,都羅列出來了,對號入座。

屏蔽變量?

new List<string>(){"UnityEngine.AudioSource", "gamepadSpeakerOutputType"},

?屏蔽無參方法

new List<string>(){"UnityEngine.AudioSource", "DisableGamepadOutput"},

?屏蔽參數(shù)是Int32的方法

new List<string>(){"UnityEngine.AudioSource", "PlayOnGamepad","System.Int32"},

屏蔽多參數(shù)方法?

new List<string>(){"UnityEngine.AudioSource", "SetGamepadSpeakerRestrictedAudio","System.Int32","System.Boolean"},

請注意,AudioSource前面的命名空間不能省略

找到BlackList

 //黑名單
    [BlackList]
    public static List<List<string>> BlackList = new List<List<string>>()  {
                new List<string>(){"System.Xml.XmlNodeList", "ItemOf"},
                new List<string>(){"UnityEngine.WWW", "movie"},
    #if UNITY_WEBGL
                new List<string>(){"UnityEngine.WWW", "threadPriority"},
    #endif
                new List<string>(){"UnityEngine.Texture2D", "alphaIsTransparency"},
                new List<string>(){"UnityEngine.Security", "GetChainOfTrustValue"},
                new List<string>(){"UnityEngine.CanvasRenderer", "onRequestRebuild"},
                new List<string>(){"UnityEngine.Light", "areaSize"},
                new List<string>(){"UnityEngine.Light", "lightmapBakeType"},
    #if UNITY_ANDROID
                new List<string>(){"UnityEngine.Light", "SetLightDirty"},
                new List<string>(){"UnityEngine.Light", "shadowRadius"},
                new List<string>(){"UnityEngine.Light", "shadowAngle"},
    #endif
                new List<string>(){"UnityEngine.WWW", "MovieTexture"},
                new List<string>(){"UnityEngine.WWW", "GetMovieTexture"},
                new List<string>(){"UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup"},
    #if !UNITY_WEBPLAYER
                new List<string>(){"UnityEngine.Application", "ExternalEval"},
    #endif
                new List<string>(){"UnityEngine.GameObject", "networkView"}, //4.6.2 not support
                new List<string>(){"UnityEngine.Component", "networkView"},  //4.6.2 not support
                new List<string>(){"System.IO.FileInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
                new List<string>(){"System.IO.FileInfo", "SetAccessControl", "System.Security.AccessControl.FileSecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
                new List<string>(){"System.IO.DirectoryInfo", "SetAccessControl", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "CreateSubdirectory", "System.String", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "Create", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"UnityEngine.MonoBehaviour", "runInEditMode"},
            };

然后把我下面這一段加入到中間

    //Texture
    new List<string>(){"UnityEngine.Texture", "imageContentsHash"},

    //MeshRenderer
    new List<string>(){"UnityEngine.MeshRenderer", "scaleInLightmap"},
    new List<string>(){"UnityEngine.MeshRenderer", "receiveGI"},
    new List<string>(){"UnityEngine.MeshRenderer", "stitchLightmapSeams"},
    new List<string>(){"UnityEngine.MeshRenderer", "scaleInLightmap"},
    new List<string>(){"UnityEngine.MeshRenderer", "receiveGI"},
    new List<string>(){"UnityEngine.MeshRenderer", "stitchLightmapSeams"},

    //AudioSource
    new List<string>(){"UnityEngine.AudioSource", "gamepadSpeakerOutputType"},
    new List<string>(){"UnityEngine.AudioSource", "PlayOnGamepad","System.Int32"},
    new List<string>(){"UnityEngine.AudioSource", "DisableGamepadOutput"},
    new List<string>(){"UnityEngine.AudioSource", "SetGamepadSpeakerMixLevel","System.Int32","System.Int32"},
    new List<string>(){"UnityEngine.AudioSource", "SetGamepadSpeakerMixLevelDefault","System.Int32"},
    new List<string>(){"UnityEngine.AudioSource", "SetGamepadSpeakerRestrictedAudio","System.Int32","System.Boolean"},
    new List<string>(){"UnityEngine.AudioSource", "GamepadSpeakerSupportsOutputType","UnityEngine.GamepadSpeakerOutputType"},

再次執(zhí)行Clear Generated Code、Generated Code后,會發(fā)現(xiàn)Wrap文件里的相關變量和方法都消失了。再次打包則不會報錯文章來源地址http://www.zghlxwxcb.cn/news/detail-765822.html

到了這里,關于[游戲開發(fā)][Unity] Xlua生成wrap文件報錯、打AB包Wrap報錯的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!

本文來自互聯(lián)網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • [游戲開發(fā)][Unity]Assetbundle下載篇(1)熱更前準備與下載AB包清單

    [游戲開發(fā)][Unity]Assetbundle下載篇(1)熱更前準備與下載AB包清單

    打包與資源加載框架目錄 熱更流程都不是固定的,每個人寫的狀態(tài)機也有所差別,但是一些必要步驟肯定不可能少,例如下載清單,對比版本,下載AB包,標記下載完成。我接下來的每一篇文章都是下載AB包的重要步驟,大概率是不能省略的。 檢查沙盒路徑是否存在 檢查下載

    2024年02月15日
    瀏覽(26)
  • [游戲開發(fā)][Unity]Assetbundle下載篇(4)檢查斷點續(xù)傳以及開始下載AB包

    打包與資源加載框架目錄 下 載 AB包之前,要檢查該AB包是否下載中斷過,例如用戶殺程序,卡死等情況。 前文有講解過,下載AB包會先下載到臨時文件夾,全部下載成功后,全部剪切到persistentDataPath沙盒目錄中。 回顧一下之前的篩選機制,哪些AB包可以加入下載列表,其中并

    2024年02月09日
    瀏覽(25)
  • [游戲開發(fā)][Unity]Assetbundle加載篇(4)檢查斷點續(xù)傳以及開始下載AB包

    打包與資源加載框架目錄 下 載 AB包之前,要檢查該AB包是否下載中斷過,例如用戶殺程序,卡死等情況。 前文有講解過,下載AB包會先下載到臨時文件夾,全部下載成功后,全部剪切到persistentDataPath沙盒目錄中。 回顧一下之前的篩選機制,哪些AB包可以加入下載列表,其中并

    2024年02月08日
    瀏覽(28)
  • 第二節(jié) 彈性盒子( justify-content屬性、align-items屬性、flex-direction屬性、flex-wrap屬性)

    彈性盒子( Flexible Box 或 flexbox):CSS3的一種新布局模式。 是一種當頁面需要適應不同的屏幕大小以及設備類型時確保元素擁有恰當?shù)男袨榈牟季址绞健?row(默認值):主軸為水平方向,起點在左端; ?row-reverse:主軸為水平方向,起點在右端; column:主軸為垂直方向,起點

    2023年04月17日
    瀏覽(26)
  • Unity xLua開發(fā)環(huán)境搭建與基礎進階

    Unity xLua開發(fā)環(huán)境搭建與基礎進階

    Unity是一款非常流行的游戲開發(fā)引擎,而xLua是一個為Unity開發(fā)者提供的Lua框架,可以讓開發(fā)者使用Lua語言來進行游戲開發(fā)。在本文中,我們將介紹如何搭建Unity xLua開發(fā)環(huán)境,并進行基礎進階的學習。 環(huán)境搭建 首先,我們需要下載xLua框架,可以在GitHub上找到最新的版本。下載

    2024年02月22日
    瀏覽(94)
  • Unity3D xLua開發(fā)環(huán)境搭建詳解

    xLua是一種基于Lua語言的開發(fā)框架,可以幫助開發(fā)者在Unity3D中使用Lua腳本來開發(fā)游戲。 對惹,這里有一 個游戲開發(fā)交流小組 ,希望大家可以點擊進來一起交流一下開發(fā)經驗呀! 在本文中,我們將詳細介紹如何搭建Unity3D xLua開發(fā)環(huán)境,包括安裝Unity3D和xLua插件,配置環(huán)境變量

    2024年02月22日
    瀏覽(26)
  • 修改element-ui中Tabs標簽頁下劃線默認顏色的方法以及為什么設置了.el-tabs /deep/ .el-tabs__nav-wrap::after不起效果

    修改element-ui中Tabs標簽頁下劃線默認顏色的方法以及為什么設置了.el-tabs /deep/ .el-tabs__nav-wrap::after不起效果

    類似圖上的灰色線段,這是Tabs的默認樣式, 在項目中的路徑位置在:node_modules/element-ui/theme-chalk/tag.css? ?(我原本想在源文件直接改顏色的,但是找了一圈不知道哪個是他的顏色哈哈哈) 方法是: /deep/ 深度作用操作符:可以使樣式作用的更深,例如影響子組件。 同時,

    2024年02月09日
    瀏覽(35)
  • Unity組件開發(fā)--AB包打包工具

    Unity組件開發(fā)--AB包打包工具

    1.項目工程路徑下創(chuàng)建文件夾:ABundles 2.AB包打包腳本: 3.需要打包的場景添加到打包配置: 4.unity編輯器生成菜單: 5.場景加載AB包管理器:

    2024年04月28日
    瀏覽(13)
  • 基于Unity開發(fā)WebGL項目加載AB包(三)

    基于Unity開發(fā)WebGL項目加載AB包(三)

    在前兩篇文章中,我們分別了解了WebGL如何通過StreamingAssets加載AB包資源(鏈接:基于Unity開發(fā)WebGL項目加載AB包(一)_梵高先森丶的博客-CSDN博客)和如何通過局域網(本地服務器)加載AB包資源(鏈接:基于Unity開發(fā)WebGL項目加載AB包(二)_梵高先森丶的博客-CSDN博客),那么本文,

    2024年02月13日
    瀏覽(23)
  • 【游戲開發(fā)算法每日一記】使用隨機prime算法生成錯綜復雜效果的迷宮(C#,C++和Unity版)

    【游戲開發(fā)算法每日一記】使用隨機prime算法生成錯綜復雜效果的迷宮(C#,C++和Unity版)

    ?????個人主頁 :@元宇宙-秩沅 ????? hallo 歡迎 點贊?? 收藏? 留言?? 加關注?! ????? 本文由 秩沅 原創(chuàng) ????? 收錄于專欄 :Unity基礎實戰(zhàn) 1.首先全部判定為墻,最外的為路包裹墻( 類似于防止數(shù)組越界 ) 2.紅色為它的檢測范圍(假設檢測點在如圖所示的位置)—

    2024年02月05日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包