设计技术3:数字游戏设计与开发 | Design Technology 3: Game Design and Development

(2023版 | Edition 2023)

设计技术3:数字游戏设计与开发
Design Technology 3: Game Design
and Development

(2023版 | Edition 2023)

基本信息 | Basic Information

课程性质 | Course Type: 必修 | Compulsory 课程编号 | Course ID: 55007403 授课语言 | Language: 中文 | Chinese
先修要求 | Prerequisite: 无 | None 学分 | Credits: 4 课内学时 | Total Hours: 68
课程性质 | Course Type:必修 | Compulsory 课程编号 | Course ID:55007403
授课语言 | Language:中文 | Chinese 先修要求 | Prerequisite:无 | None
学分 | Credits:4 课内学时 | Total Hours:68
课程性质 | Course Type:必修 | Compulsory
课程编号 | Course ID:55007403
授课语言 | Language:中文 | Chinese
先修要求 | Prerequisite:无 | None
学分 | Credits:4
课内学时 | Total Hours:68

课程简介 | Course Introduction​

在本课程中,同学们将在老师的指导下以团队合作的形式进行一项完整的创作实践。通过本课程,他们将有机会产出高质量的作品、参与各类学科竞赛,同时也能为即将开展的毕业设计积累经验。本课程常会邀请业界专家参与教学,成果形式包括但不限于游戏、功能性游戏、交互软件、虚拟现实/增强现实等。
In this course, students go through a complete process of creation in teams under the guidance of the teacher. This course provides them with an opportunity to produce high-quality works so as to participate in various disciplinary competitions. At the same time they may also accumulate experience for their graduation projects about to begin very soon. Experts from the industries are often invited to participate as supervisors in this course, and the forms of the outcomes include but are not limited to games for fun, serious games, interactive applications, virtual reality / augmented reality applications, and so forth.

学习评价 | Learning Evaluation

这门以创作为导向的实践型课程要求创作团队在期末时提交用于作品展示的视频、陈述创作理念的视频,以及可以正常运行的游戏/交互作品原型;并且创作团队须以公开汇报及展览的形式进行创作成果的展示。
This creation-oriented course places emphsis on practice and requires the student-teams to submit a showreel video to promote their work, an introductory video to explain the concept of their creation, and a working prototype of their games or interactive applications at the end of the semester. They are also required to present to the public their work in the form of a presentation and an exhibition.

课程内容 | Course Content ​

  • 1 课程简介
    • 1.1 教学目标
    • 1.2 课程内容
    • 1.3 考核要求
  • 2 游戏发展简史及现状
    • 2.1 电子游戏发展史
    • 2.2 基于游戏主机的断代史
  • 3 游戏引擎简介
    • 3.1 游戏引擎的起源及概念
    • 3.2 常见游戏开发流程
  • 4 Unity引擎简介
    • 4.1 Unity的优势
    • 4.2 Unity的应用方向
  • 5 初识Unity
    • 5.1 渲染管线的概念
    • 5.2 实战练习1:试用Unity HDRP
      • 5.2.1 下载安装Unity
      • 5.2.2 Unity工程
      • 5.2.3 Unity编辑器
    • 5.3 实战练习2:艺术馆夜景
      • 5.3.1 检视原始数据
      • 5.3.2 试用Substance Sampler创建材质
      • 5.3.3 第1步:模型与材质设置
      • 5.3.4 第2步:布置艺术品
      • 5.3.5 第3步:运用预制件
      • 5.3.6 第4步:在Unity中运用全局光
        • 5.3.6.1 全局光、环境遮蔽与光照贴图的概念
      • 5.3.7 第5步:反射探针与平面反射
      • 5.3.8 第6步:体积与后处理效果
      • 5.3.9 第7步:碰撞体与FPS相机资产
      • 5.3.10 第8步:最终润色及发布
  • 6 游戏设计理论
    • 6.1 游戏的概念及Jesse Schell的游戏设计全景图
    • 6.2 理解游戏设计
      • 6.2.1 游戏:本质体验、主题、结构、机制、故事
      • 6.2.2 玩家:专注、共情、建模与想象、动机、新奇
      • 6.2.3 体验:兴趣曲线
      • 6.2.4 流程:原型
      • 6.2.5 设计师:使命、要求
    • 6.3 游戏类型学
  • 7 C#程序设计概述
    • 7.1 Unity中的C#脚本及可视化编程
    • 7.2 C#中的变量与常量
  • 8 实战练习3:猜数字
    • 8.1 第1步:添加飞船装饰
    • 8.2 第3步:搭建GUI
      • 8.2.1 Unity知识点:粒子系统
    • 8.3 第2步:添加粒子效果
      • 8.3.1 Unity知识点:UGUI系统
    • 8.4 第4步:输入有效性检查
      • 8.4.1 C#知识点:转义序列
      • 8.4.2 C#知识点:运算符及其优先级
      • 8.4.3 C#知识点:IF语句
      • 8.4.4 其它知识点:名称空间、字符串转换等
    • 8.5 第5步:随机数
      • 8.5.1 Unity API:Random.Range()、SetActive()、物体.activeSelf属性、元件enabled属性等
    • 8.6 第6步:限制尝试次数
      • 8.6.1 C#知识点:连接字符串与字符串内插
      • 8.6.2 C#知识点:do、while、for循环
      • 8.6.3 C#知识点:continue与break命令
      • 8.6.4 C#知识点:数组
        • 8.6.4.1 一维数组
        • 8.6.4.2 多维数组
        • 8.6.4.3 交错数组
    • 8.7 第7步:避免重复输入
    • 8.8 第8步:随机背景
      • 8.8.1 C#知识点:switch语句
      • 8.8.2 C#知识点:函数
        • 8.8.2.1 函数定义及调用
        • 8.8.2.2 输出参数
        • 8.8.2.3 引用参数
        • 8.8.2.4 参数数组
      • 8.8.3 Unity API:tranfrom.childCount
      • 8.8.4 Unity API:tranfrom.GetChild()
      • 8.8.5 Unity API:Destroy()
      • 8.8.6 Unity API:Instantiate()
  • 9 实战练习4:猜数字之换你出题
    • 9.1 第1步:算法测试
      • 9.1.1 Unity API:查找物体
      • 9.1.2 Unity API:按钮响应
      • 9.1.3 C#知识点:强制类型转换
      • 9.1.4 C#知识点:取整
      • 9.1.5 C#知识点:转换为字符串
    • 9.2 第2步:编写函数
    • 9.3 第3步:完成界面
    • 9.4 第4步:完成逻辑
  • 10 实战练习5:艺术馆(续)
    • 10.1 第1步:地形
      • 10.1.1 Unity知识点:使用地形系统
    • 10.2 第2步:光照探针
      • 10.2.1 Unity知识点:使用光照探针
    • 10.3 第3步:动画
      • 10.3.1 Unity知识点:创建并调用基本动画
    • 10.4 第4步:声音与视频
      • 10.4.1 Unity知识点:导入并使用音视频
    • 10.5 第5步:图形用户界面
      • 10.5.1 Unity知识点:创建常用GUI控件
    • 10.6 第6步:物理
      • 10.6.1 Unity知识点:在Unity中运用物理模拟
    • 10.7 第7步:粒子系统
      • 10.7.1 Unity知识点:标准粒子系统与VFX Graph粒子系统
    • 10.8 第8步:AI寻径
      • 10.8.1 Unity知识点:使用AI寻径系统
    • 10.9 第9步:角色
      • 10.9.1 Unity知识点:导入角色并控制动画
    • 10.10 第10步:时间线
      • 10.10.1 Unity知识点:使用Timeline制作影片
  • 11 Unity功能模块概览
    • 11.1 场景搭建、资产管理、地形、渲染、脚本编写、着色器开发、动画、粒子系统、物理、二维、导航与寻径、用户输入、音视频、用户界面、性能调试、其它
  • 12 为游戏制作美术资源
    • 12.1 二维美术
    • 12.2 三维美术
    • 12.3 法线贴图
    • 12.4 模块化设计策略
  • 13 拓展C#知识(1)
    • 13.1 C#知识点:枚举
    • 13.2 C#知识点:隐式类型
    • 13.3 C#知识点:元组
    • 13.4 C#知识点:函数的重载
    • 13.5 Unity API:延迟执行
    • 13.6 Unity API:协程
    • 13.7 C#知识点:委托(代理)
    • 13.8 C#知识点:事件
    • 13.9 Unity API:Unity事件
    • 13.10 C#知识点:结构体
    • 13.11 IDE知识点:纠错
    • 13.12 C#知识点:结构化异常处理
  • 14 实战练习6:打气球
    • 14.1 面向对象的程序设计
      • 14.1.1 类、实例、字段、属性、方法
    • 14.2 C#知识点:类与实例的创建
    • 14.3 第1步:实例化气球
      • 14.3.1 Unity API:设置材质属性
      • 14.3.2 Unity知识点:FixedUpdate()
    • 14.4 第2步:设计运动目标类
      • 14.4.1 C#知识点:类的基本规划原则
      • 14.4.2 C#知识点:OOP三大特征
      • 14.4.3 C#知识点:类的定义与继承
      • 14.4.4 C#知识点:类的包含与嵌套
      • 14.4.5 C#知识点:字段、属性与方法
      • 14.4.6 C#知识点:类成员可访问性
    • 14.5 第3步:完成运动目标类
      • 14.5.1 C#知识点:构造函数及其重载与继承
      • 14.5.2 C#知识点:析构函数
      • 14.5.3 C#知识点:重写方法
      • 14.5.4 C#知识点:多态
      • 14.5.5 C#知识点:隐藏方法
    • 14.6 第4步:完成机械弩控制
    • 14.7 第5步:绘制曲线与射箭
    • 14.8 第6步:基于接口实现被击中
      • 14.8.1 C#知识点:接口
      • 14.8.2 C#知识点:值类型与引用类型
      • 14.8.3 C#知识点:封箱与拆箱
      • 14.8.4 C#知识点:类型比较与转换
    • 14.9 第7步:完善功能、添加GUI
      • 14.9.1 C#知识点:静态成员与静态类
    • 14.10 第8步:利用泛型列表实现道具功能
      • 14.10.1 C#知识点:泛型列表
      • 14.10.2 C#知识点:泛型列表的排序
  • 15 拓展C#知识(2)
    • 15.1 C#知识点:数组列表
    • 15.2 C#知识点:字典
    • 15.3 C#知识点:对象的转换
    • 15.4 C#知识点:对象的复制
    • 15.5 C#知识点:初始化器
    • 15.6 C#知识点:匿名类
    • 15.7 C#知识点:匿名方法与Lamda表达式
    • 15.8 C#知识点:特性
  • 16 设计模式概述
    • 16.1 设计模式的概念
    • 16.2 OOP应遵循的设计原则
    • 16.3 设计模式范例:单例模式
    • 16.4 设计模式范例:状态模式
    • 16.5 设计模式总结
  • 17 渲染管线及着色器入门
    • 17.1 实时渲染是如何发生的
    • 17.2 Unity中的着色器类型
    • 17.3 Unity着色器创建方式
    • 17.4 Shader Graph案例:模型显隐
    • 17.5 Shader Graph案例:时空通道
    • 17.6 Shader学习资源
  • 1 Introduction
    • 1.1 learning target
    • 1.2 course content
    • 1.3 methods of evaluation
  • 2 History and Current Development of Games
    • 2.1 history of digital games
    • 2.2 console based dynastic history
  • 3 Intro to Game Engine
    • 3.1 origin and concept of game engines
    • 3.2 common game development workflow
  • 4 Intro to Unity
    • 4.1 advantages of Unity
    • 4.2 application fields of Unity
  • 5 Get to Know Unity Engine
    • 5.1 concept of render pipeline
    • 5.2 practice 1: try to use Unity HDRP
      • 5.2.1 download and install Unity
      • 5.2.2 Unity projects
      • 5.2.3 Unity editor
    • 5.3 practice 2: art gallery at night
      • 5.3.1 inspect the raw data
      • 5.3.2 create materials with Substance Sampler
      • 5.3.3 step1: model and material setup
      • 5.3.4 step2: place artworks
      • 5.3.5 step3: use prefabs
      • 5.3.6 step4: use global illumination
        • 5.3.6.1 concpets of GI, AO and lightmapping
      • 5.3.7 step5: reflection probe and planar reflection
      • 5.3.8 step6: volume and post-processing effects
      • 5.3.9 step7: add colliders and FPS camera
      • 5.3.10 step8: polish and publish
  • 6 Game Design Theories
    • 6.1 the concept of game and Jesse Schell's panoramic view
    • 6.2 understand game design
      • 6.2.1 game: essential experience, themes, structure, mechanism, story
      • 6.2.2 player: concerntration, empathy, modelling and imagination, motivation, novelty
      • 6.2.3 experience: interest curve
      • 6.2.4 workflow: prototype
      • 6.2.5 game designer:mission, requirements
    • 6.3 game typology
  • 7 Fundamental C# Programming
    • 7.1 scritpting and visual scripting in Unity
    • 7.2 variables and constants in C#
  • 8 Practice3: Guess a Number
    • 8.1 step1: add decorative spaceships
    • 8.2 step2: add particles
      • 8.2.1 Unity knowledge: particle system
    • 8.3 step3: finish GUI
      • 8.3.1 Unity knowledge: UGUI
    • 8.4 step4: input validation
      • 8.4.1 C# knowledge: escape sequence
      • 8.4.2 C# knowledge: operators and priority
      • 8.4.3 C# knowledge: IF statement
      • 8.4.4 C# knowledge: name space and string conversion
    • 8.5 step5: random number
      • 8.5.1 Unity API:Random.Range(), SetActive(), gameObject.activeSelf, component.enabled
    • 8.6 step6: limit number of tries
      • 8.6.1 C# knowledge: link and interpolate strings
      • 8.6.2 C# knowledge: do、while、for loops
      • 8.6.3 C# knowledge: continue and break
      • 8.6.4 C# knowledge: array
        • 8.6.4.1 simple arrays
        • 8.6.4.2 multi-dimensional
        • 8.6.4.3 jagged arrays
    • 8.7 step7: avoid duplicate inputs
    • 8.8 step8: random background
      • 8.8.1 C# knowledge: switch statement
      • 8.8.2 C# knowledge: functions
        • 8.8.2.1 definition & execution
        • 8.8.2.2 output parameters
        • 8.8.2.3 reference parameters
        • 8.8.2.4 parameter array
      • 8.8.3 Unity API: tranfrom.childCount
      • 8.8.4 Unity API: tranfrom.GetChild()
      • 8.8.5 Unity API: Destroy()
      • 8.8.6 Unity API: Instantiate()
  • 9 Practice4: Switch Play
    • 9.1 step1: test algorithm
      • 9.1.1 Unity API: find objects
      • 9.1.2 Unity API: add button response
      • 9.1.3 C# knowledge: explicit type conversion
      • 9.1.4 C# knowledge: convert to integer
      • 9.1.5 C# knowledge: convert to string
    • 9.2 step2: write functions
    • 9.3 step3: finish the GUI
    • 9.4 step4: complete game logics
  • 10 Practice5: Art Gallery (continued)
    • 10.1 step1: terrain
      • 10.1.1 Unity knowledge: use terrain system
    • 10.2 step2: light probes
      • 10.2.1 Unity knowledge: use light probes
    • 10.3 step3: animation
      • 10.3.1 Unity knowledge: create and use animation
    • 10.4 step4: audio and video
      • 10.4.1 Unity knowledge: import and use audio and video files
    • 10.5 step5: GUI
      • 10.5.1 Unity knowledge: create common GUI widgets
    • 10.6 step6: physics
      • 10.6.1 Unity knowledge: physical simulation in Unity
    • 10.7 step7: particle system
      • 10.7.1 Unity knowledge: standard and VFX graph particles
    • 10.8 step8: AI navigation
      • 10.8.1 Unity knowledge: use AI navigation
    • 10.9 step9: characters
      • 10.9.1 Unity knowledge: import and use character animation
    • 10.10 step10: timeline
      • 10.10.1 Unity knowledge: use timeline to create cinematic clips
  • 11 Unity Function Modules
    • 11.1 scene building, asset management, terrain, rendering, scripting, shader development, animation, particle system, physics, 2D, navigation and path finding, user input, audio and video, GUI, profiling, misc
  • 12 Visual Art for Games
    • 12.1 2D art
    • 12.2 3D art
    • 12.3 normal mapping
    • 12.4 modular design strategy
  • 13 Extensive C# Knowledge (1)
    • 13.1 C# knowledge: enumeration
    • 13.2 C# knowledge: implicity typed variables
    • 13.3 C# knowledge: tuples
    • 13.4 C# knowledge: overriding a function
    • 13.5 Unity API: delayed execution
    • 13.6 Unity API: coroutine
    • 13.7 C# knowledge: delegate
    • 13.8 C# knowledge: events
    • 13.9 Unity API: Unity events
    • 13.10 C# knowledge: structure
    • 13.11 IDE knowledge: debugging
    • 13.12 C# knowledge: structured exception handling
  • 14 Practice6: Balloon Shooter
    • 14.1 Object oriented Programming
      • 14.1.1 class, instance, field, property, method
    • 14.2 C# knowledge: class and instance creation
    • 14.3 step1: instantiate balloons
      • 14.3.1 Unity API: set material properties
      • 14.3.2 Unity knoledge: FixedUpdate()
    • 14.4 step2: design moving target class
      • 14.4.1 C# knowledge: basic principles of class planning
      • 14.4.2 C# knowledge: three characteristics of OOP
      • 14.4.3 C# knowledge: class definition and inheritance
      • 14.4.4 C# knowledge: containment of classes and nesting of classes
      • 14.4.5 C# knowledge: field, property, method
      • 14.4.6 C# knowledge: member accessibility
    • 14.5 step3: moving target classs
      • 14.5.1 C# knowledge: constructor and inheritance
      • 14.5.2 C# knowledge: finalizer (destructor)
      • 14.5.3 C# knowledge: method overriding
      • 14.5.4 C# knowledge: polymorphism
      • 14.5.5 C# knowledge: method hiding
    • 14.6 step4: finish the bow controls
    • 14.7 step5: draw curve and arrow shooting
    • 14.8 step6: create hit effect via interface
      • 14.8.1 C# knowledge: interface
      • 14.8.2 C# knowledge: value type and reference type
      • 14.8.3 C# knowledge: boxing and unboxing
      • 14.8.4 C# knowledge: type comparison and conversion
    • 14.9 step7: improve functions and add UI
      • 14.9.1 C# knowledge: static class & member
    • 14.10 step8: use generic list for props
      • 14.10.1 C# knowledge: generic list
      • 14.10.2 C# knowledge: sort a generic list
  • 15 Extensive C# Knowledge (2)
    • 15.1 C# knowledge: array list
    • 15.2 C# knowledge: dictionary as a generic collection
    • 15.3 C# knowledge: conversion of objects
    • 15.4 C# knowledge: copying objects
    • 15.5 C# knowledge: initializer
    • 15.6 C# knowledge: anonymous class
    • 15.7 C# knowledge: anonymous methods and Lamda expressions
    • 15.8 C# knowledge: attributes
  • 16 Intro to Design Pattern
    • 16.1 concept of design pattern
    • 16.2 rules to following in OOP design
    • 16.3 design pattern example: singleton
    • 16.4 design pattern example: state
    • 16.5 summary of the intro to design patterns
  • 17 Intro to Render Pipeline and Shader Development
    • 17.1 how does real-time rendering happen
    • 17.2 types of shaders in Unity
    • 17.3 ways of shader creation in Unity
    • 17.4 shader graph example: model dissolution
    • 17.5 shader graph example: time and space tunnel
    • 17.6 shader learning resources
  • 1 课程简介
    • 1.1 教学目标
    • 1.2 课程内容
    • 1.3 考核要求
  • 2 游戏发展简史及现状
    • 2.1 电子游戏发展史
    • 2.2 基于游戏主机的断代史
  • 3 游戏引擎简介
    • 3.1 游戏引擎的起源及概念
    • 3.2 常见游戏开发流程
  • 4 Unity引擎简介
    • 4.1 Unity的优势
    • 4.2 Unity的应用方向
  • 5 初识Unity
    • 5.1 渲染管线的概念
    • 5.2 实战练习1:试用Unity HDRP
      • 5.2.1 下载安装Unity
      • 5.2.2 Unity工程
      • 5.2.3 Unity编辑器
    • 5.3 实战练习2:艺术馆夜景
      • 5.3.1 检视原始数据
      • 5.3.2 试用Substance Sampler创建材质
      • 5.3.3 第1步:模型与材质设置
      • 5.3.4 第2步:布置艺术品
      • 5.3.5 第3步:运用预制件
      • 5.3.6 第4步:在Unity中运用全局光
        • 5.3.6.1 全局光、环境遮蔽与光照贴图的概念
      • 5.3.7 第5步:反射探针与平面反射
      • 5.3.8 第6步:体积与后处理效果
      • 5.3.9 第7步:碰撞体与FPS相机资产
      • 5.3.10 第8步:最终润色及发布
  • 6 游戏设计理论
    • 6.1 游戏的概念及Jesse Schell的游戏设计全景图
    • 6.2 理解游戏设计
      • 6.2.1 游戏:本质体验、主题、结构、机制、故事
      • 6.2.2 玩家:专注、共情、建模与想象、动机、新奇
      • 6.2.3 体验:兴趣曲线
      • 6.2.4 流程:原型
      • 6.2.5 设计师:使命、要求
    • 6.3 游戏类型学
  • 7 C#程序设计概述
    • 7.1 Unity中的C#脚本及可视化编程
    • 7.2 C#中的变量与常量
  • 8 实战练习3:猜数字
    • 8.1 第1步:添加飞船装饰
    • 8.2 第3步:搭建GUI
      • 8.2.1 Unity知识点:粒子系统
    • 8.3 第2步:添加粒子效果
      • 8.3.1 Unity知识点:UGUI系统
    • 8.4 第4步:输入有效性检查
      • 8.4.1 C#知识点:转义序列
      • 8.4.2 C#知识点:运算符及其优先级
      • 8.4.3 C#知识点:IF语句
      • 8.4.4 其它知识点:名称空间、字符串转换等
    • 8.5 第5步:随机数
      • 8.5.1 Unity API:Random.Range()、SetActive()、物体.activeSelf属性、元件enabled属性等
    • 8.6 第6步:限制尝试次数
      • 8.6.1 C#知识点:连接字符串与字符串内插
      • 8.6.2 C#知识点:do、while、for循环
      • 8.6.3 C#知识点:continue与break命令
      • 8.6.4 C#知识点:数组
        • 8.6.4.1 一维数组
        • 8.6.4.2 多维数组
        • 8.6.4.3 交错数组
    • 8.7 第7步:避免重复输入
    • 8.8 第8步:随机背景
      • 8.8.1 C#知识点:switch语句
      • 8.8.2 C#知识点:函数
        • 8.8.2.1 函数定义及调用
        • 8.8.2.2 输出参数
        • 8.8.2.3 引用参数
        • 8.8.2.4 参数数组
      • 8.8.3 Unity API:tranfrom.childCount
      • 8.8.4 Unity API:tranfrom.GetChild()
      • 8.8.5 Unity API:Destroy()
      • 8.8.6 Unity API:Instantiate()
  • 9 实战练习4:猜数字之换你出题
    • 9.1 第1步:算法测试
      • 9.1.1 Unity API:查找物体
      • 9.1.2 Unity API:按钮响应
      • 9.1.3 C#知识点:强制类型转换
      • 9.1.4 C#知识点:取整
      • 9.1.5 C#知识点:转换为字符串
    • 9.2 第2步:编写函数
    • 9.3 第3步:完成界面
    • 9.4 第4步:完成逻辑
  • 10 实战练习5:艺术馆(续)
    • 10.1 第1步:地形
      • 10.1.1 Unity知识点:使用地形系统
    • 10.2 第2步:光照探针
      • 10.2.1 Unity知识点:使用光照探针
    • 10.3 第3步:动画
      • 10.3.1 Unity知识点:创建并调用基本动画
    • 10.4 第4步:声音与视频
      • 10.4.1 Unity知识点:导入并使用音视频
    • 10.5 第5步:图形用户界面
      • 10.5.1 Unity知识点:创建常用GUI控件
    • 10.6 第6步:物理
      • 10.6.1 Unity知识点:在Unity中运用物理模拟
    • 10.7 第7步:粒子系统
      • 10.7.1 Unity知识点:标准粒子系统与VFX Graph粒子系统
    • 10.8 第8步:AI寻径
      • 10.8.1 Unity知识点:使用AI寻径系统
    • 10.9 第9步:角色
      • 10.9.1 Unity知识点:导入角色并控制动画
    • 10.10 第10步:时间线
      • 10.10.1 Unity知识点:使用Timeline制作影片
  • 11 Unity功能模块概览
    • 11.1 场景搭建、资产管理、地形、渲染、脚本编写、着色器开发、动画、粒子系统、物理、二维、导航与寻径、用户输入、音视频、用户界面、性能调试、其它
  • 12 为游戏制作美术资源
    • 12.1 二维美术
    • 12.2 三维美术
    • 12.3 法线贴图
    • 12.4 模块化设计策略
  • 13 拓展C#知识(1)
    • 13.1 C#知识点:枚举
    • 13.2 C#知识点:隐式类型
    • 13.3 C#知识点:元组
    • 13.4 C#知识点:函数的重载
    • 13.5 Unity API:延迟执行
    • 13.6 Unity API:协程
    • 13.7 C#知识点:委托(代理)
    • 13.8 C#知识点:事件
    • 13.9 Unity API:Unity事件
    • 13.10 C#知识点:结构体
    • 13.11 IDE知识点:纠错
    • 13.12 C#知识点:结构化异常处理
  • 14 实战练习6:打气球
    • 14.1 面向对象的程序设计
      • 14.1.1 类、实例、字段、属性、方法
    • 14.2 C#知识点:类与实例的创建
    • 14.3 第1步:实例化气球
      • 14.3.1 Unity API:设置材质属性
      • 14.3.2 Unity知识点:FixedUpdate()
    • 14.4 第2步:设计运动目标类
      • 14.4.1 C#知识点:类的基本规划原则
      • 14.4.2 C#知识点:OOP三大特征
      • 14.4.3 C#知识点:类的定义与继承
      • 14.4.4 C#知识点:类的包含与嵌套
      • 14.4.5 C#知识点:字段、属性与方法
      • 14.4.6 C#知识点:类成员可访问性
    • 14.5 第3步:完成运动目标类
      • 14.5.1 C#知识点:构造函数及其重载与继承
      • 14.5.2 C#知识点:析构函数
      • 14.5.3 C#知识点:重写方法
      • 14.5.4 C#知识点:多态
      • 14.5.5 C#知识点:隐藏方法
    • 14.6 第4步:完成机械弩控制
    • 14.7 第5步:绘制曲线与射箭
    • 14.8 第6步:基于接口实现被击中
      • 14.8.1 C#知识点:接口
      • 14.8.2 C#知识点:值类型与引用类型
      • 14.8.3 C#知识点:封箱与拆箱
      • 14.8.4 C#知识点:类型比较与转换
    • 14.9 第7步:完善功能、添加GUI
      • 14.9.1 C#知识点:静态成员与静态类
    • 14.10 第8步:利用泛型列表实现道具功能
      • 14.10.1 C#知识点:泛型列表
      • 14.10.2 C#知识点:泛型列表的排序
  • 15 拓展C#知识(2)
    • 15.1 C#知识点:数组列表
    • 15.2 C#知识点:字典
    • 15.3 C#知识点:对象的转换
    • 15.4 C#知识点:对象的复制
    • 15.5 C#知识点:初始化器
    • 15.6 C#知识点:匿名类
    • 15.7 C#知识点:匿名方法与Lamda表达式
    • 15.8 C#知识点:特性
  • 16 设计模式概述
    • 16.1 设计模式的概念
    • 16.2 OOP应遵循的设计原则
    • 16.3 设计模式范例:单例模式
    • 16.4 设计模式范例:状态模式
    • 16.5 设计模式总结
  • 17 渲染管线及着色器入门
    • 17.1 实时渲染是如何发生的
    • 17.2 Unity中的着色器类型
    • 17.3 Unity着色器创建方式
    • 17.4 Shader Graph案例:模型显隐
    • 17.5 Shader Graph案例:时空通道
    • 17.6 Shader学习资源
  • 1 Introduction
    • 1.1 learning target
    • 1.2 course content
    • 1.3 methods of evaluation
  • 2 History and Current Development of Games
    • 2.1 history of digital games
    • 2.2 console based dynastic history
  • 3 Intro to Game Engine
    • 3.1 origin and concept of game engines
    • 3.2 common game development workflow
  • 4 Intro to Unity
    • 4.1 advantages of Unity
    • 4.2 application fields of Unity
  • 5 Get to Know Unity Engine
    • 5.1 concept of render pipeline
    • 5.2 practice 1: try to use Unity HDRP
      • 5.2.1 download and install Unity
      • 5.2.2 Unity projects
      • 5.2.3 Unity editor
    • 5.3 practice 2: art gallery at night
      • 5.3.1 inspect the raw data
      • 5.3.2 create materials with Substance Sampler
      • 5.3.3 step1: model and material setup
      • 5.3.4 step2: place artworks
      • 5.3.5 step3: use prefabs
      • 5.3.6 step4: use global illumination
        • 5.3.6.1 concpets of GI, AO and lightmapping
      • 5.3.7 step5: reflection probe and planar reflection
      • 5.3.8 step6: volume and post-processing effects
      • 5.3.9 step7: add colliders and FPS camera
      • 5.3.10 step8: polish and publish
  • 6 Game Design Theories
    • 6.1 the concept of game and Jesse Schell's panoramic view
    • 6.2 understand game design
      • 6.2.1 game: essential experience, themes, structure, mechanism, story
      • 6.2.2 player: concerntration, empathy, modelling and imagination, motivation, novelty
      • 6.2.3 experience: interest curve
      • 6.2.4 workflow: prototype
      • 6.2.5 game designer:mission, requirements
    • 6.3 game typology
  • 7 Fundamental C# Programming
    • 7.1 scritpting and visual scripting in Unity
    • 7.2 variables and constants in C#
  • 8 Practice3: Guess a Number
    • 8.1 step1: add decorative spaceships
    • 8.2 step2: add particles
      • 8.2.1 Unity knowledge: particle system
    • 8.3 step3: finish GUI
      • 8.3.1 Unity knowledge: UGUI
    • 8.4 step4: input validation
      • 8.4.1 C# knowledge: escape sequence
      • 8.4.2 C# knowledge: operators and priority
      • 8.4.3 C# knowledge: IF statement
      • 8.4.4 C# knowledge: name space and string conversion
    • 8.5 step5: random number
      • 8.5.1 Unity API:Random.Range(), SetActive(), gameObject.activeSelf, component.enabled
    • 8.6 step6: limit number of tries
      • 8.6.1 C# knowledge: link and interpolate strings
      • 8.6.2 C# knowledge: do、while、for loops
      • 8.6.3 C# knowledge: continue and break
      • 8.6.4 C# knowledge: array
        • 8.6.4.1 simple arrays
        • 8.6.4.2 multi-dimensional
        • 8.6.4.3 jagged arrays
    • 8.7 step7: avoid duplicate inputs
    • 8.8 step8: random background
      • 8.8.1 C# knowledge: switch statement
      • 8.8.2 C# knowledge: functions
        • 8.8.2.1 definition & execution
        • 8.8.2.2 output parameters
        • 8.8.2.3 reference parameters
        • 8.8.2.4 parameter array
      • 8.8.3 Unity API: tranfrom.childCount
      • 8.8.4 Unity API: tranfrom.GetChild()
      • 8.8.5 Unity API: Destroy()
      • 8.8.6 Unity API: Instantiate()
  • 9 Practice4: Switch Play
    • 9.1 step1: test algorithm
      • 9.1.1 Unity API: find objects
      • 9.1.2 Unity API: add button response
      • 9.1.3 C# knowledge: explicit type conversion
      • 9.1.4 C# knowledge: convert to integer
      • 9.1.5 C# knowledge: convert to string
    • 9.2 step2: write functions
    • 9.3 step3: finish the GUI
    • 9.4 step4: complete game logics
  • 10 Practice5: Art Gallery (continued)
    • 10.1 step1: terrain
      • 10.1.1 Unity knowledge: use terrain system
    • 10.2 step2: light probes
      • 10.2.1 Unity knowledge: use light probes
    • 10.3 step3: animation
      • 10.3.1 Unity knowledge: create and use animation
    • 10.4 step4: audio and video
      • 10.4.1 Unity knowledge: import and use audio and video files
    • 10.5 step5: GUI
      • 10.5.1 Unity knowledge: create common GUI widgets
    • 10.6 step6: physics
      • 10.6.1 Unity knowledge: physical simulation in Unity
    • 10.7 step7: particle system
      • 10.7.1 Unity knowledge: standard and VFX graph particles
    • 10.8 step8: AI navigation
      • 10.8.1 Unity knowledge: use AI navigation
    • 10.9 step9: characters
      • 10.9.1 Unity knowledge: import and use character animation
    • 10.10 step10: timeline
      • 10.10.1 Unity knowledge: use timeline to create cinematic clips
  • 11 Unity Function Modules
    • 11.1 scene building, asset management, terrain, rendering, scripting, shader development, animation, particle system, physics, 2D, navigation and path finding, user input, audio and video, GUI, profiling, misc
  • 12 Visual Art for Games
    • 12.1 2D art
    • 12.2 3D art
    • 12.2 normal mapping
    • 12.4 modular design strategy
  • 13 Extensive C# Knowledge (1)
    • 13.1 C# knowledge: enumeration
    • 13.2 C# knowledge: implicity typed variables
    • 13.3 C# knowledge: tuples
    • 13.4 C# knowledge: overriding a function
    • 13.5 Unity API: delayed execution
    • 13.6 Unity API: coroutine
    • 13.7 C# knowledge: delegate
    • 13.8 C# knowledge: events
    • 13.9 Unity API: Unity events
    • 13.10 C# knowledge: structure
    • 13.11 IDE knowledge: debugging
    • 13.12 C# knowledge: structured exception handling
  • 14 Practice6: Balloon Shooter
    • 14.1 Object oriented Programming
      • 14.1.1 class, instance, field, property, method
    • 14.2 C# knowledge: class and instance creation
    • 14.3 step1: instantiate balloons
      • 14.3.1 Unity API: set material properties
      • 14.3.2 Unity knoledge: FixedUpdate()
    • 14.4 step2: design moving target class
      • 14.4.1 C# knowledge: basic principles of class planning
      • 14.4.2 C# knowledge: three characteristics of OOP
      • 14.4.3 C# knowledge: class definition and inheritance
      • 14.4.4 C# knowledge: containment of classes and nesting of classes
      • 14.4.5 C# knowledge: field, property, method
      • 14.4.6 C# knowledge: member accessibility
    • 14.5 step3: moving target classs
      • 14.5.1 C# knowledge: constructor and inheritance
      • 14.5.2 C# knowledge: finalizer (destructor)
      • 14.5.3 C# knowledge: method overriding
      • 14.5.4 C# knowledge: polymorphism
      • 14.5.5 C# knowledge: method hiding
    • 14.6 step4: finish the bow controls
    • 14.7 step5: draw curve and arrow shooting
    • 14.8 step6: create hit effect via interface
      • 14.8.1 C# knowledge: interface
      • 14.8.2 C# knowledge: value type and reference type
      • 14.8.3 C# knowledge: boxing and unboxing
      • 14.8.4 C# knowledge: type comparison and conversion
    • 14.9 step7: improve functions and add UI
      • 14.9.1 C# knowledge: static class & member
    • 14.10 step8: use generic list for props
      • 14.10.1 C# knowledge: generic list
      • 14.10.2 C# knowledge: sort a generic list
  • 15 Extensive C# Knowledge (2)
    • 15.1 C# knowledge: array list
    • 15.2 C# knowledge: dictionary as a generic collection
    • 15.3 C# knowledge: conversion of objects
    • 15.4 C# knowledge: copying objects
    • 15.5 C# knowledge: initializer
    • 15.6 C# knowledge: anonymous class
    • 15.7 C# knowledge: anonymous methods and Lamda expressions
    • 15.8 C# knowledge: attributes
  • 16 Intro to Design Pattern
    • 16.1 concept of design pattern
    • 16.2 rules to following in OOP design
    • 16.3 design pattern example: singleton
    • 16.4 design pattern example: state
    • 16.5 summary of the intro to design patterns
  • 17 Intro to Render Pipeline and Shader Development
    • 17.1 how does real-time rendering happen
    • 17.2 types of shaders in Unity
    • 17.3 ways of shader creation in Unity
    • 17.4 shader graph example: model dissolution
    • 17.5 shader graph example: time and space tunnel
    • 17.6 shader learning resources

学习资料 | Learning Materials

课程内容 | course content
▲ 知识学习 | Knowledge Learning
▲ 创作实践 | Creation Practice
成绩构成 | how the final score is given
● 出勤记录 | Attendance: 10%
● 平时成绩 | Usual performance: 20%
– 随堂测试 | In-class quizzes: 5% x 4
● 期末作业+展览 | Final project and exhibition: 50%
– 游戏设计方案 | Game design: 10%
– 美术+程序品质及完成度 | Art + programming quality and completeness: 15% + 15%
– 展览 | Exhibition: 10%
● 期末现场考题 | Final-term test: 20%
– 基础考题+美术/程序专属考题 | Basic questions + art/programming exclusives: 10% + 10%
● 知识分享 | Knowledge sharing: ≤10%
期末创作要求 | requirements on the final creation project
● 以5人团队为单位完成期末创作 | You are expected to work in 5-people teams to finish the final creation projects.
● 选题方向由企业合作方提供 | The corporate partner will provide the direction of creation.
● 具体主题、形式与内容由创作团队决定 | The student teams decide on their own topics, forms and contents.
● 游戏/严肃游戏/交互叙事/交互艺术等形式均可 | You may choose to create games, serious games, interactive narratives, interactive arts and etc.
● 需兼顾创造性、艺术性、技术性与可实现性 | You need to take into consideration creativity, aesthetics, technology and feasibility.
● 允许使用第三方素材,但需随附说明 | 3rf-party content is allowed, but you must state its usage.
期末须提交的内容 | documents to submit at the end of the semester
● 游戏/交互软件可执行文件或安装包 | A game/interaction application (executable files or installer)
● Unity工程文件夹(删除Library后以7zip最高压缩率压缩)| Unity project folder (delete the Library sub-folder, 7zip, highest compression ratio)
● 结项汇报PPT文件 | PPT file for conclusive presentation
● 2-3分钟作品宣传影片 (.mp4, 1080p@25fps) | A trailer video (2-3 minutes, .mp4 format, 1080p@25fps)
● 3-5分钟理念阐述影片 (.mp4, 1080p@25fps) | A concept introduction video (3-5 minutes, .mp4 format, 1080p@25fps)
课件中的图片/影片高清版 | high-res images/videos from the lecture slides
游戏主机发展断代史 | generations of game consoles
参考资料来源 | Reference

https://en.wikipedia.org/wiki/Video_game_console

全球游戏市场报告 | global games market report
参考资料来源 | Reference
https://newzoo.com/
游戏引擎发展历史 | the history of game engines
id Software引擎发展史 | the history of id Software engines
▲ 第1部分 | Part 1
▲ 第2部分 | Part 2
▲ 第3部分 | Part 3
▲ 第4部分 | Part 4
▲ 第5部分 | Part 5
Unity引擎发展历史 | a history of the Unity game engine
参考资料来源 | Reference
https://web.wpi.edu/Pubs/E-project/Available/E-project-030614-143124/unrestricted/Haas_IQP_Final.pdf
CUSGA2022决赛入围作品混剪 | a mix of the finalists for CUSGA2022
2022年数字动画与数字娱乐实验室作品混剪 | a games showreel from the DAElab 2022
影视与动画《抗生素》 | films & animations: Antibiotics
影视与动画《加州旅馆》 | films & animations: Hotel California
XR体验《三三零》 | XR experience: 330
XR体验《折叠》 | XR experience: FOLD
XR体验《次要任务》 | XR experience: Secondary Mission
XR体验《海底两万里》 | XR experience: 20000 milse under water
交互艺术《设计交响》 | XR experience: Design Symphony
交互艺术《分身·源起》 | XR experience: Avatar Mythology
严肃游戏《VR电影训练营》 | serious games: VR Film School
严肃游戏《Monolith》 | serious games: Monolith
可视化与仿真《快艇及战斗机沉浸式模拟体验》 | visualization and simulation: Speed Boad and Jet Fighter Simulators
可视化与仿真《飞鲨出击》 | visualization and simulation: The Strike of Flying Sharks
商用软件《长城集团海外销售工具》 | commercial application: The Oversea Sales Tool for Great Wall Corp.
课件中的图片/影片高清版 | high-res images/videos from the lecture slides
Unity Hub安装地址 | Unity Hub installation
Unity 2022.3.8f1c1离线安装文件下载地址 | Unity 2022.3.8f1c1 offline installer
艺术馆练习原始文件 | raw data for the gallery exercise
第三方素材来源 | sources of 3rd-party content
Statue Models:
https://assetstore.unity.com/packages/3d/props/bronze-bear-statue-65904
https://assetstore.unity.com/packages/3d/props/discobolus-statue-107544
https://assetstore.unity.com/packages/3d/dragon-statue-59053
https://assetstore.unity.com/packages/3d/props/interior/golden-dragon-statue-63132
https://assetstore.unity.com/packages/3d/environments/fantasy/horse-statue-52025
https://assetstore.unity.com/packages/3d/props/exterior/hq-lion-statue-50736
https://assetstore.unity.com/packages/3d/props/exterior/lion-statue-34247
https://assetstore.unity.com/packages/3d/nefertiti-56818
https://assetstore.unity.com/packages/3d/props/queen-victoria-bronze-bust-statue-prop-129905

Music:
https://freepd.com/romantic.php

Mini first person controller:
https://assetstore.unity.com/packages/tools/input-management/mini-first-person-controller-174710

Substance 3D for Unity:
https://assetstore.unity.com/packages/tools/utilities/substance-3d-for-unity-213208

Substance Material:
https://substance3d.adobe.com/community-assets/assets/be8c895f6ebcefeb7a8af0fb37ce3c8cce2134d7
https://substance3d.adobe.com/community-assets/assets/ed308b8f9037c60f13ba7e91d4dbb82140116c4f
https://substance3d.adobe.com/community-assets/assets/a4d374705d893449950febb0c6463e0e265e137f

Skybox Texture:
http://www.zfight.com/misc/images/textures/envmaps/grimmnight_large.jpg
...
艺术馆练习最终发布版本 | final builds of the gallery exercise
选题参考资料 | reference material for design proposal
课件中的图片/影片高清版 | high-res images/videos from the lecture slides
游戏类型学 | genres of games
游戏设计理论参考书目 | reference books on game design theories
《游戏设计艺术》 | The Art of Game Design
杰西·谢尔著,电子工业出版社,2021年5月第三版,ISBN:9787121409271 |
by Jesse Schell, Publishing House of Electronics Industry, 3rd edition, May 2021
《体验引擎:游戏设计全景揭秘》 | Designing Games: A Guide to Engineering Experiences
泰南·西尔维斯特著,电子工业出版社,2015年3月第一版,ISBN:9787121253799 |
by Tynan Sylvester, Publishing House of Electronics Industry, 1st edition, March 2015
《通关!游戏设计之道》 | Level Up! The Guide to Greate Video Game Design
斯科特·罗杰斯著,人民邮电出版社,2016年11月第二版,ISBN:9787115431776 |
by Scott Rogers, The People’s Posts and Telecomm Press, 2nd edition, 2019 November
《游戏设计梦工厂》 | Game Design Workshop
特雷西·富勒顿著,电子工业出版社,2022年6月第四版,ISBN:9787121433481 |
by Tracy Fullerton, Publishing House of Electronics Industry, 4th edition, June 2022
《妙趣横生的游戏制作之旅》 | A Playful Production Process: For Game Designers
理查德·雷马卡德著,电子工业出版社,2022年8月第一版,ISBN:9787121440953 |
by Richard Lemarchand, Publishing House of Electronics Industry, 1st edition, August 2022
《游戏设计进阶:一种系统方法》 | Advanced Game Design: A Systems Approach
迈克尔·塞勒斯著,电子工业出版社,2019年7月第一版,ISBN:9787121366642 |
by Michael Sellers, Publishing House of Electronics Industry, 1st edition, July 2019
《游戏剧本怎么写》 | Screen Writing for Games
佐佐木智广著,人民邮电出版社,2018年8月第一版,ISBN:9787115484338 |
by Tomohiro Sasaki, The People’s Posts and Telecomm Press, 1st edition, August 2018
《游戏感:游戏操控感和体验设计指南》 | Game Feel: A Game Designer’s Guide to Virtual Sensation
史蒂夫· 斯温克著,电子工业出版社,2020年4月第一版,ISBN:9787121363245 |
by Steve Swink, Publishing House of Electronics Industry, 1st edition, April 2020
《平衡掌控者:游戏数值战斗设计》 | Balance: Design Battle Parameters for Games
似水无痕著,电子工业出版社,2017年5月第一版,ISBN:9787121312397 |
by Si Shui Wu Hen, Publishing House of Electronics Industry, 1st edition, May 2017
《平衡掌控者:游戏数值经济设计》 | Balance: Design Economy Systems for Games
似水无痕著,电子工业出版社,2020年9月第一版,ISBN:9787121393631 |
by Si Shui Wu Hen, Publishing House of Electronics Industry, 1st edition, September 2020
如何使用VS Code | how to use VS Code
Mono v.s. IL2CPP | how to use VS Code
可视化编程 | Visual Scripting
C#中的变量类型 | Types of Variables in C#
变量类型 | Variable Type 取值范围 | Value Range 长度 | Length
sbyte (带符号字节型)
-128 ~ 127
1 byte, 28 bits
byte(字节型)
0 ~ 255
1 byte, 28 bits
short(短整型)
-32768 ~ 32767
2 bytes, 216 bits
ushort(无符号短整型)
0 ~ 65535
2 bytes, 216 bits
int(整型)
-2147483648 ~ 2147483647
4 bytes, 232 bits
uint(无符号整型)
0 ~ 4294967295
4 bytes, 232 bits
long(长整型)
-9223372036854775808 ~ 9223372036854775807
8 bytes, 264 bits
ulong(无符号整型)
0 ~ 18446744073709551615
8 bytes, 264 bits
float(单精度浮点型)
形式 | form: ±m×2e,m=0~224,e=-149~104
范围 | range: 0∪±(1.5×10-45 ~ 3.4×1038),有效数字 | sig. digits = 7
4 bytes, 232 bits
double(双精度浮点型)
形式 | form: ±m×2e,m=0~253,e=-1075~970
范围 | range: 0∪±(5.0×10-324 ~ 1.7×10308),有效数字 | sig. digits = 15 ~ 16
8 bytes, 264 bits
decimal(十进制型)
形式 | form: (-1)s × c×10-e,s∈{0,1},c=0~296,e=0~28
范围 | range: 0∪±(1.0×10-28 ~ 7.9×1028),有效数字 | sig. digits = 28-29
16 bytes, 2128 bits
bool(布尔型)
true / false
1 byte, 28 bits
char(字符型)
0 ~ 65535之间的Unicode字符 | a Unicode char between 0 and 65535
2 bytes, 216 bits
string(字符串型)
一组字符 | a series of chars
不限 | unlimited
字面值 | Literals
变量类型 | Var. Type 数据类型 | Data Type 后缀 | Suffix 范例 | Example 备注 | Memo
bool
布尔量 | Boolean
无 | null
true / false
int, uint, long, ulong
整数 | integer
无 | null
100
使用前缀0x或0X表示十六进制数 |
Use prefix 0x or 0X for hexadecimal numbers.

使用前缀0b或0B表示二进制数 |
Use prefix 0b or 0B for binary numbers.
uint, ulong
整数 | integer
u / U
100U
long, ulong
整数 | integer
l / L
100L
ulong
整数 | integer
ul / uL / Ul / UL / lu / lU / Lu / LU
100UL
float
实数 | real number
f / F
1.5f
double
实数 | real number
无,d 或 D | null, d or D
1.5
decimal
实数 | real number
m / M
1.5M
char
字符 | character
无 | null
‘a’
可包括转义序列 |may include escape sequences
string
字符串 | string
无 | null
“This”
“猜数字”游戏原始文件 | raw data for the game “guess a number”
第三方素材来源 | sources of 3rd-party content
星空背景 | Starfield Background:
https://wallpapers.com/picture/universe-pictures-b45b5bvjjenvyg9p.html

背景音乐 | Music:
https://soundraw.io/(AIGC)

三维模型 | 3D Models:
https://assetstore.unity.com/packages/3d/vehicles/space/star-sparrow-sci-fi-modular-spaceship-73167

图形用户界面 | GUI:
https://assetstore.unity.com/packages/2d/gui/sci-fi-gui-skin-15606
“猜数字”游戏最终发布版本 | final build of the game “guess a number”
Unity功能扩展阅读材料 | online documents on Unity functions
C#知识点 | C# knowledge points
● 转义序列 | escape sequences
转义序列 | escape sequences 结果 | output 转义序列 | escape sequences 结果 | output
\'
单引号 | Single quotation marks
\"
双引号 | Double quotation mark
\b
退格键 | Backspace
\f
换页符 | Next Page
\\
反斜杠 | Backslash
\0
空 | Null
\n
换行 | Next Line
\r
回车 | Return
\t
水平制表符 | Horizontal Tab
\v
垂直制表符 | Vertical Tab
\a
哔声 | Beep
● 运算符及其优先级 | operators and priority
运算符 | operators 优先级 | priority
++ (自增前缀 | increment prefix)
-- (自减前缀 | increment prefix)
+ (正号前缀 | plus prefix)
-(负号前缀 | minus prefix)
! (否 | negation)
~ (按位取反 | bitwise complement)
1
(最高)
* (乘 | multiplication)
/(除 | division)
%(求余 | calculate remainder)
2
+ (加 | add)
- (减 | subtraction)
3
<< (左移位 | left shift)
>> (右移位 | right shift)
4
< (小于 | less than)
> (大于 | greater than)
<= (小于等于 | equal or less than)
>= (大于等于 | equal or greater than)
5
== (相等 | equal)
!= (不等 | not equal)
6
& (按位与 | bitwise AND)
7
^ (按位异或 | bitwise exclusive OR)
8
| (按位或 | bitwise OR)
9
&& (逻辑与 | logical AND)
10
|| (逻辑或 | logical OR)
11
? : (条件运算符 | conditional operator)
12
= (赋值 | assignment)
*=, /=, %=, +=, -= (运算赋值 | calculation assignment)
<>=, &=, ^=, |= (按位运算赋值 | bitwise calc. assignment)
13
++ (自增后缀 | increment suffix)
-- (自减后缀 | decrement suffix)
14
(最低)
● if判断语句 | if judgement statement
if 指令的不同形式 | different forms of the if statement
if (条件 | condition)
    {
       …
    }
if (条件 | condition)
    {
       …
    }
else
    {
       …
    }
if (条件 | condition)
    {
       …
    }
else if (条件 | condition)
    {
       …
    }
else
    {
       …
    }
● switch分支语句 | switch branches
switch 指令的不同形式 | different forms of the switch statement
switch (条件 | condition)
    {
        case 值1 | Value1:
            …
            break;
        case 值2 | Value2:
            …
            break;
        case 值3 | Value3:
            …
            break;
        …
        default:
            …
            break;
}
switch (条件 | condition)
    {
        case 值1 | Value1:
        case 值2 | Value2:
            …
            break;
        case 值3 | Value3:
            …
            break;
        …
        default:
            …
            break;
}
switch (条件 | condition)
    {
        case 值1 | Value1:
            …
            goto case 值3 | Value3;
        case 值2 | Value2:
            …
            break;
        case 值3 | Value3:
            …
            break;
        …
        default:
            …
            break;
}
● 循环语句 | loops
循环指令 | iteration statements 跳转指令 | jump statments
do
    {
       …
    } while (条件 | condition)
while (条件 | condition)
    {
       …
    }
continue;
break;
for (初始化表达式 | initializer ; 条件 | condition ; 迭代器 | iterator)
    {
       …
    }
foreach (变量类型 | variable type 枚举器 | enumerator in 集合 | collection)
    {
       …
    }
● 名称空间 | name spaces
using 名称空间 | namespace;
例 | example
using UnityEngine.UI;
● 字符串转换为整数 | convert a string to an integer
int.Parse (字符串 | string);
例 | example
int Value = int.Parse(“80”);
int.TryParse (字符串 | string , out 字符串 | string);
例 | example
bool ConvSuccess = int.TryParse(“80”,out int val);
● 连接字符串 | combine strings
字符串1 | string1 + 字符串2 | string2 + 字符串3 | string3 + …
例 | example
string NewString = “Total Time: ” + TimeValue; //TimeValue自动转换为字符串格式|TimeValue auto convert to string
● 字符串内插 | string interpolation
$”字符串1 | string1 { 内插表达式 | interpolation expression } 字符串2 | string2 …”
例 | example
string NewString = $”Total Time: {TimeValue}”;
● 一维数组 | one-dimensional arrays
变量类型 | Variable Type [ ] 数组名称 | array name = new 变量类型 | Variable Type [ 元素数量 | item count ];
例1 | example 1
int[] AgeArray;
AgeArray = new int[5] {18,20,31,25,38};
例2 | example 2
int[] AgeArray = new int[5] {18,20,31,25,38}; //声明数组的同时初始化|initialize on declaration
例3 | example 3
int[] AgeArray = new int[] {18,20,31,25,38}; //省略元素数量|Omit item count
例4 | example 4
int[] AgeArray = {18,20,31,25,38}; //隐式类型化,仅在声明同行时可用|implicitly typed array, only valid on declaration
● 多维数组 | multi-dimensional arrays
变量类型 | Variable Type [ … , … , … ] 数组名称 | array name = new 变量类型 | Variable Type [ 元素数量 | item count , 元素数量 | item count , … ];
例1 | example 1
int[,] NumArray;
NumArray = new int[4,2] {{1,2},{3,4},{5,6},{7,8}};
例2 | example 2
int[,] NumArray = new int[4,2]{{1,2},{3,4},{5,6},{7,8}};
例3 | example 3
int[,] NumArray = new int[,]{{1,2},{3,4},{5,6},{7,8}};
例4 | example 4
int[,] NumArray = {{1,2},{3,4},{5,6},{7,8}};
● 交错数组(数组的数组) | jagged arrays (arrays of arrays)
变量类型 | Variable Type [ ][ ] 数组名称 | array name = new 变量类型 | Variable Type [ 数组数量 | array count ] [ ];
例1 | example 1
int[][] JArray = new int[2][];
JArray[0] = new int[5]{1,3,5,7,9};
JArray[1] = new int[4]{2,4,6,8};
例2 | example 2
int[][] JArray = new int[][]
{
  new int[]{1,3,5,7,9},
  new int[]{0,2,4,6},
  new int[]{11,22}
};
● 定义函数 | define a function
可访问性 | accessibility   返回值类型 | return type   函数名 | function name ( 参数列表 | parameter list ) { 函数体 | function body }
例1 | example 1
public void PrintMessage (string Msg)
  {
    print($”The input message is: {Msg}”);
  }
例2 | example 2
private float AddValues(float Op1, float Op2)
  {
    return(Op1+Op2);
  }
● 调用函数 | use a function
函数名 | function name ( 参数列表 | parameter list );
例1 | example 1
PrintMessage(“Hello world!”);
例2 | example 2
float sum = AddValues(1.5f, 3.9f);
● 输出参数 | output parameters
函数名 | function name ( out 输出参数类型 | output parameter type   输出参数名称 | output parameter name );
例 | example
int MaxValue (int[] intArray, out int maxIndex)
  {
    int maxVal=intArray[0];
    for (int i=1;i<intArray.Length;i++)
    if (intArray[i]>maxVal)
      {
        maxVal = intArray[i];  //设置当前发现的最大值
        maxIndex = i;  //输出对应的序号
      }
    return maxVal;  //返回最大值}
  }
● 引用参数 | reference parameters
函数名 | function name ( ref 输出参数类型 | output parameter type   输出参数名称 | output parameter name );
例 | example
void DoubleValue(ref int InputValue)
  {
    InputValue *= 2;
  }
● 参数数组 | parameter array
函数名 | function name ( … , …, params 数组数据类型 | array data type [ ]   参数数组名称 | parameter array name );
例 | example
float CalcSum(string Data, params float[] Vals)
  {
    float sum=0;
    foreach (float val in Vals)
      sum += val;
    print($“The sum of {Data} is {sum}”);
    return sum;
  }
float TotalPrice = CalcSum(“Price”,1.5f , 2.3f , 9.8f);  //TotalPrice获得返回值13.6,输出“The sum of Price is 13.6”
Unity API知识点 | Unity API knowledge points
● 获得游戏物体上的元件 | get access to components on a Game Object
游戏物体 | game object . GetComponent < 元件类型 | Component Type > ( );
例 | example
Button ConfirmButton = UIObj.GetComponent<Button>();
● 获得Input Field中的输入值 | get the input value from the Input Field
Input Field元件 | Input Field Component . text
例 | example
string InputText = InputFieldGameObj.GetComponent().text;
● 修改Text控件的显示内容 | change the content of the Text elements
Text元件 | Text Component . text
例 | example
HintText.GetComponent<Text>().text = “There are only 10 seconds left.”;
● 设置UI控件(如按钮)的可交互性 | set UI widgets (e.g. buttons) to be interactible
按钮元件 | button component . interactable = 布尔值 | boolean value;
例 | example
ButtonObj.GetComponent<Button>().interactable = true;
● 生成随机数 | generate random numbers
Random.Range ( 最小值 | min value , 最大值 | max value );
例1 | example 1
int Value = Random.Range(1,100);
例2 | example 2
float Value = Random.Range(1f,100f);
● 激活/取消激活游戏物体 | active/deactivate Game Objects
游戏物体 | game object . SetActive ( 布尔值 | boolean value );
例 | example
ConfirmButton.SetActive(true);
● 判断物体激活状态 | judge whether a game object is activated
游戏物体 | game object . activeSelf
游戏物体 | game object . activeInHierarchy
● 启用/停用组件 | enable/disable components
元件 | component . enabled = 布尔值 | Boolean Value;
例1 | example 1
GateGameObj.GetComponent().enabled=false;
例2 | example 2
Button_Replay.GetComponent<Button>().enabled=true;
● 获得子物体数量 | get children count
变换 | transform . childCount
● 获取子物体 | get a child game object
变换 | transform . GetChild ( 子物体序号 | Child Index )
例 | example
RootGameObject.transform.GetChild(1);  //获取RootGameObject的第二个子物体
● 删除物体 | delete a game object
Destroy ( 游戏物体 | game object , 延迟时间 | delay time )
例1 | example 1
Destroy(DwarfGamObj);
例2 | example 2
Destroy(DwarfGamObj,2.5f);
● 实例化 | instantiate a game object
Instantiate ( 源游戏物体或预制件 | source game object or prefab );
Instantiate ( 源游戏物体或预制件 | source game object or prefab , 父物体变换 | parent transform);
Instantiate ( 源游戏物体或预制件 | source game object or prefab , 位置向量 | position , 旋转角度 | rotation);
Instantiate ( 源游戏物体或预制件 | source game object or prefab , 位置向量 | position , 旋转角度 | rotation , 父物体变换 | parent transform);
例1 | example 1
Gameobject NewEnemy = Instantiate (DwarfPrefab, EnemyRootObj.transform);
例2 | example 2
Gameobject NewEnemy = Instantiate (DwarfPrefab, new Vector3(5,15,0), Quaternion.identity);
“换你出题”游戏原始文件 | raw data for the game “switch play”
第三方素材来源 | sources of 3rd-party content
星空背景 | Starfield Background:
https://wallpapers.com/picture/universe-pictures-b45b5bvjjenvyg9p.html

背景音乐 | Music:
https://soundraw.io/(AIGC)

三维模型 | 3D Models:
https://assetstore.unity.com/packages/3d/vehicles/space/star-sparrow-sci-fi-modular-spaceship-73167

图形用户界面 | GUI:
https://assetstore.unity.com/packages/2d/gui/sci-fi-gui-skin-15606
“换你出题”游戏最终发布版本 | final build of the game “switch play”
C#知识点 | C# knowledge points
● 强制类型转换 | explicit type conversion
( 类型 | type ) 类变量名或字面值 | variable name or literal value ;
例 | example
int a = (int)2.0f;
float b = (float)a;
● 取整 | convert to integer
Mathf.Floor ( 变量 | variable ) ;
Mathf.FloorToInt ( 变量 | variable ) ;
Mathf.Ceil ( 变量 | variable ) ;
Mathf.CeilToInt ( 变量 | variable ) ;
Mathf.Round ( 变量 | variable ) ;
Mathf.RoundToInt ( 变量 | variable ) ;
● 将变量转换为字符串(对于许多类型的变量均适用)| Convert to string (applicable to various variable types)
变量 | variable . ToString ( ) ;
例 | example
ScoreObj.GetComponent().text = Score.ToString(); //假设Score是float类型的浮点数
Unity API知识点 | Unity API knowledge points
● 查找游戏物体 | find game objects
变换 | transform . Find ( “游戏物体名称含路径 | game object’s name including path” );
例1 | example 1
transform.Find(“/Canvas/CancelButton/Text”) //完整路径;注意:返回类型为transform
例2 | example 2
transform.Find(“CancelButton/Text”) //相对路径(CancelButton应为当前物体的子物体);注意:返回类型为transform
● 基于Tag查找游戏物体 | find game objects with their tags
GameObject . FindWithTag ( “标签字符串 | tag string” );
例 | example
GameObject EnemyManager = GameObject.FindWithTag(“EnemyMng”); //注意:尽量确保场景中只有唯一标签物体
GameObject . FindGameObjectsWithTag ( “标签字符串 | tag string” );
例 | example
GameObject[] Enemies = GameObject.FindGameObjectsWithTag(“Enemy”); //注意:返回为GameObject数组
● 通过脚本增加按钮点击响应 | Add button click response via scripting
按钮类型变量 | Button type variable . onClick . AddListener ( “标签字符串 | tag string” );
例 | example
SubmitButton.onClick.AddListener(SubmitFunc);
艺术馆(续)练习原始文件 | raw data for the gallery (continued) exercise
第三方素材来源 | sources of 3rd-party content
Statue Models:
https://assetstore.unity.com/packages/3d/props/bronze-bear-statue-65904
https://assetstore.unity.com/packages/3d/props/discobolus-statue-107544
https://assetstore.unity.com/packages/3d/dragon-statue-59053
https://assetstore.unity.com/packages/3d/props/interior/golden-dragon-statue-63132
https://assetstore.unity.com/packages/3d/environments/fantasy/horse-statue-52025
https://assetstore.unity.com/packages/3d/props/exterior/hq-lion-statue-50736
https://assetstore.unity.com/packages/3d/props/exterior/lion-statue-34247
https://assetstore.unity.com/packages/3d/nefertiti-56818
https://assetstore.unity.com/packages/3d/props/queen-victoria-bronze-bust-statue-prop-129905

Music:
https://freepd.com/romantic.php

Mini first person controller:
https://assetstore.unity.com/packages/tools/input-management/mini-first-person-controller-174710

Substance 3D for Unity:
https://assetstore.unity.com/packages/tools/utilities/substance-3d-for-unity-213208

Substance Material:
https://substance3d.adobe.com/community-assets/assets/be8c895f6ebcefeb7a8af0fb37ce3c8cce2134d7
https://substance3d.adobe.com/community-assets/assets/ed308b8f9037c60f13ba7e91d4dbb82140116c4f
https://substance3d.adobe.com/community-assets/assets/a4d374705d893449950febb0c6463e0e265e137f

