public void setInitialEntity(Entity entity) { removeEntity(); entity.transform.parent = this.transform.parent; entity.transform.position = transform.position; this.entityPresent = entity; entity.setCurrentTile (this); if (entity.GetType() != typeof(Obstacle)) { int type = (entity.getIsPlayer() ? 0 : 1); graphicTile = GetComponent<GraphicTile>(); graphicTile.setAnim(); setTileType(type); } }
public void setEntity(Entity entity) { removeEntity(); if (entity != null) { entity.getCurrentTile().setEntity(null); entity.setCurrentTile(this); } this.entityPresent = entity; }