mirror of
https://github.com/Kizuren/SynthMaze.git
synced 2025-12-21 21:16:08 +01:00
34 lines
791 B
C#
34 lines
791 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SniperGuyBullet : MonoBehaviour
|
|
{
|
|
public float speed = 20f;
|
|
public int damage = 40;
|
|
public Rigidbody2D rb;
|
|
public GameObject impactEffect;
|
|
|
|
void Start()
|
|
{
|
|
if (SniperGuy.BulletDirection == 0f)
|
|
{
|
|
rb.velocity = -transform.right * speed;
|
|
}
|
|
if (SniperGuy.BulletDirection == 1f)
|
|
{
|
|
rb.velocity = transform.right * speed;
|
|
}
|
|
}
|
|
|
|
void OnTriggerEnter2D(Collider2D collision)
|
|
{
|
|
if (collision.gameObject.tag == "Player")
|
|
{
|
|
LevelMgr.killPlayer = true;
|
|
}
|
|
|
|
//Instantiate(impactEffect, transform.position, transform.rotation);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|