Beispiel #1
0
 /// <summary>
 ///     Register a component to be rendered
 /// </summary>
 /// <param name="sc">The ScreenComponent to add</param>
 public void AddComponent(ScreenComponent sc)
 {
     if (sc.Space == DrawSpace.Screen)
     {
         ScreenSpaceComponents[(int)sc.Layer].Add(sc);
     }
     else
     {
         WorldSpaceComponents[(int)sc.Layer].Add(sc);
     }
 }
Beispiel #2
0
 /// <summary>
 ///     Unregister a previously registered component
 /// </summary>
 /// <param name="sc">The ScreenComponent to be removed</param>
 public void RemoveComponent(ScreenComponent sc)
 {
     if (sc != null)
     {
         if (ScreenSpaceComponents[(int)sc.Layer].Contains(sc))
         {
             ScreenSpaceComponents[(int)sc.Layer].Remove(sc);
         }
         else if (WorldSpaceComponents[(int)sc.Layer].Contains(sc))
         {
             WorldSpaceComponents[(int)sc.Layer].Remove(sc);
         }
     }
 }