0% found this document useful (0 votes)
535 views62 pages

Unity 2020 An Enjoyable and Intuitive Approach To Getting Started With C Programming and Unity 12073856

The document is an overview of the ebook 'Learning C# by Developing Games with Unity 2020' by Harrison Ferrone, which provides an engaging introduction to C# programming and Unity game development. It includes details about the book's content, structure, and various chapters covering programming fundamentals, control flow, and object-oriented programming. The ebook is available for instant download and is part of an exclusive educational collection.

Uploaded by

janellorjule7130
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
535 views62 pages

Unity 2020 An Enjoyable and Intuitive Approach To Getting Started With C Programming and Unity 12073856

The document is an overview of the ebook 'Learning C# by Developing Games with Unity 2020' by Harrison Ferrone, which provides an engaging introduction to C# programming and Unity game development. It includes details about the book's content, structure, and various chapters covering programming fundamentals, control flow, and object-oriented programming. The ebook is available for instant download and is part of an exclusive educational collection.

Uploaded by

janellorjule7130
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

(Ebook) Learning C# by developing games with Unity

2020: An enjoyable and intuitive approach to getting


started with C# programming and Unity by Harrison
Ferrone ISBN 9781800204447, 1800204442 instant
download 2025

Purchase at ebooknice.com
( 4.7/5.0 ★ | 460 downloads )

https://ebooknice.com/product/learning-c-by-developing-games-with-
unity-2020-an-enjoyable-and-intuitive-approach-to-getting-started-
with-c-programming-and-unity-12073856
(Ebook) Learning C# by developing games with Unity 2020: An
enjoyable and intuitive approach to getting started with C#
programming and Unity by Harrison Ferrone ISBN
9781800204447, 1800204442 Pdf Download

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 EDUCATIONAL COLLECTION - LIMITED TIME

INSTANT DOWNLOAD VIEW LIBRARY


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

(Ebook) Learning C# 7 By Developing Games with Unity 2017: Learn C#


Programming by building fun and interactive games with Unity - Third
Edition by Micael DaGraca; Greg Lukosek ISBN 9781788478922, 1788478924

https://ebooknice.com/product/learning-c-7-by-developing-games-with-
unity-2017-learn-c-programming-by-building-fun-and-interactive-games-
with-unity-third-edition-7250930

(Ebook) Developing 2D Games with Unity: Independent Game Programming


with C# by Jared Halpern ISBN 9781484237717, 1484237714

https://ebooknice.com/product/developing-2d-games-with-unity-
independent-game-programming-with-c-7263918

(Ebook) Developing 2D Games with Unity: Independent Game Programming


with C# by Jared Halpern ISBN 9781484237717, 9781484237724,
1484237714, 1484237722

https://ebooknice.com/product/developing-2d-games-with-unity-
independent-game-programming-with-c-7264636

(Ebook) Getting Started with Unity 2018 : A Beginner's Guide to 2D and


3D Game Development with Unity by Edward Lavieri ISBN 9781788830102,
1788830105

https://ebooknice.com/product/getting-started-with-
unity-2018-a-beginner-s-guide-to-2d-and-3d-game-development-with-
unity-7255046
(Ebook) Getting Started with Unity 2018 : A Beginner's Guide to 2D and
3D Game Development with Unity by Edward Lavieri ISBN 9781788832915,
1788832914

https://ebooknice.com/product/getting-started-with-
unity-2018-a-beginner-s-guide-to-2d-and-3d-game-development-with-
unity-11144414

(Ebook) Mastering UI Development With Unity: An In-Depth Guide to


Developing Engaging User Interfaces with Unity 5, Unity 2017, and
Unity 2018 by Ashley Godbold ISBN 9781787125520, 1787125521

https://ebooknice.com/product/mastering-ui-development-with-unity-an-
in-depth-guide-to-developing-engaging-user-interfaces-with-
unity-5-unity-2017-and-unity-2018-7250934

(Ebook) Learning C# programming with Unity 3D by Alex Okita ISBN


9781138336810, 9781138336827, 1138336815, 1138336823

https://ebooknice.com/product/learning-c-programming-with-
unity-3d-11301474

(Ebook) Advanced Unity Game Development: Build Professional Games with


Unity, C#, and Visual Studio by Victor G Brusca ISBN 9781484278505,
148427850X

https://ebooknice.com/product/advanced-unity-game-development-build-
professional-games-with-unity-c-and-visual-studio-36477258

(Ebook) Learning C# by Developing Games with Unity 5.x: Develop your


first interactive 2D platformer game by learning the fundamentals of
C# - Second Edition by Greg Lukosek ISBN 9781785287596, 1785287591

https://ebooknice.com/product/learning-c-by-developing-games-with-
unity-5-x-develop-your-first-interactive-2d-platformer-game-by-
learning-the-fundamentals-of-c-second-edition-5635500
Learning C# by Developing
Games with Unity 2020
Fifth Edition

An enjoyable and intuitive approach to getting started with C#


programming and Unity

Harrison Ferrone

BIRMINGHAM - MUMBAI
Learning C# by Developing Games with
Unity 2020
Fifth Edition
Copyright © 2020 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form
or by any means, without the prior written permission of the publisher, except in the case of brief quotations
embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.
However, the information contained in this book is sold without warranty, either express or implied. Neither the
author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to
have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy
of this information.

Commissioning Editor: Pavan Ramchandani


Acquisition Editor: Ashitosh Gupta
Content Development Editor: Akhil Nair
Senior Editor: Hayden Edwards
Technical Editor: Deepesh Patel
Copy Editor: Safis Editing
Project Coordinator: Kinjal Bari
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Production Designer: Nilesh Mohite

First published: September 2013


Second edition: March 2016
Third edition: December 2017
Fourth edition: March 2019
Fifth edition: August 2020

Production reference: 1200820

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-80020-780-6

www.packt.com
"If people reach perfection they vanish, you know."

The Once and Future King


Packt.com

Subscribe to our online digital library for full access to over 7,000 books and videos, as well
as industry leading tools to help you plan your personal development and advance your
career. For more information, please visit our website.

Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos
from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Fully searchable for easy access to vital information

Copy and paste, print, and bookmark content

Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.packt.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
[email protected] for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters, and receive exclusive discounts and offers on Packt books and
eBooks.
Contributors

About the author


Harrison Ferrone was born in Chicago, IL, and was raised all over. Most days you can find
him writing technical documentation at Microsoft, creating instructional content for
LinkedIn Learning and Pluralsight, or tech editing for the Ray Wenderlich website.

He holds various fancy looking pieces of paper from the University of Colorado at Boulder
and Columbia College, Chicago. Despite being a proud alumnus, most of these are stored
in a basement somewhere.

After a few years as an iOS developer at small start-ups, and one Fortune 500 company, he
fell into a teaching career and never looked back. Throughout all this, he's bought many
books, acquired a few cats, worked abroad, and continually wondered why Neuromancer
isn't on more course syllabi.

Completing this book wouldn't have been possible without the support of Kelsey, my
partner in crime on this journey, and Wilbur, Merlin, Walter, and Evey for their
courageous spirits and gracious hearts.
About the reviewers
Andrew Edmonds is an experienced programmer, game developer, and educator. He has a
Bachelor of Science degree in Computer Science from Washburn University and is a Unity
Certified Programmer and Instructor. After college, he worked as a software engineer for
the Kansas State Legislature for three years before spending the next five years teaching
high school kids how to write code and make video games. As a teacher, he helped many
young aspiring game developers achieve beyond what they ever thought possible,
including winning the SkillsUSA National Championship for video game development in
2019 with a virtual reality game made in Unity. Andrew lives in Washington with his wife,
Jessica, and daughters, Alice and Ada.

