예제 #1
0
 private void game_EntityAdded(EntityAddedEvent evt)
 {
     if (evt.AddedXmasEntity is Player)
     {
         this.playerFlagEvent.Set();
     }
 }
예제 #2
0
    private void OnTerrainEntity(EntityAddedEvent evt)
    {
        TerrainEntity terEnt = (TerrainEntity)evt.AddedXmasEntity;
        TilePosition posinfo = (TilePosition)evt.AddedPosition;
        Point pos = posinfo.Point;

        var transform = Factory.CreateTile(terEnt, posinfo);

        transform.gameObject.AddComponent<TerrainInformation>();
        var terinfo = transform.gameObject.GetComponent<TerrainInformation>();
        terinfo.SetTerrain(terEnt);
        this.termap[terEnt] = transform;
        transform.renderer.sharedMaterial.SetTexture("_MainTex", TextureDictionary.GetTexture(terEnt.TextureType));
    }
예제 #3
0
    private void OnUnitEntity(EntityAddedEvent evt)
    {
        UnitInfoModule uinfo = evt.AddedXmasEntity.Module<UnitInfoModule>();
        GuiInformation guiinfo = this.GuiLoader.GetGuiInfo(uinfo.Controller);

        UnitEntity unitEnt = (UnitEntity)evt.AddedXmasEntity;
        TilePosition posinfo = (TilePosition)evt.AddedPosition;

        Point pos = posinfo.Point;
        Transform unitobj = Factory.CreateUnit(unitEnt, posinfo);

        UnitInformation info = unitobj.gameObject.GetComponent<UnitInformation>();
        info.ControllerInfo = guiinfo;
    }
예제 #4
0
 private void Model_EntityAdded(EntityAddedEvent evt)
 {
     viewWorld.AddEntity((ConsoleEntityView)entityFactory.ConstructEntityView(evt.AddedXmasEntity,evt.AddedPosition));
 }
예제 #5
0
 private void model_EntityAdded(EntityAddedEvent evt)
 {
     log.LogStringWithTimeStamp(String.Format("{{{0}}} was added to the world", evt.AddedXmasEntity), DebugLevel.Info);
     viewlookup.Add(evt.AddedXmasEntity, (LoggerEntityView)entityFactory.ConstructEntityView(evt.AddedXmasEntity, evt.AddedPosition));
 }