private IEnumerator DwarfDeath() { anim.SetBool("isDead", true); TileManagerSystem.TileList[row, column] .GetComponent <Tile>().RemoveGoodGuy(); TileManagerSystem.TileList[row, column].GetComponent <TileIndicator>().isOccupied = false; yield return(new WaitForSeconds(4)); DwarfPool.ReturnDwarf(gameObject, axWarriorSO.name); }
private void MouseLeftEnd() { if (hasUnitSelected) { if (isDropable) { print("trying to create new dwarf from pool"); DwarfPool.GetDwarf(selectedObject.transform.GetComponent <DwarfSelectPrefabs>().unitType.name, selectedTile); OnUnitBought?.Invoke(selectedObject.transform.GetComponent <DwarfSelectPrefabs>().unitType.name); } selectedObject.position = new Vector3(selectedObjectOrigin.x, selectedObjectOrigin.y, selectedObjectOrigin.z); } //Resetting selectedObject = null; isDropable = false; hasUnitSelected = false; }