欢迎大家关注我的日志,今天简单的讲讲主角打怪物:
//主角走动
private NavMeshAgent agent;
public GameObject hero;
public static float lifeTime = 0f;
public bool flag=false ;
//private float timer=1f;
void Start () {
agent =GetComponent <NavMeshAgent >();
}
// Update is called once per frame
void Update () {
if(Input .GetMouseButtonDown (0)){
Ray ray=Camera .main .ScreenPointToRay (Inp