diff --git a/Assets/Behaviour.cs b/Assets/Behaviour.cs new file mode 100644 index 0000000..cbf2792 --- /dev/null +++ b/Assets/Behaviour.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using System.Collections; + +public class Behaviour : MonoBehaviour { + + public GameController GameCon; + + // Use this for initialization + void Start () { + GameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + } + + // Update is called once per frame + void Update () { + + } +} diff --git a/Assets/Behaviour.cs.meta b/Assets/Behaviour.cs.meta new file mode 100644 index 0000000..c7fca94 --- /dev/null +++ b/Assets/Behaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3a21f751365037e4083d9b9c46a12914 +timeCreated: 1438600314 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BuildingBehaviour.cs b/Assets/BuildingBehaviour.cs new file mode 100644 index 0000000..eb706d5 --- /dev/null +++ b/Assets/BuildingBehaviour.cs @@ -0,0 +1,10 @@ +using UnityEngine; + + +public class BuildingBehaviour : MonoBehaviour +{ + public Building properties; + + void OnMouseDown() + { } +} diff --git a/Assets/BuildingBehaviour.cs.meta b/Assets/BuildingBehaviour.cs.meta new file mode 100644 index 0000000..8a4efde --- /dev/null +++ b/Assets/BuildingBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f8cba78ae3f76a24c845cb601074949c +timeCreated: 1438759944 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/CodeMap1.dgml b/Assets/CodeMap1.dgml new file mode 100644 index 0000000..78afaa6 --- /dev/null +++ b/Assets/CodeMap1.dgml @@ -0,0 +1,1183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/CodeMap1.dgml.meta b/Assets/CodeMap1.dgml.meta new file mode 100644 index 0000000..06b273a --- /dev/null +++ b/Assets/CodeMap1.dgml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fab67f0416da1cd47976d3255b9020d3 +timeCreated: 1438616330 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GUI.meta b/Assets/GUI.meta new file mode 100644 index 0000000..e1e8aa7 --- /dev/null +++ b/Assets/GUI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 371f3a1cca3f0c3418f427f8cdf4391f +folderAsset: yes +timeCreated: 1438703343 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GUIHandler.cs b/Assets/GUI/GUIHandler.cs similarity index 78% rename from Assets/GUIHandler.cs rename to Assets/GUI/GUIHandler.cs index 1d59589..02fc832 100644 --- a/Assets/GUIHandler.cs +++ b/Assets/GUI/GUIHandler.cs @@ -6,10 +6,14 @@ public class GUIHandler : MonoBehaviour { public InventoryDesplay InventoryDisplay; + public DualInventoryDesplay DualInventory; + public GameObject actionGroup; public ActionButton[] actions = new ActionButton[10]; + public bool inventoryOn; + public bool dualinventoryOn; // Use this for initialization void Start() @@ -19,7 +23,7 @@ void Start() for (int i = 0; i < ac.transform.childCount; i++) { GameObject go = ac.transform.GetChild(i).gameObject; - actions[i] = go.AddComponent(); + //actions[i] = go.AddComponent(); } } diff --git a/Assets/GUIHandler.cs.meta b/Assets/GUI/GUIHandler.cs.meta similarity index 100% rename from Assets/GUIHandler.cs.meta rename to Assets/GUI/GUIHandler.cs.meta diff --git a/Assets/Inventory.meta b/Assets/GUI/Inventory.meta similarity index 100% rename from Assets/Inventory.meta rename to Assets/GUI/Inventory.meta diff --git a/Assets/GUI/Inventory/Dual.meta b/Assets/GUI/Inventory/Dual.meta new file mode 100644 index 0000000..6ea7126 --- /dev/null +++ b/Assets/GUI/Inventory/Dual.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 45c40932bb4c25c4db72dcc6c1472add +folderAsset: yes +timeCreated: 1438857812 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs b/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs new file mode 100644 index 0000000..fa3a493 --- /dev/null +++ b/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; + +public class DualInventoryDesplay : MonoBehaviour +{ + + + public GameObject InventoryCanvasPlayer; + public GameObject InventoryCanvasOther; + + + public GameObject InventoryDubleElement; + + public GameObject[] drawedInvPlayer = new GameObject[10]; + public GameObject[] drawedInvOther = new GameObject[10]; + + DualInventoryElement InventoryDravedElement; + + Inventory player; + Inventory other; + + void Awake() + { + player = GameObject.FindGameObjectWithTag("Player").GetComponent().Inventory; + } + + void Update() + { + UpdateInventory(); + } + + public void UpdateInventory() + { + #region player inventory + + Inventory inv = player; + + GameObject drawingCanvas = InventoryCanvasPlayer.transform.FindChild("Items").gameObject; + GameObject[] drawedInv = drawedInvPlayer; + + for (int i = 0; i < inv.size; i++) + { + if (inv.inventory[i] != null) + { + + if (drawedInv[i] == null) + { + #region setup all + #region setup part + InventoryDravedElement = null; + InventoryDravedElement = Instantiate(InventoryDubleElement).GetComponent(); + InventoryDravedElement.transform.SetParent(drawingCanvas.transform); + #endregion + InventoryDravedElement.Set(inv.inventory[i]); + drawedInv[i] = InventoryDravedElement.gameObject; + drawedInv[i].GetComponent().isPlayer = true; + drawedInv[i].GetComponent().other = other; + drawedInv[i].GetComponent().thisinv = player; + drawedInv[i].GetComponent().index = i; + + Debug.Log(inv.inventory[i].GetType()); + Debug.Log("Drawed " + i); + #endregion + } + else + { + InventoryDravedElement = drawedInv[i].GetComponent(); + InventoryDravedElement.Set(inv.inventory[i].amount); + //Debug.Log(inv.inventory[i].GetType() + " " + InventoryDravedElement.name); + //Debug.Log("Drawed " + i); + } + } + else + { + if (drawedInv[i] != null) + { + Destroy(drawedInv[i]); + drawedInv[i] = null; + } + } + } + #endregion + + + #region other inventory + + inv = other; + + drawingCanvas = InventoryCanvasOther.transform.FindChild("Items").gameObject; + drawedInv = drawedInvOther; + + for (int i = 0; i < inv.size; i++) + { + if (inv.inventory[i] != null) + { + + if (drawedInv[i] == null) + { + #region setup part + InventoryDravedElement = null; + InventoryDravedElement = Instantiate(InventoryDubleElement).GetComponent(); + InventoryDravedElement.transform.SetParent(drawingCanvas.GetComponent()); + + InventoryDravedElement.Set(inv.inventory[i]); + drawedInv[i] = InventoryDravedElement.gameObject; + drawedInv[i].GetComponent().isPlayer = false; + drawedInv[i].GetComponent().other = player; + drawedInv[i].GetComponent().thisinv = other; + drawedInv[i].GetComponent().index = i; + + Debug.Log(inv.inventory[i].GetType()); + Debug.Log("Drawed " + i); + #endregion + } + else + { + #region change part + InventoryDravedElement = drawedInv[i].GetComponent(); + InventoryDravedElement.Set(inv.inventory[i].amount); + //Debug.Log(inv.inventory[i].GetType() + " " + InventoryDravedElement.name); + //Debug.Log("Drawed " + i); + #endregion + } + } + else + { + if (drawedInv[i] != null) + { + Destroy(drawedInv[i]); + drawedInv[i] = null; + } + } + } + #endregion + } + + + public void UpdateInventory(Inventory inv, int num) + { + GameObject drawingCanvas = InventoryCanvasPlayer; + GameObject[] drawedInv = drawedInvPlayer; + if (inv.inventory[num] != null) + { + + if (drawedInv[num] == null) + { + + //invDwrEl = drawedInv[i].GetComponent(); + + Debug.Log("Drawed " + num); + + InventoryDravedElement = null; + InventoryDravedElement = Instantiate(InventoryDubleElement).GetComponent(); + InventoryDravedElement.transform.SetParent(drawingCanvas.transform); + Debug.Log(inv.inventory[num].GetType()); + + InventoryDravedElement.Set(inv.inventory[num]); + + drawedInv[num] = InventoryDravedElement.gameObject; + } + else + { + InventoryDravedElement.Set(inv.inventory[num]); + } + } + } + + public void DesplayInventory(Inventory player, Inventory other) + { + + Inventory inv = player; + GameObject drawingCanvas = InventoryCanvasPlayer; + GameObject[] drawedInv = drawedInvPlayer; + + #region player inventory drawing + for (int i = 0; i < inv.size; i++) + { + if (inv.inventory[i] != null) + { + + if (drawedInv[i] == null) + { + + InventoryDravedElement = null; + InventoryDravedElement = Instantiate(InventoryDubleElement).GetComponent(); + InventoryDravedElement.transform.SetParent(InventoryCanvasPlayer.transform); + + + InventoryDravedElement.Set(inv.inventory[i]); + + drawedInv[i] = InventoryDravedElement.gameObject; + Debug.Log(inv.inventory[i].GetType()); + Debug.Log("Drawed " + i); + } + else + { + InventoryDravedElement = drawedInv[i].GetComponent(); + InventoryDravedElement.Set(inv.inventory[i].amount); + Debug.Log(inv.inventory[i].GetType() + " " + InventoryDravedElement.name); + Debug.Log("Drawed " + i); + } + } + } + #endregion + + inv = other; + drawingCanvas = InventoryCanvasOther; + drawedInv = drawedInvOther; + + + #region Other inventory drawing + for (int i = 0; i < inv.size; i++) + { + if (inv.inventory[i] != null) + { + + if (drawedInv[i] == null) + { + + InventoryDravedElement = null; + InventoryDravedElement = Instantiate(InventoryDubleElement).GetComponent(); + InventoryDravedElement.transform.SetParent(InventoryCanvasPlayer.transform); + + + InventoryDravedElement.Set(inv.inventory[i]); + + drawedInv[i] = InventoryDravedElement.gameObject; + Debug.Log(inv.inventory[i].GetType()); + Debug.Log("Drawed " + i); + } + else + { + InventoryDravedElement = drawedInv[i].GetComponent(); + InventoryDravedElement.Set(inv.inventory[i].amount); + Debug.Log(inv.inventory[i].GetType() + " " + InventoryDravedElement.name); + Debug.Log("Drawed " + i); + } + } + } + #endregion + + } + + public void SetOtherInv(Inventory OtherInventory) + { + other = OtherInventory; + if (OtherInventory != null) + { + drawedInvOther = new GameObject[other.size]; + } + else + { + foreach (GameObject des in drawedInvOther) + { + Destroy(des); + } + } + } + + + +} diff --git a/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs.meta b/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs.meta new file mode 100644 index 0000000..c87b58a --- /dev/null +++ b/Assets/GUI/Inventory/Dual/DualInventoryDesplay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f6396524bbccd5e4c9cec1c179da0699 +timeCreated: 1438851511 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GUI/Inventory/Dual/DualInventoryElement.cs b/Assets/GUI/Inventory/Dual/DualInventoryElement.cs new file mode 100644 index 0000000..f21df35 --- /dev/null +++ b/Assets/GUI/Inventory/Dual/DualInventoryElement.cs @@ -0,0 +1,80 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; + +[AddComponentMenu("Dual Inventory/Dual Inventory Element")] +public class DualInventoryElement : MonoBehaviour +{ + public bool isPlayer; + public string name; + public int amount; + public int index; + + public Inventory other; + public Inventory thisinv; + + public GameController GameCon; + public GameObject nameDisplay; + public GameObject amountDisplay; + + + // Use this for initialization + void Awake() + { + nameDisplay = transform.FindChild("Name").gameObject; + amountDisplay = transform.FindChild("Icon").gameObject; + GameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + + + } + + // Update is called once per frame + void Update() + { + + } + + + #region Set + public void Set(int setAmount) + { + this.amount = setAmount; + amountDisplay.GetComponent().text = null; + amountDisplay.GetComponent().text = setAmount.ToString(); + + //Debug.Log("updated drawed inv element: amount: " + amount + " type: " + this.name + " obj: " + this.GetType().ToString()); + } + + public void Set(string setName) + { + this.name = setName; + Debug.Log(setName); + + nameDisplay.GetComponent().text = setName.ToString(); + } + + public void Set(string setName, int setAmount) + { + Set(setName); + Set(setAmount); + } + + public void Set(Item item) + { + Set(item.amount); + + Debug.Log(GameCon.language); + Set(Language.Get(item, GameCon.language)); + } + #endregion + + + public void Transfer() + { + Debug.Log("Transfer"); + + + other.TransferItem(thisinv, index); + + } +} diff --git a/Assets/GUI/Inventory/Dual/DualInventoryElement.cs.meta b/Assets/GUI/Inventory/Dual/DualInventoryElement.cs.meta new file mode 100644 index 0000000..bf01d79 --- /dev/null +++ b/Assets/GUI/Inventory/Dual/DualInventoryElement.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7a9bc2d3a58412649a178c56679887c9 +timeCreated: 1438851511 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Inventory/Inventory.cs b/Assets/GUI/Inventory/Inventory.cs similarity index 59% rename from Assets/Inventory/Inventory.cs rename to Assets/GUI/Inventory/Inventory.cs index 8fdacff..d0126ff 100644 --- a/Assets/Inventory/Inventory.cs +++ b/Assets/GUI/Inventory/Inventory.cs @@ -1,12 +1,13 @@ using UnityEngine; using System.Collections; +[System.Serializable] public class Inventory { - public Item[] inventory = new Item[10]; - + public Item[] inventory; + public int size; public void Add(Item added) @@ -39,4 +40,26 @@ public void Add(Item added) } + + public Inventory (int InventorySize) + { + inventory = new Item[InventorySize]; + this.size = InventorySize; + } + + public void Remove(int i) + { + inventory[i] = null; + } + + public Item Get(int i) + { + return inventory[i]; + } + + public void TransferItem(Inventory inv, int index) + { + this.Add(inv.Get(index)); + inv.Remove(index); + } } diff --git a/Assets/Inventory/Inventory.cs.meta b/Assets/GUI/Inventory/Inventory.cs.meta similarity index 100% rename from Assets/Inventory/Inventory.cs.meta rename to Assets/GUI/Inventory/Inventory.cs.meta diff --git a/Assets/Inventory/InventoryDesplay.cs b/Assets/GUI/Inventory/InventoryDesplay.cs similarity index 67% rename from Assets/Inventory/InventoryDesplay.cs rename to Assets/GUI/Inventory/InventoryDesplay.cs index 2be75b7..79c133e 100644 --- a/Assets/Inventory/InventoryDesplay.cs +++ b/Assets/GUI/Inventory/InventoryDesplay.cs @@ -1,20 +1,45 @@ using UnityEngine; using System.Collections; +[AddComponentMenu("Inventory/Inventory Desplay")] public class InventoryDesplay : MonoBehaviour { + + public GameObject InventoryCanvas; + //public GameObject InventoryCanvasPlayer; + //public GameObject InventoryCanvasOther; + public GameObject InventoryPrefab; + //public GameObject InventoryDubleElement; - public GameObject[] drawedInv = new GameObject[10]; + public GameObject[] drawedInvPlayer = new GameObject[10]; + //public GameObject[] drawedInvOther = new GameObject[10]; InventoryDrawedElement InventoryDravedElement; + public Inventory player; + //Inventory other; + + void Awake() + { + player = GameObject.FindGameObjectWithTag("Player").GetComponent().Inventory; + } - public void UpdateInventory(Inventory inv) + void Update() { - for (int i = 0; i < 10; i++) + UpdateInventory(); + } + + public void UpdateInventory() + { + Inventory inv = player; + + + GameObject[] drawedInv = drawedInvPlayer; + + for (int i = 0; i < inv.size; i++) { if (inv.inventory[i] != null) { @@ -41,12 +66,22 @@ public void UpdateInventory(Inventory inv) Debug.Log("Drawed " + i); } } + else + { + if (drawedInv[i] != null) + { + Destroy(drawedInv[i]); + drawedInv[i] = null; + } + } } } + public void UpdateInventory(Inventory inv, int num) { - + + GameObject[] drawedInv = drawedInvPlayer; if (inv.inventory[num] != null) { @@ -72,6 +107,11 @@ public void UpdateInventory(Inventory inv, int num) } } } + + + + + } diff --git a/Assets/Inventory/InventoryDesplay.cs.meta b/Assets/GUI/Inventory/InventoryDesplay.cs.meta similarity index 100% rename from Assets/Inventory/InventoryDesplay.cs.meta rename to Assets/GUI/Inventory/InventoryDesplay.cs.meta diff --git a/Assets/Inventory/InventoryDrawedElement.cs b/Assets/GUI/Inventory/InventoryDrawedElement.cs similarity index 77% rename from Assets/Inventory/InventoryDrawedElement.cs rename to Assets/GUI/Inventory/InventoryDrawedElement.cs index 59cf55d..1c3b24c 100644 --- a/Assets/Inventory/InventoryDrawedElement.cs +++ b/Assets/GUI/Inventory/InventoryDrawedElement.cs @@ -2,12 +2,13 @@ using System.Collections; using UnityEngine.UI; -public class InventoryDrawedElement : MonoBehaviour { +public class InventoryDrawedElement : MonoBehaviour +{ public string name; public int amount; - + public GameController GameCon; public GameObject nameDisplay; public GameObject amountDisplay; @@ -16,7 +17,7 @@ public class InventoryDrawedElement : MonoBehaviour { void Awake () { nameDisplay = transform.FindChild("Name").gameObject; amountDisplay = transform.FindChild("Icon").gameObject; - + GameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent(); } // Update is called once per frame @@ -51,6 +52,7 @@ public void Set(Item item) { Set(item.amount); - Set(Language.Get(item)); + Debug.Log(GameCon.language); + Set(Language.Get(item, GameCon.language)); } } diff --git a/Assets/Inventory/InventoryDrawedElement.cs.meta b/Assets/GUI/Inventory/InventoryDrawedElement.cs.meta similarity index 100% rename from Assets/Inventory/InventoryDrawedElement.cs.meta rename to Assets/GUI/Inventory/InventoryDrawedElement.cs.meta diff --git a/Assets/GameController.cs b/Assets/GameController.cs index a7c2f6a..70c3b58 100644 --- a/Assets/GameController.cs +++ b/Assets/GameController.cs @@ -5,15 +5,19 @@ public class GameController : MonoBehaviour { + public GameState gameS; public Map map; public Player playerclass; //map Load - public Sprite[] sprites; + public GameObject mapPiece; public float tileSize; public Vector2 posMultiplyer; + //settings + public int language; + //Ore gen public float orePercent; public float oreReducer; @@ -38,35 +42,39 @@ void OnLevelWasLoaded(int level) { if (level == 1) { - guiHandler = GameObject.Find("_GUIHandler").GetComponent(); - playerclass = GameObject.FindGameObjectWithTag("Player").GetComponent(); - } + guiHandler = GameObject.Find("_GUIHandler").GetComponent(); + playerclass = GameObject.FindGameObjectWithTag("Player").GetComponent(); - } + if (Application.loadedLevelName == "Main" && !gameIsOn) + { - public void Update() - { - if (Application.loadedLevelName == "Main" && !gameIsOn) - { + Debug.Log("Jeej!"); + + Sprite[] GeneratedSprites = Resources.LoadAll("Texturas/Generated"); + GameObject[] BuildingPrefabs = Resources.LoadAll("Prefabs/Buildings"); - Debug.Log("Jeej!"); + GeneratedTile[,] t = TerrainGen.Generate(orePercent, oreReducer, 666421, 2); - sprites = Resources.LoadAll("Texturas"); - Tile[,] t = TerrainGen.Generate(orePercent, oreReducer, 666421, 2); - + map = new Map(t); + Debug.Log(t.Length == null); + Debug.Log(map.mapGenerated == null); - map = new Map(t); - Debug.Log(t.Length == null); - Debug.Log(map.mapArray == null); + MapLoad.MapDraw(map, mapPiece, GeneratedSprites, BuildingPrefabs, tileSize); - MapLoad.MapDraw(map, mapPiece, sprites, tileSize); + gameIsOn = true; - gameIsOn = true; + Camera.main.GetComponent().MapLoaded(); + } - Camera.main.GetComponent().MapLoaded(); } + + } + + public void Update() + { + } public void StartGame() @@ -99,15 +107,27 @@ public IEnumerator LoadLevel(string a) } - public void TogleInventory() + public void TogleSingleInventory() { - if (!(guiHandler.inventoryOn)) + if ((guiHandler.dualinventoryOn)) + { + Debug.Log("Closing"); + guiHandler.actionGroup.SetActive(true); + guiHandler.DualInventory.SetOtherInv(null); + guiHandler.DualInventory.gameObject.SetActive(false); + playerclass.gameObject.GetComponent().isKinematic = false; + guiHandler.dualinventoryOn = false; + gameS = GameState.InGame; + return; + } + else if (!(guiHandler.inventoryOn)) { Debug.Log("Opening"); guiHandler.actionGroup.SetActive(false); guiHandler.InventoryDisplay.gameObject.SetActive(true); playerclass.gameObject.GetComponent().isKinematic = true; guiHandler.inventoryOn = true; + gameS = GameState.Inventory; return; } else @@ -117,8 +137,53 @@ public void TogleInventory() guiHandler.InventoryDisplay.gameObject.SetActive(false); playerclass.gameObject.GetComponent().isKinematic = false; guiHandler.inventoryOn = false; + gameS = GameState.InGame; + return; } } + + public void TogleDualInventory(Inventory other) + { + if ((guiHandler.inventoryOn)) + { + Debug.Log("Closing"); + guiHandler.actionGroup.SetActive(true); + guiHandler.InventoryDisplay.gameObject.SetActive(false); + playerclass.gameObject.GetComponent().isKinematic = false; + guiHandler.inventoryOn = false; + gameS = GameState.InGame; + + return; + } + else if (!(guiHandler.dualinventoryOn)) + { + Debug.Log("Opening"); + guiHandler.actionGroup.SetActive(false); + guiHandler.DualInventory.SetOtherInv(other); + guiHandler.DualInventory.gameObject.SetActive(true); + playerclass.gameObject.GetComponent().isKinematic = true; + guiHandler.dualinventoryOn = true; + gameS = GameState.DualInventory; + return; + } + else + { + Debug.Log("Closing"); + guiHandler.actionGroup.SetActive(true); + guiHandler.DualInventory.SetOtherInv(null); + guiHandler.DualInventory.gameObject.SetActive(false); + playerclass.gameObject.GetComponent().isKinematic = false; + guiHandler.dualinventoryOn = false; + gameS = GameState.InGame; + return; + } + } + + + public void ChangeLanguage(int num) + { + language = num; + } } diff --git a/Assets/scripts/NuclearReactor.cs b/Assets/GameState.cs similarity index 50% rename from Assets/scripts/NuclearReactor.cs rename to Assets/GameState.cs index 2500450..f2e9590 100644 --- a/Assets/scripts/NuclearReactor.cs +++ b/Assets/GameState.cs @@ -3,10 +3,10 @@ using System.Linq; using System.Text; - - - public class NuclearReactor:Building - { - - } - +public enum GameState +{ + InGame, + Inventory, + DualInventory + +} diff --git a/Assets/GameState.cs.meta b/Assets/GameState.cs.meta new file mode 100644 index 0000000..e81ca11 --- /dev/null +++ b/Assets/GameState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 00abcc33a9d59124bb0390ff1f5758ac +timeCreated: 1438938039 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GeneratedTile.cs b/Assets/GeneratedTile.cs new file mode 100644 index 0000000..7af02c3 --- /dev/null +++ b/Assets/GeneratedTile.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +public class GeneratedTile : Tile +{ + public OreType type; + + public GeneratedTile(int xpos, int ypos) + : base(xpos, ypos) + { } +} diff --git a/Assets/GeneratedTile.cs.meta b/Assets/GeneratedTile.cs.meta new file mode 100644 index 0000000..ba20702 --- /dev/null +++ b/Assets/GeneratedTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 10321f9e1c8e60345b85bf84b58a3f45 +timeCreated: 1438680568 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/InputHandler.cs b/Assets/InputHandler.cs index 0137b4c..c4e3bd6 100644 --- a/Assets/InputHandler.cs +++ b/Assets/InputHandler.cs @@ -27,7 +27,13 @@ void Update() if (Input.GetButtonUp("Inventory")) { Debug.Log("Inventory opening"); - GameCon.TogleInventory(); + GameCon.TogleSingleInventory(); + } + + if (Input.GetButtonUp("Mine") && (GameCon.gameS == GameState.InGame)) + { + Debug.Log("Mine"); + GameCon.playerclass.MineStar(); } } } diff --git a/Assets/Language.cs b/Assets/Language.cs index d47538e..27f1f19 100644 --- a/Assets/Language.cs +++ b/Assets/Language.cs @@ -7,16 +7,16 @@ public abstract class Language static public string[,] Names = { - {"CoalOre","Coal Ore"}, - {"StoneOre","Stone"}, - {"SandOre","Sand"}, - {"IronOre","Iron Ore"}, - {"UraniumOre","Uran Ore"}, - {"CoalOre","Coal Ore"}, - {"CoalOre","Coal Ore"} + {"CoalOre", "Coal Ore", "szén érc" }, + {"StoneOre", "Stone", "kő" }, + {"SandOre", "Sand", "homok" }, + {"IronOre", "Iron Ore", "vas érc" }, + {"UraniumOre", "Uran Ore", "urán érc" }, + {"CoalOre", "Coal Ore", "" }, + {"CoalOre", "Coal Ore", "" } }; - public static string Get(System.Object itemObject) + public static string Get(System.Object itemObject, int language) { string name = "Unlocalized Name"; @@ -25,7 +25,12 @@ public static string Get(System.Object itemObject) if (Names[i,0] == itemObject.GetType().ToString()) { - name = Names[i, 1]; + if (language == 2) + { + name = Names[i, 0]; + break; + } + name = Names[i, language+1]; } } diff --git a/Assets/MainBuildingBehaviour.cs b/Assets/MainBuildingBehaviour.cs new file mode 100644 index 0000000..db4897c --- /dev/null +++ b/Assets/MainBuildingBehaviour.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine.UI; +using UnityEngine; + +[System.Serializable] +public class MainBuildingBehaviour : BuildingBehaviour +{ + public Text Name; + public Text InventoryButtonText; + public Text asd; + public GameObject Canvas; + public bool guion; + + + GameController GameCon; + + void Start() + { + GameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + Canvas.SetActive(false); + Canvas.transform.position = Vector3.zero; + } + + void OnMouseDown() + { + if (guion) + { + Canvas.SetActive(false); + guion = false; + } + else + { + Canvas.SetActive(true); + guion = true; + } + } + + public void OpenInventory() + { + GameCon.TogleDualInventory(((MainBuilding)properties).Inventory); + } + +} diff --git a/Assets/MainBuildingBehaviour.cs.meta b/Assets/MainBuildingBehaviour.cs.meta new file mode 100644 index 0000000..1b8f933 --- /dev/null +++ b/Assets/MainBuildingBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0dfe5681681ed1b4b893f8472bc87b04 +timeCreated: 1438759937 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Map.cs b/Assets/Map.cs index 16cb1fa..fea9117 100644 --- a/Assets/Map.cs +++ b/Assets/Map.cs @@ -6,22 +6,30 @@ public class Map { public int mapHeight; - public Tile[, ,] mapArray; + public GeneratedTile[,] mapGenerated; + public Building[,] mapBuilt; + public int seed; - public Map(Tile[,] inmap) + public Map(GeneratedTile[,] inmap) { this.mapHeight = (int)Math.Sqrt(inmap.Length); - this.mapArray = new Tile[mapHeight, mapHeight, 2]; + this.mapGenerated = new GeneratedTile[mapHeight, mapHeight]; for (int i = 0; i < mapHeight; i++) { for (int j = 0; j < mapHeight; j++) { - mapArray[i, j, 0] = inmap[i, j]; + mapGenerated[i, j] = inmap[i, j]; } } + mapBuilt = new Building[mapHeight, mapHeight]; + + int xMpos; + xMpos = ((int)Math.Floor((double)mapHeight / 2)); + + mapBuilt[xMpos, xMpos] = new MainBuilding(xMpos, xMpos); } public Map() diff --git a/Assets/MapLoad.cs b/Assets/MapLoad.cs index 570cda8..84483db 100644 --- a/Assets/MapLoad.cs +++ b/Assets/MapLoad.cs @@ -6,7 +6,7 @@ public class MapLoad - public static void MapDraw(Map map, GameObject mapPiece, Sprite[] sprites, float tileSize) + public static void MapDraw(Map map, GameObject mapPiece, Sprite[] GeneratedSprites, GameObject[] BuildingSprites, float tileSize) { Vector2 posMultiplyer = new Vector2((tileSize / 2), -(tileSize / 2)); @@ -24,7 +24,7 @@ public static void MapDraw(Map map, GameObject mapPiece, Sprite[] sprites, float - if (map.mapArray != null) + if (map.mapGenerated != null) Debug.Log("OK"); @@ -32,6 +32,7 @@ public static void MapDraw(Map map, GameObject mapPiece, Sprite[] sprites, float Debug.Log(map.seed); Debug.Log(map.mapHeight); + #region load generated for (int xPos = 0; xPos < map.mapHeight; xPos++) { @@ -44,7 +45,8 @@ public static void MapDraw(Map map, GameObject mapPiece, Sprite[] sprites, float go.name = "Tile_" + xPos + "_" + yPos; SpriteRenderer curr = go.GetComponent(); - curr.sprite = sprites[((int)map.mapArray[xPos, yPos, 0].type)]; + Debug.Log(xPos + "," + yPos); + curr.sprite = GeneratedSprites[((int)map.mapGenerated[xPos, yPos].type)]; curr.transform.parent = showLay.transform; @@ -56,17 +58,48 @@ public static void MapDraw(Map map, GameObject mapPiece, Sprite[] sprites, float //Debug.Log("Tile Done"); } } + #endregion + + + #region Building load + for (int xPos = 0; xPos < map.mapHeight; xPos++) + { + + for (int yPos = 0; yPos < map.mapHeight; yPos++) + { + if (map.mapBuilt[xPos, yPos] != null) + { + //Debug.Log(xPos + "," + yPos); + + GameObject go = GameObject.Instantiate(BuildingSprites[((int)map.mapBuilt[xPos, yPos].Textura)]); + + go.GetComponent().properties = map.mapBuilt[xPos, yPos]; + + Vector3 pos = new Vector3(yPos + posMultiplyer.x, -xPos + posMultiplyer.y, -5) * tileSize; + + go.transform.localPosition = (pos); + + + + //Debug.Log("Tile Done"); + } + } + } + #endregion + + + } public static void MapUpdate(int x, int y, Map map) { - Sprite[] sprites = Resources.LoadAll("Texturas"); + Sprite[] sprites = Resources.LoadAll("Texturas/Generated"); GameObject go = GameObject.Find("Tile_" + x + "_" + y); SpriteRenderer curr = go.GetComponent(); - curr.sprite = sprites[((int)map.mapArray[x, y, 0].type)]; + curr.sprite = sprites[((int)map.mapGenerated[x, y].type)]; } } diff --git a/Assets/Objects.cd b/Assets/Objects.cd new file mode 100644 index 0000000..b47f9c4 --- /dev/null +++ b/Assets/Objects.cd @@ -0,0 +1,354 @@ + + + + + + ABQADAAAACAAxDAAAAAAAAAAAAAAAEAAAAAAAAAAAAQ= + Assets\ActionButton.cs + + + + + + ABQAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\Behaviour.cs + + + + + + ABQAAEAAACAAAAABEAAAAAAAAAAAQAAAAAAAAAgAAAA= + Assets\CameraChase.cs + + + + + + AAwAGAAACYgAAAgAACAAAEokAAABEAAgCCAAAAAAgEA= + Assets\GameController.cs + + + + + + AAQAAAAAQCAAACAAAAAAAGAAAAAAAAAAAAAAAAAIAAA= + Assets\GUI\GUIHandler.cs + + + + + + ABQAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA= + Assets\InputHandler.cs + + + + + + AAAAgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\Language.cs + + + + + + AAAQAAAAAIAAQAAAAAAAAAAAAAAAABAAAAAAAAAAAAA= + Assets\Map.cs + + + + + + EAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAA= + Assets\MapLoad.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\SandOre.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAA= + Assets\TerrainGen.cs + + + + + + AAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACAAAAAAAAA= + Assets\scripts\Buildings\Building.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Items\Ore\CoalOre.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Items\Food.cs + + + + + + AAAAAAAAQAAAAABAAAAAAQAAAAAAAAAAAAAAAAAAAAQ= + Assets\scripts\Buildings\Generato.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\GlassPLane.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\InteriorPlate.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\Items\Ore\OreIron.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\IronIngot.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\IronPipe.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\IronPlate.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAA= + Assets\scripts\Item.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Buildings\Miner\Miner.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Ore.cs + + + + + + AAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAA= + Assets\scripts\Buildings\Oxigeneration.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\RefrinedUranium.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Resource.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\Roof.cs + + + + + + AAAAAAAAAAAAAAAAAAIAAAAAAAABAAAAAAAAAAAAAAA= + Assets\scripts\Buildings\Miner\SpecMine.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\Stone.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\StoneBrick.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Tool.cs + + + + + + AAAAAAAAAAAAAAAAAAIAAAAAAAABAQAAAAAAAAAAAAA= + Assets\scripts\Buildings\UniverzalMiner.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= + Assets\scripts\Uranium.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Buildings\WareHouse.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Assets\scripts\Wood.cs + + + + + + AAIAAAAAAAAAAAAAAAAAAAAAAACAgIAAAAAAAAAAAAA= + Assets\Tile\OreTile.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAA= + Assets\Tile\Tile.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAA= + Assets\GeneratedTile.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA= + Assets\scripts\Buildings\MainBuilding.cs + + + + + + AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAA= + Assets\BuildingBehaviour.cs + + + + + + ABAAAAAAACAAAAAACCIAAAQAAAAAAQAAIEAAAAAAAAA= + Assets\MainBuildingBehaviour.cs + + + + + + AAIAAAAAAAAAAABAAIAABAAAAAAAAAACAAAAAAAACAA= + Assets\GUI\Inventory\Inventory.cs + + + + + + AAQAAAAAAAQAAAAAAggAAAAAAAAAAAABEAACAAAAAEA= + Assets\GUI\Inventory\InventoryDesplay.cs + + + + + + ABQAAAAAIAAABAAAAAAAAAAAAAAEgAAAAAAAAAAAgEA= + Assets\GUI\Inventory\InventoryDrawedElement.cs + + + + + + ABIIAAAAECAAQAAEAAAAAAAAIAAAAQAAACAAAgAAAAA= + Assets\Player\Player.cs + + + + + + AAQAAAAAACAgAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAA= + Assets\Player\PlayerMovment.cs + + + + + + BAQAAAAAAAAAAAAAAgiAAAAAAAAAQAABBAACAAwAAUA= + Assets\GUI\Inventory\Dual\DualInventoryDesplay.cs + + + + + + AAAAAEAAAAAAAAAAAAAAEAAEAAAAAAAAEAIgAAAAAAA= + Assets\Tile\OreType.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAgAIAAA= + Assets\GameState.cs + + + + \ No newline at end of file diff --git a/Assets/Objects.cd.meta b/Assets/Objects.cd.meta new file mode 100644 index 0000000..5990ba5 --- /dev/null +++ b/Assets/Objects.cd.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c616ecfb9441704dbaada178fc4db05 +timeCreated: 1438680566 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Player/Player.cs b/Assets/Player/Player.cs index 82e234b..3ff8623 100644 --- a/Assets/Player/Player.cs +++ b/Assets/Player/Player.cs @@ -10,7 +10,7 @@ public class Player : MonoBehaviour - public Inventory Inventory = new Inventory(); + public Inventory Inventory = new Inventory(10); public int eatSpeed; public int breathAmount; @@ -46,7 +46,7 @@ public void Mine() Vector2 pos = new Vector2(-1 * (int)Mathf.Round(transform.position.y * 10) / 10, (int)Mathf.Round(transform.position.x * 10) / 10); - Tile ore = ((Tile)GameCon.map.mapArray[(int)pos.x, (int)pos.y, 0]); + GeneratedTile ore = ((GeneratedTile)GameCon.map.mapGenerated[(int)pos.x, (int)pos.y]); if (ore.GetType() == typeof(OreTile)) { @@ -57,7 +57,7 @@ public void Mine() mined = (((Item)Activator.CreateInstance(null, ore.type.ToString() + "Ore").Unwrap())); mined.amount = 1; Inventory.Add(mined); - GameCon.guiHandler.InventoryDisplay.UpdateInventory(Inventory); + GameCon.guiHandler.InventoryDisplay.UpdateInventory(); Debug.Log(((OreTile)ore).amount); if (((OreTile)ore).Mine(1)) @@ -75,7 +75,7 @@ public void MineStar() Vector2 pos = new Vector2(-1 * (int)Mathf.Round(transform.position.y * 10) / 10, (int)Mathf.Round(transform.position.x * 10) / 10); - Tile ore = ((Tile)GameCon.map.mapArray[(int)pos.x, (int)pos.y, 0]); + GeneratedTile ore = ((GeneratedTile)GameCon.map.mapGenerated[(int)pos.x, (int)pos.y]); if (ore.GetType() == typeof(OreTile)) { diff --git a/Assets/Prefabs/DoubleInventoryElement.prefab b/Assets/Prefabs/DoubleInventoryElement.prefab new file mode 100644 index 0000000..835bb81 Binary files /dev/null and b/Assets/Prefabs/DoubleInventoryElement.prefab differ diff --git a/Assets/Prefabs/DoubleInventoryElement.prefab.meta b/Assets/Prefabs/DoubleInventoryElement.prefab.meta new file mode 100644 index 0000000..9fd8f7c --- /dev/null +++ b/Assets/Prefabs/DoubleInventoryElement.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f66703fca4a5d494495133976b495198 +timeCreated: 1438875676 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/LanguageTogler.prefab b/Assets/Prefabs/LanguageTogler.prefab new file mode 100644 index 0000000..eac3eda Binary files /dev/null and b/Assets/Prefabs/LanguageTogler.prefab differ diff --git a/Assets/Prefabs/LanguageTogler.prefab.meta b/Assets/Prefabs/LanguageTogler.prefab.meta new file mode 100644 index 0000000..be766a6 --- /dev/null +++ b/Assets/Prefabs/LanguageTogler.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd7fa9639624dcc4f894591143cc70fd +timeCreated: 1438599176 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs.meta b/Assets/Resources/Prefabs.meta new file mode 100644 index 0000000..2befbfb --- /dev/null +++ b/Assets/Resources/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ba5b0e89a5c95dd4a812587e69d5487e +folderAsset: yes +timeCreated: 1438703798 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/Buildings.meta b/Assets/Resources/Prefabs/Buildings.meta new file mode 100644 index 0000000..aa7db51 --- /dev/null +++ b/Assets/Resources/Prefabs/Buildings.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 63c017e19b7d9d24e999113dc022bdcf +folderAsset: yes +timeCreated: 1438704123 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab b/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab new file mode 100644 index 0000000..63d347b Binary files /dev/null and b/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab differ diff --git a/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab.meta b/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab.meta new file mode 100644 index 0000000..2de3db0 --- /dev/null +++ b/Assets/Resources/Prefabs/Buildings/MainBuilding.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d68969563c9412143ab5753ff0ffe275 +timeCreated: 1438766387 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Texturas/0.png b/Assets/Resources/Texturas/0.png deleted file mode 100644 index d646225..0000000 Binary files a/Assets/Resources/Texturas/0.png and /dev/null differ diff --git a/Assets/Resources/Texturas/Buildings.meta b/Assets/Resources/Texturas/Buildings.meta new file mode 100644 index 0000000..5beb33e --- /dev/null +++ b/Assets/Resources/Texturas/Buildings.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fdd278153513b7b41af16f2bbd89516e +folderAsset: yes +timeCreated: 1438684488 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Texturas/Buildings/0_MainBuilding.png b/Assets/Resources/Texturas/Buildings/0_MainBuilding.png new file mode 100644 index 0000000..5728712 Binary files /dev/null and b/Assets/Resources/Texturas/Buildings/0_MainBuilding.png differ diff --git a/Assets/Resources/Texturas/Buildings/0_MainBuilding.png.meta b/Assets/Resources/Texturas/Buildings/0_MainBuilding.png.meta new file mode 100644 index 0000000..e57b287 --- /dev/null +++ b/Assets/Resources/Texturas/Buildings/0_MainBuilding.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: f6d84f211ce6d304b809b1f538957fe3 +timeCreated: 1438684799 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 32 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Texturas/Generated.meta b/Assets/Resources/Texturas/Generated.meta new file mode 100644 index 0000000..a0ad0b9 --- /dev/null +++ b/Assets/Resources/Texturas/Generated.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 39e7dc640dcc7eb44b31db4adae31b9e +folderAsset: yes +timeCreated: 1438684421 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Texturas/Generated/0_surface.png b/Assets/Resources/Texturas/Generated/0_surface.png new file mode 100644 index 0000000..972f8b3 Binary files /dev/null and b/Assets/Resources/Texturas/Generated/0_surface.png differ diff --git a/Assets/Resources/Texturas/0.png.meta b/Assets/Resources/Texturas/Generated/0_surface.png.meta similarity index 92% rename from Assets/Resources/Texturas/0.png.meta rename to Assets/Resources/Texturas/Generated/0_surface.png.meta index b4c01e9..16b3a3a 100644 --- a/Assets/Resources/Texturas/0.png.meta +++ b/Assets/Resources/Texturas/Generated/0_surface.png.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 66343d11b694d964fb85f09347ceea66 -timeCreated: 1437578921 +guid: 390b69d71723dbb45a3b3fbe25ed7ec7 +timeCreated: 1438592693 licenseType: Free TextureImporter: fileIDToRecycleName: {} @@ -43,7 +43,7 @@ TextureImporter: alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 16 + spritePixelsToUnits: 32 alphaIsTransparency: 1 textureType: 8 buildTargetSettings: [] diff --git a/Assets/Resources/Texturas/1.png b/Assets/Resources/Texturas/Generated/1.png similarity index 100% rename from Assets/Resources/Texturas/1.png rename to Assets/Resources/Texturas/Generated/1.png diff --git a/Assets/Resources/Texturas/1.png.meta b/Assets/Resources/Texturas/Generated/1.png.meta similarity index 100% rename from Assets/Resources/Texturas/1.png.meta rename to Assets/Resources/Texturas/Generated/1.png.meta diff --git a/Assets/Resources/Texturas/2.png b/Assets/Resources/Texturas/Generated/2.png similarity index 100% rename from Assets/Resources/Texturas/2.png rename to Assets/Resources/Texturas/Generated/2.png diff --git a/Assets/Resources/Texturas/2.png.meta b/Assets/Resources/Texturas/Generated/2.png.meta similarity index 100% rename from Assets/Resources/Texturas/2.png.meta rename to Assets/Resources/Texturas/Generated/2.png.meta diff --git a/Assets/Resources/Texturas/3.png b/Assets/Resources/Texturas/Generated/3.png similarity index 100% rename from Assets/Resources/Texturas/3.png rename to Assets/Resources/Texturas/Generated/3.png diff --git a/Assets/Resources/Texturas/3.png.meta b/Assets/Resources/Texturas/Generated/3.png.meta similarity index 100% rename from Assets/Resources/Texturas/3.png.meta rename to Assets/Resources/Texturas/Generated/3.png.meta diff --git a/Assets/Resources/Texturas/4.png b/Assets/Resources/Texturas/Generated/4.png similarity index 100% rename from Assets/Resources/Texturas/4.png rename to Assets/Resources/Texturas/Generated/4.png diff --git a/Assets/Resources/Texturas/4.png.meta b/Assets/Resources/Texturas/Generated/4.png.meta similarity index 100% rename from Assets/Resources/Texturas/4.png.meta rename to Assets/Resources/Texturas/Generated/4.png.meta diff --git a/Assets/Resources/Texturas/5.png b/Assets/Resources/Texturas/Generated/5.png similarity index 100% rename from Assets/Resources/Texturas/5.png rename to Assets/Resources/Texturas/Generated/5.png diff --git a/Assets/Resources/Texturas/5.png.meta b/Assets/Resources/Texturas/Generated/5.png.meta similarity index 100% rename from Assets/Resources/Texturas/5.png.meta rename to Assets/Resources/Texturas/Generated/5.png.meta diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 55d9ff6..a11171e 100644 Binary files a/Assets/Scenes/Main.unity and b/Assets/Scenes/Main.unity differ diff --git a/Assets/Scenes/Start.unity b/Assets/Scenes/Start.unity index b04898c..9f1b0d6 100644 Binary files a/Assets/Scenes/Start.unity and b/Assets/Scenes/Start.unity differ diff --git a/Assets/Scenes/TestScene.unity b/Assets/Scenes/TestScene.unity new file mode 100644 index 0000000..818b0c6 Binary files /dev/null and b/Assets/Scenes/TestScene.unity differ diff --git a/Assets/Scenes/TestScene.unity.meta b/Assets/Scenes/TestScene.unity.meta new file mode 100644 index 0000000..a47fc51 --- /dev/null +++ b/Assets/Scenes/TestScene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 390abe37740600b47824cc8ee70f215a +timeCreated: 1438703572 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TerrainGen.cs b/Assets/TerrainGen.cs index fbdc0cd..2b1d96a 100644 --- a/Assets/TerrainGen.cs +++ b/Assets/TerrainGen.cs @@ -6,7 +6,7 @@ public class TerrainGen{ - public static Tile[,] Generate(float h, float reduce , int seed,int maxOre) + public static GeneratedTile[,] Generate(float h, float reduce , int seed,int maxOre) { FileStream file = new FileStream("./file.txt", FileMode.Create); @@ -16,9 +16,9 @@ public class TerrainGen{ int gen = 50; float[,] h2 = new float[,] { {3f, 15f}, {2f,20f}, {1f,22f}, {0.2f,30f}, {0.1f,40f}, {0.001f,45}}; System.Random rand = new System.Random(seed); - - Tile[,] map = new Tile[50, 50]; - Tile initial; + + GeneratedTile[,] map = new GeneratedTile[50, 50]; + GeneratedTile initial; bool t = false; @@ -27,7 +27,7 @@ public class TerrainGen{ { for (int j = 0; j < gen; j++) { - map[i, j] = new Tile(i, j); + map[i, j] = new GeneratedTile(i, j); } } diff --git a/Assets/Tile/OreTile.cs b/Assets/Tile/OreTile.cs index 95664e5..0111cd8 100644 --- a/Assets/Tile/OreTile.cs +++ b/Assets/Tile/OreTile.cs @@ -1,10 +1,10 @@  -public class OreTile : Tile +public class OreTile : GeneratedTile { public float amount; public float[] miningTime = {0,4,4.5f,5,7,14,3,3}; - public Tile[,] Spread(Tile[,] map, float h, System.Random rnd, float reduce, float amountReduce) + public GeneratedTile[,] Spread(GeneratedTile[,] map, float h, System.Random rnd, float reduce, float amountReduce) { int l = (int)System.Math.Sqrt(map.Length); diff --git a/Assets/Tile/Tile.cs b/Assets/Tile/Tile.cs index e5a5a92..7602636 100644 --- a/Assets/Tile/Tile.cs +++ b/Assets/Tile/Tile.cs @@ -1,7 +1,7 @@  public class Tile { - public OreType type; + public int x, y; public Tile(int xpos, int ypos) diff --git a/Assets/UnityVS.meta b/Assets/UnityVS.meta new file mode 100644 index 0000000..4ed67cd --- /dev/null +++ b/Assets/UnityVS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02fe78e962405814a83b8ba6c9471d32 +folderAsset: yes +timeCreated: 1438615220 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnityVS/Editor.meta b/Assets/UnityVS/Editor.meta new file mode 100644 index 0000000..615808d --- /dev/null +++ b/Assets/UnityVS/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6e71a3e2fb5854e43823a9da25b68e21 +folderAsset: yes +timeCreated: 1438615220 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll new file mode 100644 index 0000000..c8e6011 Binary files /dev/null and b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll differ diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta new file mode 100644 index 0000000..3d88642 --- /dev/null +++ b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta @@ -0,0 +1 @@ +guid: 38d405c119fcc7c4e83d4a478a40ff2f diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll new file mode 100644 index 0000000..b48f81e Binary files /dev/null and b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll differ diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta new file mode 100644 index 0000000..1645275 --- /dev/null +++ b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta @@ -0,0 +1 @@ +guid: 4ad02dc83da735c4e8d945332b9202f6 diff --git a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll new file mode 100644 index 0000000..53a1841 Binary files /dev/null and b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll differ diff --git a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta new file mode 100644 index 0000000..3e3a39d --- /dev/null +++ b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 8a6acd3e3a6b57d40838ad9cc3fe480e +timeCreated: 1438615234 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/Assembler.cs b/Assets/scripts/Assembler.cs deleted file mode 100644 index 6a53a8d..0000000 --- a/Assets/scripts/Assembler.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - - public class Assembler:Producer - { - public int speed; - - public void Production() - { - throw new System.NotImplementedException(); - } - } - diff --git a/Assets/scripts/Buildings.meta b/Assets/scripts/Buildings.meta new file mode 100644 index 0000000..e3e6aba --- /dev/null +++ b/Assets/scripts/Buildings.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 33723db525bde324d81febbeb0609a02 +folderAsset: yes +timeCreated: 1438680567 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/Buildings/Assembler.cs b/Assets/scripts/Buildings/Assembler.cs new file mode 100644 index 0000000..2ec9c1b --- /dev/null +++ b/Assets/scripts/Buildings/Assembler.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + + //public class Assembler:Producer + //{ + // public int speed; + + // public void Production() + // { + // throw new System.NotImplementedException(); + // } + //} + diff --git a/Assets/scripts/Assembler.cs.meta b/Assets/scripts/Buildings/Assembler.cs.meta similarity index 76% rename from Assets/scripts/Assembler.cs.meta rename to Assets/scripts/Buildings/Assembler.cs.meta index 948ec3e..7cc7c6f 100644 --- a/Assets/scripts/Assembler.cs.meta +++ b/Assets/scripts/Buildings/Assembler.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 85eb1f1317c4f9f4b9eab76ee073941a -timeCreated: 1437723305 +guid: 8be1a2d240685ab4c880c1121863b8ab +timeCreated: 1438680570 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Building.cs b/Assets/scripts/Buildings/Building.cs similarity index 65% rename from Assets/scripts/Building.cs rename to Assets/scripts/Buildings/Building.cs index 9df2614..1af736c 100644 --- a/Assets/scripts/Building.cs +++ b/Assets/scripts/Buildings/Building.cs @@ -2,16 +2,21 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using UnityEngine; - + [System.Serializable] public class Building { public List buildingMaterials; - + public int Textura; public void Usage() { throw new System.NotImplementedException(); } + + public Building(int xpos, int ypos) + {} + } diff --git a/Assets/scripts/Building.cs.meta b/Assets/scripts/Buildings/Building.cs.meta similarity index 76% rename from Assets/scripts/Building.cs.meta rename to Assets/scripts/Buildings/Building.cs.meta index f652c13..96ad5a8 100644 --- a/Assets/scripts/Building.cs.meta +++ b/Assets/scripts/Buildings/Building.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 5998b4a01f488d44991b01183575542d -timeCreated: 1437723304 +guid: 10902ca0e0092384ca56edad3d2e0334 +timeCreated: 1438680568 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/Furnace.cs b/Assets/scripts/Buildings/Furnace.cs new file mode 100644 index 0000000..f86964c --- /dev/null +++ b/Assets/scripts/Buildings/Furnace.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + + //public class Furnace:Producer + //{ + // public int speed; + + // public void Production() + // { + // throw new System.NotImplementedException(); + // } + //} + diff --git a/Assets/scripts/Furnace.cs.meta b/Assets/scripts/Buildings/Furnace.cs.meta similarity index 76% rename from Assets/scripts/Furnace.cs.meta rename to Assets/scripts/Buildings/Furnace.cs.meta index bfbbe2b..6110cec 100644 --- a/Assets/scripts/Furnace.cs.meta +++ b/Assets/scripts/Buildings/Furnace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 103851bd3918be24d9514b29e15ed544 -timeCreated: 1437723300 +guid: a04aad07443a5804981fc4f213194f2f +timeCreated: 1438680570 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Generato.cs b/Assets/scripts/Buildings/Generato.cs similarity index 68% rename from Assets/scripts/Generato.cs rename to Assets/scripts/Buildings/Generato.cs index e856266..7577f77 100644 --- a/Assets/scripts/Generato.cs +++ b/Assets/scripts/Buildings/Generato.cs @@ -18,8 +18,12 @@ public void Transfer() { if (this.internalsorage > 1) { - main.Inventory =+ this.internalsorage; + //main.Inventory =+ this.internalsorage; } } + + public Generator(int xpos, int ypos) + : base(xpos, ypos) + {} } diff --git a/Assets/scripts/Generato.cs.meta b/Assets/scripts/Buildings/Generato.cs.meta similarity index 76% rename from Assets/scripts/Generato.cs.meta rename to Assets/scripts/Buildings/Generato.cs.meta index fd3f226..a3f44bd 100644 --- a/Assets/scripts/Generato.cs.meta +++ b/Assets/scripts/Buildings/Generato.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: d34caf78fb22fdb4b85a94f3702c625d -timeCreated: 1437723311 +guid: 7262f4c137450054386d9d77252902fc +timeCreated: 1438680570 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/MainBuilding.cs b/Assets/scripts/Buildings/MainBuilding.cs new file mode 100644 index 0000000..c784dab --- /dev/null +++ b/Assets/scripts/Buildings/MainBuilding.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +public class MainBuilding : Building +{ + + public Inventory Inventory = new Inventory(20); + + + public MainBuilding(int xpos, int ypos) :base(xpos,ypos) + { + base.Textura = 0; + } +} + diff --git a/Assets/scripts/Class1.cs.meta b/Assets/scripts/Buildings/MainBuilding.cs.meta similarity index 100% rename from Assets/scripts/Class1.cs.meta rename to Assets/scripts/Buildings/MainBuilding.cs.meta diff --git a/Assets/scripts/Buildings/Miner.meta b/Assets/scripts/Buildings/Miner.meta new file mode 100644 index 0000000..6f16985 --- /dev/null +++ b/Assets/scripts/Buildings/Miner.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 936984fe175516746800a4d4d10d26ac +folderAsset: yes +timeCreated: 1438684107 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/Miner.cs b/Assets/scripts/Buildings/Miner/Miner.cs similarity index 62% rename from Assets/scripts/Miner.cs rename to Assets/scripts/Buildings/Miner/Miner.cs index e1403c2..a0bfbb4 100644 --- a/Assets/scripts/Miner.cs +++ b/Assets/scripts/Buildings/Miner/Miner.cs @@ -8,9 +8,9 @@ public class Miner : Generator { - public void Mine() + public Miner(int xpos, int ypos) :base(xpos,ypos) { - throw new System.NotImplementedException(); + } } diff --git a/Assets/scripts/Miner.cs.meta b/Assets/scripts/Buildings/Miner/Miner.cs.meta similarity index 76% rename from Assets/scripts/Miner.cs.meta rename to Assets/scripts/Buildings/Miner/Miner.cs.meta index 1665c03..32f395e 100644 --- a/Assets/scripts/Miner.cs.meta +++ b/Assets/scripts/Buildings/Miner/Miner.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 3baf1385789e3dc47a0ac18822ec4f4a -timeCreated: 1437723302 +guid: 7d455d133e1765c47a481f4768a34d18 +timeCreated: 1438684110 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/SpecMine.cs b/Assets/scripts/Buildings/Miner/SpecMine.cs similarity index 62% rename from Assets/scripts/SpecMine.cs rename to Assets/scripts/Buildings/Miner/SpecMine.cs index 066be18..4482948 100644 --- a/Assets/scripts/SpecMine.cs +++ b/Assets/scripts/Buildings/Miner/SpecMine.cs @@ -10,9 +10,8 @@ public class SpecMine : Miner public OreType type; public int capacity; - public void Mine() - { - throw new System.NotImplementedException(); - } + public SpecMine(int xpos, int ypos) + : base(xpos, ypos) + { } } diff --git a/Assets/scripts/SpecMine.cs.meta b/Assets/scripts/Buildings/Miner/SpecMine.cs.meta similarity index 76% rename from Assets/scripts/SpecMine.cs.meta rename to Assets/scripts/Buildings/Miner/SpecMine.cs.meta index adae9ee..e65edd7 100644 --- a/Assets/scripts/SpecMine.cs.meta +++ b/Assets/scripts/Buildings/Miner/SpecMine.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 42d1bbd3a14c3fb47ad81da7bb0d309e -timeCreated: 1437723303 +guid: 05f4d1117cf3c3847b8ccfa84a0821e3 +timeCreated: 1438684108 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/NuclearReactor.cs b/Assets/scripts/Buildings/NuclearReactor.cs new file mode 100644 index 0000000..768f312 --- /dev/null +++ b/Assets/scripts/Buildings/NuclearReactor.cs @@ -0,0 +1,12 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; + + + +// public class NuclearReactor:Building +// { + +// } + diff --git a/Assets/scripts/NuclearReactor.cs.meta b/Assets/scripts/Buildings/NuclearReactor.cs.meta similarity index 76% rename from Assets/scripts/NuclearReactor.cs.meta rename to Assets/scripts/Buildings/NuclearReactor.cs.meta index b401e5f..cc4ce4c 100644 --- a/Assets/scripts/NuclearReactor.cs.meta +++ b/Assets/scripts/Buildings/NuclearReactor.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: cceee9ca605e88a4ab705ebab6353913 -timeCreated: 1437723309 +guid: 4b45bef45661d5c45b5fde0d1e70e784 +timeCreated: 1438680569 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Oxigeneration.cs b/Assets/scripts/Buildings/Oxigeneration.cs similarity index 60% rename from Assets/scripts/Oxigeneration.cs rename to Assets/scripts/Buildings/Oxigeneration.cs index d9b3e92..0bb9a14 100644 --- a/Assets/scripts/Oxigeneration.cs +++ b/Assets/scripts/Buildings/Oxigeneration.cs @@ -11,9 +11,8 @@ public class Oxigenerator:Generator public int capacity; - public void Get(int slot, int amount) - { - throw new NotImplementedException(); - } + public Oxigenerator(int xpos, int ypos) + : base(xpos, ypos) + { } } diff --git a/Assets/scripts/Oxigeneration.cs.meta b/Assets/scripts/Buildings/Oxigeneration.cs.meta similarity index 76% rename from Assets/scripts/Oxigeneration.cs.meta rename to Assets/scripts/Buildings/Oxigeneration.cs.meta index a3ffe5a..edfab42 100644 --- a/Assets/scripts/Oxigeneration.cs.meta +++ b/Assets/scripts/Buildings/Oxigeneration.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 1dca0f6f8a30c89408776b902c47082a -timeCreated: 1437723301 +guid: 70256e9a73ede8d4b86f5d43f5d15d31 +timeCreated: 1438680569 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/Producer.cs b/Assets/scripts/Buildings/Producer.cs new file mode 100644 index 0000000..2dea727 --- /dev/null +++ b/Assets/scripts/Buildings/Producer.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + + + //public class Producer:Building + //{ + // public void Production() + // { + // throw new System.NotImplementedException(); + // } + //} + diff --git a/Assets/scripts/Producer.cs.meta b/Assets/scripts/Buildings/Producer.cs.meta similarity index 76% rename from Assets/scripts/Producer.cs.meta rename to Assets/scripts/Buildings/Producer.cs.meta index 0dbd073..e760ffb 100644 --- a/Assets/scripts/Producer.cs.meta +++ b/Assets/scripts/Buildings/Producer.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: cfbbd71e63197324d904d3c271122426 -timeCreated: 1437723310 +guid: 82e0e334f5dc8844fa8885bf4916f3fc +timeCreated: 1438680570 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/ResearchFacility.cs b/Assets/scripts/Buildings/ResearchFacility.cs new file mode 100644 index 0000000..923787a --- /dev/null +++ b/Assets/scripts/Buildings/ResearchFacility.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + + + //public class ResearchFacility:Building + //{ + // private int researchspeed; + + // public void Research() + // { + // throw new System.NotImplementedException(); + // } + //} + diff --git a/Assets/scripts/ResearchFacility.cs.meta b/Assets/scripts/Buildings/ResearchFacility.cs.meta similarity index 76% rename from Assets/scripts/ResearchFacility.cs.meta rename to Assets/scripts/Buildings/ResearchFacility.cs.meta index fe5c8ef..cb1887f 100644 --- a/Assets/scripts/ResearchFacility.cs.meta +++ b/Assets/scripts/Buildings/ResearchFacility.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 027edef5ea90ca1429e1ca4043fc50e6 -timeCreated: 1437723297 +guid: 0756710f4958dac438ffa3a114a86d66 +timeCreated: 1438680567 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/UniverzalMiner.cs b/Assets/scripts/Buildings/UniverzalMiner.cs similarity index 65% rename from Assets/scripts/UniverzalMiner.cs rename to Assets/scripts/Buildings/UniverzalMiner.cs index 87f18fa..7524e34 100644 --- a/Assets/scripts/UniverzalMiner.cs +++ b/Assets/scripts/Buildings/UniverzalMiner.cs @@ -11,9 +11,7 @@ public class UniverzalMiner:Miner public int speed; public OreType type; - public void MIne() - { - throw new System.NotImplementedException(); - } + public UniverzalMiner(int xpos, int ypos) : base(xpos,ypos) + {} } diff --git a/Assets/scripts/UniverzalMiner.cs.meta b/Assets/scripts/Buildings/UniverzalMiner.cs.meta similarity index 76% rename from Assets/scripts/UniverzalMiner.cs.meta rename to Assets/scripts/Buildings/UniverzalMiner.cs.meta index bb1dac9..3467485 100644 --- a/Assets/scripts/UniverzalMiner.cs.meta +++ b/Assets/scripts/Buildings/UniverzalMiner.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: a7067429fa2813249a6a9a5c14152592 -timeCreated: 1437723308 +guid: ee75ba7097aa83e43908c41ad8700c7c +timeCreated: 1438680571 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Buildings/UraniumRefiner.cs b/Assets/scripts/Buildings/UraniumRefiner.cs new file mode 100644 index 0000000..c51a212 --- /dev/null +++ b/Assets/scripts/Buildings/UraniumRefiner.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + + + //public class UraniumRefiner:Producer + //{ + // public int speed; + + // public void Production() + // { + // throw new System.NotImplementedException(); + // } + //} + diff --git a/Assets/scripts/UraniumRefiner.cs.meta b/Assets/scripts/Buildings/UraniumRefiner.cs.meta similarity index 76% rename from Assets/scripts/UraniumRefiner.cs.meta rename to Assets/scripts/Buildings/UraniumRefiner.cs.meta index df62275..6d750bd 100644 --- a/Assets/scripts/UraniumRefiner.cs.meta +++ b/Assets/scripts/Buildings/UraniumRefiner.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 791bb489f99ee2f49a12b58759fcbfe3 -timeCreated: 1437723304 +guid: 1bfab0ca10353ff4993cf64be30ef95a +timeCreated: 1438680568 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/WareHouse.cs b/Assets/scripts/Buildings/WareHouse.cs similarity index 58% rename from Assets/scripts/WareHouse.cs rename to Assets/scripts/Buildings/WareHouse.cs index 84a0ada..62748f7 100644 --- a/Assets/scripts/WareHouse.cs +++ b/Assets/scripts/Buildings/WareHouse.cs @@ -7,5 +7,8 @@ public class WareHouse:Building { + public WareHouse(int xpos, int ypos) + : base(xpos, ypos) + {} } diff --git a/Assets/scripts/WareHouse.cs.meta b/Assets/scripts/Buildings/WareHouse.cs.meta similarity index 76% rename from Assets/scripts/WareHouse.cs.meta rename to Assets/scripts/Buildings/WareHouse.cs.meta index bf4d751..2aa5d75 100644 --- a/Assets/scripts/WareHouse.cs.meta +++ b/Assets/scripts/Buildings/WareHouse.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 755a6513ec4dff7488d766e3808a4ae2 -timeCreated: 1437723304 +guid: f4135416603522c438e2e64855c46edd +timeCreated: 1438680573 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/scripts/Class1.cs b/Assets/scripts/Class1.cs deleted file mode 100644 index 9b96647..0000000 --- a/Assets/scripts/Class1.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - - - - - public class MainBuilding - { - - public int Inventory; - } - diff --git a/Assets/scripts/Furnace.cs b/Assets/scripts/Furnace.cs deleted file mode 100644 index 23d2da5..0000000 --- a/Assets/scripts/Furnace.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - - public class Furnace:Producer - { - public int speed; - - public void Production() - { - throw new System.NotImplementedException(); - } - } - diff --git a/Assets/scripts/Items.meta b/Assets/scripts/Items.meta new file mode 100644 index 0000000..03ab151 --- /dev/null +++ b/Assets/scripts/Items.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 55f91f1b6498b09419aaaffafdbe769d +folderAsset: yes +timeCreated: 1438680567 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/Food.cs b/Assets/scripts/Items/Food.cs similarity index 100% rename from Assets/scripts/Food.cs rename to Assets/scripts/Items/Food.cs diff --git a/Assets/scripts/Food.cs.meta b/Assets/scripts/Items/Food.cs.meta similarity index 100% rename from Assets/scripts/Food.cs.meta rename to Assets/scripts/Items/Food.cs.meta diff --git a/Assets/scripts/Items/Ore.meta b/Assets/scripts/Items/Ore.meta new file mode 100644 index 0000000..13efc3f --- /dev/null +++ b/Assets/scripts/Items/Ore.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b5b47974fdf2bdc41baa89378b1b9e95 +folderAsset: yes +timeCreated: 1438684164 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/coal.cs b/Assets/scripts/Items/Ore/CoalOre.cs similarity index 100% rename from Assets/scripts/coal.cs rename to Assets/scripts/Items/Ore/CoalOre.cs diff --git a/Assets/scripts/coal.cs.meta b/Assets/scripts/Items/Ore/CoalOre.cs.meta similarity index 100% rename from Assets/scripts/coal.cs.meta rename to Assets/scripts/Items/Ore/CoalOre.cs.meta diff --git a/Assets/scripts/Iron.cs b/Assets/scripts/Items/Ore/OreIron.cs similarity index 100% rename from Assets/scripts/Iron.cs rename to Assets/scripts/Items/Ore/OreIron.cs diff --git a/Assets/scripts/Iron.cs.meta b/Assets/scripts/Items/Ore/OreIron.cs.meta similarity index 100% rename from Assets/scripts/Iron.cs.meta rename to Assets/scripts/Items/Ore/OreIron.cs.meta diff --git a/Assets/scripts/Producer.cs b/Assets/scripts/Producer.cs deleted file mode 100644 index 5b72c95..0000000 --- a/Assets/scripts/Producer.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - - - public class Producer:Building - { - public void Production() - { - throw new System.NotImplementedException(); - } - } - diff --git a/Assets/scripts/ResearchFacility.cs b/Assets/scripts/ResearchFacility.cs deleted file mode 100644 index 867b6df..0000000 --- a/Assets/scripts/ResearchFacility.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - - - public class ResearchFacility:Building - { - private int researchspeed; - - public void Research() - { - throw new System.NotImplementedException(); - } - } - diff --git a/Assets/scripts/UraniumRefiner.cs b/Assets/scripts/UraniumRefiner.cs deleted file mode 100644 index 83b2fcf..0000000 --- a/Assets/scripts/UraniumRefiner.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - - - public class UraniumRefiner:Producer - { - public int speed; - - public void Production() - { - throw new System.NotImplementedException(); - } - } - diff --git a/Assets/test.sequencediagram b/Assets/test.sequencediagram new file mode 100644 index 0000000..071349b --- /dev/null +++ b/Assets/test.sequencediagram @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/test.sequencediagram.layout b/Assets/test.sequencediagram.layout new file mode 100644 index 0000000..37cc4e1 --- /dev/null +++ b/Assets/test.sequencediagram.layout @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/test.sequencediagram.layout.meta b/Assets/test.sequencediagram.layout.meta new file mode 100644 index 0000000..29e7df3 --- /dev/null +++ b/Assets/test.sequencediagram.layout.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3449173089f662b498c2509e70bd2c22 +timeCreated: 1438937752 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test.sequencediagram.meta b/Assets/test.sequencediagram.meta new file mode 100644 index 0000000..8098614 --- /dev/null +++ b/Assets/test.sequencediagram.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab8a6c46b60de834497822245209a9ad +timeCreated: 1438937752 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 5c4e082..25e314c 100644 Binary files a/ProjectSettings/InputManager.asset and b/ProjectSettings/InputManager.asset differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index b2305a6..827ee8b 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