egametang / ET

Unity3D Client And C# Server Framework
Other
8.82k stars 3k forks source link

PC standalone: NullReference #166

Open ikay70 opened 4 years ago

ikay70 commented 4 years ago

Hi, trying to take a look at ET-Framework. Getting nullreference exception after build.

Steps I took:

  1. \Git\ET 6.0 beta
  2. \Unity -> Unity 2018.4.15 -> open c# project -> compile
  3. \Server\server.sln -> VS2019 with netcore 3.0 -> compile
  4. Unity project -> Tools -> compile -> Platform: PC, isBuildExe: true (tried both with Mono and IL2CPP)
  5. Unity project -> Tools -> run server
  6. Unity project -> Tools -> run web sever
  7. Unity build -> run -> NULLREFERENCE
    NullReferenceException: Object reference not set to an instance of an object.
    at ETModel.BundleDownloaderComponent.Dispose () [0x00000] in <00000000000000000000000000000000>:0 
    at ETModel.BundleHelper+<DownloadBundle>d__0.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
    at System.Array.InternalArray__ICollection_Add[T] (T item) [0x00000] in <00000000000000000000000000000000>:0 
    at ETModel.BundleHelper.DownloadBundle () [0x00000] in <00000000000000000000000000000000>:0 
    at ETModel.Init+<StartAsync>d__1.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
    at System.Array.InternalArray__ICollection_Add[T] (T item) [0x00000] in <00000000000000000000000000000000>:0 
    at ETModel.Init.Start () [0x00000] in <00000000000000000000000000000000>:0 
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    ETModel.Log:Error(Exception)
    ETModel.<DownloadBundle>d__0:MoveNext()
    System.Array:InternalArray__ICollection_Add(T)
    ETModel.BundleHelper:DownloadBundle()
    ETModel.<StartAsync>d__1:MoveNext()
    System.Array:InternalArray__ICollection_Add(T)
    ETModel.Init:Start()

But I still can run within Unity Editor. Any suggestions where to look at?

zxt385189207 commented 4 years ago

6.0 beta版 release后运行会出现NullReference bug 解决办法: 1.Game.Scene用 EntityFactory.CreateScene方法生成,这样Game.Scene才正确有Domain 144749pax1lhlffyhhewhg

2.BundleDownloaderComponent 的dispose方法中Parent.RemoveComponent()要放到base.Dispose之前 因为base.dispose会清除parent信息 QQ截图20200122125027

3.BundleHelper中 Game.EventSystem.Run(EventIdType.LoadingBegin)加上一个Game.Scene的参数 144818a868yji644664vsv

freedomWind commented 4 years ago

Thank you very much!

2020年1月22日 下午12:52,TianDao notifications@github.com 写道:

.0 beta版 release后运行会出现NullReference bug 解决办法: 1.Game.Scene用 EntityFactory.CreateScene方法生成,这样Game.Scene才正确有Domain https://user-images.githubusercontent.com/20718536/72866356-f6a77a80-3d15-11ea-9628-74a6463d5c81.png 2.BundleDownloaderComponent 的dispose方法中Parent.RemoveComponent()要放到base.Dispose之前 因为base.dispose会清除parent信息 https://user-images.githubusercontent.com/20718536/72866367-ff984c00-3d15-11ea-8b94-9fbba8f982fa.png 3.BundleHelper中 Game.EventSystem.Run(EventIdType.LoadingBegin)加上一个Game.Scene的参数 https://user-images.githubusercontent.com/20718536/72866380-07f08700-3d16-11ea-8424-56d2acb47bef.png — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/egametang/ET/issues/166?email_source=notifications&email_token=AA6FLYP2X67ZISHYMZ4ZUHTQ67GJVA5CNFSM4KJYSXMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJSGZQQ#issuecomment-577006786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6FLYN3FL7QXK43WPRC7PLQ67GJVANCNFSM4KJYSXMA.