public WorldEntity GetWorldByUnit(Unit u)
        {
            WorldEntity w = null;

            if (mWorldDic.TryGetValue(u.Id, out w))
            {
                return(w);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public static WorldEntity Create()
        {
            WorldManagerComponent worldManagerComponent = ETModel.Game.Scene.GetComponent <WorldManagerComponent>();

            if (worldManagerComponent == null)
            {
                worldManagerComponent = ETModel.Game.Scene.AddComponent <WorldManagerComponent>();
            }
            WorldEntity worldEntity = ComponentFactory.Create <WorldEntity>();

            Debug.Log(worldManagerComponent == null);
            Debug.Log(worldEntity == null);
            worldManagerComponent.AddWorld(worldEntity);
            return(worldEntity);
        }
Esempio n. 3
0
 public void SetWorldEntity(WorldEntity w)
 {
     mWorldEntity = w;
 }
Esempio n. 4
0
 public void InitWorldEntity(WorldEntity w)
 {
     mWorldEntity = w;
     mFrameComponent.SetWorldEntity(w);
 }
 public void AddUnitToWorld(Unit u, WorldEntity world)
 {
     mWorldDic.Add(u.Id, world);
     world.AddUnit(u);
 }
 public void AddWorld(WorldEntity entity)
 {
     mEntityList.Add(entity);
 }