【发布时间】:2018-04-06 21:35:27
【问题描述】:
我创建了一个Prefab,并使用以下代码将其加载到Awake 函数中:
GameObject bulletPrefab = Resources.Load<GameObject>("Enemy/Bullet");
bulletPrefab.transform.position = new Vector3(0,0,0);
问题是bulletPrefab 不会出现在游戏场景中。它的activeSelf 属性是true,但它的activeInHierarchy 属性是false。有谁知道为什么会这样以及如何让bulletprefab在场景中显示?
【问题讨论】: