using System; using DefaultNamespace; using HighlightPlus; using MotionFramework; using UnityEngine; namespace ToolsPack { /// /// 附着在工具模型上 /// [RequireComponent(typeof(BoxCollider))] [RequireComponent(typeof(HighlightEffect))] public class ToolsPackGameObjectComponent : MonoBehaviour { private HighlightEffect _highlight; private int index; private void Awake() { _highlight = this.GetComponent(); } private void OnEnable() { _highlight.highlighted = false; } private void OnMouseDown() { MotionEngine.GetModule().AddToolsPack(this.name, this.gameObject); this.gameObject.SetActive(false); } private void OnMouseEnter() { _highlight.highlighted = true; } private void OnMouseExit() { _highlight.highlighted = false; } public void SetIndex(int inde) { index = inde; } public int GetIndex() { return index; } } }