Adam Brzozowski is an experienced software engineer who develops games and client
applications. Working with Unity, Unreal Engine, C++, Swift, and Java, he finds the right
solution for each project.

Packt is searching for authors like you


If you're interested in becoming an author for Packt, please visit authors.packtpub.com
and apply today. We have worked with thousands of developers and tech professionals,
just like you, to help them share their insight with the global tech community. You can
make a general application, apply for a specific hot topic that we are recruiting an author
for, or submit your own idea.
Table of Contents
Preface 1
Chapter 1: Getting to Know Your Environment 7
Technical requirements 8
Getting started with Unity 2020 9
Using macOS 15
Creating a new project 17
Navigating the editor 18
Using C# with Unity 20
Working with C# scripts 20
Introducing the Visual Studio editor 22
Time for action – opening a C# file 22
Beware of naming mismatches 25
Syncing C# files 25
Exploring the documentation 26
Accessing Unity's documentation 26
Time for action – opening the Reference Manual 26
Time for action – using the Scripting Reference 27
Locating C# resources 29
Time for action – looking up a C# class 29
Summary 30
Pop quiz – dealing with scripts 31
Chapter 2: The Building Blocks of Programming 32
Defining variables 33
Names are important 34
Variables act as placeholders 34
Time for action – creating a variable 35
Time for action – changing a variable's value 37
Understanding methods 38
Methods drive actions 38
Methods are placeholders too 39
Time for action – creating a simple method 40
Introducing classes 41
A common Unity class 41
Classes are blueprints 42
Working with comments 43
Practical backslashes 43
Multi-line comments 43
Time for action – adding comments 44
Putting the building blocks together 45
Table of Contents

Scripts become components 45


A helping hand from MonoBehavior 46
Hero's trial – MonoBehavior in the Scripting API 47
Communication among classes 47
Summary 48
Pop quiz – C# building blocks 48
Chapter 3: Diving into Variables, Types, and Methods 49
Writing proper C# 50
Debugging your code 51
Declaring variables 52
Type and value declarations 52
Type-only declarations 53
Using access modifiers 54
Choosing a security level 54
Time for action – making a variable private 55
Working with types 55
Common built-in types 56
Time for action – playing with different types 57
Time for action – creating interpolated strings 58
Type conversions 59
Inferred declarations 60
Custom types 60
Types roundup 60
Naming variables 61
Best practices 61
Understanding variable scope 62
Introducing operators 64
Arithmetic and assignments 64
Time for action – executing incorrect type operations 66
Defining methods 67
Basic syntax 67
Modifiers and parameters 68
Time for action – defining a simple method 69
Naming conventions 70
Methods are logic detours 70
Specifying parameters 71
Time for action – adding method parameters 72
Specifying return values 73
Time for action – adding a return type 73
Using return values 74
Time for action – capturing return values 74
Hero's trial – methods as arguments 75
Dissecting common Unity methods 76
The Start method 76
The Update method 77

[ ii ]
Table of Contents

Summary 78
Pop quiz – variables and methods 78
Chapter 4: Control Flow and Collection Types 79
Selection statements 80
The if-else statement 80
Basic syntax 80
Time for action – thieving prospects 83
Using the NOT operator 85
Nesting statements 86
Evaluating multiple conditions 87
Time for action – reaching the treasure 88
The switch statement 90
Basic syntax 90
Pattern matching 91
Time for action – choosing an action 91
Fall-through cases 92
Time for action – rolling the dice 92
Pop quiz 1 – if, and, or but 94
Collections at a glance 94
Arrays 94
Basic syntax 95
Indexing and subscripts 96
Range exceptions 96
Lists 97
Basic syntax 97
Time for action – party members 98
Common methods 99
Dictionaries 100
Basic syntax 100
Time for action – setting up an inventory 101
Working with dictionary pairs 102
Pop quiz 2 – all about collections 103
Iteration statements 103
For loops 104
Time for action – finding an element 105
foreach loops 107
Looping through key-value pairs 108
Hero's trial – finding affordable items 109
while loops 109
Time for action – tracking player lives 110
To infinity and beyond 111
Summary 112
Chapter 5: Working with Classes, Structs, and OOP 113
Defining a class 114
Basic syntax 114
Time for action – creating a character class 114
Instantiating class objects 115

[ iii ]
Table of Contents

Time for action – creating a new character 115


Adding class fields 116
Time for action – fleshing out character details 117
Using constructors 118
Time for action – specifying starting properties 119
Declaring class methods 120
Time for action – printing out character data 120
Declaring structs 122
Basic syntax 122
Time for action – creating a weapon struct 123
Understanding reference and value types 124
Reference types 124
Time for action – creating a new hero 125
Value types 126
Time for action – copying weapons 126
Integrating the object-oriented mindset 127
Encapsulation 128
Time for action – adding a reset 128
Inheritance 129
Base constructors 130
Time for action – calling a base constructor 130
Composition 131
Polymorphism 132
Time for action – functional variations 132
OOP roundup 133
Applying OOP in Unity 134
Objects are a class act 134
Accessing components 136
Basic syntax 136
Time for action – accessing the current transform component 137
Time for action – finding components on different objects 138
Drag and drop 139
Time for action – assigning variables in Unity 140
Summary 141
Pop quiz – all things OOP 141
Chapter 6: Getting Your Hands Dirty with Unity 142
A game design primer 143
Game design documents 143
The Hero Born one-page 144
Building a level 145
Creating primitives 145
Time for action – creating a ground plane 146
Thinking in 3D 147
Materials 149
Time for action – changing the ground color 150
White-boxing 151

[ iv ]
Table of Contents

Editor tools 152


Hero's trial – putting up drywall 154
Keeping the hierarchy clean 154
Time for action – using empty objects 155
Working with prefabs 156
Time for action – creating a turret 156
Time for action – updating the prefab 158
Time for action – finishing the level 159
Hero's trial – creating a health pickup 160
Lighting basics 161
Creating lights 162
Light component properties 163
Animating in Unity 164
Creating clips 164
Time for action – creating a new clip 165
Recording keyframes 167
Time for action – spinning animation 168
Curves and tangents 170
Time for action – smoothing the spin 171
The particle system 173
Time for action – adding sparkle effects 173
Summary 175
Pop quiz – basic Unity features 175
Chapter 7: Movement, Camera Controls, and Collisions 176
Moving the player 177
Player setup 178
Time for action – creating the player capsule 178
Understanding vectors 179
Getting player input 181
Time for action – player locomotion 183
Adding a following Camera 186
Time for action – scripting camera behavior 186
Working with Unity physics 189
Rigidbody components in motion 191
Time for action – accessing the Rigidbody component 191
Time for action – moving the Rigidbody component 193
Colliders and collisions 195
Time for action – picking up an item 196
Using Collider triggers 198
Time for action – creating an enemy 199
Time for action – capturing trigger events 199
Hero's trial – all the prefabs! 202
Physics roundup 202
Summary 203
Pop quiz – player controls and physics 203
Chapter 8: Scripting Game Mechanics 204

[v]
Table of Contents

Adding jumps 205


Introducing enumerations 205
Underlying types 206
Time for action – pressing the spacebar to jump! 207
Working with layer masks 209
Time for action – setting object layers 209
Time for action – one jump at a time 211
Shooting projectiles 214
Instantiating objects 214
Time for action – creating a projectile prefab 215
Time for action – adding the shooting mechanic 216
Managing GameObject buildup 219
Time for action – destroying bullets 219
Creating a game manager 220
Tracking player properties 220
Time for action – creating a game manager 221
The get and set properties 222
Time for action – adding backing variables 223
Time for action – updating item collection 225
Adding player polish 227
Graphical UI 227
Time for action – adding UI elements 228
Win and loss conditions 231
Time for action – winning the game 231
Using directives and namespaces 234
Time for action – pausing and restarting 234
Summary 236
Pop quiz – working with mechanics 236
Chapter 9: Basic AI and Enemy Behavior 237
Navigating in Unity 238
Navigation components 238
Time for action – setting up the NavMesh 239
Time for action – setting up enemy agents 240
Moving enemy agents 242
Procedural programming 243
Time for action – referencing the patrol locations 243
Time for action – moving the enemy 246
Time for action – patrolling continuously between locations 248
Enemy game mechanics 250
Seek and destroy 251
Time for action – changing the agent's destination 251
Time for action – lowering player health 252
Time for action – detecting bullet collisions 254
Time for action – updating the game manager 256
Refactoring and keeping it DRY 258
Time for action – creating a restart method 258

[ vi ]
Table of Contents

Hero's trial – refactoring win/lose logic 259


Summary 260
Pop quiz – AI and navigation 260
Chapter 10: Revisiting Types, Methods, and Classes 261
Access Modifier redux 262
Constant and read-only properties 262
Using the static keyword 263
Time for action – creating a static class 263
Methods redux 265
Overloading methods 265
Time for action – overloading the level restart 266
Ref parameters 267
Time for action – tracking player restarts 268
Out parameters 269
OOP redux 270
Interfaces 270
Time for action – creating a manager interface 271
Time for action – adopting an interface 272
Abstract classes 274
Class extensions 276
Time for action – extending the string class 276
Time for action – using an extension method 277
Namespace redux 279
Type aliasing 279
Summary 280
Pop quiz – leveling up 280
Chapter 11: Introducing Stacks, Queues, and HashSets 281
Introducing stacks 282
Basic syntax 282
Time for action – storing collected items 283
Popping and peeking 285
Time for action – the last item collected 285
Common methods 286
Working with queues 288
Basic syntax 288
Adding, removing, and peeking 289
Common methods 289
Using HashSets 290
Basic syntax 290
Performing operations 291
Summary 293
Pop quiz – intermediate collections 293
Chapter 12: Exploring Generics, Delegates, and Beyond 294
Introducing generics 295

[ vii ]
Table of Contents

Generic objects 295


Time for action – creating a generic collection 296
Generic methods 297
Time for action – adding a generic item 298
Constraining type parameters 300
Time for action – limiting generic elements 301
Delegating actions 301
Basic syntax 301
Time for action – creating a debug delegate 302
Delegates as parameter types 304
Time for action – using a delegate argument 304
Firing events 305
Basic syntax 306
Time for action – creating an event 306
Handling event subscriptions 307
Time for action – subscribing to an event 308
Handling exceptions 310
Throwing exceptions 310
Time for action – checking negative scene indexes 311
Using try-catch 312
Time for action – catching restart errors 313
Design pattern primer 316
Common game patterns 316
Summary 317
Pop quiz – intermediate C# 318
Chapter 13: The Journey Continues 319
Scratching the surface 320
Remembering your object-oriented programming 321
Approaching Unity projects 321
Unity features we didn't cover 322
Next steps 322
C# resources 323
Unity resources 323
Unity certifications 324
Hero's trial – putting something out into the world 324
Summary 325
Pop Quiz Answers 326
Other Books You May Enjoy 331
Index 334

[ viii ]
Preface
Unity is one of the most popular game engines in the world, catering to amateur hobbyists,
professional AAA studios, and cinematic production houses. While mainly considered a 3D
tool, Unity has a host of dedicated features that support everything from 2D games and
virtual reality to post-production and cross-platform publishing.

Developers love its drag-and-drop interface and built-in features, but it's the ability to write
custom C# scripts for behaviors and game mechanics that really take Unity the extra mile.
Learning to write C# code might not be a huge obstacle to a seasoned programmer with
other languages under their belt, but it can be daunting for those of you who have no
programming experience. That's where this book comes in, as I'll be taking you through the
building blocks of programming and the C# language from scratch, all while building a fun
and playable game in Unity.

Who this book is for


This book was written primarily for those of you who don't have any experience with the
basic tenets of programming or the C# language. If you're a competent novice or seasoned
programmer coming from another language, or even C#, but need to get hands-on with
game development in Unity, then this is where you need to be.

What this book covers


Chapter 1, Getting to Know Your Environment, gets you started with the Unity installation
process, the main features of the editor, and finding documentation for both C# and Unity-
specific topics. We'll also go through creating C# scripts from inside Unity and take a look
at the Visual Studio application, where all our code editing will take place.

Chapter 2, The Building Blocks of Programming, begins by laying out the atomic-level
concepts of programming, giving you the opportunity to relate variables, methods, and
classes to situations in everyday life. From there, we move on to simple debugging
techniques, proper formatting and commenting, and a look at how Unity turns C# scripts
into components.
Preface

Chapter 3, Diving into Variables, Types, and Methods, takes a deeper look at variables. This
includes C# data types, naming conventions, access modifiers, and everything else
you'll need for the foundation of a program. We'll also go over how to write methods,
incorporate parameters, and use return types effectively, ending with an overview of
standard Unity methods belonging to the MonoBehavior class.

Chapter 4, Control Flow and Collection Types, introduces the common approaches to making
decisions in code, consisting of the if...else and switch statements. From there, we
move on to working with arrays, lists, and dictionaries, and incorporating iteration
statements for looping through collection types. We end the chapter with a look at
conditional looping statements and a special C# data type called enumerations.

Chapter 5, Working with Classes, Structs, and OOP, details our first contact with constructing
and instantiating classes and structs. We'll go through the basic steps of creating
constructors, adding variables and methods, and the fundamentals of subclassing and
inheritance. The chapter will end with a comprehensive explanation of object-oriented
programming and how it applies to C#.

Chapter 6, Getting Your Hands Dirty with Unity, marks our departure from C# syntax into
the world of game design, level building, and Unity's featured tools. We'll start by going
over the basics of a game design document and then move on to blocking out our level
geometry and adding lighting and a simple particle system.

Chapter 7, Movement, Camera Controls, and Collisions, explains different approaches to


moving a player object and setting up a third-person camera. We'll discuss incorporating
Unity physics for more realistic locomotion effects, as well as how to work with collider
components and capture interactions within a scene.

Chapter 8, Scripting Game Mechanics, introduces the concept of game mechanics and how to
effectively implement them. We'll start by adding a simple jump action, create a shooting
mechanic, and build on the previous chapters' code by adding logic to handle item
collection.

Chapter 9, Basic AI and Enemy Behavior, starts with a brief overview of artificial intelligence
in games and the concepts we will be applying to Hero Born. Topics covered in this chapter
will include navigation in Unity, using the level geometry and a navigation mesh, smart
agents, and automated enemy movement.

Chapter 10, Revisiting Types, Methods, and Classes, takes a more in-depth look at data types,
intermediate method features, and additional behaviors that can be used for more complex
classes. This chapter will give you a deeper understanding of the versatility and breadth of
the C# language.

[2]
Preface

