YanCheng_Metrology/Assets/Scripts/CXX/Tools/Tool_Base.cs

51 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
/// <summary>
/// 工具材料基类
/// </summary>
public class Tool_Base : PermanentTriggerBase
{
/// <summary>
/// 工具类型
/// </summary>
public ToolType toolType;
/// <summary>
/// trigger触发事件
/// </summary>
private Action<string> triggerAction;
protected override void OnStart()
{
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
{
base.OnStart();
}
}
protected override void OnMEnter()
{
if (GameManager.RunModelMgr.SceneType == E_SceneType.Site && GameManager.RunModelMgr.ModeType != E_ModeType.Study)
{
base.OnMEnter();
_highlight.SetHighlighted(true);
}
}
protected override void OnMExit()
{
if (GameManager.RunModelMgr.SceneType == E_SceneType.Site && GameManager.RunModelMgr.ModeType != E_ModeType.Study)
{
base.OnMExit();
_highlight.SetHighlighted(false);
}
}
public void AddTriggerAction(Action<string> action)
{
this.triggerAction = action;
}
}