扩充工具脚本基类,修改字段名称
This commit is contained in:
parent
8f2b841f2c
commit
b8f2efff51
Binary file not shown.
|
@ -92,7 +92,7 @@ public enum E_ModeType
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工具材料
|
/// 工具材料
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum E_ToolOrMaterial
|
public enum E_ToolOrDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 空
|
/// 空
|
||||||
|
@ -107,7 +107,7 @@ public enum E_ToolOrMaterial
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 材质
|
/// 材质
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Material,
|
Device,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工具或者材料基类,此脚本必须挂在工具或者材料上
|
||||||
|
/// </summary>
|
||||||
|
public abstract class BaseToolOrDevice : MonoBehaviour
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工具Id
|
||||||
|
/// </summary>
|
||||||
|
public int toolId;
|
||||||
|
|
||||||
|
public string toolName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工器具类型 工具/设备
|
||||||
|
/// </summary>
|
||||||
|
public E_ToolOrDevice toolOrMaterial;
|
||||||
|
|
||||||
|
[ContextMenu("GetInfo")]
|
||||||
|
public void GetInfo()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMouseEnter()
|
||||||
|
{
|
||||||
|
if (GlobalFlag.currentUserID != "04_ToolMaterialScene") return;
|
||||||
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
|
OnEnter();
|
||||||
|
//TODO: 这里写提示打开的代码
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMouseDown()
|
||||||
|
{
|
||||||
|
if (GlobalFlag.currentUserID != "04_ToolMaterialScene") return;
|
||||||
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
|
OnDown();
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMouseExit()
|
||||||
|
{
|
||||||
|
//TODO: 这里写提示关闭的代码
|
||||||
|
if (GlobalFlag.currentUserID != "04_ToolMaterialScene") return;
|
||||||
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
|
OnExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual void OnEnter()
|
||||||
|
{
|
||||||
|
Debug.Log("进入");
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnDown()
|
||||||
|
{
|
||||||
|
Debug.Log("点击");
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnExit()
|
||||||
|
{
|
||||||
|
Debug.Log("离开");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,23 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工具或者材料基类
|
|
||||||
/// </summary>
|
|
||||||
public abstract class BaseToolOrMaterial : MonoBehaviour
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 工具Id
|
|
||||||
/// </summary>
|
|
||||||
public int toolId;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工器具类型 工具/材料
|
|
||||||
/// </summary>
|
|
||||||
public E_ToolOrMaterial toolOrMaterial;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ΅η±Κ
|
/// ΅η±Κ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Tool_Electroprobe : BaseToolOrMaterial
|
public class Tool_Electroprobe : BaseToolOrDevice
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 绝缘螺丝刀
|
/// 绝缘螺丝刀
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Tool_InsulatedScrewdriver : BaseToolOrMaterial
|
public class Tool_InsulatedScrewdriver : BaseToolOrDevice
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Tool_SelectComponent : BaseToolOrDevice
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a6f31a9609373b04faa317bc87afe550
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,4 @@
|
||||||
|
UI设计图: https://lanhuapp.com/web/#/item/project/stage?pid=e9f8fe5b-bcc0-4abc-8c67-ab835fe30448&image_id=d10b92fc-acf0-49bb-baad-3ed2de8d577e&tid=c8c17801-6d13-4d68-b35c-c07226fd5f21
|
||||||
|
业务、研发流程图: https://lanhuapp.com/web/#/item/project/product?tid=b340bf82-0fdd-4ca9-89b0-0b2c033b31e2&pid=91885815-de31-4387-9610-4776a57fff41&versionId=11d16567-1909-461f-b6dd-3fb0cffa30f9&docId=b27d3db7-fa20-4cf9-9207-f6fb4802913e&docType=axure&pageId=3ba4da39bb1f4eab9d956605c6463033&image_id=b27d3db7-fa20-4cf9-9207-f6fb4802913e&parentId=c741a79a-b646-45be-ae66-b0e6954ff2b1
|
||||||
|
腾讯文档】计量专业仿真内部表
|
||||||
|
https://docs.qq.com/sheet/DQlBodkpVamRJTUdu
|
Loading…
Reference in New Issue