Comments (6)
Not during the start of the scene, no, it gets created when I invoke the file browser by clicking on a UI button in my own Canvas. But when I was getting the error yesterday, I can't remember if the SimpleFileBrowserCanvas object was there from the beginning or not, and now I can't reproduce the exception.
I did two changes in the SimpleFileBrowserCanvas: I disabled the EventSystem, because I already have one in my scene, and changed the CanvasScaler reference resolution.
EDIT: I managed to reproduce the bug!! It happened while I started the game in the editor while having the SimpleFileBrowserCanvas prefab opened in Prefab mode. Here are the steps to reproduce it in Unity 2020.2.1f1:
- Create an empty scene (I tried with my existing scene and with an empty one, and it happened both times).
- Double-click SimpleFileBrowserCanvas.prefab in the Project panel. This will open it in Prefab mode, and makes the scene panel background blue.
- With the prefab still open, press Play.
- The following exception occurs right after starting:
NullReferenceException: Object reference not set to an instance of an object
SimpleFileBrowser.RecycledListView.UpdateList () (at Assets/Plugins/SimpleFileBrowser/Scripts/SimpleRecycledListView/RecycledListView.cs:55)
SimpleFileBrowser.FileBrowser.RefreshFiles (System.Boolean pathChanged) (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1621)
SimpleFileBrowser.FileBrowser.OnShowHiddenFilesToggleChanged () (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1266)
UnityEngine.Events.InvokableCall.Invoke () (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.UI.Toggle.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:130)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:182)
UnityEngine.UI.ScrollRect:LateUpdate() (at C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/ScrollRect.cs:808)
I must've had the prefab mode open yesterday and didn't realize it.
from unitysimplefilebrowser.
The closest setup I have is Unity 2019.4.0f1 on Windows and I can't reproduce this issue with these reproduction steps. And frankly, it should be impossible to encounter this Issue. Let's see why:
-
Error comes from this line:
-
Value of adapter is assigned here:
-
This function is called here
which is inside here:
Awake is called before any other functions. If there was an exception that interrupted Awake, this error would be possible but you didn't mention any in the Issue description.
Are there any other steps that you didn't mention in Reproduction steps? You should create a new Unity project, import the plugin there and take note of every step you take until you can reproduce this issue and report all of these steps in Reproduction steps.
from unitysimplefilebrowser.
I'm finding the same error with version 1.4.1, running in Unity 2020.2.1f1 on Windows 10.
It happens one single time, when the scene starts, even before I invoke the file browser. But after that, everything works as expected: I can open the browser, select a file, etc.
@yasirkula from what you say, it makes sense that it happens, because during the start of my scene, I don't invoke any file browser, so the Awake method doesn't have a chance to run. But somehow Unity itself is invoking something that runs SimpleFileBrowser.FileBrowser.OnShowHiddenFilesToggleChanged
.
I already have an EventSystem in my scene, so I disabled the EventSystem gameobject inside SimpleFileBrowserCanvas. I didn't try it in an empty scene without an existing EventSystem... could that be it? The already-existing EventSystem is triggering the toggle changed event?
from unitysimplefilebrowser.
I restarted Unity and now I can't reproduce the bug anymore... I'm not sure what fixed it, because I didn't change anything in my setup. Maybe it was because I imported a new version of Runtime File Browser without deleting all the files from the previous one.
from unitysimplefilebrowser.
I don't think it is related to EventSystem. Do you have an instance of SimpleFileBrowserCanvas object in your scene? If so, is it active? Did you modify it in any way?
from unitysimplefilebrowser.
Awesome! I was able to reproduce the error on 2018.4, too.
from unitysimplefilebrowser.
Related Issues (20)
- A question about compatibility HOT 4
- file save/load pathes cannot be used on android 13 HOT 1
- Suggestion: Expose DocumentsContract.isChildDocument HOT 3
- Overwrite prompt only works once HOT 3
- MissingReferenceException: The variable m_font of UISkin doesn't exist anymore. HOT 1
- how do you add a link to user sub folder like C:\\Users\<username>\Pictures ? HOT 1
- How to get the SimpleFileBrowserCanvas(Clone) reference after it spawns on my scene in script? HOT 2
- Exclusion not working HOT 1
- Changing skin during runtime throws error HOT 2
- VR Pointer issue when selecting items in File Browser (Oculus/Meta Quest 2) HOT 8
- Android Showing Different Menu HOT 10
- Log Spam: Invalid Unicode Error HOT 6
- WebGL Methods HOT 2
- File Access does not work on quest 2 HOT 3
- Drop Down Text Missing
- GLB and JSON files not appearing Quest Pro HOT 10
- How do I turn off listening for long presses and multiple selections HOT 2
- Whether it supports opening folders on Android phones HOT 1
- Files do not show in playmode HOT 1
- 1.6.6 (git) & 2022.3.23f (windows) — Null Reference Exception HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitysimplefilebrowser.