Änderungen am 18.03.2025 in der Schule getroffen.

This commit is contained in:
Lilia Schwab 2025-03-18 21:14:56 +01:00
parent 0698d6020e
commit dc1338e821
10 changed files with 11 additions and 221 deletions

View File

@ -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}

View File

@ -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}

View File

@ -1,23 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Platform destroyer
/// Original script found in: https://stackoverflow.com/questions/75924903/instantiating-and-destroying-unity-prefabs.
/// </summary>
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);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6e1f87050f92a0048829711096bc7730
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,42 +0,0 @@
using UnityEngine;
/// <summary>
/// Platform generator logic
/// Original Guide on YouTube link: https://www.youtube.com/watch?v=NtY_R0g8L8E.
/// </summary>
public class PlatformGenerator : MonoBehaviour
{
/*
[SerializeField] private Transform platformStart;
[SerializeField] private System.Collections.Generic.List<Transform> 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;
}*/
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2a58f8ab6811b9942b34b7598fe7d37f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,23 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Platform spawner
/// Original script found in: https://stackoverflow.com/questions/75924903/instantiating-and-destroying-unity-prefabs.
/// </summary>
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);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c31972b8c73d95d4098ee6aca9c698e9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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);
}
}

View File

@ -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);
}
}