Chapter 11, Introducing Stacks, Queues, and HashSets, dives into intermediate collection
types and their features. Topics covered in this chapter include using Stacks, Queues, and
HashSets and the different development scenarios that each is uniquely suited for.

Chapter 12, Exploring Generics, Delegates, and Beyond, details intermediate features of the C#
language and how to apply them in practical, real-world scenarios. We'll start with an
overview of generic programming and progress to concepts such as delegation, events, and
exception handling. The chapter will end with a brief discussion of common design
patterns and set you up for further study.

Chapter 13, The Journey Continues, reviews the main topics you've learned throughout the
book and leaves you with resources for further study in both C# and Unity. Included in
these resources will be online reading material, certification information, and a host of my
favorite video tutorial channels.

To get the most out of this book


The only thing you need to get the most from your upcoming C# and Unity adventure is a
curious mind and a willingness to learn. Having said that, doing all the Time for
Action, Heroes Trial, and Quiz sections is a must if you hope to cement the knowledge
you're learning. Lastly, revisiting topics and entire chapters to refresh or solidify your
understanding before moving on is always a good idea. There is no sense in building a
house on an unstable foundation.

You'll also need a current version of Unity installed on your computer – 2020 or later is
recommended. All code examples have been tested with Unity 2020.1 and should work
with future versions without issues.

Software/hardware covered in the book


Unity 2020.1 or later
Visual Studio 2019 or later
C# 8.0 or later

Before starting, check that your computer setup meets the Unity system requirements
at https:/​/​docs.​unity3d.​com/​2019.​1/​Documentation/​Manual/​system-​requirements.
html. These are for Unity 2019 but hold true for 2020 and above.

[3]
Preface

Download the example code files


You can download the example code files for this book from your account at
www.packt.com. If you purchased this book elsewhere, you can visit
www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

1. Log in or register at www.packt.com.


2. Select the Support tab.
3. Click on Code Downloads.
4. Enter the name of the book in the Search box and follow the onscreen
instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:

WinRAR/7-Zip for Windows


Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https:/​/​github.​com/
PacktPublishing/​Learning-​C-​8-​by-​Developing-​Games-​with-​Unity-​2020. In case there's
an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available
at https:/​/​github.​com/​PacktPublishing/​. Check them out!

Download the color images


We also provide a PDF file that has color images of the screenshots/diagrams used in this
book. You can download it
here: https://static.packt-cdn.com/downloads/9781800207806_ColorImages.pdf.

Conventions used
There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in the text, database table names, folder names,
filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here
is an example: "Select the Materials folder."

[4]
Preface

A block of code is set as follows:


public string firstName = "Harrison";

When we wish to draw your attention to a particular part of a code block, the relevant lines
or items are set in bold:
accessModifier returnType UniqueName(parameterType parameterName) {
method body
}

Bold: Indicates a new term, an important word, or words that you see on screen. For
example, words in menus or dialog boxes appear in the text like this. Here is an example:
"Click on Create | 3D Object | Capsule from the Hierarchy panel."

Warnings or important notes appear like this.

Tips and tricks appear like this.

Get in touch
Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book
title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you have found a mistake in this book, we would be grateful if you would
report this to us. Please visit www.packtpub.com/support/errata, selecting your book,
clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we
would be grateful if you would provide us with the location address or website name.
Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in,
and you are interested in either writing or contributing to a book, please visit
authors.packtpub.com.

[5]
Preface

Reviews
Please leave a review. Once you have read and used this book, why not leave a review on
the site that you purchased it from? Potential readers can then see and use your unbiased
opinion to make purchase decisions, we at Packt can understand what you think about our
products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

[6]
1
Getting to Know Your
Environment
Pop culture has taught us that computer programmers are often outsiders, lone wolves, or
geeky hackers who possess extraordinary mental gifts for algorithmic thought, little social
IQ, and the odd anarchic bent. While this is not the case, there is something to the idea that
learning to code fundamentally changes the way you look at the world. The good news is
that your naturally curious mind will quickly adapt to this new way of thinking and may
even come to enjoy it.

You already use analytical skills in your everyday life that translate to programming –
you're just missing the right language and syntax to map those life skills into code. You
know your age, right? That's a variable. When you cross the street, I presume you look
down the road in both directions before stepping off the curb like the rest of us. That's
evaluating different conditions, or what we call control flow in programming parlance.
When you look at a can of pop, you instinctively identify that it has certain properties such
as shape, weight, and contents. That's a class object! You get the idea.
Getting to Know Your Environment Chapter 1

With all that real-world experience at your fingertips, you're more than ready to cross over
into the realm of programming. You'll need to know how to set up your development
environment, work with the applications involved, and know exactly where to go when
you need help. To that end, we're going to begin our adventure delving into C# by covering
the following topics:

Getting started with Unity


Working with Visual Studio
Using C# with Unity
Exploring the documentation

Let's get started!

Technical requirements
Sometimes, it's easier to start with what a thing isn't, rather than what it is. The main goal
of this book isn't to learn the vast ins and outs of the Unity game engine or all of game
development. By necessity, we'll cover these topics at a basic level here at the beginning of
our journey, and in more detail in Chapter 6, Getting Your Hands Dirty with
Unity. However, these topics are simply to provide a fun, accessible way for us to learn the
C# programming language from the ground up.

Since this book is aimed at complete beginners to programming, if you have no previous
experience with either C# or Unity, you're in the right place! If you've had some experience
with the Unity Editor but not with programming, guess what? This is still the place to be.
Even if you've dabbled in a bit of C# mixed with Unity, but want to explore some more
intermediate or advanced topics, the later chapters of this book can provide you with what
you're looking for.

If you're an experienced programmer in other languages, feel free to skip


the beginner theory and dive right into the parts you're interested in, or
stick around and refresh your fundamentals.

[8]
Getting to Know Your Environment Chapter 1

Getting started with Unity 2020


If you don’t have Unity installed already, or are running an earlier version, you'll need to
do a little setup. Follow these steps:

1. Head over to https:/​/​www.​unity.​com/​.


2. Select Get Started (shown in the following screenshot), which will take you to
the Unity store page:

If the Unity home page looks different for you than what you can see in
the preceding screenshot, you can go directly to https:/​/​store.​unity.
com.

Don't feel overwhelmed by this – you can get Unity completely free!

[9]
Getting to Know Your Environment Chapter 1

3. Click the Individual tab and select the Personal option on the left. The other paid
options offer more advanced functionality and services subscribers, but you can
check these out on your own:

After selecting the personal plan, you'll be asked if you're a first-time or returning user.

[ 10 ]
Getting to Know Your Environment Chapter 1

4. Select Start here under First-time Users:

5. Select Agree and download to get your copy of Unity Hub:

[ 11 ]
Getting to Know Your Environment Chapter 1

Once the download is complete, follow these steps:

1. Open up the package (by double-clicking it).


2. Accept the user agreement.
3. Follow the installation instructions. When you get the green light, go ahead and
fire up the Unity Hub application! You'll see the following screen:

The newest version of Unity Hub has a wizard or getting started path
when you first open the application. If you'd like to follow that, feel free.
The following steps show you how to start a new project without any help
from the application since that's only available on the first launch.

4. With Unity Hub open, switch to the Installs tab from the left-hand menu and
select ADD:

[ 12 ]
Getting to Know Your Environment Chapter 1

At the time of writing, Unity 2020 is still in its Alpha phase, but you should be able to select
a 2020 version from the Latest Official Releases list:

