- Summary 更新時間:2021-07-02 20:00:14
- PlayerController.cs
- Code
- How to export and make it playable
- Animator
- 3D animations
- 3D models
- How to create a 3D game
- Through script
- Through animation
- Adding sound effects
- Adding music
- Where to find sound effects and music
- How to add sound effects and music
- Audio 3D Games and Export
- Summary
- The code in this chapter
- Making it an enemy
- Trigger movement
- Movement by animation
- Movement
- What makes an enemy?
- Enemies
- Summary
- The code in this chapter
- Magic Points and Magic bar
- Health Points and Health bar
- High score and persisting data
- The Collectable class
- The coin prefab
- Collectables
- Collectables
- Summary
- The code in this chapter
- Game over
- GameView
- Reference exceptions
- Hiding and showing the Canvas
- The Button action
- Interaction
- The Button component
- The image
- Basic button
- Buttons
- Recognizing events
- Target screen resolution
- Constructing the view UI – how to keep things clean
- Views
- Introducting the Unity UI
- The User Interface
- Summary
- The code used in this chapter
- Extending the level
- Testing LevelGenerator
- Vector3
- Instantiating
- Creating a copy of the level piece
- Writing the script LevelGenerator
- Planning the LevelGenerator class
- Creating a generated level
- Creating a designed level
- Designed levels versus generated levels
- The Game Level
- Summary
- Code in this chapter
- Setting up the player starting position
- Restarting the game
- Using triggers
- Setting up input keys
- Starting the game
- Singleton class
- Gameplay loops
- Writing GameManager
- Summary
- PlayerController.cs
- Code
- Running
- Animator
- Jump
- User input
- PlayerController
- CircleCollider2D
- Rigidbody2D
- Preparing the player prefab
- Keeping your project clean
- Backup
- Setting up a new Unity project for our game
- Starting Your First Game
- Summary
- Target screen resolution
- Target platform and resolution
- UI – the user interface
- Scoring
- Collectables and obstacles
- Mouse and touch controls
- Physics
- An animated 2D character
- Level design
- Testing the mechanics
- Breaking the concept into smaller parts
- Game mechanics and core components
- The concept
- What do I need to learn before I start creating my own game?
- Your first game – avoiding the trap of the never–ending concept
- Let's Make a Game! – from Idea to Development
- Summary
- Overloading
- Custom constructors
- Using methods with objects
- Bored yet?
- Instantiating an object
- Example
- A few facts
- Working with objects is a class act
- Object a Container with Variables and Methods
- Summary
- Breaking the loop
- Searching for data inside an array
- Modulo
- Loops in statements
- while versus for loops
- The while loop
- An example
- The for loop
- The foreach loop
- Introduction to loops
- Loops
- Summary
- How do I know what's inside my Hashtable?
- Accessing values
- Dictionaries
- ArrayList
- Checking the size
- Retrieving the data from the Array or List<T>
- List <T> versus arrays
- Common operations with Lists
- Storing items in the List
- Declaring an array
- What is an array?
- Lists Arrays and Dictionaries
- Summary
- Example
- Returning the value
- Returning a value from a method
- How many parameters can a method have?
- Specifying a method's parameters
- Understanding parentheses - why are they there?
- The minimum requirements for defining a method
- Defining a method the right way
- Parentheses are part of the method's name
- Using multiword names for a method
- Beginning method names with an uppercase letter
- Naming methods properly
- Using methods in a script
- Getting into the Details of Methods
- Summary
- Variable scope - determining where a variable can be used
- Where you declare a variable is important
- Assigning values while declaring a variable
- The most common built-in variable types
- Declaring a variable and its type
- Using multiword variable names
- Beginning variable names with lowercase
- Naming your variables properly
- Private variables
- Displaying public variables in the Inspector panel
- Changing a property's value in the Inspector panel
- Unity changes script and variable names slightly
- Variables become component properties
- Understanding component properties in Unity's Inspector
- Writing C# statements properly
- Getting into the Details of Variables
- Summary
- Pencil and paper are powerful tools
- Making decisions based on user input
- Using else if to make complex decisions
- Checking many conditions in an if statement
- Using the NOT operator to change the condition
- Making decisions in code
- What's with the dots?
- Components that communicate using dot syntax
- The Start() Update() and Awake() methods and the execution order
- Inheritance
- Introducing the class
- Method names are substitutes too
- Using the term "method" instead of "function"
- What is a method?
- Watching for a possible gotcha when using public variables
- Changing variables
- Click Play!
- Assignment
- Declaration
- Creating a variable and seeing how it works
- A variable name is just a substitute for a value
- Naming a variable
- Understanding what a variable is and what it does
- Introducing the Building Blocks for Unity Scripts
- Summary
- Instance? What is this?
- Why does my Project tab look different?
- Lots of files can create a mess
- Adding our script to GameObject
- Fixing synchronization if it isn't working properly
- Watching for possible gotchas while creating script files in Unity
- The namespace – highlighted in blue
- Opening LearningScript in MonoDevelop
- Syncing C# files between MonoDevelop and Unity
- Introducing the MonoDevelop code editor
- Creating a C# script file
- Working with C# script files
- The Unity community – asking others for help
- C# documentation – where to find it and do I need it at all?
- Using Unity's documentation
- Teaching behavior to GameObjects
- Obtaining a free license
- Downloading Unity
- Dealing with scriptphobia
- Prerequisite knowledge to use this book
- Discovering Your Hidden Scripting Skills and Getting Your Environment Ready
- Questions
- Piracy
- Errata
- Downloading the example code
- Customer support
- Reader feedback
- Conventions
- Who this book is for
- What you need for this book
- What this book covers
- Preface
- Customer Feedback
- Why subscribe?
- www.PacktPub.com
- About the Reviewer
- About the Authors
- About the Authors
- Credits
- 版權信息
- 封面
- 封面
- 版權信息
- Credits
- About the Authors
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Why subscribe?
- Customer Feedback
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Errata
- Piracy
- Questions
- Discovering Your Hidden Scripting Skills and Getting Your Environment Ready
- Prerequisite knowledge to use this book
- Dealing with scriptphobia
- Downloading Unity
- Obtaining a free license
- Teaching behavior to GameObjects
- Using Unity's documentation
- C# documentation – where to find it and do I need it at all?
- The Unity community – asking others for help
- Working with C# script files
- Creating a C# script file
- Introducing the MonoDevelop code editor
- Syncing C# files between MonoDevelop and Unity
- Opening LearningScript in MonoDevelop
- The namespace – highlighted in blue
- Watching for possible gotchas while creating script files in Unity
- Fixing synchronization if it isn't working properly
- Adding our script to GameObject
- Lots of files can create a mess
- Why does my Project tab look different?
- Instance? What is this?
- Summary
- Introducing the Building Blocks for Unity Scripts
- Understanding what a variable is and what it does
- Naming a variable
- A variable name is just a substitute for a value
- Creating a variable and seeing how it works
- Declaration
- Assignment
- Click Play!
- Changing variables
- Watching for a possible gotcha when using public variables
- What is a method?
- Using the term "method" instead of "function"
- Method names are substitutes too
- Introducing the class
- Inheritance
- The Start() Update() and Awake() methods and the execution order
- Components that communicate using dot syntax
- What's with the dots?
- Making decisions in code
- Using the NOT operator to change the condition
- Checking many conditions in an if statement
- Using else if to make complex decisions
- Making decisions based on user input
- Pencil and paper are powerful tools
- Summary
- Getting into the Details of Variables
- Writing C# statements properly
- Understanding component properties in Unity's Inspector
- Variables become component properties
- Unity changes script and variable names slightly
- Changing a property's value in the Inspector panel
- Displaying public variables in the Inspector panel
- Private variables
- Naming your variables properly
- Beginning variable names with lowercase
- Using multiword variable names
- Declaring a variable and its type
- The most common built-in variable types
- Assigning values while declaring a variable
- Where you declare a variable is important
- Variable scope - determining where a variable can be used
- Summary
- Getting into the Details of Methods
- Using methods in a script
- Naming methods properly
- Beginning method names with an uppercase letter
- Using multiword names for a method
- Parentheses are part of the method's name
- Defining a method the right way
- The minimum requirements for defining a method
- Understanding parentheses - why are they there?
- Specifying a method's parameters
- How many parameters can a method have?
- Returning a value from a method
- Returning the value
- Example
- Summary
- Lists Arrays and Dictionaries
- What is an array?
- Declaring an array
- Storing items in the List
- Common operations with Lists
- List <T> versus arrays
- Retrieving the data from the Array or List<T>
- Checking the size
- ArrayList
- Dictionaries
- Accessing values
- How do I know what's inside my Hashtable?
- Summary
- Loops
- Introduction to loops
- The foreach loop
- The for loop
- An example
- The while loop
- while versus for loops
- Loops in statements
- Modulo
- Searching for data inside an array
- Breaking the loop
- Summary
- Object a Container with Variables and Methods
- Working with objects is a class act
- A few facts
- Example
- Instantiating an object
- Bored yet?
- Using methods with objects
- Custom constructors
- Overloading
- Summary
- Let's Make a Game! – from Idea to Development
- Your first game – avoiding the trap of the never–ending concept
- What do I need to learn before I start creating my own game?
- The concept
- Game mechanics and core components
- Breaking the concept into smaller parts
- Testing the mechanics
- Level design
- An animated 2D character
- Physics
- Mouse and touch controls
- Collectables and obstacles
- Scoring
- UI – the user interface
- Target platform and resolution
- Target screen resolution
- Summary
- Starting Your First Game
- Setting up a new Unity project for our game
- Backup
- Keeping your project clean
- Preparing the player prefab
- Rigidbody2D
- CircleCollider2D
- PlayerController
- User input
- Jump
- Animator
- Running
- Code
- PlayerController.cs
- Summary
- Writing GameManager
- Gameplay loops
- Singleton class
- Starting the game
- Setting up input keys
- Using triggers
- Restarting the game
- Setting up the player starting position
- Code in this chapter
- Summary
- The Game Level
- Designed levels versus generated levels
- Creating a designed level
- Creating a generated level
- Planning the LevelGenerator class
- Writing the script LevelGenerator
- Creating a copy of the level piece
- Instantiating
- Vector3
- Testing LevelGenerator
- Extending the level
- The code used in this chapter
- Summary
- The User Interface
- Introducting the Unity UI
- Views
- Constructing the view UI – how to keep things clean
- Target screen resolution
- Recognizing events
- Buttons
- Basic button
- The image
- The Button component
- Interaction
- The Button action
- Hiding and showing the Canvas
- Reference exceptions
- GameView
- Game over
- The code in this chapter
- Summary
- Collectables
- Collectables
- The coin prefab
- The Collectable class
- High score and persisting data
- Health Points and Health bar
- Magic Points and Magic bar
- The code in this chapter
- Summary
- Enemies
- What makes an enemy?
- Movement
- Movement by animation
- Trigger movement
- Making it an enemy
- The code in this chapter
- Summary
- Audio 3D Games and Export
- How to add sound effects and music
- Where to find sound effects and music
- Adding music
- Adding sound effects
- Through animation
- Through script
- How to create a 3D game
- 3D models
- 3D animations
- Animator
- How to export and make it playable
- Code
- PlayerController.cs
- Summary 更新時間:2021-07-02 20:00:14