Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Aug 2002
Offline Last Active Today, 12:18 PM

Posts I've Made

In Topic: Unity C# EditorSceneManager Issue

Yesterday, 03:20 PM

You might also see if the SceneManager (not EditorSceneManager) will work. It's the equivalent class that you can use while the game is running.


I haven't personally used it for what you're trying to do, but UnloadScene sounds promising. (The documentation on that page says there is an UnloadSceneAsync function, but I don't actually see that one. Could be sketchy docs...)

In Topic: Unity C# EditorSceneManager Issue

Yesterday, 02:23 PM

MenuItem examples: https://docs.unity3d.com/ScriptReference/MenuItem.html

Basically, just put a [MenuItem("Menu/ItemName")] attribute on a static function. This will create an entry on the Unity editor's main menu that you can click to run the function.

This will let you test your scene closing code. This should let you find out if it's a problem specific to switching from edit->play mode or not.

In Topic: Unity C# EditorSceneManager Issue

Yesterday, 01:24 PM

It might be an issue with trying to manipulate the scene during the edit->play transition. Does that code work if you run it from a MenuItem?

How do you define and initialize the sceneName variable? Try also Debug.Logging the sceneName variable to make sure it's still what you expect when that code runs.

Is there anything else happening when the game starts that could be instantly re-opening the scene?

In Topic: Visual studios 2010 debugger variable doesn't update

26 September 2016 - 02:04 PM

That thing that you accidentally clicked might have been something on the "project is out of date, do you want to compile it?" dialog. If that is set to 'never', you could be running an old version of your EXE which doesn't contain any of the new variables you've been adding.

I recommend finding the following setting and making sure it's set to Always Build. If you accidentally changed it to Never Build, then this could be causing some of your problems.

Tools -> Options -> Projects and Solutions -> Build and Run -> On Run, when projects are out of date: --> Always Build

In Topic: Visual Studio C++ without debugging screen fades.

25 September 2016 - 01:05 AM

This attach process idea works well if in a while loop for example, what are its other uses?

A few other cases where I've used attach-to-process:

- When my program starts child processes, I attach the debugger to all of the child processes as well. (I wish visual studio could do this automatically.) The only game examples I can think of where you would start a child process would be when a game client launches its own dedicated server instead of hosting it in-process.

- When a program crashes but I forgot to attach the debugger, sometimes the crash dialog will suspend the program and I can attach at that time to see where the crash is. (As far as I know this is something special that Visual Studio installs.)

- Debugging programs I don't have source code for (using the disassembly window).

- Attaching to a process on a different computer (usually for debugging the program on a Windows RT tablet).