private void game_EntityAdded(EntityAddedEvent evt)
 {
     if (evt.AddedXmasEntity is Player)
     {
         this.playerFlagEvent.Set();
     }
 }
Esempio n. 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));
    }
Esempio n. 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;
    }
Esempio n. 4
0
 private void Model_EntityAdded(EntityAddedEvent evt)
 {
     viewWorld.AddEntity((ConsoleEntityView)entityFactory.ConstructEntityView(evt.AddedXmasEntity,evt.AddedPosition));
 }
Esempio n. 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));
 }