Commit 66973817 by Tim Reiter
parents d9334fea 4d6397f8
fileFormatVersion: 2
guid: 28dfe170d909586449b1605a27882ad2
timeCreated: 1433440842
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 84f3fefc4de4fd24982fdd4f908396bb
timeCreated: 1433440862
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class Bullet : MonoBehaviour {
public int healingPoints = 10;
public bool destroyTrap = false;
public int speed = 5;
// Use this for initialization
void Start () {
}
/// <summary>
/// Das aufrufen, wenn die Kugel wirklich losgeschossen werden soll.
/// </summary>
/// <param name="direction"></param>
public void shoot(Vector2 direction)
{
GetComponent<Rigidbody2D>().velocity = (float)speed*direction.normalized;
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
other.GetComponent<PlayerHealth>().changeHealthBy(healingPoints);
}
if (other.tag == "Trap")
{
//Zerstöre Falle
Debug.Log("TODO Destroy Trap");
}
Destroy(gameObject);
}
}
fileFormatVersion: 2
guid: 5fca959367c3f454b93020477922fde9
timeCreated: 1433439929
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment