
本文共 2206 字,大约阅读时间需要 7 分钟。
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
using UnityEngine;using System.Collections;public class HighlightableObject : MonoBehaviour{ public Color activeColor; // ������������ public Color inherentColor; // ������������ public void FlashingOn(Color color1, Color color2, float duration) { // ��������������������������� } public void FlashingOff() { // ��������������������������� } public void ConstantOn(Color color) { // ��������������������������� } public void ConstantOff() { // ��������������������������� }}
���������������������
bitte
1. ��������������������������������������� Highlighting Effect
������
������������������������������������������������
2. ��������������������� HighlightableObject
������
���������������������������������������������������
3. ������������������������������
��������������������������� HighLightControl
������������������������������
// ���������������������������������private HighlightableObject m_ho;public void Start(){ m_ho = GetComponent();}public void OnMouseEnter(){ // ��������������������������������������������� m_ho.FlashingOn(Color.green, Color.blue, 1f);}public void OnMouseExit(){ // ��������������������������������� m_ho.FlashingOff();}
������������������������
������������������������
������������������������������������������������������������������������������������������������
������������������
������������������������������������������������������������������������������������������
// ������������������Vector3 MousePos = Input.mousePosition + Vector3(0, 0, 10);float dis = (MousePos - target.transform.position).magnitude;
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
