Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (6 votes)
1K views55 pages

Download Complete (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 for All Chapters

The document provides information about various ebooks related to learning C# programming and game development using Unity, including titles by authors such as Harrison Ferrone and Micael DaGraca. It includes details on the books' ISBNs, publication years, and links to download them. Additionally, it highlights the author's background and the structure of the content within the books.

Uploaded by

almustareke62
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (6 votes)
1K views55 pages

Download Complete (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 for All Chapters

The document provides information about various ebooks related to learning C# programming and game development using Unity, including titles by authors such as Harrison Ferrone and Micael DaGraca. It includes details on the books' ISBNs, publication years, and links to download them. Additionally, it highlights the author's background and the structure of the content within the books.

Uploaded by

almustareke62
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 55

Download Full Version ebook - Visit ebooknice.

com

(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
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

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(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
ebooknice.com

(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

ebooknice.com

(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

ebooknice.com

(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
ebooknice.com
(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
ebooknice.com

(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
ebooknice.com

(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

ebooknice.com

(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

ebooknice.com

(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
ebooknice.com
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
customercare@packtpub.com 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 customercare@packtpub.com.

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 copyright@packt.com 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 ]
Exploring the Variety of Random
Documents with Different Content
Fifteen feet from the goal—ten.
With their eyes fixed on the white line, the Ripleys, inspired by that
spirit of determination and aggressiveness which victory almost won
carries with it, continued the battle. Only five feet now separated
them from the coveted goal.
In a voice that was strong and clear, Bill Stiles commanded:
“All together—Ripley forever!”
And the others chimed in loudly:
“Ripley forever—now all together!”
Before an irresistible rush, the discouraged Thorntons fell back, and
the big ball rolled over the line.
As the cheers from Ripley and their adherents rang out, a flag was
run up on the pole at the end of the field, and, as it fluttered out on
the breeze, “Ripley,” in big blue letters, appeared on the silken
surface.
The house-boat boys yelled loud and long.
“That old rag will come down yet,” grumbled the disconsolate Bates.
“I can tell you that!”
Just at this juncture, and quite unnoticed, a slight man of dignified
bearing briskly approached.
As his eyes lighted on the ex-tutor, he rushed with outstretched arms
toward him.
“Norman Redfern!” he exclaimed, in a tone of surprise and pleasure.
CHAPTER XXIII
GOOD NEWS FOR REDFERN
Redfern turned sharply.
“Mosley!” he cried, seizing the other’s hand, and shaking it warmly. “I
was intending to stop in and see you. This is indeed a pleasure.”
“I’ve been searching a month for you, Redfern; but excuse me a
moment—are you Colonel Ellison, sir? I was out when you called,
but was told I might find you here.”
“That is my name, sir,” said Uncle Dan. “You are the president of
Ripley Academy, I believe?”
Redfern seemed astounded.
“What!” he cried. “Mosley, is it possible? Where is Professor
Blackwell?”
“Resigned three months ago. And I was elected in his place.
Congratulate me, old man!”
“With all my heart; this is splendid news.” And Redfern again seized
the other’s hand. “Mosley and I were classmates here at Ripley,” he
added, to the others.
“Let me add my congratulations, too,” said Colonel Ellison, stiffly,
“and express the hope that the majority of visitors will not be obliged
to come, as I have, with complaints against the actions of your
students.”
“Ah,” said the new president, “what is it? I am sorry if they have
misbehaved themselves.”
“Some effort should be made to prevent such occurrences in the
future.”
“What is the nature of your complaint? But perhaps we had better
withdraw to another place,” added the president, noting that his
visitor spoke in a tone which carried a long distance.
As they walked slowly along the road, President Mosley listened
intently to Colonel Ellison’s complaint against Bill Stiles and his
motor boat crew, and promised to look into the matter thoroughly.
“And now,” he said, “if you will permit me, Colonel, we will change
the subject. I was on the point of communicating with you on a
matter of the utmost importance, both to yourself and Norman
Redfern.”
“Eh?” said the Colonel.
“What is that, Mosley?” asked Redfern, quickly.
“As I told you, I have been hunting for you for a month, but could find
no trace of your whereabouts. All letters addressed to you were
returned. Where in the world did you stop?”
“At a place where postmen never come,” replied Norman, with a faint
smile. “But what has happened—why should you wish to see me so
particularly? To speak frankly, I know that Professor Blackwell
expressed a wish that I should keep away.”
“I must remind you, Redfern, that the wishes of President Blackwell
are not those of President Mosley.”
“Good for you,” put in Joe Preston.
“What does all this rigmarole mean?” demanded Colonel Ellison,
looking from one to the other, in surprise.
“Simply this: by a bit of detective work, an unfortunate situation has
been cleared up—the name of a certain person entirely freed from
blame, and——”
“What is that?” cried Redfern, his voice trembling with excitement
and hope. “You mean——”
“Just what I say. But, as it is a private matter, I would respectfully ask
that these young gentlemen retire for a short time.”
“Not so far as I am concerned,” put in Redfern, with a flush. “I have
nothing to conceal; speak freely.”
“Something great coming, I’m sure,” said George, with interest.
“Ma foi, but what ees this?” muttered Pierre, scratching his head. “I
no understand it—ze talk ees so fast.”
Colonel Ellison merely nodded, to show that the arrangement suited
him.
“Well,” proceeded President Mosley, hesitatingly, “I suppose we shall
have to briefly review the whole matter.”
“Yes, yes!” said Redfern, eagerly.
“It seems, then, that one day last spring, your employer, Colonel
Ellison, sent you to a bank to collect a certain sum of money.
Unfortunately, you placed this in your overcoat pocket?”
Redfern nodded.
“And when you went to a restaurant, absent-mindedly hung the
garment on a rack?”
“Yes, yes!”
“And on leaving rather hastily, took what you thought to be your own
overcoat, and were on the train to Nyack before discovering that this
was not the case?”
“Correct again,” said Redfern, his tone indicating suppressed
excitement.
“On returning to the restaurant, you found your overcoat gone?”
“Yes.”
During this conversation a very strange expression came over
Colonel Ellison’s face. He looked decidedly uncomfortable; and his
glance shifted uneasily from the president to Redfern and back
again.
It was plain that the similarity between the overcoats had been the
means of losing the Colonel’s money.
After a short pause, Mr. Mosley continued:
“You made every effort to find the money which had been in your
keeping, and failed?”
“Yes, yes—but tell me—has it been recovered?” asked Redfern,
eagerly.
“Yes, I’m glad I can say that it has.”
Norman Redfern gave an exclamation of relief; his eyes sparkled
with pleasure, while Colonel Ellison stopped abruptly in his walk, and
stared down at him.
“Bully for you, Redfern!” cried Jack Lyons, enthusiastically. And
George Clayton slapped his former tutor on the shoulder, and shook
his hand warmly.
Pierre Dufour looked on in amazement, and murmured, “Ma foi, what
ees this?”
For an instant, Colonel Ellison remained silent. Then, clearing his
throat, he held out his hand.
“Redfern,” he said, frankly, “a man should always be willing to
acknowledge his mistakes. I ask your pardon for having wrongly
suspected you.”
“And I freely give it,” exclaimed the happy Redfern. “I will admit that
appearances were against me. But, Mosley, how in the world did all
this come about?”
“Well, to continue our story: I was, at the time, a professor at Ripley
and expected you, also, to join the staff. Unfortunately, President
Blackwell considered you—shall I say it?—guilty. And that ended
your chances.”
“Yes,” said Redfern, “I have been only too well aware of that.”
“But I had confidence in you; and was determined to prove that it
was well placed. I advertised freely, and——”
“You did?”
“Yes, sir! And in my spare time investigated to the best of my ability.
Nothing resulted, and I got a bit discouraged. But I don’t believe in
giving up easily. Several times, at intervals, I went back to the
restaurant, made inquiries and kept the matter fresh in their minds.
Then what should happen? A few days ago, I got a letter; and it
made me jump.”
“How can I ever thank you enough?” murmured Redfern.
“The man was a traveling salesman—only occasionally visited New
York—and did not again have a chance to go to the restaurant until
quite recently. But he was honest, and wished to find the owner of
the money. The proprietor told him to communicate with me.”
Redfern seized the other’s hand.
“Mosley,” he said, “I’ll never forget you for this.”
The president smiled.
“Well, my story is almost finished. I was about to write to Colonel
Ellison, in order that he might meet the gentleman and have his
money restored. The visit is most opportune, though I regret his
errand.”
“Think no more about it,” said Uncle Dan, hastily. “I was once a boy
myself; circumstances had a great deal to do with my feelings.”
“Uncle Dan,” put in George Clayton, “may I speak a word to you?”
“Well, young man, what is it?”
Briefly, George explained the whole story of his connection with the
house-boat expedition, and this time his guardian, in the light of
recent developments, listened and believed.
“You must understand, George,” he said, “though Redfern is not to
blame in the matter, you have acted in a most reckless and self-
willed fashion. We shall talk about it later.”
“I no comprehend, monsieur the Colonel,” exclaimed Pierre. “Ees
nobody any scamps, eh? Ma foi!”
“Shake Mr. Redfern by the hand, Pierre,” commanded the Colonel.
“It was all a misunderstanding.”
“If it hadn’t been for Pierre’s meddling, a great deal of trouble might
have been saved,” said George, half-resentfully. “He butted in, and
——”
“George—George!” cried Uncle Dan, “I must protest against the use
of such slang—such a lack of courtesy. Affairs have turned out
happily for all concerned; and this is no time for ill-feeling.”
“I guess you are right, uncle,” admitted George, frankly; and then
turning toward the chauffeur, he added, “Everything is all right.”
“All one grand mistake? Ma foi!” said the Frenchman, with the
corners of his mouth beginning to curve upward. Then, with a sly
glance at Colonel Ellison, whose stern countenance still showed a
trace of discomfiture, he extended his hand toward the former tutor.
“We shake hand, Monsieur Redfern,” he exclaimed. “I’m sorry I say I
would your face smack.”
“It’s all forgotten, Pierre,” laughed Redfern, cordially.
The Frenchman smiled broadly.
“A la bonne heure, Monsieur George!” he cried. “We are friends
again. But nevaire you say ‘fired’—‘fired’ to me.” And this time, Pierre
Dufour showed that his resentfulness was a thing of the past.
Norman Redfern presently slapped Jack Lyons on the back.
“Jack,” he said, “your house-boat trip has certainly resulted in
making a great change in the feelings of one young man.”
“And it will have a more substantial result than that,” put in Uncle
Dan, quickly. “I hope you will become George’s tutor again.”
Redfern’s features lighted up.
“Certainly—I shall be only too glad,” he began.
But President Mosley hastily interposed.
“One minute, Redfern,” he exclaimed. “Colonel Ellison’s offer is very
kind; but it might interfere with your professorship at Ripley
Academy.”
And when the true significance of his words was realized, a
tremendous volley of cheers rose on the air.
CHAPTER XXIV
THE END OF THE CRUISE
President Mosley, accompanied by Uncle Dan, Redfern and Pierre
Dufour, entered the Academy building, while the boys wandered off
to the athletic field. The events, rapid and unexpected, and the
happy termination of the house-boat trip, had put everybody in the
best of humor.
The Ripley flag still floated proudly from the top of the pole. Bill Stiles
and his followers, hot, victorious, husky-voiced and tired, marched
around the field. They had won the second event, and Ripley was
crowned with glory.
Owen Andrews picked up his tin horn. It was now a battered and
twisted wreck.
Andrews looked at it sadly, put it to his lips, and, with a tremendous
effort, managed to draw forth a thin, dismal groan.
“Too bad it didn’t last for just one more blow,” put in George Clayton.
“Why, Bill number one?” demanded Stiles.
“Because I intend to enter Ripley,” answered George, calmly.
The hoots, yells and jeers which this remark brought forth from the
Thorntons filled the hearts of the Ripleys with pure, unalloyed joy.
“I say, Joe Preston,” remarked Fred Winter, abruptly, “I knew it.”
“Knew what?”
“That you wouldn’t do a stroke of work on the history of our trip.”
“But I have; I wrote the heading. When I get home, I’ll finish it sure,”
laughed Joe. “Anyway, I have an idea.”
“What is it?”
“We’ll try to get the governor to put a bill through the legislature for
the state to buy the ‘Gray Gull’ and place it in a museum.”
“You silly thing! Do be serious.”
“Let’s see: there was the ‘Half-moon,’ the ‘Clermont,’ and now the
‘Gray Gull.’ I’m going to put that in my history, too.”
“One thing we came near forgetting, fellows,” put in Jack Lyons. He
seized Aleck Hunt by the shoulder. “How about that story of yours?”
“That’s so,” chorused the others.
“What story?”
“What story? Why, about Joe Archer and Battery Park, of course.”
“Oh, yes! Do you fellows really think I’m going to tell it now?”
“You bet we do.”
“Well, I put it in pickle some time ago; and the jar’s been left on the
house-boat. It won’t be taken out before I get a bite to eat—no siree.”
And Aleck backed away.
Joe Preston winked at the others; his grin grew to positively
enormous dimensions. Then he burst into a loud, long laugh.
“I wonder what we’re going to do next, Bob?”
It was Tom that asked the question.
“Well, Ramblers,” spoke up Jack Lyons, heartily, “we’ve had such a
jolly good time on this trip I should say we’d all better take another.”
“Hooray!” shouted his hearers. “That’s what we’ll do.”

Other Stories in this Series are

THE RAMBLER CLUB AFLOAT


THE RAMBLER CLUB’S WINTER CAMP
THE RAMBLER CLUB IN THE MOUNTAINS
THE RAMBLER CLUB ON CIRCLE T RANCH
THE RAMBLER CLUB AMONG THE LUMBERJACKS
THE RAMBLER CLUB’S GOLD MINE
THE RAMBLER CLUB’S AEROPLANE
Transcriber’s note
Minor punctuation errors have been changed
without notice. Spelling has been retained as
published.
The following printer errors have been changed.
CHANGED FROM TO
Table of “XXIII. THE “XVIII. THE
Contents: COLONEL IS” COLONEL IS”
“there was no “there was no
Page 105:
reponse” response”
“could gee “could get
Page 150:
together” together”
“assuming “assuming
Page 172:
definate shape” definite shape”
“became a “became a
Page 208:
confused blurr” confused blur”
““took their “took their
Page 302:
opponent” opponents”
*** END OF THE PROJECT GUTENBERG EBOOK THE RAMBLER
CLUB'S HOUSE-BOAT ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright
in these works, so the Foundation (and you!) can copy and
distribute it in the United States without permission and without
paying copyright royalties. Special rules, set forth in the General
Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree to
abide by all the terms of this agreement, you must cease using
and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project
Gutenberg™ works in compliance with the terms of this
agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms
of this agreement by keeping this work in the same format with
its attached full Project Gutenberg™ License when you share it
without charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it
away or re-use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of the
copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite
these efforts, Project Gutenberg™ electronic works, and the
medium on which they may be stored, may contain “Defects,”
such as, but not limited to, incomplete, inaccurate or corrupt
data, transcription errors, a copyright or other intellectual
property infringement, a defective or damaged disk or other
medium, a computer virus, or computer codes that damage or
cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES -


Except for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU
AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
STRICT LIABILITY, BREACH OF WARRANTY OR BREACH
OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE
TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER
THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE
OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF
THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If


you discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person or
entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS
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