[ 13 ]
Getting to Know Your Environment Chapter 1

You won't need any specific platform modules to follow along with future examples, so go
ahead and leave this as-is. If you do want to add them at any time, you can click the
More button (three-dot icon) at the upper right of any version in the Installs window:

When the installation is complete, you'll see a new version in your Installs panel, as
follows:

[ 14 ]
Another Random Scribd Document
with Unrelated Content
Mr. Knudsen. C. Calvert Knudsen. And may the record show that I am,
Mr. Chairman, if you please, the treasurer of the Seattle Bar
Association, and, at the request of that association and at the
request of this gentleman, I am undertaking to represent him at this
hearing inasmuch as he is financially unable to obtain other counsel.

Mr. Moulder. The record will so reflect the statement made by


counsel.

Mr. Velde. May I make this remark?

In connection with our hearings last June it was mentioned several


times that the mere fact that an attorney represents a witness who
might be a fifth amendment witness should be no reflection
whatsoever on the attorney. And I am sure that is true of all the
attorneys who have appeared here today.

Mr. Moulder. It is your duty to be here in the capacity in which you


appear here today, in the honor of your own profession.

Mr. Knudsen. Thank you, Mr. Chairman.

Mr. Wheeler. Will you spell your name, please?

Mr. Kroener. K-r-o-e-n-e-r.

Mr. Wheeler. Do you presently reside in Seattle?

Mr. Kroener. Yes.

Mr. Wheeler. What is your occupation, Mr. Kroener?

Mr. Kroener. Work as a machinist.

Mr. Wheeler. Are you presently employed?

Mr. Kroener. No; I am not.


Mr. Wheeler. Being a machinist, are you a member of any union?

(The witness confers with his counsel.)

Mr. Kroener. I wish to invoke, on answering that, the fifth


amendment, on the grounds that it may incriminate me.

Mr. Wheeler. Are you a member of the International Association of


Machinists, A. F. of L.?

Mr. Kroener. Again I wish to invoke the fifth amendment.

Mr. Wheeler. Have they instituted charges against you to remove you
from membership in the union?

Mr. Kroener. Again I wish to invoke the fifth amendment.

Mr. Wheeler. What has been your educational background, Mr.


Kroener?

Mr. Kroener. First half year of the eighth grade of grammar school.

Mr. Wheeler. In Seattle?

Mr. Kroener. Yes.

Mr. Wheeler. How have you been employed?

Mr. Kroener. When I was younger I worked in logging camps and did
odd jobs in the steel mills, and as a welder. And, oh, since about
1941 and 1942 I have worked in the machine trade.

Mr. Wheeler. In the machine trade?

Mr. Kroener. Yes.

Mr. Wheeler. For what companies have you worked as a machinist?


Mr. Kroener. I don’t remember all of them exactly, and I couldn’t say
the times I have worked for a number of the uptown shops and
marine yards in Seattle. Some of them have gone out of business.
Gibson’s has gone out of business. And I worked at Washington Iron
Works and marine yards around Seattle.

Mr. Wheeler. Do you know who just preceded you on the witness
stand?

(The witness confers with his counsel.)

Mr. Kroener. I wish to again invoke the fifth amendment on the


grounds of self-incrimination.

Mr. Wheeler. Were you present in the hearing room when Mr. Eugene
Robel testified?

Mr. Kroener. I was present.

Mr. Wheeler. Are you acquainted with him?

Mr. Kroener. Again I wish to invoke the fifth amendment.

Mr. Wheeler. Were you present in the hearing room when Mr. Harold
Johnston testified?

Mr. Kroener. I was present.

Mr. Wheeler. Are you acquainted with Mr. Harold Johnston?

Mr. Kroener. Again I wish to invoke the fifth amendment.

Mr. Wheeler. Is it a fact that the three individuals I just mentioned,


along with you and other people, were members of a cell within the
machinists union?

Mr. Kroener. Again I wish to invoke the fifth amendment on the


grounds of self-incrimination.
Mr. Moulder. Do you have any knowledge as to the action taken by a
machinists union referred to by Mr. Wheeler in expelling members
from that union where there is evidence of their Communist
affiliations?

Mr. Kroener. I believe there may be some such program going on,
but I am not too well acquainted with it. So I couldn’t answer it too
clearly.

Mr. Moulder. Is the reason why you refuse to answer because of the
fear you might be expelled from the union?

(The witness confers with his counsel.)

Mr. Kroener. Again I wish to invoke the fifth amendment on the


ground that the answer may tend to incriminate me.

Mr. Moulder. Do you have knowledge and information that the union
referred to is exercising its efforts to rid its ranks of persons who are
Communists?

Mr. Kroener. Again I wish to invoke the fifth amendment.

Mr. Moulder. I hope the witness has contributed to the union’s effort.

Mr. Wheeler. When and where you were born, Mr. Kroener?

Mr. Kroener. Seattle, Wash., April 8, 1920.

Mr. Wheeler. Are you acquainted with Mrs. Barbara Hartle?

Mr. Kroener. Again I invoke the fifth amendment.

Mr. Wheeler. Did you know that Mrs. Hartle, in her testimony as a
witness before this committee in June 1954, identified you as a
member of the Communist Party?
Mr. Kroener. Again I invoke the fifth amendment on the grounds of
self-incrimination.

Mr. Wheeler. Have no comment other than that concerning her


testimony?

Mr. Kroener. No.

Mr. Velde. Mr. Wheeler, do you have the testimony of Mrs. Hartle
there?

Mr. Wheeler. I do, sir.

Mr. Velde. Will you read it for the record, please?

Mr. Wheeler. Mrs. Hartle, during a portion of the testimony discussing


the industrial branch of the Communist Party, was questioned by Mr.
Tavenner:

Will you tell the committee, please, whether or not there was
any important function that Elmer Thrasher performed in the
industrial section of the party?

Mrs. Hartle. He was chairman of a branch in the industrial


section, in the building trades. He was a member of one of the
building-trades unions—the carpenters union.

Another one whom I recall is Ed Kroener. He lived in the


Duwamish Bend area, in the Duwamish Bend housing project,
with his wife, Donna Kroener, who was a member of the south
King region and the Duwamish Bend Club, but he was a
member of the industrial section inasmuch as he was a member
of the Machinists Union, Local No. 79.

Do you wish to comment on that testimony, Mr. Kroener?

Mr. Kroener. No.


Mr. Velde. To what period of time was Mrs. Hartle referring?

Mr. Wheeler. To what period of time, Mr. Kroener, was she referring?

Mr. Kroener. Again I wish to invoke the fifth amendment on the


grounds of self-incrimination.

Mr. Wheeler. Mr. Kroener, did you at any time participate as an


individual within the Progressive Party in 1948 in the State of
Washington?

Mr. Kroener. Again I wish to invoke the fifth amendment on the


grounds of self-incrimination.

Mr. Wheeler. Are you a member of the Communist Party today?

Mr. Kroener. Again I wish to invoke the fifth amendment on the


grounds of self-incrimination.

Mr. Wheeler. I have no further questions, Mr. Chairman.

Mr. Moulder. Mr. Velde?

Mr. Velde. I have just one brief question. How could your
acquaintanceship with Mrs. Hartle or Mr. Johnston or the other
witnesses whom you were asked about tend to incriminate you?

(The witness confers with his counsel.)

Mr. Kroener. The answer to that question may open up a whole field
of other questions, and, therefore, I wish to invoke the fifth
amendment on the grounds of self-incrimination.

