GunScene added // Bullet erstellt mit Scriptable Objekt // Bullet Moving Script erstellt // Alles nur mit Platzhalter für richtige Meshes
This commit is contained in:
25
Plunderblock/Assets/Scripts/ScriptsKevin/BulletMoving.cs
Normal file
25
Plunderblock/Assets/Scripts/ScriptsKevin/BulletMoving.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BulletMoving : MonoBehaviour
|
||||
{
|
||||
public GameObject parent;
|
||||
|
||||
public BulletScript bulletScript;
|
||||
|
||||
public Rigidbody rb;
|
||||
|
||||
private
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
rb = parent.GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
rb.velocity = bulletScript.direction * bulletScript.speed;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf678ed456c71c949b0b1a2b01e9f32b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs
Normal file
16
Plunderblock/Assets/Scripts/ScriptsKevin/BulletScript.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "BulletScriptableObject", menuName = "BulletScriptableObject", order = 0)]
|
||||
public class BulletScript : ScriptableObject
|
||||
{
|
||||
public int damage = 10;
|
||||
|
||||
public float speed = 5f;
|
||||
|
||||
public Vector3 direction = new Vector3();
|
||||
|
||||
public int ammo;
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e1d27c11e7949e4fa59cefee3928ca4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 367b5b014101def4293a7d819cab7434
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9e1d27c11e7949e4fa59cefee3928ca4, type: 3}
|
||||
m_Name: BulletScriptableObject
|
||||
m_EditorClassIdentifier:
|
||||
damage: 10
|
||||
speed: 2
|
||||
direction: {x: 1, y: 0, z: 0}
|
||||
ammo: 4
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a62dca8041fc5c48944492b0df9ef56
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user