Microsoft Visual Studio Unity For Mac

Microsoft Visual Studio Unity For Mac 9,5/10 3760 votes

Visual Studio for Mac supports syntax highlighting for ShaderLab, Unity’s shader format. Access to the Unity documentation by searching types and members in Unity’s documentation from the IDE. Simply select the text you want to search and press ⌘ Command + ‘ to read their documentation.

  1. C++ Visual Studio Mac
  2. Microsoft Visual Studio Unity For Mac Windows 7
-->
  1. Oct 25, 2019  Visual Studio Tools for Unity is a free Visual Studio extension that turns Visual Studio into a powerful tool for developing cross-platform games and apps with Unity. While the Unity editor is great for putting your game world together, you can't write your code in it.
  2. After Microsoft today announced the general availability of Visual Studio for Mac, many developers on forum sites questioned if it's really the same IDE that Windows users have known and loved for years, or a refactored, rebadged and rebranded version of Xamarin Studio - and no less than Xamarin chief Miguel de Icaza himself weighed in with some answers.

Unity is a game engine that enables you to develop games in C#. This walkthrough shows how to get started developing and debugging Unity games using Visual Studio for Mac and the Visual Studio for Mac Tools for Unity extension alongside the Unity environment.

Visual Studio for Mac Tools for Unity is a free extension, installed with Visual Studio for Mac. It enables Unity developers to take advantage of the productivity features of Visual Studio for Mac, including excellent IntelliSense support, debugging features, and more.

Objectives

  • Learn about Unity development with Visual Studio for Mac

