Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning C# by Developing Games with Unity 2020

You're reading from   Learning C# by Developing Games with Unity 2020 An enjoyable and intuitive approach to getting started with C# programming and Unity

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781800207806
Length 366 pages
Edition 5th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Harrison Ferrone Harrison Ferrone
Author Profile Icon Harrison Ferrone
Harrison Ferrone
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Getting to Know Your Environment 2. The Building Blocks of Programming FREE CHAPTER 3. Diving into Variables, Types, and Methods 4. Control Flow and Collection Types 5. Working with Classes, Structs, and OOP 6. Getting Your Hands Dirty with Unity 7. Movement, Camera Controls, and Collisions 8. Scripting Game Mechanics 9. Basic AI and Enemy Behavior 10. Revisiting Types, Methods, and Classes 11. Introducing Stacks, Queues, and HashSets 12. Exploring Generics, Delegates, and Beyond 13. The Journey Continues 14. Pop Quiz Answers 15. Other Books You May Enjoy

Time for action – updating the prefab

Now our turret has a huge gap in the middle, which isn't ideal for covering our character, so let's update the Barrier_01 prefab by adding another cube and applying the change:

  1. Create a Cube primitive and place it at the intersection of the turret base. 
  2. The new Cube primitive will be marked as gray with a little + icon next to its name in the Hierarchy tab. This means it's not officially part of the prefab yet:

  1. Right-click on the new Cube primitive and select Added GameObject | Apply to Prefab 'Barrier_01':

The Barrier_01 prefab is now updated to include the new cube, and the entire prefab hierarchy should be blue again. You now have a turret prefab that looks like the preceding screenshot or, if you're feeling adventurous, something more creative. However, we want these to be in every corner of the arena. It's going to be your job to add them!

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image