Exemplo n.º 1
0
        public GameObjectComponent GetComponent(Type T)
        {
            foreach (GameObjectComponent GOC in GameObjectComponents)
            {
                if (GOC.GetType() == T)
                {
                    return(GOC);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        public void Destroy()
        {
            foreach (GameObject Child in Children)
            {
                Child.ShouldBeDeleted = true;
            }

            foreach (GameObjectComponent GOC in GameObjectComponents)
            {
                GOC.Destroy();
            }

            if (Parent != null)
            {
                Parent.RemoveChild(this);
            }

            ShouldBeDeleted = true;

            Children.Clear();
        }