Rename Sand/Glass to Wood/Planks
This commit is contained in:
@@ -1708,7 +1708,7 @@ PrefabInstance:
|
|||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 891704993983032679, guid: 2760da9f550c02e4480b4b992d6c8748, type: 3}
|
- target: {fileID: 891704993983032679, guid: 2760da9f550c02e4480b4b992d6c8748, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: SandMine
|
value: WoodCutter
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 3319062436162208223, guid: 2760da9f550c02e4480b4b992d6c8748, type: 3}
|
- target: {fileID: 3319062436162208223, guid: 2760da9f550c02e4480b4b992d6c8748, type: 3}
|
||||||
propertyPath: resource
|
propertyPath: resource
|
||||||
@@ -1963,7 +1963,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5101894592932716088, guid: 33abb00a5a886954698312f903f951f9, type: 3}
|
- target: {fileID: 5101894592932716088, guid: 33abb00a5a886954698312f903f951f9, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: GlassBlower
|
value: Woodery
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6385844933959367090, guid: 33abb00a5a886954698312f903f951f9, type: 3}
|
- target: {fileID: 6385844933959367090, guid: 33abb00a5a886954698312f903f951f9, type: 3}
|
||||||
propertyPath: baseOutput
|
propertyPath: baseOutput
|
||||||
@@ -2337,13 +2337,13 @@ MonoBehaviour:
|
|||||||
description: 'This is big building '
|
description: 'This is big building '
|
||||||
brickCost: 200
|
brickCost: 200
|
||||||
tileCost: 1000
|
tileCost: 1000
|
||||||
glassCost: 100
|
plankCost: 0
|
||||||
worldObject: {fileID: 149471774}
|
worldObject: {fileID: 149471774}
|
||||||
- name: Test Monument 2
|
- name: Test Monument 2
|
||||||
description: 'This is big building '
|
description: 'This is big building '
|
||||||
brickCost: 100
|
brickCost: 100
|
||||||
tileCost: 200
|
tileCost: 200
|
||||||
glassCost: 100
|
plankCost: 0
|
||||||
worldObject: {fileID: 1883187468}
|
worldObject: {fileID: 1883187468}
|
||||||
nextUnlockLabel: {fileID: 406856357}
|
nextUnlockLabel: {fileID: 406856357}
|
||||||
--- !u!4 &1441277718
|
--- !u!4 &1441277718
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ using TMPro;
|
|||||||
public enum Resource
|
public enum Resource
|
||||||
{
|
{
|
||||||
ROCK,
|
ROCK,
|
||||||
SAND,
|
WOOD,
|
||||||
CLAY,
|
CLAY,
|
||||||
BRICK,
|
BRICK,
|
||||||
TILE,
|
TILE,
|
||||||
GLASS,
|
PLANKS,
|
||||||
HOUSE,
|
HOUSE,
|
||||||
WORKER,
|
WORKER,
|
||||||
TOTAL_WORKER
|
TOTAL_WORKER
|
||||||
@@ -23,17 +23,17 @@ public class GameManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
{ Resource.BRICK, 0 },
|
{ Resource.BRICK, 0 },
|
||||||
{ Resource.TILE, 0 },
|
{ Resource.TILE, 0 },
|
||||||
{ Resource.GLASS, 0 }
|
{ Resource.PLANKS, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
private Dictionary<Resource, int> resources = new Dictionary<Resource, int>()
|
private Dictionary<Resource, int> resources = new Dictionary<Resource, int>()
|
||||||
{
|
{
|
||||||
{ Resource.ROCK, 0 },
|
{ Resource.ROCK, 0 },
|
||||||
{ Resource.SAND, 0 },
|
{ Resource.WOOD, 0 },
|
||||||
{ Resource.CLAY, 0 },
|
{ Resource.CLAY, 0 },
|
||||||
{ Resource.BRICK, 0 },
|
{ Resource.BRICK, 0 },
|
||||||
{ Resource.TILE, 0 },
|
{ Resource.TILE, 0 },
|
||||||
{ Resource.GLASS, 0 },
|
{ Resource.PLANKS, 0 },
|
||||||
{ Resource.HOUSE, 0 },
|
{ Resource.HOUSE, 0 },
|
||||||
{ Resource.WORKER, 0 },
|
{ Resource.WORKER, 0 },
|
||||||
{ Resource.TOTAL_WORKER, 0 }
|
{ Resource.TOTAL_WORKER, 0 }
|
||||||
@@ -78,8 +78,8 @@ public class GameManager : MonoBehaviour
|
|||||||
housingLabel.text = $"{resources[Resource.HOUSE]} Houses\n" +
|
housingLabel.text = $"{resources[Resource.HOUSE]} Houses\n" +
|
||||||
$"{resources[Resource.WORKER]}/{resources[Resource.TOTAL_WORKER]} Workers";
|
$"{resources[Resource.WORKER]}/{resources[Resource.TOTAL_WORKER]} Workers";
|
||||||
resourceLabel.text = $"Resources:\n" +
|
resourceLabel.text = $"Resources:\n" +
|
||||||
$"Storage: Bricks {resources[Resource.BRICK]} | Tiles {resources[Resource.TILE]} | Glass {resources[Resource.GLASS]}\n" +
|
$"Storage: Bricks {resources[Resource.BRICK]} | Tiles {resources[Resource.TILE]} | Planks {resources[Resource.PLANKS]}\n" +
|
||||||
$"Comitted: Bricks {committedResources[Resource.BRICK]} | Tiles {committedResources[Resource.TILE]} | Glass {committedResources[Resource.GLASS]}";
|
$"Comitted: Bricks {committedResources[Resource.BRICK]} | Tiles {committedResources[Resource.TILE]} | Planks {committedResources[Resource.PLANKS]}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CommitResources()
|
public void CommitResources()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class HouseManager : MonoBehaviour
|
|||||||
private int workerPerHouse = 3;
|
private int workerPerHouse = 3;
|
||||||
private GameManager gameManager;
|
private GameManager gameManager;
|
||||||
|
|
||||||
//House cost: Brick Tile Glass
|
//House cost: Brick Tile Plank
|
||||||
public int[] cost = new int[3] { 10, 5, 2 };
|
public int[] cost = new int[3] { 10, 5, 2 };
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
@@ -42,7 +42,7 @@ public class HouseManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (gameManager.GetResourceCount(Resource.BRICK) < cost[0] ||
|
if (gameManager.GetResourceCount(Resource.BRICK) < cost[0] ||
|
||||||
gameManager.GetResourceCount(Resource.TILE) < cost[1] ||
|
gameManager.GetResourceCount(Resource.TILE) < cost[1] ||
|
||||||
gameManager.GetResourceCount(Resource.GLASS) < cost[2])
|
gameManager.GetResourceCount(Resource.PLANKS) < cost[2])
|
||||||
{
|
{
|
||||||
Debug.Log("Not enough resources to build house!");
|
Debug.Log("Not enough resources to build house!");
|
||||||
return;
|
return;
|
||||||
@@ -50,7 +50,7 @@ public class HouseManager : MonoBehaviour
|
|||||||
|
|
||||||
gameManager.RemoveResource(Resource.BRICK, cost[0]);
|
gameManager.RemoveResource(Resource.BRICK, cost[0]);
|
||||||
gameManager.RemoveResource(Resource.TILE, cost[1]);
|
gameManager.RemoveResource(Resource.TILE, cost[1]);
|
||||||
gameManager.RemoveResource(Resource.GLASS, cost[2]);
|
gameManager.RemoveResource(Resource.PLANKS, cost[2]);
|
||||||
gameManager.AddResource(Resource.HOUSE, 1);
|
gameManager.AddResource(Resource.HOUSE, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class Monument
|
|||||||
{
|
{
|
||||||
public string name;
|
public string name;
|
||||||
public string description;
|
public string description;
|
||||||
public int brickCost, tileCost, glassCost;
|
public int brickCost, tileCost, plankCost;
|
||||||
public GameObject worldObject;
|
public GameObject worldObject;
|
||||||
}
|
}
|
||||||
public class MonumentManager : MonoBehaviour
|
public class MonumentManager : MonoBehaviour
|
||||||
@@ -44,11 +44,11 @@ public class MonumentManager : MonoBehaviour
|
|||||||
Monument monument = monuments[i];
|
Monument monument = monuments[i];
|
||||||
if(availableResources[Resource.BRICK] >= monument.brickCost &&
|
if(availableResources[Resource.BRICK] >= monument.brickCost &&
|
||||||
availableResources[Resource.TILE] >= monument.tileCost &&
|
availableResources[Resource.TILE] >= monument.tileCost &&
|
||||||
availableResources[Resource.GLASS] >= monument.glassCost )
|
availableResources[Resource.PLANKS] >= monument.plankCost )
|
||||||
{
|
{
|
||||||
availableResources[Resource.BRICK] -= monument.brickCost;
|
availableResources[Resource.BRICK] -= monument.brickCost;
|
||||||
availableResources[Resource.TILE] -= monument.tileCost;
|
availableResources[Resource.TILE] -= monument.tileCost;
|
||||||
availableResources[Resource.GLASS] -= monument.glassCost;
|
availableResources[Resource.PLANKS] -= monument.plankCost;
|
||||||
monument.worldObject.GetComponent<Renderer>().material.color = Color.green;
|
monument.worldObject.GetComponent<Renderer>().material.color = Color.green;
|
||||||
lastMonumentIndex = i;
|
lastMonumentIndex = i;
|
||||||
} else
|
} else
|
||||||
@@ -68,7 +68,7 @@ public class MonumentManager : MonoBehaviour
|
|||||||
nextUnlockLabel.text = $"Next Unlock: {monuments[lastMonumentIndex + 1].name} (" +
|
nextUnlockLabel.text = $"Next Unlock: {monuments[lastMonumentIndex + 1].name} (" +
|
||||||
$" B: {resourcesForNextUnlock[Resource.BRICK]}/{monuments[lastMonumentIndex + 1].brickCost}" +
|
$" B: {resourcesForNextUnlock[Resource.BRICK]}/{monuments[lastMonumentIndex + 1].brickCost}" +
|
||||||
$" T: {resourcesForNextUnlock[Resource.TILE]}/{monuments[lastMonumentIndex + 1].tileCost}" +
|
$" T: {resourcesForNextUnlock[Resource.TILE]}/{monuments[lastMonumentIndex + 1].tileCost}" +
|
||||||
$" G: {resourcesForNextUnlock[Resource.GLASS]}/{monuments[lastMonumentIndex + 1].glassCost})";
|
$" P: {resourcesForNextUnlock[Resource.PLANKS]}/{monuments[lastMonumentIndex + 1].plankCost})";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class Tutorial : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (gameManager.GetResourceCount(Resource.BRICK) >= houseManager.cost[0] &&
|
if (gameManager.GetResourceCount(Resource.BRICK) >= houseManager.cost[0] &&
|
||||||
gameManager.GetResourceCount(Resource.TILE) >= houseManager.cost[1] &&
|
gameManager.GetResourceCount(Resource.TILE) >= houseManager.cost[1] &&
|
||||||
gameManager.GetResourceCount(Resource.GLASS) >= houseManager.cost[2])
|
gameManager.GetResourceCount(Resource.PLANKS) >= houseManager.cost[2])
|
||||||
{
|
{
|
||||||
|
|
||||||
tutorialElements[(int)Tutorials.HouseBuilding].worldObject.SetActive(true);
|
tutorialElements[(int)Tutorials.HouseBuilding].worldObject.SetActive(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user