What is responsible for pausing code in Unity? - c#

There's something that's pausing my code in Unity and I'm not sure what it is. I've searched for Debug.Break() statements everywhere and don't have any. What's causing this issue?
(Asked on behalf of Jabrils who could have been saved by this question.)

If you don't have any Debug.Break() statements, and your code doesn't have any other breakpoints to look at, check the "Pause on Error" functionality of Unity. It can be turned off by clicking a UI button when you have the console open.

Related

VisualStudio highlights all my code green, I don't know how to disable this effect/feature

I was writing the code normally and then I fear I have accidentally pressed some shortcut that made my code all highlighted green, I tried to press some combos but nothing changed, I deleted the script from Unity and pasted the code into a new script, and it gave me the same issue. If I press anywhere it doesn't change anything and it only disappears for a moment when I edit the code and then it goes back to being green. I imagine this feature has a purpose that I'm not understanding but at the moment it's not doing anything for me except making the code less readable. Does anyone know what caused this effect, how can I remove it, and what is it's purpose? Thanks for your help.
You can also check the theme here:
Maybe you turned on "Toggle Code Coverage Highlithing" under Tools menu.
If it looks something like this then you've probably added the files to your project without adding them to git. The green indicates added but unstaged changes. Do you see plus signs in the ruler?

Unity Stuck on Application.UpdateScene

My game was working fine all long for days. Recently just after adding attack animation for my enemyai it started freezing everytime I clicked on play.
So when I click play unity pops up with a message saying "Hold On ! Application.UpdateScene" and its stuck on that ever since. The only way for me to exit is using task manager.
Screenshot:
I tried debbing and adding break points but it did not work. At this point I don't know what wrong is it my code or something else.
I haven't updated my unity I am on 2020.1f but I don't think that might be causing the problem.
Also incase it's not possible to resolve this problem can you'll please tell me a way to complete my project quicker without redoing it everything.
Thanks
It is usually caused by a dead-loop.
I also has this issue today. I solved it by attaching the debugger (Visual Studio in my case) to the forever loading Unity Editor. After that, pause the debugger. This will freeze Unity but we can then inspect where the code is executing at this particular moment. Select the inspecting thread to "Unity Thread" in Visual Studio. In my case, it immediately show the code is running inside a while-loop which I forgot to increase the i variable and turn the loop into a dead loop.
The reason is just delete your Library package in your project folder then reopen your project unity recreate the file. The problem appears when you import assets from asset store.

UIAutomation, pause application if Help window appears

This is related to my other question.
I used the OnStructureChanged event to detect that the 'Help' window popped up in the 3rd party application that my application is writing data to. I need my application to pause while the end user resolves the data issue in the 3rd party application, then I need my application to resume once the end user closes the 'Help' window. (Either I need to detect that the 'Help' window was closed or I need to display a message box and use the DialogResult to trigger my application to resume).
I've never encountered something like this before. I don't know if it's possible to do what I want to do. If it is possible, I don't know where to start.
Advice?
UPDATES:
I have only used Threading once before and I think it was a fairly "easy peasy" usage, I pulled it off without much effort, considering I'd never used Threading before. I'm playing around with Threading for this issue right now. There's a good chance I've implemented it incorrectly, but my app isn't functioning correctly anymore...I don't know if I'm even playing with the correct tool.
I had to just keep moving with the project - deadlines, you know...
I ended up using UI Automation to detect the "Help" window, then I showed a message box giving instructions to the end user. I check the MessageBox's DialogResult and continue processing based on that. It might not be the "best" way to skin the cat, but I'm a noob and I have a deadline, so I did what I needed to do to keep moving.

can i see real time javascript events like ajax calls in firebug?

So when I do an ajax POST I can see the thing firing in firebug, I can see the spinning icon as it's running, a finished icon when it's done. I can see results or errors and whatnot, you all know the deal.
Is there a way to get it to show me every javascript event as it fires? So if I have something like this in my windows onload:
defaultJs.LoadImages();
defaultJs.CheckAccount(username);
vendorsJs.UpdateSearch();
I would ideally see each of those happening, or be able to step through them similar to how you would step through CS files while you're attached to the WWW process with F10 and F11 and all that.
My problem is how long it takes tracking through another person's code when I'm tasked with finishing the work of another developer that's been moved to another project. I basically have to do what I described manually reading the code, or set up a ton of console.logs to try and force this sort of information into something I can read.
I'm hoping firebug has some feature I haven't enabled, or there's a program like fiddler (where you see things loading realtime) that'll do it for me.
Sorry if this is a repeat question, I wasn't able to find an answer that worked for me after some searching. I appreciate any time anyone commits to helping me out here. Have a good day yall.
you can debug the JS code using FireBug
http://getfirebug.com/javascript

Application freezes when changing windows keyboard input language

When I run my application, do some work on it and click the language button on the Windows taskbar and change the input language, my C# application freezes displaying an hourglass cursor. Does anyone have any idea on what may be going wrong? I have absolutely no clue where to start...
First of all, your problem is hard to follow, since we don't know what is going on in your application. Neither we know which exactly code in your application freezes.
For others, the problem in your application is not clear. So having this quite weakly defined problem, it's hardly possible that someone can help.
You can do the following in order to resolve the issue:
Try to build a minimal test case, which reproduces the problem. Usually you'll need to start with a copy of your source code, and remove features until the bug is not reproducible any more.
After this, you will most likely see yourself, where the problem is.
If not, you can post the example and the changes which make the bug happen. Please kindly try to remove as much as possible from the example, leaving only essential part.
This way you will most likely have your problem solved.

Categories