public static void instance_destroy(GameObject go)
 {
     if (go.Layer != null)
     {
         go.Layer.Objects.Remove(go);
         SceneObjects.Remove(go);
     }
 }
 public static void instance_destroy()
 {
     if (currentObject.Layer != null)
     {
         currentObject.Layer.Objects.Remove(currentObject);
         SceneObjects.Remove(currentObject);
     }
 }
Exemple #3
0
        public static void instance_destroy(Type type)
        {
            foreach (RoomLayer rl in roomLayers)
            {
                if (rl is ObjectLayer)
                {
                    ObjectLayer ol = (ObjectLayer)rl;

                    foreach (GameObject go in ol.Objects)
                    {
                        if (go.OriginalType == type)
                        {
                            go.Layer.Objects.Remove(go);
                            SceneObjects.Remove(go);
                        }
                    }
                }
            }
        }
        public static void instance_destroy(Type type)
        {
            foreach (RoomLayer rl in roomLayers)
            {
                if (rl is ObjectLayer)
                {
                    ObjectLayer ol = (ObjectLayer)rl;

                    foreach (GameObject go in ol.Objects)
                    {
                        if (go.OriginalType == type)
                        {
                            go.Layer.Objects.Remove(go);
                            SceneObjects.Remove(go);

                            if (CollisionsTree.CollisionActiveTypes.Contains(go.GetType()))
                            {
                                SceneColliders.Remove(go);
                            }
                        }
                    }
                }
            }
        }