You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var u = CS.UnityEngine;
var uGO = u.GameObject;
var uR = u.Renderer;
CS.UnityEngine.Debug.Log('Hello World');
var sphere = new uGO.CreatePrimitive(u.PrimitiveType.Sphere);
var renderer = sphere.GetComponent('Renderer');
var mat = renderer.GetComponent('Material');
mat.SetColor( '_MainTex', u.Color.Red );
How do you set color?
hmm so most of the above works in editor but it seems assigning shorthand does not work on device or perhaps instantiation of new gameobject doesn't work?
Exception: chunk:6: TypeError: uGO.CreatePrimitive is not a constructor
TypeError: uGO.CreatePrimitive is not a constructor
at chunk:6:17
at Puerts.JsEnv.Eval (System.String chunk, System.String chunkName) [0x00000] in <00000000000000000000000000000000>:0
Also, it seems explicitly writing it out also does not work on device?
Exception: chunk:6: TypeError: CS.UnityEngine.GameObject.CreatePrimitive is not a constructor
TypeError: CS.UnityEngine.GameObject.CreatePrimitive is not a constructor
at chunk:6:17
at Puerts.JsEnv.Eval (System.String chunk, System.String chunkName) [0x00000] in <00000000000000000000000000000000>:0
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How do you set color?
hmm so most of the above works in editor but it seems assigning shorthand does not work on device or perhaps instantiation of new gameobject doesn't work?
Also, it seems explicitly writing it out also does not work on device?
Beta Was this translation helpful? Give feedback.
All reactions