diff --git a/Assets/Prefabs/Input/Player.prefab b/Assets/Prefabs/Input/Player.prefab index 99199fbb0..717ac7f86 100644 --- a/Assets/Prefabs/Input/Player.prefab +++ b/Assets/Prefabs/Input/Player.prefab @@ -337,6 +337,57 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &345906872987025452 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3484089900029681523} + - component: {fileID: 4146737323431763604} + m_Layer: 5 + m_Name: Spam + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3484089900029681523 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 345906872987025452} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3570743071879246586} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &4146737323431763604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 345906872987025452} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 054f8241b622aff439e7b31758f43d23, type: 3} + m_Name: + m_EditorClassIdentifier: + popups: + - {fileID: 2749458525383876187, guid: 6e375834f9190b44b85120879f9bbee1, type: 3} --- !u!1 &650044701630506088 GameObject: m_ObjectHideFlags: 0 @@ -936,6 +987,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 3484089900029681523} - {fileID: 5051670465698078307} - {fileID: 1664387495115092571} - {fileID: 1417967732049705392} diff --git a/Assets/Prefabs/UI/SpamWindow.prefab b/Assets/Prefabs/UI/SpamWindow.prefab new file mode 100644 index 000000000..5edda20d1 --- /dev/null +++ b/Assets/Prefabs/UI/SpamWindow.prefab @@ -0,0 +1,109 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3985983561988511089 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1225662013474792832} + - component: {fileID: 4203500173424713874} + - component: {fileID: 196829886972534681} + - component: {fileID: 2749458525383876187} + - component: {fileID: 3979177335964750275} + m_Layer: 5 + m_Name: SpamWindow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1225662013474792832 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3985983561988511089} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 27.8552, y: 3.3161} + m_SizeDelta: {x: 360, y: 264} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4203500173424713874 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3985983561988511089} + m_CullTransparentMesh: 1 +--- !u!114 &196829886972534681 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3985983561988511089} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1208c49ff8294ce498efcc7be814bca7, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &2749458525383876187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3985983561988511089} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf36c31efc151dc4b96cecf0ef7f1f29, type: 3} + m_Name: + m_EditorClassIdentifier: + minTimeout: 2 + maxTimeout: 4 +--- !u!114 &3979177335964750275 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3985983561988511089} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf39a137c20631044b50258ded7b8ed2, type: 3} + m_Name: + m_EditorClassIdentifier: + baseWaitTime: 0 + additionalWaitTime: 0 + repeat: 0 diff --git a/Assets/Prefabs/UI/SpamWindow.prefab.meta b/Assets/Prefabs/UI/SpamWindow.prefab.meta new file mode 100644 index 000000000..dbe15adad --- /dev/null +++ b/Assets/Prefabs/UI/SpamWindow.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6e375834f9190b44b85120879f9bbee1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/Popup.cs b/Assets/Scripts/UI/Popup.cs new file mode 100644 index 000000000..49c12bc74 --- /dev/null +++ b/Assets/Scripts/UI/Popup.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +public class Popup : MonoBehaviour +{ + [SerializeField] + private float minTimeout = 2; + + [SerializeField] + private float maxTimeout = 4; + + private Timer timer; + + private void Start() + { + timer = GetComponent(); + timer.StartTimer(Random.Range(minTimeout, maxTimeout)); + timer.OnTimerRunCompleted += () => Destroy(gameObject); + } +} diff --git a/Assets/Scripts/UI/Popup.cs.meta b/Assets/Scripts/UI/Popup.cs.meta new file mode 100644 index 000000000..8f9004485 --- /dev/null +++ b/Assets/Scripts/UI/Popup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf36c31efc151dc4b96cecf0ef7f1f29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/PopupSpammer.cs b/Assets/Scripts/UI/PopupSpammer.cs new file mode 100644 index 000000000..fe5467040 --- /dev/null +++ b/Assets/Scripts/UI/PopupSpammer.cs @@ -0,0 +1,38 @@ +using System.Collections; +using CollectionExtensions; +using UnityEngine; + +public class PopupSpammer : MonoBehaviour +{ + [SerializeField] private Popup[] popups; + + private RectTransform rectTransform; + + private void Start() + { + rectTransform = GetComponent(); + StartCoroutine(SpamALot()); + } + + private void Spam() + { + // TODO get the popups on top! + var popup = popups.RandomElement(); + var halfWidth = rectTransform.rect.width / 2; + var halfHeight = rectTransform.rect.height / 2; + var position = new Vector2( + Random.Range(-halfWidth, halfWidth), + Random.Range(-halfHeight, halfHeight)); + var instance = Instantiate(popup, transform.position, transform.rotation, rectTransform); + instance.GetComponent().anchoredPosition = position; + } + + private IEnumerator SpamALot() + { + while (true) + { + Spam(); + yield return new WaitForSeconds(.5f); + } + } +} diff --git a/Assets/Scripts/UI/PopupSpammer.cs.meta b/Assets/Scripts/UI/PopupSpammer.cs.meta new file mode 100644 index 000000000..caf78fa18 --- /dev/null +++ b/Assets/Scripts/UI/PopupSpammer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 054f8241b622aff439e7b31758f43d23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Textures/Spam.meta b/Assets/Textures/Spam.meta new file mode 100644 index 000000000..711a42175 --- /dev/null +++ b/Assets/Textures/Spam.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67306a98c1f4bc04c8141c15e49d4217 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Textures/Spam/ErrorWindow.jpg b/Assets/Textures/Spam/ErrorWindow.jpg new file mode 100644 index 000000000..a873a8522 Binary files /dev/null and b/Assets/Textures/Spam/ErrorWindow.jpg differ diff --git a/Assets/Textures/Spam/ErrorWindow.jpg.meta b/Assets/Textures/Spam/ErrorWindow.jpg.meta new file mode 100644 index 000000000..1ef34ff1b --- /dev/null +++ b/Assets/Textures/Spam/ErrorWindow.jpg.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 1208c49ff8294ce498efcc7be814bca7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + 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: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 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 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + 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: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: