72 lines
1.3 KiB
C#
72 lines
1.3 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.EventSystems;
|
||
//============================================================
|
||
//支持中文,文件使用UTF-8编码
|
||
//@author #AUTHOR#
|
||
//@create #CREATEDATE#
|
||
//@company #COMPANY#
|
||
//
|
||
//@description:
|
||
//============================================================
|
||
|
||
public enum Attribute
|
||
{
|
||
/// <summary>
|
||
/// 默认
|
||
/// </summary>
|
||
defaultModel,
|
||
/// <summary>
|
||
/// 安全工器具
|
||
/// </summary>
|
||
SafetyToolsAndInstruments,
|
||
/// <summary>
|
||
/// 工器具
|
||
/// </summary>
|
||
ToolsAndInstruments
|
||
}
|
||
|
||
public enum RightAndWrong
|
||
{
|
||
/// <summary>
|
||
/// 默认
|
||
/// </summary>
|
||
defaultModel,
|
||
/// <summary>
|
||
/// 对
|
||
/// </summary>
|
||
right,
|
||
/// <summary>
|
||
/// 错
|
||
/// </summary>
|
||
wrong
|
||
}
|
||
|
||
public class ToolModelClick : MonoBehaviour
|
||
{
|
||
|
||
public Attribute attribute = Attribute.defaultModel;
|
||
public RightAndWrong rightAndWrong = RightAndWrong.defaultModel;
|
||
|
||
|
||
|
||
private void OnMouseEnter()
|
||
{
|
||
|
||
}
|
||
|
||
private void OnMouseDown()
|
||
{
|
||
if (EventSystem.current.IsPointerOverGameObject())
|
||
return;
|
||
ToolsItemManager.Instance.CreatToolItem(gameObject);
|
||
Destroy(gameObject);
|
||
}
|
||
|
||
private void OnMouseExit()
|
||
{
|
||
|
||
}
|
||
}
|