diff --git a/Assets/Models/mollo.blend b/Assets/Models/mollo.blend new file mode 100644 index 0000000..3c960e3 Binary files /dev/null and b/Assets/Models/mollo.blend differ diff --git a/Assets/Scripts/SpawnManager.cs b/Assets/Scripts/SpawnManager.cs index e64a783..66da5ea 100644 --- a/Assets/Scripts/SpawnManager.cs +++ b/Assets/Scripts/SpawnManager.cs @@ -7,6 +7,11 @@ public class SpawnManager : MonoBehaviour public List enemyList = new List(); public List spawnPoints = new List(); + public int enemyNumber = 10; + public GameObject Sun = new GameObject(); + + bool night = false; + bool alreadySpawn = false; // Start is called before the first frame update void Start() @@ -17,6 +22,46 @@ public class SpawnManager : MonoBehaviour // Update is called once per frame void Update() { + float sunRotationX = Sun.transform.localEulerAngles.x; + sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX; + + Debug.Log(sunRotationX.ToString()); + if (sunRotationX < 0) + { + Debug.Log("It is a Night"); + night = true; + } else { + Debug.Log("It is a Day"); + night = false; + } + + if (!night) + { + alreadySpawn = false; + } + + if (!alreadySpawn && night) + { + for (int i = 0; i < enemyNumber; i++) + { + int randomSpawnPoint = Random.Range(0, (spawnPoints.Count - 1)); + int random = Random.Range(0, (enemyList.Count - 1)); + GameObject randomSpawnPointGO = spawnPoints[randomSpawnPoint].gameObject; + + Instantiate(enemyList[random], new Vector3(randomSpawnPointGO.transform.position.x, randomSpawnPointGO.transform.position.y, randomSpawnPointGO.transform.position.z), Quaternion.identity); + alreadySpawn = true; + } + } + } + + public static float Clamp0360(float eulerAngles) + { + float result = eulerAngles - Mathf.CeilToInt(eulerAngles / 360f) * 360f; + if (result < 0) + { + result += 360f; + } + return result; } } diff --git a/Assets/Sprites/Icons/Hammer.png b/Assets/Sprites/Icons/Hammer.png new file mode 100644 index 0000000..b8a025b Binary files /dev/null and b/Assets/Sprites/Icons/Hammer.png differ diff --git a/Assets/Sprites/Icons/Hammer.png.meta b/Assets/Sprites/Icons/Hammer.png.meta new file mode 100644 index 0000000..4cd41ab --- /dev/null +++ b/Assets/Sprites/Icons/Hammer.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: d55b404a7fd26744a9731469621f0035 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Icons/Shotgun.png b/Assets/Sprites/Icons/Shotgun.png new file mode 100644 index 0000000..a3dea97 Binary files /dev/null and b/Assets/Sprites/Icons/Shotgun.png differ diff --git a/Assets/Sprites/Icons/Shotgun.png.meta b/Assets/Sprites/Icons/Shotgun.png.meta new file mode 100644 index 0000000..fbc31fd --- /dev/null +++ b/Assets/Sprites/Icons/Shotgun.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: adad66208e188914d9729f7af2614b19 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: