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

  • Unity Game Optimization
  • Dr. Davide Aversa Chris Dickinson
  • 214字
  • 2021-06-24 12:12:59

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. However, there are also 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.

主站蜘蛛池模板: 尉犁县| 云南省| 饶阳县| 新野县| 郎溪县| 寻甸| 会同县| 新晃| 乌鲁木齐市| 精河县| 五华县| 黄浦区| 六盘水市| 朝阳区| 虞城县| 盈江县| 马公市| 呼和浩特市| 莆田市| 洪湖市| 开阳县| 来安县| 淮滨县| 黑河市| 河南省| 栖霞市| 金沙县| 榆中县| 白水县| 武清区| 晋中市| 沁水县| 平山县| 拜城县| 开鲁县| 乳源| 松潘县| 淮阳县| 汕头市| 社旗县| 东乌珠穆沁旗|