Exemplo n.º 1
0
        public static BasicObject CreateInstanceOf(BasicObjectCreator Creator, Level level)
        {
            BasicObject NewObject = null;

            if (!Creator.HasLoaded)
            {
                Creator.Load();
            }

            NewObject = Creator.ReturnObject();

            if (NewObject != null)
            {
                NewObject.CreatorString = Creator.MyObjectName;

                if (NewObject.GetType().Equals(typeof(TimeBasic)))
                {
                    level.TimeEvents.Add((TimeBasic)NewObject);
                    SetAsTime((TimeBasic)NewObject, Creator);
                }
                else
                {
                    level.AddObject(NewObject);
                }
            }


            return(NewObject);
        }
Exemplo n.º 2
0
 public static void SetAsTime(TimeBasic NewObject, BasicObjectCreator Creator)
 {
     NewObject.MyEvent   = Creator.TimeEvent;
     NewObject.MyTexture = Creator.IconTexture;
 }