Skybox Texture:
http://www.zfight.com/misc/images/textures/envmaps/grimmnight_large.jpg
...
艺术馆(续)练习最终发布版本 | final builds of the gallery (continued) exercise
场景搭建 | Scene Building
● 建模与基础场景搭建 | modeling and fundamental scene building: ProBuilder
● 模型雕刻与散布 | model sculpting and scattering: Polybrush
● 场景模型导出 | export scene models: FBX Exporter
● ProBuilder, Polybrush & FBX Exporter
资产管理 | Asset Management
● 动态载入资产文件夹 | folder for dynamic asset loading: Resources
● 流式加载资产文件夹 | folder for streamed asset loading: StreamingAssets
● 资产包 | Asset Bundle
● 可寻址资产 | Addressable Assets
地形 | Terrain
● 默认地形系统 | default terrain system
● 增强地形系统 | enhanced terrain system: Terrain Tools
渲染 | Rendering
● 渲染管线 | render pipelines
● 高清渲染管线 | high definition render pipeline (HDRP)
● 通用渲染管线 | universal render pipeline (URP)
● 反射探针 | Reflection Probe
● 光照探针 | Light Probe
● 预烘焙与实时全局光 | pre-baked and real-time GI
● 细节层次 | level of detail (LOD)
● 渲染纹理 | render texture
● 贴花投影器 | decal projector
● 后处理特效 | post-processing effects
● 流式虚拟纹理(仅HDRP)| streaming virtual texture (HDRP only)
● 实时光线跟踪(仅HDRP) | real-time raytracing (abbr. RTX, HDRP only)
● 物理天空与云(仅HDRP)| physical sky and clouds (HDRP only)
脚本编写 | Scripting
● C#语言 | C# language
● Visual Scripting包(原Bolt)| Visual Scripting package (originally known as Bolt)
● 面向数据的编程 | data oriented programming (DOTS)
着色器开发 | Shader Development
● Shader Lab着色器编程语言 | Shader Lab programming language
● Shader Graph(仅支持可编程渲染管线)| Shader Graph (scriptable render pipelines only)
● 更强大的Shader编写工具 | more powerful shader authoring tool: Amplify Shader Editor
动画 | Animation
● 动画编辑窗口 | animation editing window
● 动画控制器 | animator controller
● 角色绑定 | animation rigging
● 时间线 | Timeline
● 智能化自动相机控制 | intelligent automatic camera control: Cinemachine
粒子系统 | Particle Systems
● 默认粒子系统 | default particle system
● 高级节点式粒子系统 | advanced node-base particle system: Visual Effects Graph (VFX Graph)
物理 | Physics
● 刚体物理 | rigid body physics
● 布娃娃系统 | ragdoll physics
● 布料系统 | cloth physics
● 服务于机械数字孪生 | for mechanic digital twins: Articulations
二维 | 2D
● 精灵 | sprites
● 拼贴背景图 | 2D tilemap
● 二维物理 | 2D physics
导航与寻径 | Navigation and Path Finding
● 导航网格 | Navmesh
● 导航代理 | Navmesh Agent
● 障碍物 | Navmesh Obstacle
● 网格外连接点 | Off-mesh Link
用户输入 | User Input
● 旧输入系统 | the old input system
● 新输入系统 | the new input system
音视频 | Audio & Video
● Unity中的声音 | audios in Unity
● Unity中的视频 | videos in Unity
图形用户界面 | GUI
● 最常用的游戏内GUI设计工具 | the commonest in-game GUI design tool: UGUI
● 更适宜用于编辑与调试界面的GUI | GUI more suitable for editing and profiling: IMGUI
● 同时适用两种情境、设计与功能分离的新GUI系统 | a new GUI that suits both situations and separates design and functionality: UI Toolkit
性能调试 | Profiling
● 性能调试器 | Profiler
● 帧纠错器 | Frame Debugger
● 在线性能调试 | Online profiling tool: Unity Performance Test (UPR)
其他 | Misc
● 拓展现实 | XR
● 网络通讯 | networking
● Unity记录器 | Unity Recorder
● 机器学习代理 | ML Agents
● 版本管理 | versioning
● 更多商业功能 | more commercial functions
二维美术 | 2D Art
分辨率与清晰度 | resolution and definition
色彩深度和alpha通道 | color depth and alpha
贴图文件格式 | texture file formats
贴图制作原则 | principles of texture creation
GUI和立方体贴图 | GUI textures and cubemaps
HDRI贴图 | HDRI textures
基于物理的材质设计 | PBR materials
三维美术 | 3D Art
多边形数量 | polygon count
其它建模考虑因素 | other modeling hints
渲染优化策略 | rendering optimization
UV
动画 | animation
模块化建模策略 | modular modeling strategy
法线贴图 | normal mapping
C#知识点 | C# knowledge points
枚举 | enumeration
● 枚举类型 | enumeration type
enum 枚举类型名称 | enumeration type name
  {
    枚举标识1 | enumeration ID #1,     //默认代表值为0,可用”=整数值”来指定其值 | Default to 0. May use “=X” to specify value
    枚举标识2 | enumeration ID #2,     //默认代表值为1,可用”=整数值”来指定其值 | Default to 1. May use “=X” to specify value
    …
    枚举标识N | enumeration ID N
  }
例 | example
enum Season
  {
    Spring=1,
    Summer=2,
    Autumn=3,
    Winter=4
  }
● 枚举变量 | enumeration variables
枚举类型名称 | enumeration type name  枚举变量名称 | enumeration variable name;
枚举变量 | enumeration variable = 枚举类型名称 | enumeration type name.枚举标识 | enumeration ID;
例 | example
Season XmasSeason;
XmasSeason = Season.Winter;
● 枚举标识与整型变量间显式转换 | enumeration IDs converted explicitly to and from integers
//将枚举值转换为整数值 | convert an enum value to an int value
(int) 枚举类型名称 | enumeration type name.枚举标识 | enumeration ID;
//将合理范围内的整数值转换为枚举值 | convert a valid int value to an enum value
(枚举类型名称 | enumeration type name)  整数值 | integer;
隐式类型 | implicitly typed variables
var 变量名称 | variable name = 值 | value;
例1 | example1
var Price = 2.5f;    //实际Price类型为float | actual type of Price is float
例2 | example2
var Prices = new float[ ] {2.5f, 1.2f, 3.5f};   //实际Prices类型为float数组 | actual type of Prices is float array
var Prices = new [ ] {2.5f, 1.2f, 3.5f};   //实际Prices类型也是float数组| actual type of Prices is also float array
元组 | tuples
● 定义与使用元组 | define and use tuples
(元素类型1 | element type 1 , 元素类型2 | element type 2, …) 元组名称 | tuple name;    //定义 | definition
元组名称 | tuple name = (数据元素1 | data element 1 , 数据元素1 | data element 1 , …);    //初始化 | initialization
元组名称 | tuple name.ItemN    //访问 | access
例 | example
(double, int) T = (4.5, 3);
print($”Tuple: {T.Item1} & {T.Item2}.”);   //输出结果为 | result: Tuple: 4.5 & 3
(元素类型1 | type 1    元素名称1 | name 1 , 元素类型2 | type 2    元素名称2 | name 2, …) 元组名称 | tuple name;    //定义 | definition
元组名称 | tuple name = (数据元素1 | data element 1 , 数据元素1 | data element 1 , …);    //初始化 | initialization
元组名称 | tuple name.元素名称 element Name    //访问 | access
例 | example
(float Price, int Index) T = (4.5f, 3);
print($”Price of item{T.Index} is ${T.Price}.”);   //输出结果为 | result: Price of item 3 is $4.5.
● 函数以元组为返回值 | functions may return a tuple
例 | example
var xs = new[] { 4, 7, 9 };
var limits = FindMinMax(xs);
print($”Limits of [{string.Join(” “, xs)}] are {limits.min} and {limits.max}”);

(int min, int max) FindMinMax(int[] input)   //返回值为元组的函数 | a function that returns a tuple
  {
    var min = int.MaxValue; var max = int.MinValue;
    foreach (var i in input)
      {
        if (i < min) min = i;
        if (i > max) max = i;
      }
    return (min, max);
  }
函数的重载 | overrideing a function
● 通过名称相同、参数不同的函数可实现重载,调用时以参数决定使用哪一个
   | Overload a function with the same name and different paramter(s). The parameters used on calling determine which version to use.
例 | example
float Multiply(float a)   //浮点数自乘 | self-multiplication of a float
  {
    return a*a;
  }
float Multiply(float a, float b)   //两个浮点数相乘 | multiplication of two floats
  {
    return a*b;
  }
string Multiply(string a, int b)   //字符串与整数“相乘” | multiplication of a string and an integer
  {
    string Result=””;
    for(int i=0;i<b;i++)
      Result = Result + a;
    return Result;
}
委托(代理) | delegate
● 声明委托类型 | declare a delegate type
delegate    返回类型 | return type    委托类型名 | delegate type name (参数列表 | parameter list);
例 | example
//返回值类型与参数列表决定了可指向的函数 | return type and parameter list decide which functions it may point to
delegate void PrintCalcResult (int Op1, int Op2);
● 声明委托变量 | declare a delegate variable
委托类型名 | delegate type name     委托变量名 | delegate variable name;
例 | example
//PrintCalcDele是可以实际指向具体函数的变量 | PrintCalcDele is the actual variable that may point to functions
PrintCalcResult PrintCalcDele;
● 初始化委托变量 | initialize a delegate variable
委托变量 | delegate variable = new 委托类型名 | delegate type name (可委托函数名称 | valid function name);
委托变量 | delegate variable = 可委托函数名称 | valid function name;
例1 | example1
PrintCalcDele = new PrintCalcResult(PrnAdd);   //用new来初始化委托变量 | initialize a delegate variables with new()
void PrnAdd(int Op1, intOp2)
  { print($”{Op1}+{Op2}={Op1+Op2}”); }
例2 | example2
PrintCalcDele = PrnAdd;   //也可以使用隐式转换 | to use implicit conversion is also possible
void PrnAdd(int Op1, intOp2)
  { print($”{Op1}+{Op2}={Op1+Op2}”); }
● 使用委托变量调用函数 | call functions with delegate variables
委托变量 | delegate variable (参数列表 | parameter list name);
例 | example
PrintCalcDele(5,3);
● 多播委托(也称多重代理) | multi-cast delegate
委托变量 | delegate variable += 可委托函数名称 | valid function name;
委托变量 | delegate variable -= 已委托函数名称 | the name of a function in the delegate list;
例 | example
PrintCalcDele += new PrintCalcResult(PrnAdd);   //显式转换 | explicit conversion
PrintCalcDele += PrnSub;   //隐式转换 | implicit conversion
PrintCalcDele (5,3);   //先执行PrnAdd(5,3)后执行PrnSub(5,3) | execute PrnAdd(5,3) then PrnSub(5,3)
PrintCalcDele -= PrintCalcResult (PrnAdd);   //若含多个相同函数只会移除一个 | Will only remove one duplicate function
void PrnAdd(int Op1, int Op2)
  { print($”{Op1}+{Op2}={Op1+Op2}”); }
void PrnSub(int Op2, int Op2)
  { print($”{Op1}-{Op2}={Op1-Op2}”); }
结构体 | structure
● 声明结构类型 | declare a strut type
可访问性 | accessibility struct 结构类型名称 | struct type name
  {
    可访问性 | accessibility    字段类型 | field type    字段名称 | field name;
    …
    可访问性 | accessibility    返回类型 | return type    函数名称 | function name ( 参数列表 | Parameter List )
      { 函数体 | function body }
  }
例 | example
public struct StudentStruct
  {
    public string Name;   //公有字符串变量 | public string variable
    public float Age;   //公有浮点数变量 | public float variable
    public void PrintInfo()   //公有函数 | public function
      { print($”{Name}’s age is {Age}.”); }
  }
● 声明并初始化结构类型变量 | declare and initialize a struct variable
结构类型名称 | struct type name    变量名称 | variable name = new 结构类型名称 | struct type name ( );
● 访问结构类型变量内部字段 | access internal fields of a struct variable
结构类型变量名称 | struct variable name . 字段名称 | field name
例 | example
StudentStruct Student1 = new MyStruct();
StudentStruct Student2 = new MyStruct();

Studnet1.Name = “Tom”;
Student1.Age = 20;

Studnet2.Name = “Mary”;
Student2.Age = 23;

Student1.PrintInfo();   //输出 | Output: Tom’s age is 20;
Student2.PrintInfo();   //输出 | Output: Mary’s age is 23;
Unity API知识点 | Unity API knowledge points
Invoke
● 延迟执行 | delayed execution
Invoke (函数名称 | function name , 延迟秒数 | delay seconds);
例 | example
Invoke (“PlayEndingMusic”,2.5f);
● 延迟循环执行 | delayed repeated execution
InvokeRepeating (函数名称 | function name , 首次延迟秒数 | initial delay in seconds , 后续间隔秒数 | later intervals in seconds);
例 | example
InvokeRepeating(“ShootBullet”, 10f, 2.5f);
● 取消Invoke预约 | cancel Invoke appointments
CancelInvoke();    //取消当前脚本产生的所有Inovke预约 | cancel all invoke calss made by this mono behavior
CancelInvoke(“函数名称 | function name“);    //取消指定函数的Inovke预约 | cancel the invoke calls of a specific function
例 | example
CancelInvoke (“ShootBullet”);
协程 | Coroutines
● 定义协程 | define a coroutine
IEnumerator 协程名称 | coroutine name ( )    //定义协程 | define a coroutine
  {
    …
    yield return 返回内容 | return content;
    …
  }
● 调用协程 | start a coroutine
StartCoroutine(“协程名称 | coroutine name“);    //通过协程名称字符串调用协程 | start a coroutine with a function name (string)
StartCoroutine(“协程名称 | coroutine name“, 参数 | parameter);    //以上方法可带一个参数 | the method above allows one parameter
StartCoroutine(协程名称 | coroutine name (参数列表 | parameter list));    //通过协程名称调用协程 | start with a function name
● 终止协程 | stop coroutines
StopCoroutine(“协程名称 | coroutine name“);    //通过协程名称字符串终止协程 | stop a coroutine with a function name (string)
例 | example
//使用此方法须确保调用时同样使用协程名称字符串 | applicable to coroutines started also with name strings
StartCoroutine(“MyCoFunc”,2);
StopCoroutine(“MyCoFunc”,2);
StopCoroutine(协程变量 | coroutine variable);    //通过协程变量中止协程 | Stop a coroutine with a coroutine variable.
例 | example
//使用此方法可中止不同方式调用的协程 | This approach may stop coroutines started with different methods.
Coroutine MyCoroutine = StartCoroutine(MyCoFunc(2,4,5));
StopCoroutine(MyCoroutine);
StopAllCoroutines( );    //中止所有已被调用的协程 | Stop all the coroutines currently started.
● 协程用途之一:延时执行 | coroutine usage 1: delayed execution
yield return new WaitForSeconds (等待秒数 | wait seconds);    //此处时长受Time.timescale影响 | scaled time is used here
yield return new WaitForSecondsRealtime (等待秒数 | wait seconds);    //此处采用未缩放时间 | unscaled time used here
● 协程用途之二:逐帧动效 | coroutine usage 2: frame-by-frame dynamic effects
yield return null;    //一般放在循环体中,将循环拆分为逐帧执行 | commonly used inside loops to run them frame by frame
● 协程用途之三:等待特定时刻 | coroutine usage 3: wait until a specific moment
yield return new WaitForEndOfFrame( );    //等待至画面渲染完毕 | wait until every camera and GUI is rendered
yield return new WaitForFixedUpdate( );    //等待至下一次Fixed Update周期 | wait until next Fixed Update cycle
yield return new WaitWhile (布尔型函数 | bool func.);    //当函数返回值为真时等待 | wait while a function returns true
yield return new WaitUntil (布尔型函数 | bool func.);    //当函数返回值为真时停止等待 | wait until a function returns true
● 协程用途之四:协程嵌套 | coroutine usage 4: nested coroutines
//内嵌协程结束后继续执行外部协程 | wait until the embedded coroutine finishes
yield return StartCoroutine (协程名称 | coroutine name (参数列表 | parameter list));
事件 | Events
C#中的基本事件 | basic events in C#
● 定义事件 | Define an event
event   委托类型 | delegate type   事件名称 | event name;
例 | example
delegate void PrintCalcEventHandler (int Op1, int Op2);   //首先声明委托类型 | First, declare a delegate type.
event PrintCalcEventHandler PrintCalcEvent;   //基于委托类型定义事件 | Define an event based on a delegate type.
● 为事件注册侦听函数(类似多播委托) | register listening functions to an event (similar to multi-cast delegate)
事件名称 | event name += new 委托类型 | delegate (可委托函数名称 | valid function name);
事件名称 | event name += 可委托函数名称 | valid function name;
例 | example
delegate void PrintCalcEventHandler (int Op1, int Op2);
event PrintCalcEventHandler PrintCalcEvent;

PrintCalcEvent += new PrintCalcResult(PrnAdd);   //用new来初始化委托变量 | Initialize delegate variables with new()
PrintCalcEvent += PrnSub;
void PrnAdd(int Op1, int Op2)
  { print($”{Op1}+{Op2}={Op1+Op2}”); }
void PrnSub(int Op2, int Op2)
  { print($”{Op1}-{Op2}={Op1-Op2}”); }
● 触发事件 | trigger an Event
事件名称 | event name ( 参数列表 | parameter list );
事件名称 | event name .Invoke( 参数列表 | parameter list );
例1 | example1
PrintCalcEvent(5,3);
例2 | example2
PrintCalcEvent.Invoke(5,3);
.NET中的事件 | events in .NET
using System;
using UnityEngine;

public class EventExample : MonoBehaviour
{
    //创建所需实例
    public LoadLevel loadLevel = new LoadLevel();
    public PlayMusic playMusic = new PlayMusic();
    public PlayAni playAni = new PlayAni();

    void Start()
    {
        loadLevel.LevelLoaded += playMusic.OnLevelLoaded;  //绑定侦听函数1
        loadLevel.LevelLoaded += playAni.OnLevelLoaded;    //绑定侦听函数2
        loadLevel.BeginLoadLevel(new Level{LevelName="Level One"});
    }
}

//用作示例的实例,仅包含一个关卡名称的属性
public class Level {
    public string LevelName {get;set;}
}

//用作实例的关卡载入参数,传递内容为载入的那个关卡,根据.NET规范应派生自EventArgs
public class LoadLevelArgs : EventArgs {
    public Level levelLoaded {get;set;}
}

//示例事件订阅者1,包含一个侦听函数,在关卡载入后播放音乐(文字表示)
public class PlayMusic {
    public void OnLevelLoaded(object source, LoadLevelArgs args) {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Music for " + args.levelLoaded.LevelName);
    }
}

//示例订阅者1,包含一个侦听函数,在关卡载入后播放动画(文字表示)
public class PlayAni {
    public void OnLevelLoaded(object source, LoadLevelArgs args) {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Animation for " + args.levelLoaded.LevelName);
    }
}

//示例事件发布者
public class LoadLevel
{
    //根据.NET规范,用于事件的代理一般用Handler结尾
    //根据.NET规范,,签名中包含两个参数,自身作为第一个参数,第二个则是EventArgs或其派生类实例
    public delegate void LevelLoadedHandler(object source, LoadLevelArgs args);
    public event LevelLoadedHandler LevelLoaded;
    //根据.NET规范,以上两句可被合并简写为:public EventHandler<LoadLevelArgs> LevelLoaded;

    public Level level;

    public void BeginLoadLevel(Level levelToLoad) {
        level = levelToLoad;
        MonoBehaviour.print("Loading Level...");
        /* 在这里完成载入的具体过程 */
        MonoBehaviour.print("Level Loaded.");
        OnLevelLoaded();    //在条件满足时执行触发事件的函数
    }

    public void OnLevelLoaded()  {  //执行事件的函数一般以On开头
        if (LevelLoaded != null)    //执行事件,调用所有已注册的侦听函数
            LevelLoaded.Invoke(this, new LoadLevelArgs() {levelLoaded = level});
    }
}
不带参数的Unity事件 | Unity events without parameters
//此范例演示不带参数的Unity事件
using System;
using UnityEngine;
using UnityEngine.Events;    //应用Unity事件相关的名称空间

public class EventExample : MonoBehaviour
{
    //创建所需实例
    public LoadLevel loadLevel = new LoadLevel();
    public PlayMusic playMusic = new PlayMusic();
    public PlayAni playAni = new PlayAni();

    void Start()
    {
        loadLevel.LevelLoaded.AddListener(playMusic.OnLevelLoaded);  //绑定侦听函数1
        loadLevel.LevelLoaded.AddListener(playAni.OnLevelLoaded);    //绑定侦听函数2
        loadLevel.BeginLoadLevel(new Level{LevelName="Level One"});
    }
}

//用作示例的实例,仅包含一个关卡名称的属性
public class Level {
    public string LevelName {get;set;}
}

//示例事件订阅者1,包含一个侦听函数,在关卡载入后播放音乐(文字表示)
public class PlayMusic {
    public void OnLevelLoaded() {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Music");
    }
}

//示例事件订阅者2,包含一个侦听函数,在关卡载入后播放动画(文字表示)
public class PlayAni {
    public void OnLevelLoaded() {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Animation");
    }
}

//示例事件发布者
public class LoadLevel
{
    //创建不带参数的UnityEvent实例
    public UnityEvent LevelLoaded = new UnityEvent();

    public Level level;

    public void BeginLoadLevel(Level levelToLoad) {
        level = levelToLoad;
        MonoBehaviour.print("Loading Level...");
        /* 在这里完成载入的具体过程 */
        MonoBehaviour.print("Level Loaded.");
        OnLevelLoaded();    //在条件满足时执行触发事件的函数
    }

    public void OnLevelLoaded()    {//运行事件的函数一般以On开头
        if (LevelLoaded != null)    //使用Invoke运行Unity事件,调用所有已注册的侦听函数
            LevelLoaded.Invoke();
    }
}
带一个参数的Unity事件 | Unity events with one parameters
//此范例演示带一个参数的Unity事件
using System;
using UnityEngine;
using UnityEngine.Events;

public class EventExample : MonoBehaviour
{
    //创建所需实例
    public LoadLevel loadLevel = new LoadLevel();
    public PlayMusic playMusic = new PlayMusic();
    public PlayAni playAni = new PlayAni();

    void Start()
    {
        loadLevel.LevelLoaded.AddListener(playMusic.OnLevelLoaded);  //绑定侦听函数1
        loadLevel.LevelLoaded.AddListener(playAni.OnLevelLoaded);    //绑定侦听函数2
        loadLevel.BeginLoadLevel(new Level{LevelName="Level One"});
    }
}

//用作示例的实例,仅包含一个关卡名称的属性
public class Level {
    public string LevelName {get;set;}
}

//示例事件订阅者1,包含一个侦听函数,在关卡载入后播放音乐(文字表示)
public class PlayMusic {
    public void OnLevelLoaded(Level levelLoaded) {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Music for " + levelLoaded.LevelName);
    }
}

//示例订阅者2,包含一个侦听函数,在关卡载入后播放动画(文字表示)
public class PlayAni {
    public void OnLevelLoaded(Level levelLoaded) {   //侦听函数一般以On开头
        MonoBehaviour.print("Play Animation for " + levelLoaded.LevelName);
    }
}

[System.Serializble]   //添加该特性能够使Unity Event出现在Inspector面板上
//示例事件发布者
public class LoadLevel
{
    //创建带1个参数的UnityEvent实例
    public UnityEvent<Level> LevelLoaded = new UnityEvent<Level>();

    public Level level;

    public void BeginLoadLevel(Level levelToLoad) {
        level = levelToLoad;
        MonoBehaviour.print("Loading Level...");
        /* 在这里完成载入的具体过程 */
        MonoBehaviour.print("Level Loaded.");
        OnLevelLoaded();    //在条件满足时执行触发事件的函数
    }

    public void OnLevelLoaded()    {//运行事件的函数一般以On开头
        if (LevelLoaded != null)    //使用Invoke运行Unity事件,调用所有已注册的侦听函数
            LevelLoaded.Invoke(level);
    }
}
Unity代码执行顺序 | order of execution for event functions
在Visual Studio中对脚本代码进行纠错 | script debugging in Visual Studio
结构化异常处理 | structured exception handling
待补充 | To be added
数组列表 | array list
● 数组列表与泛型列表类似,但可以存放不同类型的变量 | An array list is similar to a generic list, but it may contain variables of different types.
● 数组列表的基本用法与泛型列表类似 | The basic usage of an array list is similar to that of a generic list.
● 数组列表中元素以system.object类型存放,一般需进行类型比较与转换后才进行使用 | The type of all elements in an array list is system.object. Usually they must be compared and converted before using.
● 数组列表排序 | sort an Array List
public interface hasAge {float age{get;set;}}
public interface hasName {string name{get;set;}}

public class student: hasAge, hasName {
    public string name{get;set;}
    public float age {get;set;}
    public float score;
    public student(string nameIn, float ageIn, float scoreIn)
        {name=nameIn; age=ageIn; score=scoreIn;}
}

public class teacher:hasAge, hasName {
    public string name{get;set;}
    public float age{get;set;}
    public decimal salary;
    public teacher(string nameIn, float ageIn, decimal salaryIn)
        {name=nameIn; age=ageIn; salary=salaryIn;}
}

ArrayList myArraylist = new ArrayList();

void Start()
{
    myArraylist.Add(new student("Tom",25,90));
    myArraylist.Add(new student("Jerry",18,85));
    myArraylist.Add(new teacher("Mary",38,5000));
    myArraylist.Add(new teacher("Susan",31,2000));
    myArraylist.Sort(CompAge.CompAgeInstance);
    foreach(var itr in myArraylist)
        print(((hasName)itr).name + ": " + ((hasAge)itr).age);
}

class CompAge: IComparer
{
    static public CompAge CompAgeInstance = new CompAge();
    public int Compare(object opA, object opB)
    {
        if(opA is hasAge && opB is hasAge)
            return Mathf.FloorToInt(((hasAge)opA).age -((hasAge)opB).age);
        else
            throw(new System.Exception("Type mismatch."));
    }
}
泛型集合之字典 | dictionary as a generic collection
● 定义字典 | define a dictionay
Dictionary <键变量类型 | key variable type , 值变量类型 | value variable type>    字典变量名称 | name of the dictionary variable ;
● 初始化字典 | initialize a dictionay
字典变量 | dictionary variable = new Dictionary <键类型 | key type , 值类型 | value type>();
● 添加字典元素 | add a dictionay element
字典变量 | dictionary variable . Add ( 键 | key , 值 | value );
● 访问字典元素 | access a dictionay element
字典变量 | dictionary variable . ContainsKey ( 键 | key )    //判断字典中是否包含特定键 | checks whether the dictionary contains a key
字典变量 | dictionary variable [ 键 | key ]    //返回键对应的值 | returns the value of the key
字典变量 | dictionary variable . ElementAt ( 序号 | index ) . Key    //获取指定位置元素的键 | returns the key of the element at the index
字典变量 | dictionary variable . ElementAt ( 序号 | index ) . Value    //获取指定位置元素的值 | returns the value of the element at the index
● 删除字典元素 | delete a dictionay element
字典变量 | dictionary variable . Remove ( 键 | key );    //当通过键删除键值对 | deletes a key-value pair using a key
字典变量 | dictionary variable . Clear( );    //清空所有字典元素 | removes all dictionary elements
//以字符串为“键”,以(浮点数,浮点数)元组为“值”的字典 | A dictionary using string as "key" and a (float,float) tuple as "value".
Dictionary<string,(float,float)> myDict = new Dictionary<string,(float,float)>();

void Start() {
    myDict.Add("Beijing",(116.42f,39.917f));
    myDict.Add("Shanghai",(121.433f,34.5f));
    myDict.Add("Guangzhou",(113.233f,23.167f));
    print(myDict["Beijing"]);   //通过“键”访问“值”| Access a "value" via a "key"
    
    //在循环中访问字典的“键”与“值”| Access "key"s and "value"s of a dictionary in a foreach loop
    foreach(var itr in myDict)
        print(itr.Key+": "+itr.Value);
}
对象的转换 | conversion of objects
● 隐式转换 | implicit conversion
对象A | object A = 对象B | object B;
例 | example
objA = objB;
public class CollegeStudent {
    public string Name;
    public int Grade;
    
    //以下为隐式转换的实现,必须放在这个类中实现 | Implicit type conversion below, must be implemented inside this class.
    public static implicit operator CollegeStudent(Child ChildIn) {  //参数值须为本类类型 | Parameter shall be of this class type.
        CollegeStudent stu = new CollegeStudent();
        stu.Name = ChildIn.Name;
        stu.Grade = ChildIn.age-17;
        return stu;   //返回值须为目标类型 | Return type must be the target type.
    }
}

public class Child  {
    public string Name, FatherName, MotherName;
    public int age;
}

void Start() {
    Child Child1 = new Child();
    Child1.Name="Tom";
    Child1.FatherName="Jack";
    Child1.MotherName="Mary";
    Child1.age=19;
    CollegeStudent Student1 = Child1;   //使用隐式类型转换 | Use implicit type conversion.
    print($"Name:{Student1.Name}, Grade:{Student1.Grade}.");
}
● 显式转换 | explicit conversion
对象A | object A = ( 对象A的类型 | class of object A ) 对象B | object B;
例 | example
objA = (ClassA) objB;
public class CollegeStudent {
    public string Name;
    public int Grade;
    
    //以下为显式转换的实现,必须放在这个类中实现 | Explicit type conversion below, must be implemented inside this class.
    public static explicit operator CollegeStudent(Child ChildIn) {  //参数值须为本类类型 | Parameter shall be of this class type.
        CollegeStudent stu = new CollegeStudent();
        stu.Name = ChildIn.Name;
        stu.Grade = ChildIn.age-17;
        return stu;   //返回值须为目标类型 | Return type must be the target type.
    }
}

public class Child  {
    public string Name, FatherName, MotherName;
    public int age;
}

void Start() {
    Child Child1 = new Child();
    Child1.Name="Tom";
    Child1.FatherName="Jack";
    Child1.MotherName="Mary";
    Child1.age=19;
    CollegeStudent Student1 = (CollegeStudent)Child1;   //使用显式类型转换 | Use explicit type conversion.
}
对象的复制 | copying objects
● 变量赋值 | variable assignment
public class University {
    public string Name, Location;
    public University(string NameIn,string LocationIn) {
        Name=NameIn; Location=LocationIn;
    }
}

public class Student {
    public string Name;
    public int Age;
    public University University;
    public Student(string NameIn, int AgeIn, University UniversityIn) {
        Name=NameIn;
        Age=AgeIn;
        University = UniversityIn;
    }
}

void Start() {
    Student student1 = new Student("Tom",20,new University("Tongji","Shanghai")), student2=student1;
    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
    
    //对于student2重新赋值,结果student1也受到影响 | Reassign values to student2, and student1 is also affected.
    student2.Name = "Jack"; student2.Age=30;
    student2.University.Name="Fudan";
    student2.University.Location="Shanghai";
    
    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
}
● 浅度复制 | shallow copy
public class University { //类定义代码 | class definition }

public class Student {
    public string Name;
    public int Age;
    public University University;
    public Student(string NameIn, int AgeIn, University UniversityIn) {
        Name=NameIn;
        Age=AgeIn;
        University = UniversityIn;
    }
    public Student GetCopy() {
        return (Student) MemberwiseClone();   //进行浅度复制 | Perform shallow copy
    }
}

void Start() {
    Student student1 = new Student("Tom",20,new University("Tongji","Shanghai"));
    student2 = student1.GetCopy();   //使用GetCopy()获得浅度复制的实例 | Get a shallow copy using the GetCopy method.
    //在此情况下,值类型字段Name和Age各不相关,引用类型字段University仍指向同一地址 |
    //Value type fields Name and Age are no longer related while reference type field University still share memory address.
    student2.Name = "Jack";
    student2.Age = 30;
    student2.University.Name = "Fudan";
    student2.University.Location = "Shanghai";

    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
    print($"Name:{student2.Name}, Age:{student2.Age}, University:{student2.University.Name}@{student2.University.Location}");
}
● 深度复制 | deep copy
public class University { //类定义代码 | class definition }

public class Student : ICloneable {   //继承ICloneable接口 | Inherit ICloneable interface
    public string Name;
    public int Age;
    public University University;
    public Student(string NameIn, int AgeIn, University UniversityIn) {
        Name=NameIn;
        Age=AgeIn;
        University = UniversityIn;
    }
    public object Clone() {
        Student newStudent = (Student) MemberwiseClone();
        newStudent.University = new University(University.Name,University.Location);
        return newStudent;
    }
}

void Start() {
    Student student1 = new Student("Tom",20,new University("Tongji","Shanghai"));
    student2= (Student)student1.Clone( );   //使用Clone( )获得深度复制的实例 | Get a deep copy using the Clone method.
    //在此情况下,所有字段均独立 | In this case, all the fields are independent.
    student2.Name = "Jack";
    student2.Age=30;
    student2.University.Name="Fudan";
    student2.University.Location="Shanghai";
    
    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
    print($"Name:{student2.Name}, Age:{student2.Age}, University:{student2.University.Name}@{student2.University.Location}");
}
初始化器 | initializer
● 在没有构造函数时用初始化器可快速实例化和初始化对象 | An initializer may instantiate and initialize an object without a constructor.
new 变量类型 | variable type ( ) { 成员 | member = 值 | value , 成员 | member = 值 | value , …}
public class University {
    public string Name, Location;
}

public class Student {
    public string Name;
    public int Age;
    public University University;
}

void Start() {
    //下行嵌套使用了两次初始化器,分别初始化了新建的Student及University实例 |
    //The following line used 2 embedded initializers to initialize newly created Student and University instances.
    Student student1 = new Student(){Name="Tom", Age=20, University=new University(){Name="Tongji", Location="Shanghai"}};
    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
}
● 数组和列表都可使用初始化器 | You may also use initializer with arrays and lists.
例1 | example1
int[] A = new int[]{1,2,3};
例2 | example2
List A = new List{1,2,3};
● 初始化器运行于构造函数之后,所以可能影响构造函数运行结果 | Initializers run after constructors and may change the results of constructors.
public class University {
    public string Name, Location;
}

public class Student {
    public string Name;
    public int Age;
    public University University;
    //两个参数的构造函数,默认赋值University字段 | Constructor with 2 parameters, assigning default value to the University field
    public Student (string NameIn, int AgeIn) {
        Name = NameIn;
        Age = AgeIn;
        University = new University ( ) {Name="Tongji", Location="Shanghai"};
    }
}

void Start() {
    //指定使用两个参数的构造函数,重新给Name和University字段赋值将覆盖构造函数赋值 |
    //Specify to use the constructor with 2 parameters, then reassign values to the Name and University fields
    Student student1 = new Student("Tom",20) {Name="Jack", University=new University(){Name="Fudan", Location="Shanghai"}};
    print($"Name:{student1.Name}, Age:{student1.Age}, University:{student1.University.Name}@{student1.University.Location}");
}
匿名类 | anonymous class
● 创建匿名类实例 | create an instance from an anonymous class
var 实例名 | instance name = { 属性名称 | Property Name = 值 | value , 属性名称 | Property Name = 值 | value , …};
例 | example
//创建匿名类的实例,含两个属性 | Create an instance of an anonymous class with 2 parameters
//匿名类无法再次实例化 | An anonymous class cannot be instantiated again.
var student = new {Name=”Tom”, Age=20, Score=90.5f};
print(student.Name+”\t”+student.Age+”\t”+student.Score);
//student.Name=”Jack”;   //匿名类属性均为只读,不可赋值 | All properties in an anonymous class instance are read-only
匿名方法与Lamda表达式 | anonymous method and Lamda expressions
● 可以使用Lamda表达式创建匿名方法 | You may create anonymous methods with Lamda expressions.
● 因匿名方法不可通过名称调用,所以主要被用于代理 | Anonymous methods can’t be called with names, so they are usually used with delegates.
● Lamda表达式的定义 | definition of a Lamda expression
( 参数列表 | parameter list ) => { 代码块 | statement block }
例 | example
delegate float SizeDele (float w, float h);
void Start() {
  //将匿名方法定义为代理 | Assign the anonymous method to the delegate.
  SizeDele CalcRS = (float w,float h) => {float s = w * h; print(“Size: “+s); return s;};
  float RectSize = CalcRS(3,5);   //通过代理调用匿名方法 | Call the anonymous method using the delegate.
}
● 仅含一条命令或只返回一个表达式的Lamda表达式可以简化 | Lamda expression may be simplified if there is only one statement or expression.
( 参数列表 | parameter list ) => 指令或表达式 | statement or expression
例 | example
delegate float SizeDele (float w, float h);
void Start() {
  SizeDele CalcRS = (float w, float h) => w * h;   //Lamda表达式 | Lamda expression
  float RectSize = CalcRS(3,5);
  print(“Size: ” + RectSize);
}
● 若参数类型可以推断则可省略参数类型 | When the types of the parameters can be inferred, their types can be omitted.
( 参数 | parameter , 参数 | parameter , … ) => 指令或表达式 | statement or expression
例 | example
delegate float SizeDele (float w, float h);
void Start() {
  SizeDele CalcRS = (w,h) => w * h;   //Lamda表达式 | Lamda expression
  float RectSize = CalcRS(3,5);
  print(“Size: ” + RectSize);
}
● 当没有参数时可用空括号表示 | Use a pair of empty brackets when there is no parameter.
( ) => 指令或表达式 | statement or expression
例 | example
delegate void PrintWarningDele( );
void Start() {
  PrintWarningDele prnWarn = () => print(“Warning”);   //Lamda表达式 | Lamda expression
  prnWarn();
}
● 当仅有一个参数时参数列表的括号可省略 | Brackets can be omitted if there is only one parameter.
参数 | parameter => 指令或表达式 | statement or expression
例 | example
delegate float SizeDele (float r);
void Start() {
  SizeDele CalcRS = r => Mathf.PI*r*r;   //Lamda表达式 | Lamda expression
  print(“Size: ” + CalcRS(2));
}
● 若Lamda表达式无返回值,可使用C#自带的Action代理简化代理变量的定义 |
    If a Lamda expression has no return value, you may use the Action delegate of C# to simplify the definition of delegate variables.
Action < 参数1类型 | type of parameter1 , 参数2类型 | type of parameter2 , … > = Lamda表达式 | Lamda expression ;
例 | example
void Start() {
  Action PrintRS = r => print(“Size: ” + Mathf.PI*r*r);
  PrintRS(2);
}
● 若Lamda表达式有返回值,可使用C#自带的Func代理简化代理变量的定义 |
    If a Lamda expression has a return value, you may use the Func delegate of C# to simplify the definition of delegate variables.
Func < 参数1类型 | type of parameter1 , 参数2类型 | type of parameter2 , … , 输出类型 | output type > = Lamda表达式 | Lamda expression ;
例 | example
public Button myButton;
void Start() {
  //使用Lamda表达式定义按钮的onClick事件 | Use Lamda expression to define a button’s onClick event.
  myButton.onClick.AddListener( ( ) => print(“Button is clicked!”));
}
● 在Unity中一个使用Lamda表达式的典型例子是UGUI按钮的onClick事件 |
    In unity, a typical usage of Lamda expression is the onClick event of a UGUI button.
特性 | attributes
● 使用特性 | use attributes
[ 属性 | attribute ]   //使用单个属性 | use a single attribute
例 | example
[Serializable]   //这是装饰Student类的特性 | This is an attribute that decorates the Student class.
public class Student {
  [HideInInspector]   //这是装饰Name字段的特性 | This is an attribute that decorates the Name field.
  string Name;
  float Score;
}
[ 属性 | attribute ( 参数1 | parameter1 , 参数2 | parameter2 , … ) ]    //使用带参数属性 | use an attribute with parameters
例 | example
[Header(“MonsterName”)]
public string Name_M;
[ 属性1 | attribute1 ] [ 属性2 | attribute2 , … ]    //使用多个属性 | use multiple attributes
例 | example
[Serializable][HideInInspector]
public class student {…}
[ 属性1 | attribute1 , 属性2 | attribute2 , … ]    //使用多个属性 | use multiple attributes
例 | example
[Serializable,HideInInspector]
public class student {…}
● 创建自定义特性 | create an custom attribute
[ AttributeUsage ( AttributeTargets.目标 | target | AttributeTargets.目标 | target | … , AllowMultiple = 布尔值 | boolean value) ]
可访问性 | accessibility class 名称 | name : Attribute { 特性内容 | attribute content }
例 | example
//指定特性可用于修饰类或方法 | Specify the possible targets of attributes
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method), AllowMultiple]
public class MyTestAttribute:Attribute{ }    //定义一个无内容的简单特性 | Define a simple attribute with no content.
● 获取附加到类上的特性 | get attributes attached to a class
类 | class . GetCustomAttributes ( 布尔值 | bool value )    //布尔值表示是否取基类特性 | Use the bool value to acquire base class attributes.
例 | example
public class testAtt1:Attribute { }
public class testAtt2:Attribute { }

[testAtt1,testAtt2]
public class testClass { }

void Start() {
  //获取所有testClass类上添加的属性至attArray数组 | Get all attributes from the testClass and put them in attArray
  object[ ] attArray = typeof(testClass).GetCustomAttributes(false);
}
[AttributeUsage(AttributeTargets.Class,AllowMultiple = true)]
public class lvPLUS : Attribute { }   //定义可被多次添加的特性 | Define attributes that may be added for multiple times

[AttributeUsage(AttributeTargets.Class,AllowMultiple = true)]
public class lvMINUS : Attribute { }   //定义可被多次添加的特性 | Define attributes that may be added for multiple times

public class Enemy {
    public int attack = 100;
    public Enemy() {
        //根据所赋的特性增减攻击力 | Change attack value according to the attached attributes
        foreach (var itr in this.GetType().GetCustomAttributes(false)) {
            if(itr is lvPLUS) attack += 10;
            if(itr is lvMINUS) attack -= 10;
        }
    }
}

[lvMINUS][lvMINUS]   //使用特性修饰派生类 | Decorate the derived class with attribute
public class SkeletonKnight:Enemy { }

[lvPLUS][lvPLUS]   //使用特性修饰派生类 | Decorate the derived class with attribute
public class Dragon:Enemy { }

void Start( ) {
    SkeletonKnight enemy1 = new SkeletonKnight();
    Dragon enemy2 = new Dragon();
    print("SkeletonKnight:" + enemy1.attack);
    print("Dragon:" + enemy2.attack);
}
● 给自定义特性添加属性和构造函数 | Add properties and constructor to the custom attribute
可访问性 | accessibility class 名称 | name : Attribute {
  public 名称 | name ( 参数列表 | parameter list ) { 构造函数体 | body of the constructor }
  public 类型 | type 属性1 | Property1 {get; set;}
  public 类型 | type 属性2 | Property2 {get; set;}
  …
}
public class MyTestAttribute : Attribute {
    public MyTestAttribute (int TestValue) {   //特性的构造函数 | the constructor of the attribute 
        testValue = TestValue;
    }
    public string testString {get; set;}   //特性的属性 | a property of the attribute
    public int testValue {get; private set;}   //特性的属性 | a property of the attribute
}
...
[MyTest(1000,testString = "This is a test")]
public class myClass { }
...
object[] customAtts = myClass.GetCustomAttributes(true);
foreach (object tmp in customAtts) {
    if (tmp is MyTestAttribute) {
        print(((MyTestAttribute)tmp).testString);   //强制类型转换后取值 | get value after explicit type conversion
        print(((MyTestAttribute)tmp).testValue);   //强制类型转换后取值 | get value after explicit type conversion
    }
}
OOP设计原则 | OOP design principles
原则 | Principle 描述 | Description
原则1:单一职责原则 | Principle 1: SRP, Single Responsibility Principle
1. 当设计封装一个类时,该类应该只负责一件事 | When design and encapsulate a class, it shall be responsible for a single task.
原则2:开-闭原则 | Principle 2: Open-Closed Principle
1. 对扩展开放,对修改关闭:实现功能的类应能方便增加功能,但除非修正错误不应随便修改 | Open To extension and closed to modification: a class used for certain functions shall be easy to extend its functionality, while it shall not be modified unless there is a bug in it.
2. 实现开闭原则的方法是把功能定义抽象为接口,而把功能实现下放到派生类,通过增加新派生类而非修改原本的类来实现功能扩展 | To follow this principle, define functions as interfaces and implement them in derived classes. You may extend functions by add new derived classes without modifying the original ones.
原则3:里氏替换原则 | Principle 3: Liskov Substitution Principle
1. 派生类必须能够替换基类 | A derived class must be able to substitute its base class
2. 客户端应通过基类完成访问,不应要求强制类型转换为子类,也不需关心由哪个子类实现 | A client shall access via base class without converting it explicitly to a derived class. It shall neither care about which derived class is used to perform the functions.
3. 李氏替换原则为开闭原则提供了实现方法 | Liskov substitution principle provides a method to follow the open-closed principle.
原则4:依赖倒置原则 | Principle 4: DIP, Dependence Inversion Principle
1. 高层模块不应该依赖底层模块,它们都应该依赖于抽象概念 | A high-level module shall not depend on low-level ones. They shall both depend on abstract concepts.
2. 抽象接口不应依赖于实现,而实现应当依赖于抽象接口 | Abstract interfaces shall not depend on implementation, while implementation shall rely on abstract interfaces.
原则5:接口隔离原则 | Principle 5: Interface Segregation Principle
1. 客户端不应被强迫使用它们用不到的接口方法 | A client shall not be forced to use interface methods that they do not have to.
2. 尽量将臃肿庞大的接口拆分成更小的和更具体的接口,让接口中只包含客户端感兴趣的方法 | Try to dissemble large and complex interfaces into smaller and less abstract ones which contains only functions interest the clients.
原则6:最少知识原则 | Principle 6: Least Knowledge Principle
1. 一个类越少用到其它类提供的功能越好 | The less a class uses functions in another class, the better the result will be.
2. 最少知识原则能够有效帮助松耦合的实现 | The least knowledge helps to actualize loose coupling.
原则7:少用继承多用组合原则 | Principle 7: Less Inheritance, More Composition
1. 通过继承而来的很多方法很可能对于客户端是无用的,增加了客户端使用该类的难度和复杂性 | Many methods inherited from base classes or interfaces are not needed by the client. They make the client more difficult to use the class.
2. 解决的办法是,把相关的类作为成员组合到一个新的类中以实现其功能 | The Solution is to add relevant classes as members of a new class to implement the functions it needs.
常见OOP设计模式 | common OOP design patterns
类别 | Category 设计模式 | Design Pattern 描述 | Description
创建型模式 |
Creational Patterns
简单工厂 | Simple Factory
一个工厂类根据传入的参量决定创建出那一种产品类的实例 | A factory class creates instances of a product class based on incoming parameters.
工厂方法 | Factory Method
定义一个创建对象的接口,让子类决定实例化那个类 | Define an interface for creating objects and let child classes decide which class to instantiate.
抽象工厂 | Abstract Factory
创建相关或依赖对象的家族,而无需明确指定具体类 | Create families of related or dependent objects without explicitly specifying a specific class.
建造者模式 | Builder
封装一个复杂对象的构建过程,并可以按步骤构造 | Encapsulates the construction process of a complex object and can construct step-by-step.
单例模式 | Singleton
某个类只能有一个实例,提供一个全局的访问点 | There can only be one instance of a class, providing a global access point.
原型模式 | Prototype
通过复制现有的实例来创建新的实例 | Create a new instance by copying an existing instance.
结构型模式 |
Structrual Patterns
外观模式 | Facade
对外提供一个统一的方法,来访问子系统中的一群接口 | Provide a unified method externally to access a group of interfaces in a subsystem.
桥接模式 | Bridge
将抽象部分和它的实现部分分离,使它们都可以独立变化 | Separate abstract parts from implementation parts so that they can both change independently.
组合模式 | Composite
将对象组合成树形结构以表示“”部分-整体“”的层次结构 | Combine objects into a tree structure to represent a "part-whole" hierarchy.
装饰模式 | Decorator
动态地给对象添加新的功能 | Dynamically add new functionality to an object.
代理模式 | Proxy
为其他对象提供一个代理以便控制这个对象的访问 | Provide a proxy for other objects in order to control access to this object.
适配器模式 | Adapter
将一个类的方法接口转换成客户希望的另外一个接口 | Convert the method interface of a class to another interface required by the client.
亨元模式 | Flyweight
通过共享技术来有效地支持大量细粒度的对象 | Efficiently support a large number of fine-grained objects through sharing techniques.
行为型模式 |
Behavioral Patterns
模板模式 | Template Method
定义一个算法结构,而将一些步骤延迟到子类实现 | Define an algorithmic structure while deferring some implementation steps to child class.
解释器模式 | Interpreter
给定一个语言,定义它的文法的一种表示,并定义一个解释器 | Given a language, define one representation of its grammar and define an interpreter.
策略模式 | Strategy
定义一系列算法,把他们封装起来,并且使它们可以相互替换 | Define a set of algorithms, encapsulate them, and make them interchangeable
状态模式 | State
允许一个对象在其对象内部状态改变时改变它的行为 | Allow an object to change its behavior when its internal state changes.
观察者模式 | Observer
对象间的一对多的依赖关系 | one-to-many dependencies between objects
备忘录模式 | Memento
在不破坏封装的前提下,保持对象的内部状态 | Maintain the internal state of an object without breaking encapsulation.
中介者模式 | Mediator
用一个中介对象来封装一系列的对象交互 | Encapsulate a series of object interactions with a mediator object.
命令模式 | Command
将命令请求封装为一个对象,使得可以用不同的请求来进行参数化 | Encapsulate a command request as an object to make it possible to parameterize it with different requests.
访问者模式 | Visitor
在不改变数据结构的前提下,增加作用于一组对象元素的新功能 | Add new functionality that acts on a set of object elements without changing the data structure.
责任链模式 | Chain of Responsibility
将请求的发送者和接收者解耦,使得多个对象都有处理这个请求的机会 | Decouple the sender and receiver of a request so that multiple objects have the opportunity to process the request.
迭代器模式 | Iterator
一种遍历访问聚合对象中各个元素的方法,不暴露该对象的内部结构 | A method of traversing the elements of an aggregated object without exposing the internal structure of it.
第三方素材来源 | sources of 3rd-party content
游戏设计理论参考书目 | reference books on game design theories
《设计模式与游戏完美开发》 | Design Patterns in Game Development
蔡升达著,清华大学出版社,2017年1月第一版,ISBN:9787302455981 |
by ShengDa Cai, Tsinghua University Press, 1st edition, January 2017
《游戏编程模式》 | Game Programming Patterns
罗伯特·尼斯特罗姆著,人民邮电出版社,2016年9月第一版,ISBN:9787115426888 |
by Robert Nystrom, Posts and Telecom Press, 1st edition, Septembe 2016
设计模式范例:单例模式 | design patterns example: Singleton
● 设计目标 | design target
– 同时只存在一个对象 | Only one instance is allowed simultaneously.
– 提供一个可以便捷访问该对象的方法 | Provide a method to access this instance easily.
● 实现思路 | solution
● 实现代码 | implementation
public class Singleton {
//Name字段中要存放的数据,虽然是public但因为Singleton类不能实例化,因此外部无法直接访问 |
//Name field store the data to keep.  Though public, it can't be directly access externally because you can't initialize the class.
    public string Name;
    private static Singleton _instance;   //在类中实际保存该类实例的静态字段 | The internal static field keeping the instance inside.
    //通过将默认构造函数设为私有禁止类被实例化 | Disable instantiating the class by making its default constructor private.
    private Singleton() { }
    
