售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning NGUI for Unity
Table of Contents
Learning NGUI for Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
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
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with NGUI
Overview
Licenses
UnityGUI versus NGUI
Atlases
Events
Localization
Shaders
Final build
Importing NGUI
Importing from the Asset Store
Importing from a disk
Package importing
Creating the UI Root
Displaying text
Creating the Label widget
Selecting a font
UILabel parameters
Configuring the label
Widget parameters
Displaying a sprite
Creating the sprite widget
UISprite parameters
Configuring the sprite
Selecting an atlas
Selecting a sprite
Sprite types
Sliced
Simple
Tiled
Filled
Under the hood
UIRoot
Scaling styles
Flexible
Constrained
ConstrainedOnMobiles
Configuration
UIPanel
The camera system
Orthographic Camera
UICamera
Purpose
Parameters
Configuration
Summary
2. Creating NGUI Widgets
Control prefabs
Background
The Prefab Toolbar
Buttons
Creating a button
The UIButton parameters
The Play button
The Options button
The Exit button
The Options window
Popup List
Creating the Popup List
Parameters of UIPopup list
Creating a language selection box
Creating a background sprite
The title
The Popup list
The input field
Creating the input field
Parameters of UIInput
The nickname box
The input field
Adding a checkbox
Creating the checkbox
Parameters of UIToggle
The sound toggle box
The checkbox
Slider
Creating the slider
The parameters of UISlider
Volume adjustment
The SFX slider
The music slider
Summary
3. Enhancing Your UI
NGUI components
Enlarging buttons on hover
UIButton Scale
Usage
Parameters
Menu appearance
The tweening concept
Tween Scale
Usage
Parameters
Configuration
Menu disappearance
UIPlay Tween
Usage
Parameters
Configuration
Game exit
MenuManager Script
Linking the tween to Exit()
Switching to options
Tween Position
Hiding the menu
Configuring the Tween Position component
Playing Tween Position
Showing options
Configuring the Tween Position component
Playing Tween Position
Back to the menu
The Confirm button
Hiding options
Showing the menu
Scene initialization
Centering the options page
The initialization script
The MenuManager script
Hiding and showing the volume box
Tween Alpha
Volume box fade
Configuring Tween Alpha
Playing Tween Alpha
More tween components
Draggable windows
UIDragObject
Usage
Parameters
Configuration
Jumping windows glitch
The Main menu
Scrollable text
Textbox
Welcome label
Clipping
Close buttons
UIForward events
Closing the main menu
Closing options
UIEvent Trigger
Force-saving the nickname
Localization system
Localization file
UILocalize
Selecting the language
Remaining keys
Final corrections
Anchors
Purpose
Parameters
Configuration
Summary
4. C# with NGUI
Events
Available methods
Example
Creating tooltips
The tooltip object
Widgets
UITooltip
Displaying the tooltip
Adding the remaining tooltips
Tweens
Tween Scale
DisappearOnClick Script
Tween effects
Event delegates
The callback
Linking a callback to an event
Code
Inspector
Keyboard keys
UIKey binding
Parameters
Configuration
UIKey navigation
Parameters
Configuration
The Exit button
The Options button
The nickname input field
The volume sliders
Mouse and keyboard behavior
Saving options
The UISaved option
Configuration
The sound checkbox
Persistent UI
Singleton
The Singleton class
The MenuManager implementation
Removing the welcome text
Summary
5. Atlas and Font Customization
Texture atlas
The atlas prefab
Creating a new atlas
Atlas maker
New atlas
Necessary assets
The Game atlas
The play icon
Adding sprites to the atlas
Simple sprites
Updating the atlas
The options icon
The exit icon
Sliced sprites
Updating the Atlas
The button background
Sprite parameters
Nine-sliced configuration
Tiled sprites
Updating the atlas
Wood texture
Fonts
Dynamic fonts
Bitmap fonts
Font Maker
The UIFont component
The Tooltip label
Displaying large textures
The UITexture component
Parameters
Configuration
Summary
6. The In-game User Interface
The game
Pitch
Necessary assets
Importing the Unity package
Draggable power sources
UICamera
UIDragObject
Box Collider
Moving the player
Ground movement
Reaching an object
Player name display
In-game 2D UI root
The nickname prefab
The PlayerName component
The FollowObject component
The elemental source switch
The elemental switch UI
The Fire button
The remaining elemental buttons
The Ice button
The Lightning button
The Water button
The FollowObject component
The GameManager component
The PowerSource component
Hiding the elemental switch UI
The elemental switch charging process
The progress prefab
Progress slider implementation
Linking elemental buttons
The unavailable button
The EnableAllButtons() method
The SetButtonState() method
Changing button states
Launch from the main menu
Summary
7. 3D User Interface
Introduction to 3D user interface
The 3D UI Root
Scale calibration
The score counter
The text label
The background
The border sprite
The position and rotation
The ScoreController component
The pause button
The pause menu
The panel and box
The title bar
Buttons
Resume
Exit
Displaying the pause menu
The tween alpha
The Play Tween
Linking the buttons
Methods
Link
Key bindings
Interaction override
The 3D environment text
Lighting effects
Summary
8. Going Mobile
Switching to Android
Preparations
Testing the game
Bundle Identifier
Building the package
Manual build
Build and run
Testing
Corrections
Autorotation
Back button
Character movement
The elemental switch UI
The waiting feedback icon
Code implementation
The PowerSource component
The GameManager component
The ApproachOnClick component
Customizable UI
Draggable UI elements
Activating drag
The CustomizableUIElement component
The GameManager component
Why is this happening?
Unity Remote
Requirements
Setting it up
Testing our game
The profiler
Functionalities
Run the profiler on device
Debugging on the device
Summary
9. Screen Sizes and Aspect Ratios
The adaptive UI
The flexible UI
Multiple bitmap fonts
The SmallLato font
The MediumLato font
The LargeLato font
Displaying the fonts
Multiple atlases
Creating the atlases
SDAtlas
HDAtlas
SHDAtlas
ScreenAtlas
The test button
Changing the reference atlas
Renaming sprites
Switching atlases
The AtlasSwitchController component
Configuration
Pixel snapping
Switching fonts
ScreenFont
Assigning ScreenFont
Summary
10. User Experience and Best Practices
How it all started
Definitions
User experience
Personas
Usability
Flow
User interface design
User interfaces in games
Heuristics
Guidance
Affordance
Prompting
Categorization
Feedback
Workload
Brevity
Information density
Explicit control
Explicit actions
User control
Adaptability
Flexibility
Customization
Error management
Protect
Inform
Correct
Consistency
Testing your game
Test advice
When and what
Concept prototypes
Test the rest early
Vertical slices
Readability
Guidance
Test occurrences
The usability testing method
Preparation
Goal
Using personas
New features
Guide, don't help
Observation grid
Invite players!
Environment
Take notes
Prioritize
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