Mr. Moulder. Do you have anything else you wish to say in


explanation of your presence or your appearance here?

Are you married?


Mr. Kroener. Yes.

Mr. Moulder. Do you have a family?

Mr. Kroener. Yes.

Mr. Moulder. Did you serve in the Armed Forces of the United States?

Mr. Kroener. Yes.

Mr. Moulder. In what capacity and what branch?

Mr. Kroener. I was in the Marine Corps, 1944, 1945, and 1946, South
Pacific and China.

Mr. Moulder. Is there anything further you wish to say?

Mr. Kroener. That is all.

Mr. Moulder. The witness is excused.

(Whereupon the witness was excused.)

The committee will stand recessed until tomorrow morning at 9


o’clock.

(Whereupon, at 4:57 p. m., the committee was recessed, to be


reconvened at 9 a. m., Friday, March 18, 1955.)
INVESTIGATION OF COMMUNIST
ACTIVITIES IN THE SEATTLE,
WASH., AREA
FRIDAY, MARCH 18, 1955

United States House of Representatives,


Subcommittee of the
Committee on Un-American Activities,

Seattle, Wash.

PUBLIC HEARING

A subcommittee of the Committee on Un-American Activities met,


pursuant to recess, at 9 a. m., in Room 402, County-City Building,
Seattle, Wash., Hon. Morgan M. Moulder (chairman) presiding.

Committee members present: Representatives Morgan M. Moulder


(chairman) and Harold H. Velde (appearance as noted).

Staff members present: Frank S. Tavenner, Jr., counsel; William A.


Wheeler, staff investigator.

Mr. Moulder. The subcommittee will be in order.

Mr. Counsel, call the witness you wish to examine.

Mr. Tavenner. Mr. Chairman, I would like to recall Mr. Dennett at this
time.
TESTIMONY OF EUGENE VICTOR DENNETT,
ACCOMPANIED BY HIS COUNSEL, KENNETH A.
MacDONALD—Resumed
Mr. Tavenner. It is noted, Mr. Dennett, that your counsel is not with
you. Do you prefer to wait until he arrives before proceeding?

Mr. Dennett. It doesn’t make any particular difference. I am sure my


counsel intends to be here as soon as he can get here, but there is
no need to delay.

Mr. Tavenner. I understand he is in the corridor, so we will wait until


he arrives.

(At this point Kenneth A. MacDonald, counsel to the witness, entered


the hearing room.)

Mr. Tavenner. When you left the stand yesterday, Mr. Dennett, we
were speaking of your experience in the Communist Party at
Bellingham. Will you please describe to the committee what
additional activities of the Communist Party you engaged in while at
Bellingham.

Mr. Dennett. I believe, sir, that I recounted that the Communist Party
was active in the unemployed movement, and our membership grew
from 7 to approximately 160 in the course of a year’s time, and that
we had proceeded to reorient that membership in the party from
exclusive work in the unemployment councils to working in an
organization known as the People’s Councils, which was organized by
non-party people.

The two leaders of that organization at that time were Mr. M. M.


London and Mr. George Bradley.

The Communist Party was quite disturbed that there was such an
effective organization in existence which was not directly under our
leadership.

Mr. Tavenner. What was the name of that organization?

Mr. Dennett. The People’s Councils. Consequently, one of our major


objectives was to win that leadership to support the party position
one way or another. We had had previous experience with Mr.
London and we considered that it was not possible to win Mr.
London back to—or to support the party. Therefore, we concentrated
our attention on Mr. Bradley, and ultimately won him to support the
party and the party position in opposition to Mr. London.

Mr. Tavenner. When you say you won Mr. Bradley to the support of
the Communist Party position, do you mean to indicate that he
became a member of the Communist Party?

Mr. Dennett. Yes; he did. He became a member of the Communist


Party after my constant agitation with him had convinced him that
the Communist Party program was a sounder program and a better
program than the one that they were pursuing in the People’s
Councils.

And Mr. Bradley was unable to convince Mr. London, and they
became at some conflict in point of view on that.

Mr. Tavenner. The organization there known as the Unemployed


Councils, if I understood your testimony correctly, was a Communist-
organized group?

Mr. Dennett. That is true. The Unemployed Council was organized by


the Communist Party, and it was our policy throughout that entire
period to insist that all unemployed organizations, if they were to
truly represent the unemployed, had to affiliate with the
Unemployed Councils.

Now in the case of the People’s Councils, we tried to get them to


affiliate with the National Unemployed Councils. They never did.
Even after we won Bradley to our support the rest of the
membership still would not agree to direct affiliation with the
National Unemployed Council. Instead, they felt that they had a
greater kinship and association with the Unemployed Citizens
Leagues, which had been organized in the city of Seattle and in
various parts of the State of Washington under the leadership of
anti-Communists who had originally come from the labor movement
in the city of Seattle.

There were three particular leaders of the Unemployed Citizens


League who organized it at the outset.

And I am not sure that I related yesterday how serious the


unemployment problem was in the city of Seattle, but I am sure that
if anyone would take the trouble to look up the records they would
find that at one time there were over 90,000 families in the city of
Seattle who were dependent upon public assistance to maintain
themselves and their families.

There was no private employment in the city. The only persons who
were receiving paychecks were those who were working for either
the State, Federal, or city governments. And under those
circumstances the problem was very, very acute. The tax rolls were
overtaxed. I mean by that that the tax burden was greater than the
city was able to bear. The city treasury was soon exhausted trying to
maintain the citizens who were unemployed through no fault of their
own.

Soon the county budget was exhausted, and they were perplexed.
The problem was far more serious and far more acute than the
average person today can possibly comprehend unless he looks at
the statistics, which are available, I am sure, in some of the research
libraries.

I speak of that about the city of Seattle because I have some


knowledge of it from personal experience. The same situation
existed in nearly every small city in the State of Washington at that
time. I cannot testify as to what the condition was in other parts of
the country.

But it was that condition which opened the door for widespread
organization on the part of workers and unaffiliated and disaffiliated
people, and it was when they came into these organizations that it
became possible for the Communists to begin to hammer away with
the class-struggle line of tactics and the insistence that a relentless
fight must be waged against the capitalist system and blame the
capitalist system for this condition of unemployment.

It created a problem, too, for those who held public office because
they did not know what to do about it. And, frankly, it wasn’t
possible for any local people to solve the problem. It had to be dealt
with on a national scale, on a national basis.

It was not until after the new administration took office in 1933 that
steps were taken which made it possible to start the wheels of
industry in motion again. And as those wheels of industry got started
in motion it was possible for these workers to find jobs. And when
they started finding jobs they left the unemployed organizations.
When they left the unemployed organizations they got out from
under the immediate influence of the Communists who had entered
those organizations, and, in many instances, obtained control.

I am speaking specifically of the Unemployed Citizens League, the


People’s Councils, and I think that there were some other
organizations around here that I have forgotten the names of.

I think that there was one called the United Producers of


Washington that was created over in Pierce County which was
affiliated with the Unemployed Citizens League.

There were many different names of these organizations, and they


assumed different forms. But essentially they all performed the same
function. They provided a center around which people could begin to
develop their own ideas and listen to other people’s ideas.

I would certainly like to make certain that everyone understands that


that kind of problem has to be dealt with also with ideas.

Mr. Tavenner. You made reference to unemployment citizens’ leagues.


Were there such organizations in Bellingham?

