Ln Go

Bullet 본문

Unity/Quad Action

Bullet

Ln Ro 2021. 6. 4. 02:22
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour
{
    public int damage;
    public bool isMelee;
    public bool isRock;

    void OnCollisionEnter(Collision collision)
    {
        if (!isRock && collision.gameObject.tag == "Floor")
        {
            Destroy(gameObject, 3);
        }
        
    }
    void OnTriggerEnter(Collider other)
    {
        if (!isMelee && other.gameObject.tag == "Wall")
        {
            Destroy(gameObject);
        }
    }
}

'Unity > Quad Action' 카테고리의 다른 글

Orbit  (0) 2021.06.04
Missile  (0) 2021.06.04
Grenade  (0) 2021.06.04
Weapon  (0) 2021.06.04
BossMissile  (0) 2021.06.04
Comments