前言
本文是中山大学软件工程学院2020级3d游戏编程与设计的作业2
简答题
1. 游戏对象 (GameObjects) 和 资源 (Assets) 的区别与联系
ans:
在unity官网之中我们可以找到如下两个定义:
Assets:
A Unity asset is an item that you can use in your game or Project. An asset may come from a file created outside of Unity, such as a 3D model, an audio file, an image, or any of the other types of file that Unity supports. There are also some asset types that you can create within Unity, such as an Animator Controller, an Audio Mixer or a Render Texture.1
GameObject:
GameObjects are the fundamental objects in Unity that represent characters, props and scenery. They do not accomplish much in themselves but they act as containers for Components, which implement the functionality.2
由以上的定义,可以了解到:
资源是在游戏中可以使用的各种素材,而游戏对象则是指在游戏中容纳素材并发挥其作用的基本对象。可见,二者之间的区别与联系在于:游戏对象在游戏之中并不承担实现各种属性与功能的职责,它仅仅是一个整合了各种素材的基本对象;而游戏中各种属性与功能,都是要依靠依附在游戏对象之上的资源来实现。在一定意义上,可以理解为游戏对象即为数个实例化资源。
2. 下载几个游戏案例,分别总结资源、对象组织的结构(指资源的目录组织结构与游戏对象树的层次结构)
ans:
此处下载了官方教程的UnityPlayGround3。
资源的目录组织结如下图所示:
游戏对象树如下图所示:
通过简单的游戏实例,可以得出:
资源组织结构包括了本项目之中的所有素材,包括Font(字体文件),Prefabs(预设),