예제 #1
0
        public GameObjectComponent GetComponent(Type T)
        {
            foreach (GameObjectComponent GOC in GameObjectComponents)
            {
                if (GOC.GetType() == T)
                {
                    return(GOC);
                }
            }

            return(null);
        }
예제 #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();
        }