如果需要處理鼠標點擊物體的情況,
可以當數據接觸物體時,鼠標手勢改變,然后點擊后和NPC產生對話等:
using UnityEngine; using System.Collections; public class example : MonoBehaviour { void OnMouseOver() { renderer.material.color -= new Color(0.1F, 0, 0) * Time.deltaTime; } }
如果需要處理鼠標點擊物體的情況,
可以當數據接觸物體時,鼠標手勢改變,然后點擊后和NPC產生對話等:
using UnityEngine; using System.Collections; public class example : MonoBehaviour { void OnMouseOver() { renderer.material.color -= new Color(0.1F, 0, 0) * Time.deltaTime; } }
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。