c# - Can I reference a script attached to a prefab that's loaded from an AssetBundle in Unity WebGL? -
i have unity webgl app using assetbundle manager load prefab. it's loading prefab , associated animations, can't reference script attached prefab. i'm not trying include script in asset bundle - it's in base application. have code stripping disabled.
what's confusing me code able reference while running in editor, not when it's running in browser.
my prefab structured this:
- container gameobject
- 3d text
myscript defined this:
public class myscript : monobehaviour { public textmesh text; }
my code try access script:
var container = instantiate (prefab); var script = container.getcomponent<myscript> ();
the container gameobject has script component. script references 3d text via public property. when prefab instantiated while in browser, 3d text object renders correctly, script
null.
is there i'm doing wrong, or not possible in webgl player?
Comments
Post a Comment