 Hi, I'm JB. I'm an engineering manager in the Visual Studio team at Microsoft. Today I have with me Dan, Dan was an evangelist at Unity. Dan, thank you very much for being with us for the Visual Studio 2019 launch. Yeah, thanks for having me. The game development with Unity workload is one of the most popular workload for Visual Studio. Yet not every developer is familiar with what Unity is. So Dan, what is Unity? So Unity is a platform for creating real-time interactive content. We were originally founded in game development, but now we've been broadening outside of games as other industries start to see this need. What kind of industries? So we're exploring things with automotive, architecture, engineering, and construction, as well as the film industry, as people are using us to build up and improve their workflows. Very cool. So, how do you build a game with Unity in Visual Studio? Yeah. So why don't we go ahead and hop into the Unity editor here, and we can show you how it works. Yeah. So here we have the Unity editor itself. So we're actually here in the scene view, and this is the FPS sample project. So this is an internally developed project at Unity. So you as a developer can go and start to build on top of this, utilize it, and really create these really awesome looking experiences. So let's first go ahead and hop into the experience, and see what this application actually is. Sounds good. All right. So this is the FPS sample. So this is a first-person shooter. You can walk around the environment, start to explore, and of course, you can shoot some bullets, jump around. Shoot at things. It looks awesome. Yeah. So one error that you might notice is that once we run out of bullets, we don't actually reload. So we'll describe how you can use Visual Studios to go in debug and solve this problem. Sounds good. All right. So let's have a look at what it means to write in debug code for Unity in Visual Studio. Exactly. So as mentioned before, what you do in Unity is you create C-sharp scripts. Okay. So what you can see is in order to write code inside Unity, you can simply go and into the Create menu and create a C-sharp script. So let's just call this one TestScript, Dan. So what's a script for Unity? Or is it different from a simple C-sharp class? Yeah. So what we're doing here is we're actually providing you with some boilerplate code that allows you to interact and interface with the Unity editor. So once I've created my script here, I can simply double-click it, and that will launch Visual Studio, which allows me to go in and start writing code on top of this. Cool. All right. So you can see here that we're driving from MonoBehavior, which is a built-in Unity class. Okay. And from here, we can create public fields like Dan is cool, and of course we'll set that one to true. Of course. All right. So now once we've gone back into Unity, it simply recompiles that script right away, and now we can go and drag it onto one of our objects in the scene. So that's basically the way for Unity to attach a behavior or? Exactly. What this allows you to do here is attach components to objects, and from here you can see exposed properties like this Dan is cool Boolean, which of course we can uncheck it. It doesn't really make sense. Okay. So that's your way to adding logic to a script, but also to surface properties of those scripts to the IDE or to the editor. Exactly. And this allows people like level designers or other people creating these experiences to go in and tweak values that the developers set up themselves. Without having to change the code. Exactly. Cool. And now let's go ahead and try to solve that problem that we saw earlier. Okay. What I'm going to do here is I'm going to search through the entire solution for reload. And you can see how quickly we've now surfaced all instances of the word reload. And I happen to know that we're using the chain gun. So I'm going to go ahead and open this script here. Okay. So the way that this works is that we have different states that we're falling into. In the idle state, this is where the reload is checked. And in the fire state, we can see an if statement here, but we don't really know if this is exactly where it's at. Can we validate that this is actually the line where there's an issue in your code? Yeah. So we can easily do that. I go ahead and setting up a break point and then clicking the attach to unity button. All right. So that's simply going to attach the debugger of just your two unity. Exactly. And now we can restart the simulation here. And if it's in the correct spot, we should see our application break right after we fire the gun. All right. All right. And now. This is a game. So now if you should. Instantly it hops out. Breakpoint it. You're inside Visual Studio. You have your code stack. You have your values, your valuables. Exactly. And you can see here that the ammo in the clip is 39 and it started out at 40. So this is the exact point that we want. All right. So let's go ahead and stop that debugging and fix this issue. Okay. I'll remove the breakpoint. And from here, we can start doing the else statement to enter the idle. I don't know. Yep. And one thing to note here is right after I typed the parentheses, now we see all of the properties here exposed for us. And you get code completion for it. And now we can simply save this here. You'll notice that. I think it's ref predicted state. Exactly. And you see that Visual Studios recognized that and highlighted it with a red underline. Cool. Switch back to unity. And now let's go ahead and hop back in the simulation. And we should be able to shoot all the bullets and automatically reload. Let's empty the clip. Cool. And there we go. Problem solved. Very cool. So that's basically the workflow between Unity and Visual Studio. It's a very iterative process. You fix up code. You implement script. You attach them to your game objects. And you play the game inside Unity right until you're satisfied with your game. Exactly. It's this really back and forth workflow of writing the scripts in Visual Studio, coming back to Unity, attaching the logic, and creating awesome experiences like this. Very cool. So this is how you use Visual Studio and Unity together. But what is new for Visual Studio 2019 when it comes to building Unity game? Well, in the Visual Studio team, one of the things we've been focusing on is improving the quality of life of Unity developers. One of the main things that we've been working on is idea responsiveness. We wanted to make sure that Visual Studio starts fast, that it loads your project fast, and that you can easily switch back and forth between Unity and Visual Studio without losing too much time. Yeah, that was one of the things I first noticed when starting to develop with Visual Studio 2019, just how quickly the projects load up, as well as things like searching through entire projects. Cool. Another thing that we've been focusing on is improving the debugger experience. We know that writing C-Sharp and debugging it is a big part in writing a Unity game, and we want to make sure that debugging your C-Sharp code is reliable and fast. Another thing that we've been doing for the debugger is adding support for debugging unsafe code and pointers, which I think is going to play a role in the future of Unity. Definitely. Dan, today we've been showing Visual Studio and Unity on Windows, but you also have a Mac offering. Yeah, Unity was actually originally developed as an application only for Mac platforms. Obviously, we've expanded upon that for both Mac and PC, and we really tried to keep those development experiences the exact same. And that's also something that we're doing in the Visual Studio team. For Visual Studio 2019, a big part of the work that we've been doing is taking pieces and components of Visual Studio on Windows and taking them into Visual Studio for Mac. A big part of the experience for 2019 is the Visual Studio code editor that we've taken from Visual Studio on Windows to Visual Studio for Mac. And that, I think, will fix a bunch of complainants we heard from customers about the editing and intelligence experience on Visual Studio for Mac. Another big component that we're taking from Visual Studio on Windows is the Visual Studio tools for Unity Debugger. This way, you get the same debugging experience on Visual Studio for Mac on Windows when you debug a Unity game or the Unity Editor. Totally. And there's a lot of big improvements coming to Unity as well. In 2019, we're redeveloping how you code and build applications in Unity away from an object-oriented approach into what we call a data-oriented approach. So this introduces the data-oriented tech stack, which is comprised of three main parts. The first one being the entity component system, which is how you structure your data when developing these applications. The next being the C-Sharp job system, which allows you to easily multi-thread and parallelize your code. And the final one being the burst compiler. And together, these allow you to create some really big and incredible experiences. Burst still works, and everything still works with Visual Studio as it is today. Of course. What we're doing is you're still developing in C-Sharp. It's just a different way of actually writing your code to achieve even more performance on the platforms that you're running on. And you have a sample for it or something that we can show? Yeah, so we recently released MegaCity, which is an open source application. And yeah, you can see here that it allows you to create these really big, massive scale experiences that are only available utilizing this new data-oriented tech stack in the power of Unity. And for something that big, you didn't assume a big machine? So that's actually one of the best parts about the Dots framework, is that it can run on all the different platforms that Unity supports, and you can achieve massive scale simulation like this, even on mobile devices. Even on mobile. Well, that's very cool. Well, then it looks like that 2019 is going to be a big year for Unity developers using Unity and Visual Studio. We've compiled a list of resources on-screen that you can use if you want to learn about Visual Studio and Unity development. And thank you very much. Thanks.