예제 #1
0
        /// <summary>
        /// Initializes the entity and all his components.
        /// </summary>
        public void Initialize()
        {
            renderManager   = Scene.RenderManager;
            behaviorManager = Scene.BehaviorManager;

            foreach (var behavior in tmpBehavior)
            {
                behaviorManager.AddBehavior(behavior);
            }
            tmpBehavior.Clear();
            tmpBehavior = null;

            foreach (var drawable in tmpDrawables)
            {
                renderManager.AddDrawable(drawable);
            }

            tmpDrawables.Clear();
            tmpDrawables = null;

            foreach (var component in Components.ToArray())
            {
                component.OnInitialize();
            }
        }