简体   繁体   中英

C# / Unity : Visual Studio parameter not getting passed

Problem Overview: Parameter passed to function is not making it to the function

I have a function call in one script that calls another. The caller is shown below- 来电显示

However, the function which gets called (and I am sure that it is being called due to stepping directly into the function and only stepping forwards one line at a time), never gets that variable.

在此处输入图片说明

Hovering over the name parameter does nothing, even though hovering over the searchAllScenes gives me a value of false. The name parameter similarly does not show up in Autos, and typing it into the Immediate Window returns "Unable to evaluate the expression. General Exception". It's also not being set to the default null value, as lines 265-266 are never triggered.

I feel like this is a compiler issue, and have tried rebuilding the solution, but the same problem keeps occurring, preventing my project from working. It was working a few days ago, it just stopped, with no changes made (I have git reverted back to previous versions and they do not work).

Versions:

  • Visual Studio Community 2017, Version 15.8.9
  • Unity 2018.2.14f1 Personal

Nothing ended up working. I tried deleting the obj and bin folders and rebuilding, but it still did not work. However, for some reason, simply deleting the objects that were using those scripts and reimporting them made everything work again.

This isn't exactly a fix, as I still don't understand what happened, though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM