Example #1
0
        public void SetEntityCollisionLayers(ScriptThread thread)
        {
            EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
            if (entity == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called SetEntityCollisionLayers with an invalid object.", LogAlertLevel.Error);
                return;
            }
            if (entity.CollisionPolygon == null) return;
            int arrayIndex = thread.GetArrayParameter(1);
            entity.CollisionPolygon.Layers = new int[thread.GetArrayLength(arrayIndex)];

            for (int i = 0; i < thread.GetArrayLength(arrayIndex); i++)
                entity.CollisionPolygon.Layers[i] = thread.GetIntArrayElement(arrayIndex, i);
        }
 public void CreateAnimationProcessD(ScriptThread thread)
 {
     EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
     int memoryIndex = thread.GetArrayParameter(3);
     if (entity == null || memoryIndex == 0)
     {
         DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateAnimationProcess with an invalid object.", LogAlertLevel.Error);
         return;
     }
     int arrayLength = thread.GetArrayLength(memoryIndex);
     int[] frames = new int[arrayLength];
     for (int i = 0; i < arrayLength; i++)
         frames[i] = thread.GetIntArrayElement(memoryIndex, i);
     thread.SetReturnValue(new ProcessScriptObject(new AnimationProcess(entity, (AnimationMode)thread.GetIntegerParameter(1), thread.GetIntegerParameter(2), frames)));
 }