diff --git a/Jump Game/Assets/Scenes/Square.png b/Jump Game/Assets/Scenes/Square.png new file mode 100644 index 0000000..8eb1b1e Binary files /dev/null and b/Jump Game/Assets/Scenes/Square.png differ diff --git a/Jump Game/Assets/Scenes/Square.png.meta b/Jump Game/Assets/Scenes/Square.png.meta new file mode 100644 index 0000000..a48080c --- /dev/null +++ b/Jump Game/Assets/Scenes/Square.png.meta @@ -0,0 +1,99 @@ +fileFormatVersion: 2 +guid: 8d1be07efb3a1aa448b129141776bc0f +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: 0 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 3 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 4 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: + - - {x: -2, y: -2} + - {x: -2, y: 2} + - {x: 2, y: 2} + - {x: 2, y: -2} + physicsShape: + - - {x: -2, y: -2} + - {x: -2, y: 2} + - {x: 2, y: 2} + - {x: 2, y: -2} + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Jump Game/Assets/Scripts/InteractionObject.cs b/Jump Game/Assets/Scripts/InteractionObject.cs new file mode 100644 index 0000000..52295fd --- /dev/null +++ b/Jump Game/Assets/Scripts/InteractionObject.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class InteractionObject : MonoBehaviour +{ + public bool talks; + public string message; + public void Talk() + { + Debug.Log(message); + } + + +} diff --git a/Jump Game/Assets/Scripts/InteractionObject.cs.meta b/Jump Game/Assets/Scripts/InteractionObject.cs.meta new file mode 100644 index 0000000..3203429 --- /dev/null +++ b/Jump Game/Assets/Scripts/InteractionObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 416a1b62da70d7b478995f767ba96c11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Jump Game/Assets/Scripts/PlayerInteract.cs b/Jump Game/Assets/Scripts/PlayerInteract.cs new file mode 100644 index 0000000..778ca3a --- /dev/null +++ b/Jump Game/Assets/Scripts/PlayerInteract.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerInteract : MonoBehaviour +{ + public GameObject currentInterObj = null; + public InteractionObject currentInterObjScript = null; + + + + // Update is called once per frame + void Update() + { + if (Input.GetButtonDown ("Interact") && currentInterObj) + { + if (currentInterObjScript.talks) + { + currentInterObjScript.Talk(); + } + + } + + } + void OnTriggerEnter2D(Collider2D other) + { + if (other.CompareTag("interObject")) + { + Debug.Log(other.name); + currentInterObj = other.gameObject; + currentInterObjScript = currentInterObj.GetComponent (); + } + } +} diff --git a/Jump Game/Assets/Scripts/PlayerInteract.cs.meta b/Jump Game/Assets/Scripts/PlayerInteract.cs.meta new file mode 100644 index 0000000..b135e95 --- /dev/null +++ b/Jump Game/Assets/Scripts/PlayerInteract.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1088a3f236f0e02439c2713c24252f61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Jump Game/ProjectSettings/InputManager.asset b/Jump Game/ProjectSettings/InputManager.asset index 17c8f53..8428689 100644 --- a/Jump Game/ProjectSettings/InputManager.asset +++ b/Jump Game/ProjectSettings/InputManager.asset @@ -293,3 +293,19 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: Interact + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: e + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/Jump Game/ProjectSettings/TagManager.asset b/Jump Game/ProjectSettings/TagManager.asset index 1c92a78..5f33275 100644 --- a/Jump Game/ProjectSettings/TagManager.asset +++ b/Jump Game/ProjectSettings/TagManager.asset @@ -3,7 +3,8 @@ --- !u!78 &1 TagManager: serializedVersion: 2 - tags: [] + tags: + - interObject layers: - Default - TransparentFX