diff --git a/unity/Assets/Prefabs.meta b/unity/Assets/Prefabs.meta new file mode 100644 index 0000000..9db2722 --- /dev/null +++ b/unity/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 256a3206a82fe924fb985e6db90d58f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/Prefabs/Cloud.prefab b/unity/Assets/Prefabs/Cloud.prefab new file mode 100644 index 0000000..36a03cb --- /dev/null +++ b/unity/Assets/Prefabs/Cloud.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8093627333698608799 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8093627333698608787} + - component: {fileID: 8093627333698608786} + - component: {fileID: 8093627333698608785} + - component: {fileID: 8093627333698608784} + - component: {fileID: 8093627333698608788} + m_Layer: 0 + m_Name: Cloud + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8093627333698608787 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8093627333698608799} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 704, y: 936, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &8093627333698608786 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8093627333698608799} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2405928e5513caf448a79082add2204a, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 763, y: 328} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &8093627333698608785 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8093627333698608799} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f85dc4bb405207e44bfe557775714307, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &8093627333698608784 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8093627333698608799} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01a6f95bf180a2a45b1686ea222e1c17, type: 3} + m_Name: + m_EditorClassIdentifier: + _justVertical: 0 +--- !u!61 &8093627333698608788 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8093627333698608799} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: -16.5} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 254.33333, y: 109.333336} + newSize: {x: 763, y: 328} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 254.33333, y: 50.28} + m_EdgeRadius: 0 diff --git a/unity/Assets/Prefabs/Cloud.prefab.meta b/unity/Assets/Prefabs/Cloud.prefab.meta new file mode 100644 index 0000000..cde534e --- /dev/null +++ b/unity/Assets/Prefabs/Cloud.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 222963b5f45b20141bf7dd413f3342cd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/Scenes/SampleScene.unity b/unity/Assets/Scenes/SampleScene.unity index 7b60faf..4d97198 100644 --- a/unity/Assets/Scenes/SampleScene.unity +++ b/unity/Assets/Scenes/SampleScene.unity @@ -123,6 +123,63 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1001 &440407123 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.x + value: 403 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.y + value: 406 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608799, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_Name + value: Cloud (2) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} --- !u!1 &480143053 GameObject: m_ObjectHideFlags: 0 @@ -137,6 +194,7 @@ GameObject: - component: {fileID: 480143058} - component: {fileID: 480143057} - component: {fileID: 480143059} + - component: {fileID: 480143060} m_Layer: 0 m_Name: Dragon_Red m_TagString: Untagged @@ -207,7 +265,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &480143056 Animator: @@ -248,7 +306,7 @@ Rigidbody2D: m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 - m_Constraints: 0 + m_Constraints: 4 --- !u!114 &480143058 MonoBehaviour: m_ObjectHideFlags: 0 @@ -276,6 +334,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 01a6f95bf180a2a45b1686ea222e1c17, type: 3} m_Name: m_EditorClassIdentifier: + _justVertical: 1 +--- !u!58 &480143060 +CircleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480143053} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 31.1 --- !u!1 &519420028 GameObject: m_ObjectHideFlags: 0 @@ -359,6 +434,120 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &634183952 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.x + value: 1613 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.y + value: 218 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608799, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_Name + value: Cloud (3) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} +--- !u!1001 &1973030820 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.x + value: 1204.5117 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.y + value: 696.37427 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608799, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_Name + value: Cloud (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} --- !u!1 &2039228491 GameObject: m_ObjectHideFlags: 0 @@ -439,5 +628,62 @@ Transform: m_LocalScale: {x: 2015.1439, y: 1240.0886, z: 1240.0886} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &8093627334746431000 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.x + value: 704 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.y + value: 936 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608787, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8093627333698608799, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} + propertyPath: m_Name + value: Cloud + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 222963b5f45b20141bf7dd413f3342cd, type: 3} diff --git a/unity/Assets/Scripts.meta b/unity/Assets/Scripts.meta new file mode 100644 index 0000000..4aad88a --- /dev/null +++ b/unity/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 483d1711aade1c041ad076065508898f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/Scripts/Cloud.cs b/unity/Assets/Scripts/Cloud.cs new file mode 100644 index 0000000..8842586 --- /dev/null +++ b/unity/Assets/Scripts/Cloud.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Cloud : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + const float SPEED = 1f; + this.transform.position = new Vector3(transform.position.x - SPEED, transform.position.y, transform.position.z); + } +} diff --git a/unity/Assets/Scripts/Cloud.cs.meta b/unity/Assets/Scripts/Cloud.cs.meta new file mode 100644 index 0000000..0920082 --- /dev/null +++ b/unity/Assets/Scripts/Cloud.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f85dc4bb405207e44bfe557775714307 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/DragonMovement.cs b/unity/Assets/Scripts/DragonMovement.cs similarity index 59% rename from unity/Assets/DragonMovement.cs rename to unity/Assets/Scripts/DragonMovement.cs index 3cbc69f..b6ed4cd 100644 --- a/unity/Assets/DragonMovement.cs +++ b/unity/Assets/Scripts/DragonMovement.cs @@ -10,6 +10,19 @@ public class DragonMovement : MonoBehaviour [SerializeField] float FlapForce = 300f; [SerializeField] float FlapLength = .25f; + bool _inCloud; + + + private void OnTriggerEnter2D(Collider2D collision) + { + Debug.Log("ontriggerenter"); + _inCloud = true; + } + + private void OnTriggerExit2D(Collider2D collision) + { + _inCloud = false; + } void Start() { _rigidbody = this.GetComponent(); @@ -31,5 +44,13 @@ public class DragonMovement : MonoBehaviour } _flapTime -= Time.deltaTime; + float horizontalSpeed = .4f; + if (_inCloud) + { + horizontalSpeed = -1f; + } + + transform.position = new Vector3(transform.position.x + horizontalSpeed, transform.position.y, transform.position.z); + } } diff --git a/unity/Assets/DragonMovement.cs.meta b/unity/Assets/Scripts/DragonMovement.cs.meta similarity index 100% rename from unity/Assets/DragonMovement.cs.meta rename to unity/Assets/Scripts/DragonMovement.cs.meta diff --git a/unity/Assets/Wraparound.cs b/unity/Assets/Scripts/Wraparound.cs similarity index 55% rename from unity/Assets/Wraparound.cs rename to unity/Assets/Scripts/Wraparound.cs index 4d61d96..efeb8f6 100644 --- a/unity/Assets/Wraparound.cs +++ b/unity/Assets/Scripts/Wraparound.cs @@ -4,6 +4,7 @@ using UnityEngine; public class Wraparound : MonoBehaviour { + [SerializeField] bool _justVertical = false; // Start is called before the first frame update void Start() { @@ -14,6 +15,7 @@ public class Wraparound : MonoBehaviour void Update() { const int SCREEN_HEIGHT = 1080; + const int SCREEN_WIDTH = 1920; if (this.transform.position.y < 0) { this.transform.position = new Vector3(transform.position.x, transform.position.y + SCREEN_HEIGHT, transform.position.z); @@ -23,5 +25,18 @@ public class Wraparound : MonoBehaviour { this.transform.position = new Vector3(transform.position.x, transform.position.y - SCREEN_HEIGHT, transform.position.z); } + + if (_justVertical == false) + { + if (this.transform.position.x < 0) + { + this.transform.position = new Vector3(transform.position.x + SCREEN_WIDTH, transform.position.y, transform.position.z); + } + + if (this.transform.position.y > SCREEN_WIDTH) + { + this.transform.position = new Vector3(transform.position.x - SCREEN_WIDTH, transform.position.y, transform.position.z); + } + } } } diff --git a/unity/Assets/Wraparound.cs.meta b/unity/Assets/Scripts/Wraparound.cs.meta similarity index 100% rename from unity/Assets/Wraparound.cs.meta rename to unity/Assets/Scripts/Wraparound.cs.meta diff --git a/unity/Assets/Sprites/cloud.png b/unity/Assets/Sprites/cloud.png new file mode 100644 index 0000000..bcd3d8d Binary files /dev/null and b/unity/Assets/Sprites/cloud.png differ diff --git a/unity/Assets/Sprites/cloud.png.meta b/unity/Assets/Sprites/cloud.png.meta new file mode 100644 index 0000000..86c09d6 --- /dev/null +++ b/unity/Assets/Sprites/cloud.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 2405928e5513caf448a79082add2204a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 3 + 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 + 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 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: