Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

addComponent c# script by java

$
0
0
hello there. trying to add c# script as component in java script #pragma strict public var obj : GameObject; public var mono : MonoBehaviour; function EnableFu**ingC () { obj = gameObject.Find("TextPicRus"); mono = UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(obj, "Assets/Plugins/JS/enableC.js(15,16)", "Translate"); } this code is working, but only in Unity. if build to any platform, i have an errors Assets/Plugins/JS/enableC.js(18,62): BCE0144: 'UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(UnityEngine.GameObject, String, String)' is obsolete. Method is not meant to be used at runtime. Please, replace this call with GameObject.AddComponent()/GameObject.AddComponent(Type). Error building Player because scripts had compiler errors tried private var Translate : Translate; mono = obj.AddComponent(Translate); mono = obj.AddComponent("Translate"); mono = obj.AddComponent<"Translate">(); mono = obj.AddComponent(); nothing works. any ideas?..

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>