Prerequisites

  • Visual Studio for Mac (https://www.visualstudio.com/vs/mac)
  • Unity 5.6.1 Personal Edition or higher (https://store.unity.com, requires a unity.com account to run)

Intended Audience

This lab is intended for developers who are familiar with C#, although deep experience is not required.

Task 1: Creating a basic Unity project

  1. Launch Unity. Sign in if requested.

  2. Click New.

  3. Set the Project name to 'UnityLab' and select 3D. Click Create project.

  4. You're now looking at the default Unity interface. It has the scene hierarchy with game objects on the left, a 3D view of the blank scene shown in the middle, a project files pane on the bottom, and inspector and services on the right. Of course, there's a lot more to it than that, but those are few of the more important components.

  5. For developers new to Unity, everything that runs in your app will exist within the context of a scene. A scene file is a single file that contains all sorts of metadata about the resources used in the project for the current scene and its properties. When you package your app for a platform, the resulting app will end up being a collection of one or more scenes, plus any platform-dependent code you add. You can have as many scenes as desired in a project.

  6. The new scene just has a camera and a directional light in it. A scene requires a camera for anything to be visible and an Audio Listener for anything to be audible. These components are attached to a GameObject.

    2020-4-1  It shows that Microsoft will help you to upgrade your Microsoft applications and collect required data to Microsoft. There is only one OK button, it means that you can’t reject the notice. But even worse, once you clicked ok button, your mac computer fan will stop running and then it will load 100% CPU before it shuts down. Mac required data notice from microsoft autoupdate 2019. Diagnostic data that is collected and sent to Microsoft about Office client software being used. Connected experiences that use cloud-based functionality to provide enhanced Office features to you and your users. In addition, there is a new preference setting related to a Required Data Notice dialog for Microsoft AutoUpdate (MAU). 2019-7-25  Microsoft AutoUpdate Required Data Notice - Scam or Legit How can I delete the 'Microsoft AutoUpdate Required Data Notice' panel that, a few days ago, appeared on the screen of my iMac. I have not been able to delete it and it tries to prevent me when I want to shut down my computer. 2019-8-31  Yesterday, July 18, 2019, I started getting a popup window for Microsoft AutoUpdate that says Required data notice. Is this a virus or malware. I've never seen it before, and I don't use Microsoft software. Where is this coming from, and how do I get rid of it? UPDATE July 23, 2019: Rich Trouton has also written about this issue and has provided both a script that will set the preference on disk across all user folders as well as a configuration profile that manages only this single setting and no others in his post: Suppressing Microsoft AutoUpdate’s Required Data Notice.

  7. Select the Main Camera object from the Hierarchy pane.

  8. Select the Inspector pane from the right side of the window to review its properties. Camera properties include transform information, background, projection type, field of view, and so on. An Audio Listener component was also added by default, which essentially renders scene audio from a virtual microphone attached to the camera.

  9. Select the Directional Light object. This provides light to the scene so that components like shaders know how to render objects.

  10. Use the Inspector to see that it includes common lighting properties including type, color, intensity, shadow type, and so on.

  11. It is important to point out that projects in Unity are a little different from their Visual Studio for Mac counterparts. In the Project tab on the bottom, right-click the Assets folder and select Reveal in Finder.

  12. Projects contain Assets, Library, ProjectSettings, and Temp folders as you can see. However, the only one that shows up in the interface is the Assets folder. The Library folder is the local cache for imported assets; it holds all metadata for assets. The ProjectSettings folder stores settings you can configure. The Temp folder is used for temporary files from Mono and Unity during the build process. There is also a solution file that you can open in Visual Studio for Mac (UnityLab.sln here).

  13. Close the Finder window and return to Unity.

  14. The Assets folder contains all your assets-art, code, audio, etc. It's empty now, but every single file you bring into your project goes here. This is always the top-level folder in the Unity Editor. But always add and remove files via the Unity interface (or Visual Studio for Mac) and never through the file system directly.

  15. The GameObject is central to development in Unity as almost everything derives from that type, including models, lights, particle systems, and so on. Add a new Cube object to the scene via the GameObject > 3D Object > Cube menu.

  16. Take a quick look at the properties of the new GameObject and see that it has a name, tag, layer, and transform. These properties are common to all GameObjects. In addition, several components were attached to the Cube to provide needed functionality including mesh filter, box collider, and renderer.

  17. Rename the Cube object, which has the name 'Cube' by default, to 'Enemy'. Make sure to press Enter to save the change. This will be the enemy cube in our simple game.

  18. Add another Cube object to the scene using the same process as above, and name this one 'Player'.

  19. Tag the player object 'Player' as well (see Tag drop-down control just under name field). We'll use this in the enemy script to help locate the player game object.

  20. In the Scene view, move the player object away from the enemy object along the Z axis using the mouse. You can move along the Z axis by selecting and dragging the cube by its red panel toward the blue line. Since the cube lives in 3D space, but can only be dragged in 2D each time, the axis on which you drag is especially important.

  21. Move the cube downward and to the right along the axis. This updates the Transform.Position property in the Inspector. Be sure to drag to a location similarly to what's shown here to make later steps easier in the lab.

  22. Now you can add some code to drive the enemy logic so that it pursues the player. Right-click the Assets folder in the Project pad and select Create > C# Script.

  23. Name the new C# script 'EnemyAI'.

  24. To attach scripts to game objects drag the newly created script onto the Enemy object in the Hierarchy pane. Now that object will use behaviors from this script.

  25. Select File > Save Scenes to save the current scene. Name it 'MyScene'.

Task 2: Working with Visual Studio for Mac Tools for Unity

  1. The best way to edit C# code is to use Visual Studio for Mac. You can configure Unity to use Visual Studio for Mac as its default handler. Select Unity > Preferences.

  2. Select the External Tools tab. From the External Script Editor dropdown, select Browse and select Applications/Visual Studio.app. Alternatively, if there's already a Visual Studio option, just select that.

  3. Unity is now configured to use Visual Studio for Mac for script editing. Close the Unity Preferences dialog.

  4. Double-click EnemyAI.cs to open it in Visual Studio for Mac.

  5. The Visual Studio solution is straightforward. It contains an Assets folder (the same one from Finder) and the EnemyAI.cs script created earlier. In more sophisticated projects, the hierarchy will likely look different than what you see in Unity.

  6. EnemyAI.cs is open in the editor. The initial script just contains stubs for the Start and Update methods.

  7. Replace the initial enemy code with the code below.

  8. Take a quick look at the simple enemy behavior that is defined here. In the Start method, we get a reference to the player object (by its tag), as well as its transform. In the Update method, which is called every frame, the enemy will move towards the player object. The keywords and names use color coding to make it easier to understand the codebase in Visual Studio for Mac.

  9. Save the changes to the enemy script in Visual Studio for Mac.

Task 3: Debugging the Unity project

  1. Set a breakpoint on the first line of code in the Start method. You can either click in the editor margin at the target line or place cursor on the line and press F9.

  2. Click the Start Debugging button or press F5. This will build the project and attach it to Unity for debugging.

  3. Return to Unity and click the Run button to start the game.

  4. The breakpoint should be hit and you can now use the Visual Studio for Mac debugging tools.

  5. From the Locals pad, locate the this pointer, which references an EnemyAI object. Expand the reference and see that you can browse the associated members like Speed.

  6. Remove the breakpoint from the Start method the same way it was added-by either clicking it in the margin or selecting the line and press F9.

  7. Press F10 to step over the first line of code that finds the Player game object using a tag as parameter.

  8. Hover the mouse cursor over the player variable within the code editor window to view its associated members. You can even expand the overlay to view child properties.

  9. Press F5 or press the Run button to continue execution. Return to Unity to see the enemy cube repeatedly approach the player cube. You may need to adjust the camera if it's not visible.

  10. Switch back to Visual Studio for Mac and set a breakpoint on the first line of the Update method. It should be hit immediately.

  11. Suppose the speed is too fast and we want to test the impact of the change without restarting the app. Microsoft office 2011 for mac update 14.5.3. Locate the Speed variable within the Autos or Locals window and then change it to '10' and press Enter.

  12. Remove the breakpoint and press F5 to resume execution.

  13. Return to Unity to view the running application. The enemy cube is now moving at a fifth of the original speed.

  14. Stop the Unity app by clicking the Play button again.

  15. Return to Visual Studio for Mac. Stop the debugging session by clicking the Stop button.

C++ Visual Studio Mac

Task 4: Exploring Unity features in Visual Studio for Mac

  1. Visual Studio for Mac provides quick access to Unity documentation within the code editor. Place the cursor somewhere on the Vector3 symbol within the Update method and press ⌘ Command + '.

  2. A new browser window opens to the documentation for Vector3. Close the browser window when satisfied.

  3. Visual Studio for Mac also provides some helpers to quickly create Unity behavior classes. From Solution Explorer, right-click Assets and select Add > New MonoBehaviour.

  4. The newly created class provides stubs for the Start and Update methods. After the closing brace of the Update method, start typing 'onmouseup'. As you type, notice that Visual Studio's IntelliSense quickly zeros in on the method you're planning to implement. Select it from the provided autocomplete list. It will fill out a method stub for you, including any parameters.

  5. Inside the OnMouseUp method, type 'base.' to see all of the base methods available to call. You can also explore the different overloads of each function using the paging option in the top-right corner of the IntelliSense flyout.

  6. Visual Studio for Mac also enables you to easily define new shaders. From Solution Explorer, right-click Assets and select Add > New Shader.

  7. The shader file format gets full color and font treatment to make it easier to read and understand.

  8. Return to Unity. You'll see that since Visual Studio for Mac works with the same project system, changes made in either place are automatically synchronized with the other. Now it's easy to always use the best tool for the task.

Summary

In this lab, you've learned how to get started creating a game with Unity and Visual Studio for Mac. See https://unity3d.com/learn to learn more about Unity.

-->

Visual Studio for Mac brings the IDE loved by millions to the Mac. It offers developers an integrated environment to build, debug, test, and deploy apps, games, and services for mobile, web, and cloud. Teams across PC and Mac can share code seamlessly by relying on the same solutions and projects.

With access to the same compiler, code completion and refactoring experience that you know and love from Visual Studio on Windows, Visual Studio for Mac provides a world-class coding experience. Solutions and projects can be worked on from both PC and Mac, enabling developer flexibility and seamless collaboration across teams.

Visual Studio for Mac

This also offers benefits to developers who are working between PC and Mac, by not having to sacrifice any loss in productivity.

If you are familiar with apps on Mac, Visual Studio for Mac will feel right at home, as it is designed natively for the Mac user. Developer workflow alignment with native Mac IDEs such as Xcode enable rapid adoption without a steep learning curve

Visual Studio for Mac brings industry leading capabilities to you, letting you maximize your potential when developing applications and games targeting mobile and other devices, cloud, and the web. It enables you to develop beautiful mobile apps across Android and iOS, all in C# or F#, while delivering native performance and user experiences.

.NET Support

With the added .NET Core and ASP.NET Core workloads, your code now reaches even further to other operating systems and the web. ASP.NET Core also enables you to develop powerful backend services for your apps, and Visual Studio for Mac enables you to publish these to Azure, directly from the IDE.

Cross Platform

•Build apps for macOS, iOS, and Android devices with the power and productivity of Visual Studio and .NET. Share app logic and code across device platforms.

•Visual Studio for Mac provides the same powerful web editor tools you know and love from Visual Studio on Windows.

•With full support for ASP.NET Core, HTML5, and CSS3, you can build highly interactive JavaScript-based apps for consumers, LOB, and enterprise.

Performance and Profiling

•Develop in C# or F# and get native performance and fully customized, native user experiences.

•Optimize your app’s performance with rich profiling data, and inspect them at runtime to find bugs faster with Visual Studio Enterprise for Mac features.

Cloud Services

•Microsoft Azure App Service is a cloud platform for building powerful web and mobile apps and allows you to connect to data anywhere, in the cloud or on premises.

•With built-in support for publication of your web apps to Azure, scaling through the cloud couldn’t be easier.

•With Visual Studio for Mac and .NET Core you get the tools you need to create versatile web services running on Azure App Service and deploy them to the cloud, right from within the IDE.

Unity

Game Development with Unity3d

If you have a C# skillset and want to build games, chances are good that you will come across Unity. Unity is a widely popular toolset from Unity Technologies for creating 2D and 3D games for desktops, mobile devices, and even consoles. Visual Studio for Mac includes Tools for Unity, enabling a full script editing and debugging experience.

•With the Visual Studio for Mac Tools for Unity, you get a best-in-class script editor for your Unity games. This includes full code completion and syntax highlighting and a solution explorer that‘s specific to Unity games and mimics the layout you would see in Unity.

•With one-click debugging, you can use Visual Studio for Mac’s great debugging capabilities to optimize your games.

Versions

Visual Studio for Mac is available in the same three editions as on Windows. A generous Community edition is available for free, for development teams under 5, in companies with <250 PCs or <$1 million annual revenue.

Microsoft Visual Studio Unity For Mac Windows 7

The Community edition can also be used for open-source projects and education purposes, all while being able to create free and paid apps and seamlessly integrate with the cloud.

Included in the Visual Studio Professional and Enterprise subscriptions, come the Professional and Enterprise editions, which are fully licensed for enterprise use. The collaboration between developers on PC and Mac really shines here, all while having access to the same great benefits in the subscription.

Visual Studio for Mac is available today at https://www.visualstudio.com/vs/visual-studio-mac/. It brings you a world-class IDE to build apps, games, and services for mobile, web, and cloud. Paired with Visual Studio (on Windows), it enhances developer productivity across platforms, all while feeling right at home on the Mac and being easy to adopt.

Resources

Additionally, we also have a number of hands-on labs available on GitHub, which should help you and your students get started using the various workloads available in Visual Studio for Mac.

Download Visual Studio for Mac for your institution at https://imagine.microsoft.com/en-us/catalog