// Set piece object position public void SetPosition(GameMapObject gameMapObject) { Vector3Int tileCoords = Hex.HexToTileCoords(piece.gameHex.hexCoords); Vector3 tilePosition = gameMapObject.tileGrid.CellToWorld(tileCoords); Vector3 newPosition = new Vector3(tilePosition.x, tilePosition.y, -1); StartCoroutine(MoveOverTime(newPosition)); //transform.position = new Vector3(tilePosition.x, tilePosition.y, -1); }
protected override void OnDataInitialize(VisualObject vObject) { GameMapObject gameMapObject = vObject as GameMapObject; if (gameMapObject == null || (!((ResourceData)this.FileData != (ResourceData)null) || gameMapObject.FileData.GetResourceData().Type == this.FileData.Type)) { return; } gameMapObject.FileData = (ResourceFile)null; }
protected override void OnDataInitialize(VisualObject vObject) { GameMapObject gameMapObject = vObject as GameMapObject; if (gameMapObject != null) { if (this.FileData != null && gameMapObject.FileData.GetResourceData().Type != this.FileData.Type) { gameMapObject.FileData = null; } } }
// Set game map object public void SetGameMapObject(GameMapObject gameMapObject) { this.gameMapObject = gameMapObject; }