Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Unity 2021 Cookbook
  • Table Of Contents Toc
Unity 2021 Cookbook

Unity 2021 Cookbook - Fourth Edition

By : Matt Smith, Shaun Ferns
4.8 (26)
close
close
Unity 2021 Cookbook

Unity 2021 Cookbook

4.8 (26)
By: Matt Smith, Shaun Ferns

Overview of this book

If you are a Unity developer looking to explore the newest features of Unity 2021 and recipes for advanced challenges, then this fourth edition of Unity Cookbook is here to help you. With this cookbook, you’ll work through a wide variety of recipes that will help you use the essential features of the Unity game engine to their fullest potential. You familiarize yourself with shaders and Shader Graph before exploring animation features to enhance your skills in building games. As you progress, you will gain insights into Unity's latest editor, which will help you in laying out scenes, tweaking existing apps, and building custom tools for augmented reality and virtual reality (AR/VR) experiences. The book will also guide you through many Unity C# gameplay scripting techniques, teaching you how to communicate with database-driven websites and process XML and JSON data files. By the end of this Unity book, you will have gained a comprehensive understanding of Unity game development and built your development skills. The easy-to-follow recipes will earn a permanent place on your bookshelf for reference and help you build better games that stay true to your vision.
Table of Contents (22 chapters)
close
close
20
Other Books You May Enjoy
21
Index

Running simple Python scripts inside Unity

Unity Python is a package that allows Python code to be executed as part of a Unity project. In this recipe, we’ll install the package, test the Python Script Editor window with a traditional Hello World Python print statement, and create C# scripts to run Python based on the examples provided by Unity at https://docs.unity3d.com/Packages/[email protected]/manual/inProcessAPI.html.

How to do it...

To run simple Python scripts inside Unity, follow these steps:

  1. Create a new 2D project.
  2. Open the Package Manager by navigating to Window | Package Manager.
  3. Set the list of packages to those in the Unity Registry and search for Python Scripting. Then, click Install.

Figure 19.24: Adding the Python Scripting package to a project

  1. Open the Python Script Editor panel by going to Window | General | Python Script Editor.
  2. Enter print ('Hello World from Python') in...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Unity 2021 Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon