Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eolokk/game_jam19
  • lejugr/game_jam19
  • tmpoht/game_jam19
  • kjahei/game_jam19
  • makalo/game_jam19
5 results
Show changes
Showing
with 398 additions and 5 deletions
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuyCapacity : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
City c = transform.root.gameObject.GetComponent<City>();
if (c.IsSufficientResources(createResourceGO(), 50))
{
List<int> cost = new List<int>() { 50, 50, 50 };
c.UseResources(cost);
c.IncreaseCapacity(50);
EventSystem.EventHappened(EventType.UpgradeBuilt);
}
}
}
private List<Resource> createResourceGO() {
GameObject go = new GameObject();
go.AddComponent<Forest>();
go.AddComponent<Quarry>();
go.AddComponent<BerryBush>();
return new List<Resource>(go.GetComponents<Resource>());
}
}
fileFormatVersion: 2
guid: 94999d051d3d2a4438290a189966dcf8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuyCity : MonoBehaviour
{
[SerializeField]
private GameObject endGame;
// Start is called before the first frame update
void Start()
{
if(!transform.root.gameObject.GetComponent<City>().IsSufficientResources(createResourceGO(), 150))
{
Color c = gameObject.GetComponent<SpriteRenderer>().color;
gameObject.GetComponent<SpriteRenderer>().color = c - new Color(25, 25, 25);
}
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
City c = transform.root.gameObject.GetComponent<City>();
if (c.population > 200 && c.IsSufficientResources(createResourceGO(), 150))
{
Instantiate<GameObject>(endGame);
}
}
}
private List<Resource> createResourceGO()
{
GameObject go = new GameObject();
go.AddComponent<Forest>();
go.AddComponent<Quarry>();
go.AddComponent<BerryBush>();
return new List<Resource>(go.GetComponents<Resource>());
}
}
fileFormatVersion: 2
guid: 2d496a86a17b9d0489876dbf81a4e9bc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuyCollector : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
City c = transform.root.gameObject.GetComponent<City>();
if (c.IsSufficientResources(createResourceGO(), 50))
{
List<int> cost = new List<int>() { 50, 50, 50 };
c.UseResources(cost);
c.AddCollector();
EventSystem.EventHappened(EventType.UpgradeBuilt);
}
}
}
private List<Resource> createResourceGO()
{
GameObject go = new GameObject();
go.AddComponent<Forest>();
go.AddComponent<Quarry>();
go.AddComponent<BerryBush>();
return new List<Resource>(go.GetComponents<Resource>());
}
}
fileFormatVersion: 2
guid: fb47c1de3fd43ba4384f11aad63ef0a0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuyEfficiency : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
List<Resource> resources = new List<Resource>(3);
City c = transform.root.gameObject.GetComponent<City>();
if (c.IsSufficientResources(resources, 50))
{
List<int> cost = new List<int>() { 50, 50, 50 };
c.UseResources(cost);
EventSystem.EventHappened(EventType.UpgradeBuilt);
}
}
}
}
fileFormatVersion: 2
guid: 06839e5c330959c45a2523fafd4a33ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuyPopulation : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
City c = transform.root.gameObject.GetComponent<City>();
List<int> cost = new List<int>() { 50, 50, 50 };
if (c.IsSufficientResources(createResourceGO(), 50))
{
c.UseResources(cost);
c.AddPopulation(50);
EventSystem.EventHappened(EventType.UpgradeBuilt);
} else
{
Debug.Log("Not enough resources");
}
}
}
private List<Resource> createResourceGO()
{
GameObject go = new GameObject();
go.AddComponent<Forest>();
go.AddComponent<Quarry>();
go.AddComponent<BerryBush>();
return new List<Resource>(go.GetComponents<Resource>());
}
}
fileFormatVersion: 2
guid: 515574251ae631045a8464c9761619c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuySpeed : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
City c = transform.root.gameObject.GetComponent<City>();
if (c.IsSufficientResources(createResourceGO(), 50))
{
c.UpgradeWorkerSpeed();
List<int> cost = new List<int>() { 50, 50, 50 };
c.UseResources(cost);
EventSystem.EventHappened(EventType.UpgradeBuilt);
}
}
}
private List<Resource> createResourceGO()
{
GameObject go = new GameObject();
go.AddComponent<Forest>();
go.AddComponent<Quarry>();
go.AddComponent<BerryBush>();
return new List<Resource>(go.GetComponents<Resource>());
}
}
fileFormatVersion: 2
guid: 9c1faba44d65021418a87209c49f7953
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.