官术网_书友最值得收藏!

Verifying script presence

Sometimes, there are things we expect to see, but don't. These are usually easy to spot because the human brain is very good at pattern recognition and spotting differences we didn't expect. Meanwhile, there are times where we assume that something has been happening, but it didn't. These are generally more difficult to notice, because we're often scanning for the first kind of problem, and we’re assuming that the things we don’t see are working as intended. In the context of Unity, one problem that manifests itself this way is verifying that the scripts we expect to be operating are actually present in the Scene.

Script presence can be quickly verified by typing the following into the Hierarchy window textbox:

t:<monobehaviour name>

For example, typing t:mytestmonobehaviour (note that it is not case-sensitive) into the Hierarchy textbox will show a shortlist of all GameObjects that currently have at least one MyTestMonoBehaviour script attached as a Component.

Note that this shortlist feature also includes any GameObjects with Components that derive from the given script name.

We should also double-check that the GameObjects they are attached to are
still enabled, since we may have disabled them during earlier testing since someone or something may have accidentally deactivated the object.

主站蜘蛛池模板: 宁都县| 吐鲁番市| 无为县| 上犹县| 遵义市| 衢州市| 象州县| 林周县| 大厂| 和林格尔县| 沐川县| 阿勒泰市| 虞城县| 华宁县| 新郑市| 浦北县| 富顺县| 阆中市| 济宁市| 镇雄县| 正阳县| 高碑店市| 五寨县| 同心县| 中方县| 邻水| 江阴市| 苏尼特左旗| 大渡口区| 昌江| 德清县| 濉溪县| 博湖县| 上蔡县| 石屏县| 绥滨县| 积石山| 镇巴县| 遂昌县| 紫金县| 乌海市|