diff --git a/Plunderblock/Assets/PrefabsJan/Player.prefab b/Plunderblock/Assets/PrefabsJan/Player.prefab index 879d09e..8e61aab 100644 --- a/Plunderblock/Assets/PrefabsJan/Player.prefab +++ b/Plunderblock/Assets/PrefabsJan/Player.prefab @@ -1,5 +1,36 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &2733685271872555805 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 19647278204217505} + m_Layer: 0 + m_Name: BulletSpawnpoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &19647278204217505 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733685271872555805} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 1.168} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5950832400214244271} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3391868011099319290 GameObject: m_ObjectHideFlags: 0 @@ -294,6 +325,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 19647278204217505} - {fileID: 4163468239720933169} - {fileID: 7059315404903924766} m_Father: {fileID: 4231050703702953731} @@ -471,6 +503,18 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 5950832400214244271} m_Modifications: + - target: {fileID: 686265786403669914, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3} + propertyPath: m_LocalPosition.x + value: 0.499 + objectReference: {fileID: 0} + - target: {fileID: 686265786403669914, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3} + propertyPath: m_LocalPosition.y + value: 0.7 + objectReference: {fileID: 0} + - target: {fileID: 686265786403669914, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3} + propertyPath: m_LocalPosition.z + value: -0.166 + objectReference: {fileID: 0} - target: {fileID: 1313371464610265781, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3} propertyPath: m_LocalPosition.x value: -0.06001303 diff --git a/Plunderblock/Assets/PrefabsKevin/Bullet/Bullet.prefab b/Plunderblock/Assets/PrefabsKevin/Bullet/Bullet.prefab index 30ba54b..804b935 100644 --- a/Plunderblock/Assets/PrefabsKevin/Bullet/Bullet.prefab +++ b/Plunderblock/Assets/PrefabsKevin/Bullet/Bullet.prefab @@ -272,13 +272,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5432457483690072105} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalRotation: {x: 0, y: -0.7071068, z: 0.7071068, w: 0} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3286218375903244322} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 180} --- !u!198 &3511214472677508059 ParticleSystem: m_ObjectHideFlags: 0 diff --git a/Plunderblock/Assets/PrefabsKevin/Bullet/MuzzlePartical/MuzzleParticalSystem.prefab b/Plunderblock/Assets/PrefabsKevin/Bullet/MuzzlePartical/MuzzleParticalSystem.prefab index 5e0c596..118c732 100644 --- a/Plunderblock/Assets/PrefabsKevin/Bullet/MuzzlePartical/MuzzleParticalSystem.prefab +++ b/Plunderblock/Assets/PrefabsKevin/Bullet/MuzzlePartical/MuzzleParticalSystem.prefab @@ -43,7 +43,7 @@ ParticleSystem: serializedVersion: 8 lengthInSec: 0.1 simulationSpeed: 1 - stopAction: 2 + stopAction: 1 cullingMode: 0 ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} @@ -3821,7 +3821,7 @@ ParticleSystem: LightsModule: enabled: 1 ratio: 1 - light: {fileID: 0} + light: {fileID: 3050412642343233004, guid: ecc11f2cd73840b43ac860dbd8067281, type: 3} randomDistribution: 1 color: 1 range: 1 diff --git a/Plunderblock/Assets/PrefabsKevin/Gun/Gun.prefab b/Plunderblock/Assets/PrefabsKevin/Gun/Gun.prefab index 1a57711..1634a5d 100644 --- a/Plunderblock/Assets/PrefabsKevin/Gun/Gun.prefab +++ b/Plunderblock/Assets/PrefabsKevin/Gun/Gun.prefab @@ -1,37 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &3929927056536112425 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2326864918050230340} - m_Layer: 0 - m_Name: BulletSpawnpoint - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2326864918050230340 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3929927056536112425} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.5, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 686265786403669914} - m_Father: {fileID: 6798321073873421098} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6867957792503530889 GameObject: m_ObjectHideFlags: 0 @@ -222,7 +190,7 @@ Transform: m_Children: - {fileID: 7042537997030239891} - {fileID: 1313371464610265781} - - {fileID: 2326864918050230340} + - {fileID: 686265786403669914} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 30.44, z: 0} --- !u!114 &1169450665700565 @@ -238,7 +206,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: muzzle: {fileID: 0} - spawnpoint: {fileID: 3929927056536112425} + spawnpoint: {fileID: 0} bullet: {fileID: 939049122039926632, guid: 5bd04146a95212e41bc2c52b7079e131, type: 3} dataBullet: {fileID: 11400000, guid: cafd241bae342f446ae8141cc5d72daf, type: 2} reloadTime: 3 @@ -248,19 +216,11 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 2326864918050230340} + m_TransformParent: {fileID: 6798321073873421098} m_Modifications: - - target: {fileID: 430484790216468074, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} - propertyPath: stopAction - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 430484790216468074, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} - propertyPath: LightsModule.light - value: - objectReference: {fileID: 3050412642343233004, guid: ecc11f2cd73840b43ac860dbd8067281, type: 3} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: 0.50000054 objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalPosition.y @@ -268,7 +228,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalRotation.w @@ -276,15 +236,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0.0000000037252894 objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalRotation.y - value: 0.7071067 + value: 0.70710677 objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: -0.0000000030267977 objectReference: {fileID: 0} - target: {fileID: 6557869798269101976, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -302,10 +262,6 @@ PrefabInstance: propertyPath: m_Name value: MuzzleParticalSystem objectReference: {fileID: 0} - - target: {fileID: 8077938284314862731, guid: 0d96e9e78ab544a4a98b8af026c4d9de, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Plunderblock/Assets/Scenes/KevinSceneGun.unity b/Plunderblock/Assets/Scenes/KevinSceneGun.unity index 5114702..77056ca 100644 --- a/Plunderblock/Assets/Scenes/KevinSceneGun.unity +++ b/Plunderblock/Assets/Scenes/KevinSceneGun.unity @@ -1384,78 +1384,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} 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} propertyPath: m_Name 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} - target: {fileID: 4231050703702953731, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -1496,78 +1428,8 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4731377471211230426, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} - 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_RemovedComponents: [] + m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: abab2a81048fcb64ab6d31bc6bc8f529, type: 3} diff --git a/Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs b/Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs index 18588cc..be8a05a 100644 --- a/Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs +++ b/Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs @@ -7,23 +7,13 @@ using UnityEngine; public class BulletScript : MonoBehaviour { public DataBullet dataBullet; - private float damage; private float speed; private int ammo; - public GameObject particalClash; - public float lifetime = 3f; private Rigidbody rb; - - private Vector3 direction; - private float time = 0f; - - private Ray ray; - private RaycastHit hit; - /// /// Sobald life Time vorbei ist Destroy die Bullet. /// @@ -33,11 +23,6 @@ public class BulletScript : MonoBehaviour GameObject.Destroy(this.gameObject); } } - private void CheckForColliders(){ - if(Physics.Raycast(ray, out hit)){ //wenn true wird durch out in variable hit ein RayCastHit gespeichert - direction = hit.point - transform.position;//Richtung in die, die Kugel fliegt - } - } /// /// clashPartical spawned clashPartical am EinschlagPunkt der Kugel. /// @@ -69,18 +54,13 @@ public class BulletScript : MonoBehaviour rb = this.GetComponent(); Physics.IgnoreCollision(GetComponent(),GameObject.Find("Player").GetComponent()); - - - - ray = Camera.main.ViewportPointToRay(new Vector3(0.5f,0.5f,0f)); - CheckForColliders(); } // Update is called once per frame void Update() { - rb.velocity = direction.normalized * speed; + rb.velocity = transform.forward * speed; die(lifetime); time += Time.deltaTime; } diff --git a/Plunderblock/Assets/Scripts/ScriptsKevin/WeaponScript.cs b/Plunderblock/Assets/Scripts/ScriptsKevin/WeaponScript.cs index ad13c03..29e1b22 100644 --- a/Plunderblock/Assets/Scripts/ScriptsKevin/WeaponScript.cs +++ b/Plunderblock/Assets/Scripts/ScriptsKevin/WeaponScript.cs @@ -34,7 +34,7 @@ public class WeaponScript : MonoBehaviour if(Input.GetKeyDown(KeyCode.Mouse0)){ muzzle.gameObject.SetActive(true); //muzzle.Play(); - Instantiate(bullet,spawnpoint.transform.position,transform.rotation); + Instantiate(bullet,spawnpoint.transform.position,spawnpoint.transform.rotation); ammo--; } }else{ @@ -46,7 +46,8 @@ public class WeaponScript : MonoBehaviour void Start() { ammo = dataBullet.ammo; - muzzle = spawnpoint.GetComponentInChildren(); + muzzle = GetComponentInChildren(); + spawnpoint = GameObject.Find("Player/PlayerView/BulletSpawnpoint"); } // Update is called once per frame