Beispiel #1
0
        public void SceneGraphLayers(ScriptThread thread)
        {
            int[] layers     = SceneGraph.Layers;
            int   arrayIndex = thread.AllocateArray(DataType.Int, SceneGraph.Layers.Length);

            for (int i = 0; i < SceneGraph.Layers.Length; i++)
            {
                thread.SetArrayElement(arrayIndex, i, layers[i]);
            }
            thread.SetReturnValueArray(arrayIndex);
        }
Beispiel #2
0
        public void Explode(ScriptThread thread)
        {
            string explodee  = thread.GetStringParameter(0);
            char   seperator = thread.GetStringParameter(1)[0];

            string[] exploded = explodee.Split(new char[] { seperator });

            int arrayMemoryIndex = thread.AllocateArray(DataType.String, exploded.Length);

            for (int i = 0; i < exploded.Length; i++)
            {
                thread.SetArrayElement(arrayMemoryIndex, i, exploded[i]);
            }

            thread.SetReturnValueArray(arrayMemoryIndex);
        }