    public static Singleton Instance {   //供外部便捷访问的静态属性 | Static property for convenient external access.
    get {
        //若内部字段尚为空(如第一次运行时)则初始化它 | Initialize the internal field if it is null (e.g. in the case of first run).
        if (_instance==null)
            {_instance = new Singleton();}
        return _instance;
        }
    }
}

void Start() {
    Singleton.Instance.Name="Hello";
    print(Singleton.Instance.Name);
    //Singleton test = new Singleton();   //此语句会报错,因为Singleton类不可实例化。
}
设计模式范例:状态模式 | design patterns example: State
● 设计目标 | design target
– 让对象行为随内部状态而改变,该对象也像换了类一样 | Make an object’s behavior change with its internal state, as if it’s from another class.
● 实现思路 | approach
● 实现代码 | implementation
//负责状态管理的环境类 | The context class in charge of state management
public class Context {
    State CurrentState;   //此字段记录了当前状态 | This field records the current stage
    public void CurrentStateFunction( ) {   //当前状态下应执行的功能 | Functions to execute on current stage
        CurrentState.Handler( );   //通过当前状态的Handler方法执行功能 | Execute the functions via the Handler() of the current state.
    }
    public void SetState(State StateIn) {   //设置或修改当前State的方法 | Method to set or modify current state.
        CurrentState = StateIn;  //将当前状态修改为参数提供的状态实例 | Turn the current state into the instance from the parameter.
    }
}

//所有具体状态类的基类,定义了具体状态类应该包含的成员结构 | The base class for all classes of concrete states. It defines all the 
public abstract class State {
    //每个State必须知道由哪个Context实例管理 | Each state must be managed by a context instance.
    protected Context _Context=null;
    public State (Context ContextIn) {   //在构建State实例时须指定Context实例 | Must specify a context instance on construction.
        _Context = ContextIn;
    }
    //每个State的抽象功能,待派生具体类重写 | Abstract functions of a state to be overridden in derived classes of concrete states.
    public abstract void Handler( ); 
}

public class StateA : State {   //继承了抽象State类的具体类StateA | Concrete State A deriving from the abstract State class
    public StateA (Context ContextIn): base (ContextIn) { }   //派生类不继承构造函数,必须写明 | Constructors are not inherited.
    public override void Handler( ) {   //重写当前状态下的功能 | Override the functions of the current state.
        if(Input.GetKeyDown(KeyCode.Alpha2)) {   //在StateA状态下可按2跳至StateB | In StateA, you may press 2 to jump to StateB.
            Debug.Log("From StateA to StateB.");
            _Context.SetState(new StateB(_Context));   //跳转到下一个状态的语句 | Statement used to jump to the next state.
        }
    }
}

public class StateB : State {   //继承了抽象State类的具体类StateB | Concrete State B deriving from the abstract State class
    public StateB (Context ContextIn): base (ContextIn) { }
    public override void Handler( ) {
        if(Input.GetKeyDown(KeyCode.Alpha3)) {
            Debug.Log("From StateB to StateC.");
            _Context.SetState(new StateC(_Context));
        }
    }
}

public class StateC : State {   //继承了抽象State类的具体类StateC | Concrete State C deriving from the abstract State class
    public StateC (Context ContextIn): base (ContextIn) { }
    public override void Handler( ) {
        if(Input.GetKeyDown(KeyCode.Alpha1)) {
            Debug.Log("From StateC to StateA.");
            _Context.SetState(new StateA(_Context));
        }
    }
}

//客户端代码 | Client Code
public class test : MonoBehaviour
{
    //此Context类型的字段实例用于管理当前状态并实现状态跳转 |
    //The instance of this field whose type is Context is meant to manage the current state and switch between states.
    Context testContext=new Context( );

    void Start( ) {
        //创建一个StateA的实例,并指明其由testContext这个实例管理 |
        //Create an instance of StateA and specify that it is managed by the testContext instance.
        State TempState = new StateA(testContext);
        //通过调用testContext实例的SetState方法将刚创建的TempState设置为当前状态 |
        //Use the SetState( ) method of the testContext instance to set the current state to TempState.
        testContext.SetState(TempState);
    }
    void Update( ) {
        //在每一帧调用testContext实例的CurrentStateFunction方法,实质上执行的是在各实际状态类中定义的功能 |
        //Call the CurrentStateFunction( ) of the testContext instance and actually execute functions defined in the concrete states.
        testContext.CurrentStateFunction( );
    }
}
实时渲染流程 | the process of real-time rendering
Unity中的着色器类型 | types of shaders in Unity
着色器类型 | shader type 描述 | Description
表面着色器 | surface shaders
1. 表面着色器是Unity提供的简化着色器,用户仅需指定若干通道内容,其余代码将由Unity自动生成 | This is the simplified shader offered by unity. A user just needs to specify the content of several channels, while Unity will generate other codes automatically.
2. 表面着色器与标准着色器原理相同,在后台依旧会被转换为顶点/片元着色器 | Surface shaders are similar to the standard shader in principle. They will be converted to vertex/fragment shaders behind the stage.
3. 表面着色器的缺点在于因其固有结构复杂,渲染效率很难优化到最佳状态 | The disadvantage of surface shaders is that it's difficult to optimize its performance due to its intrinsic structural complexity.
顶点/片元着色器 | vertex/fragment shaders
1. 顶点/片元着色器是结构上最接近实际渲染管线的着色器,也是最强大、多变的着色器 | Vertex/fragment shaders are the shaders closest to the actual rendering pipeline in structure. They are also the most powerful and versatile shaders.
2. 顶点/片元着色器主要采用Cg/HLSL语言编写,也可使用GLSL语言编写(但将局限可用目标设备) |Vertex/fragment shaders are coded with Cg/HLSL. They may also be coded with GLSL, but the target platforms will be limited.
固定函数着色器 | fixed function shaders
1. 固定函数着色器是一种出于兼容性考虑而保留的过时的着色器,它在后台仍会被自动转换为顶点/片元着色器 | Fixed function shaders are obsolete shaders kept for compatibility. They are converted to Vertex/fragment shaders automatically behind the stage.
2. 除非目标平台非常老旧,不建议使用 | Avoid this shader unless the target platform is very old.
图像效果着色器(后处理) | image effect shaders (post-processing)
1. 图像效果着色器主要是用于实现后处理效果的着色器 | Image effect shaders are often used for post-processing effects.
2. 图像效果着色器本质依旧是顶点/片元着色器,其重点在于片元着色器部分 | Image effect shaders are essentially vertex/fragment shaders as well, whose emphasis is place on the fragment shader part.
计算着色器 | compute shaders
1. 计算着色器是一类特殊的着色器,其目的不是渲染而是利用GPU进行通用目的运算 | Compute shaders belong to a special type, whose purpose is not rendering, but rather computation using the processing power of GPUs.
2. 考虑到其特殊性,该着色器不在本课程介绍 | Compute Shaders will not be introduce in this course due to its particularity.
消融着色器工程文件 | project files of the dissolve shader
传送门着色器工程文件 | project files of the teleport portal shader
着色器开发参考书目 | reference books for shader development
《Unity Shader入门精要》 | The Essentials of Unity Shader
冯乐乐著,人民邮电出版社,2016年5月第一版,ISBN:9787115423054 |
by LeLe Feng, Posts and Telecom Press, 1st edition, May 2016
《Unity Universal RP 内置Shader解析》 | Analysis of the Built-in Shader of the Unity Universal RP
唐福幸著,清华大学出版社,2021年10月第一版,ISBN:9787302590378 |
by FuXing Tang, Tsinghua University Press, 1st edition, October 2021
《 3D数学基础:图形和游戏开发(第2版)》 | 3D Math Primer for Graphics and Game Development, Second Edition
弗莱彻·邓恩、伊恩·帕贝利著,穆丽君、张俊译,清华大学出版社,2020年5月第二版,ISBN:9787302549321 |
by Fletcher Dunn et al., translated by LiJun Mu et al., Tsinghua University Press, 2nd edition, May 2020
《 Real-Time Rendering, Fourth Edition》
Tomas Akenine-Mo¨ller等著,A K Peters/CRC Press,2020年5月第二版,ISBN:9781138627000 |
by Tomas Akenine-Mo¨ller et al.,A K Peters/CRC Press, , 2nd edition, May 2020

学习任务 | Learning Tasks​

课程学前调研 | pre-course survey
访问以此链接完成课程学前调研问卷 |
Fill in the pre-course survey questionnaire using this link.
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频完成自学,尝试自行创建并发布一个HDRP项目 |
Self-learn with the video tutorials on the Bilibili website, and try to create and build an HDRP project.
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频复习课程内容,并自行完成部分艺术馆练习 |
Review what you learned from the lessons with the video tutorials on the Bilibili website, and partially finish the gallery exercise.
国庆假日 | National Day holiday
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频复习课程内容,自行完成全部艺术馆练习 |
Review what you learned from the lessons with the video tutorials on the Bilibili website, and completely finish the gallery exercise.
借助哔哩哔哩上树洞鱼的教学小站中的教学视频了解游戏的不同类型及其特点 |
Learn about game genres and their characteristics with the video tutorials on the Bilibili website.
测评准备 | prepare for the quiz
10月18日将进行随堂测试,内容均包含在之前课程中,范围截止至游戏设计理论部分之前 |
A in-classroom quiz will be held on 18 October. The content of it is all covered in previous lessons, before the part of game design theories .
提交作业 | submit finished homework
点击此链接并上传完成的艺术馆练习 | Use this link to submit your finished homework, the gallery exercise.
请注意以下几点要求 | Please pay attenstion to the following requirement:
(1) 无需与老师的范例做得一模一样,可以自行修改材质、灯光或展品 | You don’t need to copy my example. Materials, lights or exhibits may alter.
(2) 删除Library等可删除的目录,加入发布程序后打包为.7z或.rar文件 | Delete library folder, add built program and compress as .7z or .rar file.
(3) 提交截止时间为2023年10月21日08:30 | Deadline for submission: 8:30am, 21 October, 2023.
准备初步方案汇报 | prepare for the preliminary proposal presentation
11月1日课上将以小组为单位进行游戏设计方案的初步汇报,建议包含机制、艺术、故事、技术(可选)四部分,每组汇报时间5分钟 |
A preliminary proposal presentation as long as 5 minutes approximately shall be given on 1 November by each team. It’s recommended to include 4 parts: mechanics, aesthetics, story and technology(optional).
最终分组名单 | the final namelist of all the teams
编号 | ID 组名 | Team Name 作品名称 | Game Title 组员 | Team Members
1
深藏blue组
城市诗人
缑悦然 王烽宇 岳洪宇 林基正 张馨月
2
YYXXYYX
山海
付雨彤 温艺馨 杜雪怡 邓茹心 杨蕾 徐成
3
Just do eat
乐诗
李禹剑 陆袁裔 田雁榕 胡丁心 王逸鸥
4
树洞咸鱼组
知白守黑
杨芊尔 蒋天逸 霍馨熠 何佳韵 李浩然
5
六法天女
明月几时有
文倩茹 张欧琦 丁舒妍 徐静雯 施绿筠 周思勉
6
cp30
饶舌梦
金巧巧 牟雪灵 任芝颖 杨俏 徐彦羚
7
如来佛祖
怀民亦未寝
涂桦儿 徐一冉 仲昭洋 苏诗淼 卢泓杉
8
芭比公组
霜降
沈亦霖 郜若言 钟宁 周子钦 傅瑜 鲍豪娟
9
甜味碳基废料
心碎诗人收容所
叶舒亦 张语菲 梁雅婕 王艺卓 冯婧仪
10
DNA重组
无聊世界
于文杰 孙思凡 仲昭弘扬 邬昀皓
准备最终方案汇报 | prepare for the final proposal presentation
11月15日课上将以小组为单位进行游戏设计方案的最终汇报,请根据11月1日的要求与建议进行修改完善,每组汇报时间10分钟 |
A final proposal presentation as long as 10 minutes approximately shall be given on 8 November by each team. Before that, please modify and polish your proposal according to the requirement and suggestions given by the teacher on 1 November.
测评准备 | prepare for the quiz
11月8日将进行随堂测试,内容均包含在之前课程中,测试范围为游戏设计理论部分 |
A in-classroom quiz will be held on 1 November. The content of it is all covered in previous lessons, which belongs to the part of game design theories.
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频复习课程内容,完成部分“猜数字”游戏 |
Review what you learned from the lessons with the video tutorials on the Bilibili website, and partially finish the guess a number game.
中期汇报 | mid-term report
第一组:《城市诗人》by 深藏blue组 | team 1: City Poet by Blue
第二组:《山海》by YYXXYYX组 | team 2: Mountain and Ocean by YYXXYYX
第三组:《乐诗》by Just Do It组 | team 3: Prosody by Just Do It
第四组:《知白守黑》by 树洞咸鱼组 | team 4: Philosophical Runner by Salted Fish
第五组:《明月几时有》by 五法天女组 | team 5: Moonlight Seeker by Five Goddesses
第六组:《饶舌梦》by cp30 | team 5: King of Couplet by cp30
第七组:《怀民亦未寝》by 如来佛组 | team 7: Sleepless Night by Rulaifo
第八组:《霜降》by 芭比公组 | team 8: First Frost by Barbies
第九组:《心碎诗人收容所》by 甜味碳基废料 | team 9: Shelter for Heartbroken Poets by Sweet Carbon-Based Waste
第十组:《无聊世界》by DNA重组 | team 8: World of Boredom by DNA Recombination
方案改进 | design improvement
参考任课老师以及腾讯游戏策划专家的建议改进游戏设计方案 |
Further improve your game design with the suggestions given by the teacher and the game design experts from Tencent.
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频复习课程内容,完成全部“猜数字”游戏 |
Review what you learned from the lessons with the video tutorials on the Bilibili website, and completely finish the game guess a number.
课后自学 | self-learning
借助哔哩哔哩上树洞鱼的教学小站中的教学视频复习课程内容,自行完成“猜数字之换你出题”游戏 |
Review what you learned from the lessons with the video tutorials on the Bilibili website, and finish the game guess a number: switch play by yourself.
准备阶段性汇报 | prepare for the progress report
第1-5组准备下周进行阶段性成果汇报 | Team 1 to 5 shall prepare for the progress report next week.
测评准备 | prepare for the quiz
12月13日将进行随堂测试,内容均包含在之前课程中,测试范围为C#基础部分 |
A in-classroom quiz will be held on 13 December. The content of it is all covered in previous lessons, which belongs to the basics of C#.
准备阶段性汇报 | prepare for the progress report
第6-10组准备下周进行阶段性成果汇报 | Team 6 to 10 shall prepare for the progress report next week.
准备阶段性汇报 | prepare for the progress report
第1-5组准备下周进行阶段性成果汇报 | Team 1 to 5 shall prepare for the progress report next week.
准备阶段性汇报 | prepare for the progress report
第6-10组准备下周进行阶段性成果汇报 | Team 6 to 10 shall prepare for the progress report next week.
测评准备 | prepare for the quiz
1月3日将进行随堂测试,测试范围为线上自学材料,可自行选择方向(艺术向或程序向) |
A in-classroom quiz will be held on 3 January. The content of it is from online tutorials and you may choose a direction (art or programming).
准备期末汇报 | prepare for the final report
1月3日将进行期末汇报,请所有小组做好准备 | All teams shall prepare for the final report on 3 January.
编号 | ID 组名 | Team Name 作品名称 | Game Title 组员 | Team Members
1
深藏blue组
蓬莱
缑悦然 王烽宇 岳洪宇 林基正 张馨月
2
YYXXYYX
山海
付雨彤 温艺馨 杜雪怡 邓茹心 杨蕾 徐成
3
Just do eat
乐诗
李禹剑 陆袁裔 田雁榕 胡丁心 王逸鸥
4
树洞咸鱼组
知白守黑
杨芊尔 蒋天逸 霍馨熠 何佳韵 李浩然
5
六法天女
明月几时有
文倩茹 张欧琦 丁舒妍 徐静雯 施绿筠 周思勉
6
cp30
饶舌传
金巧巧 牟雪灵 任芝颖 杨俏 徐彦羚
7
如来佛祖
怀民亦未寝
涂桦儿 徐一冉 仲昭洋 苏诗淼 卢泓杉
8
芭比公组
霜降
沈亦霖 郜若言 钟宁 周子钦 傅瑜 鲍豪娟
9
甜味碳基废料
心碎诗人收容所
叶舒亦 张语菲 梁雅婕 王艺卓 冯婧仪
10
DNA重组
诗界大冒险
于文杰 孙思凡 仲昭弘扬 邬昀皓
提交最终成果 | submit final outcomes
根据“1 课程简介”中的要求提交最终成果 | All teams shall submit their final outcomes according to the requirements in 1 Introduction.

课程成果 | Learning Outcomes

历年佳作 | Previous Works​

作品展示链接 | Links to the works