コード例 #1
0
ファイル: Entity.cs プロジェクト: ly774508966/GF.Unity
 //---------------------------------------------------------------------
 public Entity(EntityMgr entity_mgr)
 {
     EntityMgr = entity_mgr;
 }
コード例 #2
0
ファイル: Entity.cs プロジェクト: ly774508966/GF.Unity
        //---------------------------------------------------------------------
        // 直接销毁该Entity
        internal void _destroy()
        {
            if (SignDestroy)
            {
                return;
            }
            SignDestroy = true;

            // 先销毁所有子Entity
            if (mMapChild != null)
            {
                Dictionary <string, Dictionary <string, Entity> > map_children =
                    new Dictionary <string, Dictionary <string, Entity> >(mMapChild);
                foreach (var i in map_children)
                {
                    List <string> list_entity = new List <string>(i.Value.Keys);
                    foreach (var j in list_entity)
                    {
                        EntityMgr.destroyEntity(j);
                    }
                }
                map_children.Clear();
            }

            // 销毁Entity上挂接的所有组件
            mListComponent.Reverse();
            foreach (var i in mListComponent)
            {
                if (!EbTool.isNull(i))
                {
                    i.release();
                }
            }
            mListComponent.Clear();
            mMapComponent.Clear();

            if (mPublisher != null)
            {
                mPublisher.removeHandler(this);
            }

            if (mMapCacheData != null)
            {
                mMapCacheData.Clear();
            }

            if (mMapChild != null)
            {
                mMapChild.Clear();
                mMapChild = null;
            }

            // 从父Entity中移除
            if (Parent != null)
            {
                Parent.removeChild(this);
            }

            Type    = "";
            Guid    = "";
            mParent = null;
        }
コード例 #3
0
ファイル: EbGrid.cs プロジェクト: ly774508966/GF.Unity
 //---------------------------------------------------------------------
 public EbGrid(EntityMgr entity_mgr)
 {
     mEntityMgr = entity_mgr;
 }
コード例 #4
0
ファイル: EbGridRegion.cs プロジェクト: ly774508966/GF.Unity
 //---------------------------------------------------------------------
 public EbGridRegion(EntityMgr entity_mgr)
 {
     Publisher = new EntityEventPublisher(entity_mgr);
     SetEntity = new HashSet <Entity>();
 }
コード例 #5
0
 //-------------------------------------------------------------------------
 public ComponentFactory(EntityMgr entity_mgr)
     : base(entity_mgr)
 {
 }
コード例 #6
0
 //-------------------------------------------------------------------------
 public IComponentFactory(EntityMgr entity_mgr)
 {
     mEntityMgr = entity_mgr;
 }