public void Add(GameObject gameObject, float depth) { DrawListData newData; if (!gameObject.IsInitialised) gameObject.Initialise(); gameObject.m_drawingList = this; int i; for (i = 0; i < m_drawables.Count; ++i) if (depth < m_drawables[i].depth) break; newData.depth = depth; newData.drawable = gameObject; m_drawables.Insert(i, newData); }
public void Remove(GameObject gameObject) { m_drawables.RemoveAll(dld => dld.drawable == gameObject); gameObject.m_drawingList = null; }
public void Remove(GameObject gameObject) { m_updatables.RemoveAll(dld => dld.updatable == gameObject); gameObject.m_updateList = null; }
public GameObject(GameObject objectToCopy) { m_transform = new Transform(objectToCopy.Transform); if (objectToCopy.Sprite != null) m_sprite = new Sprite(objectToCopy.Sprite, m_transform); if (objectToCopy.m_updateList != null) m_updateList = objectToCopy.m_updateList; if (objectToCopy.m_drawingList != null) m_drawingList = objectToCopy.m_drawingList; }