39 lines
920 B
C#
39 lines
920 B
C#
using System;
|
|
using DefaultNamespace;
|
|
using HighlightPlus;
|
|
using MotionFramework;
|
|
using UnityEngine;
|
|
|
|
namespace ToolsPack
|
|
{
|
|
/// <summary>
|
|
/// 附着在工具模型上
|
|
/// </summary>
|
|
[RequireComponent(typeof(BoxCollider))]
|
|
[RequireComponent(typeof(HighlightEffect))]
|
|
public class ToolsPackGameObjectComponent : MonoBehaviour
|
|
{
|
|
private HighlightEffect _highlight;
|
|
|
|
private void Awake()
|
|
{
|
|
_highlight = this.GetComponent<HighlightEffect>();
|
|
}
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
MotionEngine.GetModule<ToolsPackManager>().AddToolsPack(this.name, this.gameObject);
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
|
|
private void OnMouseEnter()
|
|
{
|
|
_highlight.highlighted = true;
|
|
}
|
|
|
|
private void OnMouseExit()
|
|
{
|
|
_highlight.highlighted = false;
|
|
}
|
|
}
|
|
} |