c# - Cannot attach UI Text object to serialized field on Prefab in Unity 5.0.2f1 -
using unity 5.0.2f1 mac.
created ui text object (called lifecountui) in scene. then, on player's script (attached player gameobject), have following field serialized:
[serializefield] public text lifecounttext;
this player gameobject prefab.
my intention drag lifecountui in inspector serialized field on player gameobject. however, unity not allow me when select player prefab.
it works, if drag instance of player prefab on scene, , drag lifecountui field (but obviously, not prefab).
am doing wrong here? want have ability control text field prefab instance.
have @ gurus in famouse 50 tips working unity (best practices) article:
- link prefabs prefabs; not link instances instances. links prefabs maintained when dropping prefab scene; links instances not. linking prefabs whenever possible reduces scene setup, , reduce need change scenes.
this 1 of reason unable maintain reference.
Comments
Post a Comment