コード例 #1
0
        /*--------------------------------------
         * PUBLIC METHODS
         *------------------------------------*/

        /// <summary>Adds a component to the entity.</summary>
        /// <param name="component">The component to add to the entity.</param>
        public void AddComponent(EcsComponent component)
        {
            mComponents.Add(component.GetType(), component);

            var scene = mScene;

            if (scene != null)
            {
                scene.NotifyComponentsChanged(this);
            }
        }
コード例 #2
0
 public void AddComponent(EcsComponent component)
 {
     mComponents.Add(component.GetType(), component);
 }