diff --git a/Assets/Prefab/City.prefab b/Assets/Prefab/City.prefab index 75ad318c621617c5fb6a2ecf39feae7d40078dff..bd359c7e3a5bcd52ef09a2f8cf5c1ed8e173c916 100644 --- a/Assets/Prefab/City.prefab +++ b/Assets/Prefab/City.prefab @@ -70,7 +70,7 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: f591b023f317ffb4da566dc4f05efe84, type: 3} + m_Sprite: {fileID: 21300000, guid: a69243cd6bee5c34497418b7bbea1e20, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -119,3 +119,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: dfe928a858872424991e927606dd4bc3, type: 3} m_Name: m_EditorClassIdentifier: + worker: {fileID: 0} + population: 0 + populationLevel: 0 + resourcePoolLevel: 0 + roadLevel: 0 + collectorLevel: 0 diff --git a/Assets/Prefab/ground/GroundGenerator.prefab b/Assets/Prefab/ground/GroundGenerator.prefab index b2def8a24068bd4be3d45f4975f87a4e417dbe40..032267cf8615ca6079e10313e165e14a71e2bd6d 100644 --- a/Assets/Prefab/ground/GroundGenerator.prefab +++ b/Assets/Prefab/ground/GroundGenerator.prefab @@ -57,3 +57,5 @@ MonoBehaviour: - {fileID: 3917056544714409889, guid: 01c364ebfc67d2c448bff8e94d6a73e4, type: 3} - {fileID: 7205059401526678128, guid: 8a7319b0cfb1b554a8dd101ad4e060be, type: 3} - {fileID: 7666959473089792538, guid: 3d8a1dd57f0015c4093d8bfb80c3c303, type: 3} + homeGO: {fileID: 7607310651946833762, guid: 118ed7528555d45418acb5a87b330000, type: 3} + workerGO: {fileID: 548039319383633024, guid: 7dc194a2047a39340a91ca7636a56290, type: 3} diff --git a/Assets/Scripts/CameraMover.cs b/Assets/Scripts/CameraMover.cs new file mode 100644 index 0000000000000000000000000000000000000000..555d1b49485efaa74ce501556538871bc502d866 --- /dev/null +++ b/Assets/Scripts/CameraMover.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CameraMover : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + if (Input.anyKey) { + float x = transform.position.x; + float y = transform.position.y; + float z = transform.position.z; + if (Input.GetKey(KeyCode.LeftArrow)){ + gameObject.transform.position = new Vector3(x - 0.1f, y, z); + } + if (Input.GetKey(KeyCode.RightArrow)){ + gameObject.transform.position = new Vector3(x + 0.1f, y, z); + } + if (Input.GetKey(KeyCode.UpArrow)){ + gameObject.transform.position = new Vector3(x, y + 0.1f, z); + } + if (Input.GetKey(KeyCode.DownArrow)){ + gameObject.transform.position = new Vector3(x, y - 0.1f, z); + } + } + } +} diff --git a/Assets/Scripts/CameraMover.cs.meta b/Assets/Scripts/CameraMover.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..3738470e17b449a4ba61de2dcf4ff5a1c7806b3a --- /dev/null +++ b/Assets/Scripts/CameraMover.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d269887e77657841a2e967e56313d5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GroundGenerator/GroundGenerator.cs b/Assets/Scripts/GroundGenerator/GroundGenerator.cs index 900f6967219a2db32febb3818e0876701742e32f..659461ee4f189be7ccd8f4585f1676e8c531794a 100644 --- a/Assets/Scripts/GroundGenerator/GroundGenerator.cs +++ b/Assets/Scripts/GroundGenerator/GroundGenerator.cs @@ -11,10 +11,15 @@ public class GroundGenerator : MonoBehaviour private GameObject[] tiles = null; [SerializeField] private GameObject[] resourceGOs = null; + [SerializeField] + private GameObject homeGO = null; + [SerializeField] + private GameObject workerGO = null; private int food = 2; private int stone = 3; private int wood = 4; + private int home = 5; /* 0,1,2 3,4,5 @@ -36,6 +41,7 @@ public class GroundGenerator : MonoBehaviour } createGround(); + createHome(); createResources(); Destroy(gameObject); @@ -131,6 +137,11 @@ public class GroundGenerator : MonoBehaviour } } + private void createHome() { + ground[ground.GetLength(0) / 2, ground.GetLength(1) / 2] = home; + spawn(homeGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0); + spawn(workerGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0); + } private GameObject spawn(GameObject go, int x, int y, int z = 1) { return Instantiate<GameObject>(go, new Vector3(x, y, z), Quaternion.identity); }