Unity3D鼠标点击物体产生事件

如果需要处理鼠标点击物体的情况,

可以当数据接触物体时,鼠标手势改变,然后点击后和NPC产生对话等:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    void OnMouseOver() {
        renderer.material.color -= new Color(0.1F, 0, 0) * Time.deltaTime;
    }
}

 

posted on 2016-09-19 22:20  手撕高达的村长  阅读(11003)  评论(0编辑  收藏  举报

导航