Mr. Dennett. No, there were not. The People’s Councils performed all
the functions which the Unemployed Citizens Leagues would do, plus
the fact that the People’s Councils also developed some political
aspirations. I mean they did embark upon an independent political
campaign, and they did run candidates for public office. That was
largely due to the influence of the Communist Party there.
Remember 1932? We were insistent that they not support either the
Democratic or Republican Parties because we branded them as
capitalist parties, and we insisted that the only way it was possible
for the workers to obtain what they wanted was through their own
party.

We succeeded in prevailing upon the People’s Councils to run their


independent candidates, and some of them came very close to
election to office. They didn’t quite make it.

Mr. Tavenner. Mr. Dennett, I think it would be of value to the


committee to understand as fully as possible the methods used by
the Communist Party in that period in causing the Unemployed
Councils to take various courses of action in Bellingham and Seattle,
and to understand to what extent the Communist Party was
successful in using other organizations which it did not control.

Mr. Dennett. I can think of two very graphic illustrations of that.

One occurred in the city of Seattle at the time the unemployed


occupied this building for 3 solid days. The Unemployed Citizens
Leagues in the city of Seattle were anti-Communist; their leadership
was anti-Communist. But they were confronted with the budget
running low, the city funds exhausted, and the county
commissioners were confronted with the dilemma of what to do with
their funds diminishing.

The county commissioners at that time ordered a cut in the amount


of relief which would be allowed. When they did that it placed the
anti-Communist leadership in the Unemployed Citizens Leagues in a
most embarrassing position because we in the Communist Party and
in the Unemployed Councils had been very critical of everything
which the Unemployed Citizens Leagues had been doing and which
their leaders had been doing.

When this cut occurred we blamed the leaders of the Unemployed


Citizens Leagues for permitting it. We didn’t know that these leaders
had been opposing the cut. We didn’t know what their actual
attitude was. But we very soon found out because these leaders
were so desperate that they decided to make a march on the
County-City Building where the commissioners were to meet in a
room similar to this one. And it was their intention to demand at that
time that the cuts not be put into effect.

However, the demonstration proved to be much larger and had much


more support than the leaders of the Unemployed Citizens Leagues
anticipated, and the Communists—I remember it very well because I
was on the district bureau at that time—and we found ourselves not
in the leadership of a militant action, and we were embarrassed and
fearful that if we didn’t get into the act that we would be blamed by
the national leadership.

And we didn’t have any contacts in the Unemployed Citizens League


leadership, and we didn’t know what to do. So we debated the
question for about 30 hours in 1 continuous bureau meeting.
Following that meeting we decided that it was best for us to join the
demonstration regardless, whether we had contact or not, and we
issued leaflets and called upon our members to join in the
demonstration.

(At this point Representative Harold H. Velde entered the hearing


room).

Mr. Dennett. In the process of doing so we received a bigger


response than we expected. In other words, the need was more
acute than even the most closest observers realized. Consequently,
there were about 6,000 people down here in this building. They
couldn’t all get into the chambers. They crowded the hallways, they
crowded several floors of the building. And some of the
commissioners got so scared of the demonstration that they tried to
run out. They tried to avoid meeting the leaders.

As a result, the demonstrators decided they would stay until they did
meet the leaders, until they met the commissioners. And it took over
3 days before the commissioners finally agreed to meet with the
committee of this group.

I happened to be the secretary of that committee at that time, and I


am sorry that those records that I kept of that demonstration are
records which I do not have today. They would be quite valuable to
understand all the things that happened, the chronology of why one
thing followed another.

But I am quite convinced and I am quite certain that the account I


have just given you can be verified by checking the newspaper files
of that period.

Mr. Tavenner. Now is it correct to say that the general objectives of


the Unemployed Councils, which was organized by the Communist
Party, and the general objectives of the Unemployed Citizens
Leagues, which were anti-Communist in character, were the same in
that their purpose was to alleviate suffering from unemployment? Is
that true?
Mr. Dennett. I think that is generally true with this possible exception,
that the Communist Party was never satisfied to resolve the
alleviation of immediate suffering. That was a tactic to win wider
support and to pursue their further objective of political control.

But, on the other hand, the Unemployed Citizens Leagues were


concerned only with the question of getting some relief for the
immediate situation and not fundamentally altering the economic
system.

The Unemployed Councils did strive to change the economic system.

Mr. Tavenner. That is the point I wanted made clear. This appears to
be an excellent example of the Communist Party using a situation in
which all people were interested from the humanity standpoint and
endeavoring to turn it to its own advantage in developing its general
objectives.

Mr. Dennett. I think that is true.

And while we speak of that point I think that all political parties do
the same thing. They try to turn things to their own advantage. That
is the way the Communists try to do it.

Mr. Tavenner. Was there any other development at that period of time
which would demonstrate how the Communist Party by its
organizational efforts turned unfortunate situations of this character
to its own advantage?

Mr. Dennett. There was another example which seems rather devious
when you look at it from this perspective, but at that time we
thought it was quite skillful.

In the city of Seattle after this embarrassing financial crisis arose it


became quite clear to everyone that to finance the relief load was a
problem greater than cities or counties could bear. It required State
and Federal assistance. But the State was not helping at that time.
The State was not doing anything. And the Communists conceived
the idea of hunger marches. I remember there were national hunger
marches. There were also State hunger marches. There were county
hunger marches. There were hunger marches within cities.
Wherever the need was acute there were hunger marches.

And we had more than our share of them here.

In one, in particular, on one occasion, the Communists raised a


demand for a march on Olympia to demand that the State finance
the relief load for localities. Our request was for a big bond issue.

The unemployed councils in the city of Seattle did not have a very
large following, and it was a hopeless task unless some means could
be found to prevail upon the unemployed citizens’ leagues to take
part in such a march. But the Unemployed Citizens’ League
leadership was hostile to the Communist leadership in the
unemployed councils. But through the people’s councils we were
able to exert some influence because we had a considerable
Communist leadership developing in the ranks of the people’s
councils in Whatcom County. Strangely enough, that organization
was in a position where its top leadership was friendly with and
collaborated with the unemployed citizens’ leagues in Seattle while
those of us in the Communist Party, in the ranks of the organization,
naturally were following the leadership of the national unemployed
councils and were friendly with and working with the unemployed
councils in the city of Seattle.

Consequently, when the unemployed councils in the city of Seattle


issued a call for a march on Olympia, that call was transmitted to
Bellingham where we entered into the people’s councils and won a
majority vote in support of such a march, and with the further
request that they call upon the unemployed citizens’ leagues in
Seattle to join the march, which they did. They prevailed upon the
unemployed citizens’ leagues to join in the march.
Consequently, we had two somewhat hostile groups participating in
the same event, marching on Olympia.

But when they got to Olympia there was a split. There were two
demonstrations. And there is a gentleman in this room who suffered
as a casualty of one of those demonstrations because at that
particular time he was a leader in the unemployed citizens leagues.

The unemployed councils people wanted to chase the leadership of


the unemployed citizens leagues and the people’s councils away
from the head of that demonstration. And Mr. Jess Fletcher was a
casualty on that occasion. He was pulled down off of one of the—I
forget what you would call it—one of those approaches to the steps.
And he had a badly crushed ankle as a result of that occasion.

I was called upon by the district leadership of the party at that time
to make a speech. I was instructed to expose Mr. London and to
otherwise denounce the Social-Fascist leaders of those
organizations. And, of course, being a thoroughly disciplined
Communist, I did precisely what I was instructed.

It had some repercussions because when we returned to Bellingham


I had some other unfortunate experiences about it.

