43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 场景触发器
|
|
/// </summary>
|
|
public class DeviceTrigger : PermanentTriggerBase
|
|
{
|
|
/// <summary>
|
|
/// 安装位置
|
|
/// </summary>
|
|
public Transform installVector;
|
|
/// <summary>
|
|
/// 点击回调
|
|
/// </summary>
|
|
public Action clickAction;
|
|
protected override void OnMDown()
|
|
{
|
|
base.OnMDown();
|
|
clickAction?.Invoke();
|
|
base.CallScoreAction();
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
}
|