From dc1338e821e6a8658278e46aff4f67e2201c567e Mon Sep 17 00:00:00 2001 From: "RUDIAUSBUDDELN\\bib" Date: Tue, 18 Mar 2025 21:14:56 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20am=2018.03.2025=20in=20der=20?= =?UTF-8?q?Schule=20getroffen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefab/PlatfLevel-1.prefab | 40 ++---------- Assets/Scenes/GameScene.unity | 64 +------------------ .../GameScene/OffScreenDestroyPlatform.cs | 23 ------- .../OffScreenDestroyPlatform.cs.meta | 11 ---- Assets/Scripts/GameScene/PlatformGenerator.cs | 42 ------------ .../GameScene/PlatformGenerator.cs.meta | 11 ---- Assets/Scripts/GameScene/PlatformSpawner.cs | 23 ------- .../Scripts/GameScene/PlatformSpawner.cs.meta | 11 ---- Assets/Scripts/GameScene/SpawnScanner.cs | 5 +- Assets/Scripts/GameScene/movePlatform.cs | 2 +- 10 files changed, 11 insertions(+), 221 deletions(-) delete mode 100644 Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs delete mode 100644 Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs.meta delete mode 100644 Assets/Scripts/GameScene/PlatformGenerator.cs delete mode 100644 Assets/Scripts/GameScene/PlatformGenerator.cs.meta delete mode 100644 Assets/Scripts/GameScene/PlatformSpawner.cs delete mode 100644 Assets/Scripts/GameScene/PlatformSpawner.cs.meta diff --git a/Assets/Prefab/PlatfLevel-1.prefab b/Assets/Prefab/PlatfLevel-1.prefab index 90dfa7d..9c899b6 100644 --- a/Assets/Prefab/PlatfLevel-1.prefab +++ b/Assets/Prefab/PlatfLevel-1.prefab @@ -1,36 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &3993355263451668087 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6530457814582240327} - m_Layer: 0 - m_Name: PlatfEndPosition - m_TagString: Untagged - m_Icon: {fileID: -5397416234189338067, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &6530457814582240327 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3993355263451668087} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 23, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3865044956813001410} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7393099111313939161 GameObject: m_ObjectHideFlags: 0 @@ -59,8 +28,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7393099111313939161} serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 20.5, y: -4.15, z: 0} + 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: [] @@ -202,7 +171,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cd6ee5b0f1fa5844b8e9c942d62e9028, type: 3} m_Name: m_EditorClassIdentifier: - speed: 1 + speed: 3 acceleration: 0.2 --- !u!1 &9043798579608715691 GameObject: @@ -229,11 +198,10 @@ Transform: m_GameObject: {fileID: 9043798579608715691} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.5, y: -1.5, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 125308035280796441} - - {fileID: 6530457814582240327} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 392d03a..4102e13 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -220,7 +220,7 @@ Transform: m_GameObject: {fileID: 75591474} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 4, y: -1.5526457, z: 0} + m_LocalPosition: {x: 4, y: -2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -335,7 +335,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cd6ee5b0f1fa5844b8e9c942d62e9028, type: 3} m_Name: m_EditorClassIdentifier: - speed: 1 + speed: 3 acceleration: 0.2 --- !u!50 &75591480 Rigidbody2D: @@ -1887,7 +1887,7 @@ Transform: m_GameObject: {fileID: 2025757103} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.34498352, y: -0.44735432, z: 0.038601797} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1942,63 +1942,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parallaxCamera: {fileID: 1081831613} ---- !u!1001 &2321893803288505762 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalPosition.x - value: -3.5 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalPosition.y - value: -1.5 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3865044956813001410, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9043798579608715691, guid: 5af64511161f524498b4db27d67cfca8, type: 3} - propertyPath: m_Name - value: PlatfLevel-1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5af64511161f524498b4db27d67cfca8, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -2006,7 +1949,6 @@ SceneRoots: - {fileID: 1599905688} - {fileID: 564379868} - {fileID: 2025757104} - - {fileID: 2321893803288505762} - {fileID: 1781046106} - {fileID: 2096149586} - {fileID: 599090434} diff --git a/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs b/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs deleted file mode 100644 index cb78328..0000000 --- a/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// Platform destroyer -/// Original script found in: https://stackoverflow.com/questions/75924903/instantiating-and-destroying-unity-prefabs. -/// - -public class OffScreenDestroyPlatform : MonoBehaviour -{ - public static Vector2? screenBounds; - - private void FixedUpdate() - { - if (screenBounds == null) screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z)); - - if (transform.position.x < screenBounds.Value.x * 5) - { - Destroy(gameObject); - } - } -} diff --git a/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs.meta b/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs.meta deleted file mode 100644 index dfb4f01..0000000 --- a/Assets/Scripts/GameScene/OffScreenDestroyPlatform.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6e1f87050f92a0048829711096bc7730 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/GameScene/PlatformGenerator.cs b/Assets/Scripts/GameScene/PlatformGenerator.cs deleted file mode 100644 index dbef1c8..0000000 --- a/Assets/Scripts/GameScene/PlatformGenerator.cs +++ /dev/null @@ -1,42 +0,0 @@ -using UnityEngine; -/// -/// Platform generator logic -/// Original Guide on YouTube link: https://www.youtube.com/watch?v=NtY_R0g8L8E. -/// - -public class PlatformGenerator : MonoBehaviour -{ - /* - [SerializeField] private Transform platformStart; - [SerializeField] private System.Collections.Generic.List platformList; - [SerializeField] Vector2 nextSpawnPos; - - private Vector2 lastEndPosition; - - private void Awake() - { - Vector2 positionPlat = platformStart.Find("Endposition").position; - lastEndPosition = positionPlat; - - int startingSpawnLevelPlat = 5; - for (int i = 0; i < startingSpawnLevelPlat; i++) - { - SpawnLevelPlat(); - } - } - - private void SpawnLevelPlat() - { - // Platform is choosed different - Transform currentPlat = platformList[Random.Range(0, platformList.Count)]; - // Platform spawns - Transform lastLevelPlatTransform = SpawnLevelPlat(currentPlat, lastEndPosition); - lastEndPosition = lastLevelPlatTransform.Find("EndPosition").position; - } - - private Transform SpawnLevelPlat(Transform levelPlat, Vector2 spawnPosition) - { - Transform platformLevelTransform = Instantiate(levelPlat, spawnPosition, Quaternion.identity); - return platformLevelTransform; - }*/ -} diff --git a/Assets/Scripts/GameScene/PlatformGenerator.cs.meta b/Assets/Scripts/GameScene/PlatformGenerator.cs.meta deleted file mode 100644 index 3ffa124..0000000 --- a/Assets/Scripts/GameScene/PlatformGenerator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2a58f8ab6811b9942b34b7598fe7d37f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/GameScene/PlatformSpawner.cs b/Assets/Scripts/GameScene/PlatformSpawner.cs deleted file mode 100644 index 43b5a64..0000000 --- a/Assets/Scripts/GameScene/PlatformSpawner.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// Platform spawner -/// Original script found in: https://stackoverflow.com/questions/75924903/instantiating-and-destroying-unity-prefabs. -/// - -public class PlatformSpawner : MonoBehaviour -{ - [SerializeField] private int platformCount; - [SerializeField] private OffScreenDestroyPlatform platformPrefab; - - void Start() - { - for (int i = 0; i < platformCount; i++) - { - var spawnPosition = new Vector2(Random.Range(1f, 10f), Random.Range(-2f, 2f)); - Instantiate(platformPrefab, spawnPosition, Quaternion.identity); - } - } -} diff --git a/Assets/Scripts/GameScene/PlatformSpawner.cs.meta b/Assets/Scripts/GameScene/PlatformSpawner.cs.meta deleted file mode 100644 index 6d42b1a..0000000 --- a/Assets/Scripts/GameScene/PlatformSpawner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c31972b8c73d95d4098ee6aca9c698e9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/GameScene/SpawnScanner.cs b/Assets/Scripts/GameScene/SpawnScanner.cs index 51a74fe..e4f6d29 100644 --- a/Assets/Scripts/GameScene/SpawnScanner.cs +++ b/Assets/Scripts/GameScene/SpawnScanner.cs @@ -12,7 +12,8 @@ public class SpawnScanner : MonoBehaviour private void Spawn() { - Vector3 ggg = new Vector3(1f, 4f, 4f); - Instantiate(platform, ggg, Quaternion.identity); + float height = Random.Range(-2f, -1f); + Vector3 positionPLat = new Vector3(12f, height, 0f); + Instantiate(platform, positionPLat, Quaternion.identity); } } diff --git a/Assets/Scripts/GameScene/movePlatform.cs b/Assets/Scripts/GameScene/movePlatform.cs index c18ebac..cdf5325 100644 --- a/Assets/Scripts/GameScene/movePlatform.cs +++ b/Assets/Scripts/GameScene/movePlatform.cs @@ -16,7 +16,7 @@ public class movePlatform : MonoBehaviour // Update is called once per frame void Update() { - speed += acceleration * Time.deltaTime; + // speed += acceleration * Time.deltaTime; transform.Translate(new Vector2(-1f, 0f) * speed * Time.deltaTime); } }