I should say that in this demonstration in Olympia the Unemployed


Citizens League people did wait out the Governor and did get a
committee in to see the Governor, whereas the unemployed councils
people left Olympia without seeing the Governor and without
accomplishing their objective.

Mr. Tavenner. If I correctly understand these two illustrations which


you have described, in one instance the Communist Party occupied
this very building, joined in the activity of the unemployed citizens
leagues, and attempted to obtain for its own credit whatever credit
could be obtained, whereas in the other instance, by devious means,
they got the other organizations to cooperate with the unemployed
councils in the march on Olympia.
Mr. Dennett. That is true.

Mr. Tavenner. The Communist Party reversed its tactics.

Mr. Dennett. That is true. We were very flexible people. We could do


almost anything with our tactics.

Mr. Tavenner. Therefore, the Communist Party’s objectives were


accomplished in both instances.

Mr. Dennett. That is right. And what was even more important to the
party was to be able to carry a great big newspaper story in the
Daily Worker to the effect that the revolution was starting because
the workers had seized the County-City Building in King County,
State of Washington, and held it for 3 days.

Mr. Tavenner. Was that used as Communist propaganda over the


entire United States?

Mr. Dennett. It was.

Mr. Tavenner. Up until the time you made that speech at the direction
of the Communist Party it appears to me that this was a cooperative
effort between the unemployed councils and the unemployed
citizens leagues in the march on Olympia. Am I correct in that?

Mr. Dennett. It was; through the people’s councils.

Mr. Tavenner. But manipulated through the people’s councils where


you had influence?

Mr. Dennett. Correct.

Mr. Tavenner. Then after arriving on the scene, you, at the direction
of the Communist Party, made this attack on the leadership of the
unemployed citizens leagues.

Mr. Dennett. And the people’s councils.


Mr. Tavenner. Was the purpose of this attack to utterly destroy any
effectiveness of those organizations in the accomplishment of the
general purpose of the march?

Mr. Dennett. Looking back on it from this distance, it certainly


appears to me that that was its objective.

Mr. Tavenner. When you returned to Bellingham what reception did


you receive from these organizations which had in good faith
supported this march on Olympia?

Mr. Dennett. There was a great deal of tension; open threats were
made that if I showed my head around anywhere I would have my
head knocked off.

However, I was not so easily scared as that. So I showed my head.


The people’s councils had a practice of, which I considered to be
most democratic, reporting to their membership.

Following the hunger march they called a mass meeting for the
purpose of reporting what had been happening, what their success
was. And these very leaders of the people’s councils whom I had
denounced in Olympia presented themselves and reported to their
membership. In the process of reporting naturally they reported my
part in the affair, and their report aroused a great deal of bitterness
among the members of the organization.

When I appeared in attendance at the meeting those who were


present near me moved about 6 or 8 feet away, leaving me a
conspicuous figure out in the open spaces. And some of the remarks
were directed toward me in that meeting.

I felt at the time that something was wrong with the situation, of
what I had done. But I wasn’t sure what. I knew, however, that if I
didn’t face it all would be lost. So I chose to face it and take
whatever consequences might happen.
The consequences came very soon. When the meeting adjourned, as
I attempted to leave the building four members of the organization
surrounded me and marched me around behind the building where
they proceeded to give me a physical beating.

I never have been much of a fighter as such. Physically I am not


equipped to do so. So I merely rolled up into a ball and let them do
as best they could.

In the meantime some of my friends came to my assistance, and the


police intervened to stop anything from proceeding too far.

However, I did surprise everyone by appearing and I did unnerve


them because they didn’t believe that I had the nerve to show up
after what I had done in Olympia. And as a total consequence of it
all, I finally recruited most of the people who beat me up into the
Communist Party.

I felt they were good, militant people, and they were the kind of
people we wanted.

Mr. Tavenner. How long was that before you left Bellingham?

Mr. Dennett. Right now I can’t fix a real date on that. I would have to
look at the newspaper files to be certain of the date. It wasn’t too
long, however, because our influence had grown, and it wasn’t very
long after that.

Mr. Tavenner. Was there any other activity of the Communist Party
while you were at Bellingham which would be of value to this
committee as far as you know in making the committee aware of the
tactics and methods used by the Communist Party to advance its
objectives?

Mr. Dennett. Offhand, right now I think of nothing further with


respect to Bellingham.
Mr. Tavenner. I see before me several pamphlets which apparently
relate to the various hunger marches which are among the
documents which you made available to the staff. Will you examine
these, please, and state whether or not they were used in any
connection with the matters you have been describing?

(Documents handed to the witness.)

Mr. Dennett. Yes. These were what we called popular pamphlets, to


popularize the hunger marches. They were brief penny pamphlets
which we tried to sell in mass lots. In other words, if we could find
someone who would contribute a dollar we would make a hundred
of these things available and try to hand them out in large numbers.
They were given to nearly all persons who participated in hunger
marches, and they were an elementary introduction to the
orientation which the Communist Party had to the whole economic
situation.

Mr. Tavenner. The purpose is not clear of the use of those documents
by the Communist Party.

Here were those members who had agreed to take part in the
hunger marches. Why was it necessary for them to have such
material?

Mr. Dennett. Because in many instances people would participate in


these events because they were in need of relief themselves, but
they had no conception of what the economic problems were, and
they had no conception of the political objectives that we had.

And we were quite anxious to take that occasion, when they were
rubbing elbows with us, to make certain that they took some
elementary steps of understanding in our direction.
Dennett Exhibit No. 5

THE MARCH
AGAINST
HUNGER

By I. AMTER
Mr. Tavenner. Mr. Chairman, I would like to introduce in evidence three
pamphlets entitled “The March Against Hunger,” by I. Amter, “The
Highway of Hunger,” by Dave Doran, and “Our Children Cry for Bread,”
by Sadie Van Veen, and ask that they be marked “Dennett Exhibits 5,
6, and 7” respectively, with the understanding that only the front
cover and the back cover of each be incorporated in the transcript of
the record.

Read! Subscribe!

Daily Worker
Central Office Communist Party U.S.A.
50 East Thirteenth Street
New York, N. Y.

“The Only English Daily Working


Class Newspaper in America”

Brings you the truth about all vital and dramatic


developments in the class struggle in America and
throughout the world.

SPECIAL CORRESPONDENCE FROM THE


SOVIET UNION. The only authoritative news
accounts and features of the life and accomplishments
in the First Workers Republic.

Address All Subscriptions and Communications to:

DAILY WORKER
50 East 13th Street New York, N. Y.
SUBSCRIPTION RATES:
In Boros of Manhattan In the Rest of the
and Bronx, N.Y.C.: United States:
One year $9.00 One year $6.00
Six months 5.00 Six months 3.50
Three months 3.00 Three months 2.00
One month 1.00 One month .75

Mr. Moulder. They will be so marked and admitted.

Mr. Tavenner. In other words, you were going beyond the real
immediate purposes of the hunger march, and were trying to sell the
participants a bill of goods through these pamphlets.

Mr. Dennett. That is true.

Mr. Tavenner. Will you hurriedly look through these documents, please,
and call the committee’s attention to a few items which would
substantiate your testimony on that point?

Mr. Dennett. Well, here is this one on the March Against Hunger, by
Israel Amter, in which some of the subheadings tell the story.

There is one, “Struggles Force Relief.” The implication is very plain


that the only way they can get the relief is to engage in mass
struggles. And in too many instances that was true from their own
experience.

Dennett Exhibit No. 6


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like