Compare commits

...

2 Commits

Author SHA1 Message Date
pbg2h23akl
04fe6f1987 Merge branch 'main' of https://git.bib.de/PBG2H23ABR/PBG2H23ABR_PBG2H23AKL_PMC_Projekt 2024-07-03 12:46:53 +02:00
pbg2h23akl
4ca5d3db4f Refactoring 2024-07-03 12:46:41 +02:00
9 changed files with 169 additions and 13 deletions

View File

@ -365,6 +365,14 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 5950832400214244271} m_TransformParent: {fileID: 5950832400214244271}
m_Modifications: m_Modifications:
- target: {fileID: 5727695039551963900, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 357
objectReference: {fileID: 0}
- target: {fileID: 5727695039551963900, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 209
objectReference: {fileID: 0}
- target: {fileID: 5863193481701293955, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3} - target: {fileID: 5863193481701293955, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -409,6 +417,14 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: UI_Manager value: UI_Manager
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8625755030761962559, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 458
objectReference: {fileID: 0}
- target: {fileID: 8625755030761962559, guid: abb3f2146f967be4e9dfd6069915f42c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 179
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []

View File

@ -10,7 +10,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 601926406646660137} - component: {fileID: 601926406646660137}
- component: {fileID: 5420977559640316239} - component: {fileID: 5420977559640316239}
m_Layer: 0 m_Layer: 9
m_Name: Trail m_Name: Trail
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -157,7 +157,7 @@ GameObject:
- component: {fileID: 7689678004430099734} - component: {fileID: 7689678004430099734}
- component: {fileID: 878037186990386657} - component: {fileID: 878037186990386657}
- component: {fileID: 5994619817623951055} - component: {fileID: 5994619817623951055}
m_Layer: 0 m_Layer: 9
m_Name: Bullet m_Name: Bullet
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -257,7 +257,7 @@ GameObject:
- component: {fileID: 2783922791344706728} - component: {fileID: 2783922791344706728}
- component: {fileID: 3511214472677508059} - component: {fileID: 3511214472677508059}
- component: {fileID: 1974950874428390090} - component: {fileID: 1974950874428390090}
m_Layer: 0 m_Layer: 9
m_Name: BulletMesh m_Name: BulletMesh
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}

View File

@ -1384,9 +1384,77 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 423185948905945774, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 666296827679288680, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 1409017717971667579, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3230210169410262755, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3391868011099319290, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} - target: {fileID: 3391868011099319290, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Player (1) value: Player
objectReference: {fileID: 0}
- target: {fileID: 3391868011099319290, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3601559577021101208, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 4093775944364614034, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.x
value: 0.55560887
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.y
value: -0.403
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.z
value: 0.60068274
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.w
value: -0.6547129
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.x
value: 0.042114396
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.y
value: 0.753147
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.z
value: -0.048446175
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 1.022
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 262.066
objectReference: {fileID: 0}
- target: {fileID: 4163468239720933169, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 7.29
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4231050703702953731, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} - target: {fileID: 4231050703702953731, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -1428,8 +1496,78 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] - target: {fileID: 4731377471211230426, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
m_RemovedGameObjects: [] propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 4972354890819608722, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5245801164585615012, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5842865707223673138, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5846198897390256284, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6608350815154232110, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.x
value: -0.06001303
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.y
value: 0.68006015
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalPosition.z
value: -0.1801692
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8477437862324887214, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8948127678283011642, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 5245801164585615012, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
m_RemovedGameObjects:
- {fileID: 4093775944364614034, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} m_SourcePrefab: {fileID: 100100000, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3}

View File

@ -42,7 +42,7 @@ public class BulletScript : MonoBehaviour
/// clashPartical spawned clashPartical am EinschlagPunkt der Kugel. /// clashPartical spawned clashPartical am EinschlagPunkt der Kugel.
/// </summary> /// </summary>
/// <param name="collision">Die Collision mit der Bullet.</param> /// <param name="collision">Die Collision mit der Bullet.</param>
public void clashPartcal(Collision collision){ public void clashParticle(Collision collision){
ContactPoint contact = collision.GetContact(0); ContactPoint contact = collision.GetContact(0);
Instantiate(particalClash,transform.position,Quaternion.LookRotation(contact.normal)); Instantiate(particalClash,transform.position,Quaternion.LookRotation(contact.normal));
} }
@ -53,9 +53,9 @@ public class BulletScript : MonoBehaviour
private void OnCollisionEnter(Collision collision){ private void OnCollisionEnter(Collision collision){
Debug.Log(collision.gameObject.name + " UND HIER IST DER TAG: " + collision.gameObject.tag); Debug.Log(collision.gameObject.name + " UND HIER IST DER TAG: " + collision.gameObject.tag);
if(collision.transform.tag == "Enemy"){ if(collision.transform.tag == "Enemy"){
collision.transform.GetComponent<Enemy>().takeDamage(damage); collision.transform.GetComponent<EnemyHealth>().takeDamage(damage);
} }
clashPartcal(collision); clashParticle(collision);
GameObject.Destroy(this.gameObject); GameObject.Destroy(this.gameObject);
} }
@ -67,6 +67,8 @@ public class BulletScript : MonoBehaviour
speed = dataBullet.speed; speed = dataBullet.speed;
rb = this.GetComponent<Rigidbody>(); rb = this.GetComponent<Rigidbody>();
Physics.IgnoreCollision(GetComponent<Collider>(),GameObject.Find("Player").GetComponent<Collider>());

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using Unity.VisualScripting; using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
public class Enemy : MonoBehaviour public class EnemyHealth : MonoBehaviour
{ {
private int score = 1; private int score = 1;
private bool alive = true; private bool alive = true;

View File

@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class ParticalClash : MonoBehaviour public class ParticleClash : MonoBehaviour
{ {
public float lifeTime = 2; public float lifeTime = 2;

View File

@ -17,8 +17,8 @@ TagManager:
- Ground - Ground
- -
- -
- - Bullets
- - Player
- -
- -
- -