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 437 additions and 4 deletions
......@@ -41,7 +41,9 @@ public abstract class Resource : MonoBehaviour
{
return resources;
}
// Soittaa resurssin keruuseen liittyvän äänen sekä vähentää resurssista annetun määrän yksiköitä tai asettaa määrän nollaan,
// mikäli vähennettävä arvo on suurempi kuin resurssiyksiköiden senhetkinen määrä. Palauttaa resurssin vähennetyn määrän.
public int extractResource(int amount)
{
EventSystem.EventHappened(getEventType());
......@@ -58,10 +60,9 @@ public abstract class Resource : MonoBehaviour
}
}
// Metodi spriten päivitystä varten.
public abstract void refreshSprite();
// Metodi jolla tarkistetaan resurssien olemassaolon ehdot ja suoritetaan tarvittavat toimenpiteet.
public abstract void checkExistence();
}
fileFormatVersion: 2
guid: 6c8bd6d1b4693cf40af60b640e73f52b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Border : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseEnter()
{
Destroy(transform.parent.gameObject);
}
}
fileFormatVersion: 2
guid: 9dfa4cb8b74a55949bb9087ebc8eafef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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:
This diff is collapsed.
fileFormatVersion: 2
guid: 515574251ae631045a8464c9761619c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 9c1faba44d65021418a87209c49f7953
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 2cc06fd360e0e1b44b66092a664bafe1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.