You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
551 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Tool : MonoBehaviour
{
public int Tool_type;//道具类型,这里做基类不赋予具体值
void OnTriggerEnter(Collider c)//这里的c指的都是撞我的节点不是自己
{
//Debug.Log("道具说:" + c.gameObject.name + c.gameObject.layer);
if (c.tag.Equals("Player"))// 是player撞的我, 可以在这里写一些播放特效的代码
{
GameObject.Destroy(this.gameObject);
}
}
}