72 lines
1.9 KiB
C#
72 lines
1.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Device_Base : PermanentTriggerBase
|
|
{
|
|
/// <summary>
|
|
/// 设备类型
|
|
/// </summary>
|
|
public DeviceType deviceType;
|
|
/// <summary>
|
|
/// trigger触发事件
|
|
/// </summary>
|
|
public Func<string,bool,int> triggerAction;
|
|
|
|
/// <summary>
|
|
/// 打分事件
|
|
/// </summary>
|
|
public Action<string, object, int, int> scoreAction;
|
|
|
|
private Vector3 head_LocalPos;
|
|
private Vector3 head_LocalEulerAnglesl;
|
|
|
|
protected override void OnStart()
|
|
{
|
|
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
|
|
{
|
|
base.OnStart();
|
|
AddTriggerAction(GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID);
|
|
AddScoreAction(ScoreManager.instance.Check);
|
|
}
|
|
}
|
|
|
|
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(Func<string, bool, int> action)
|
|
{
|
|
this.triggerAction = action;
|
|
}
|
|
public void AddScoreAction(Action<string, object, int, int> back)
|
|
{
|
|
this.scoreAction = back;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设置工具回到手中的位置
|
|
/// </summary>
|
|
/// <param name="head_LocalPos"></param>
|
|
/// <param name="head_LocalEulerAnglesl"></param>
|
|
public void SetHeadPosAndEulerang(Vector3 head_LocalPos, Vector3 head_LocalEulerAnglesl)
|
|
{
|
|
this.head_LocalPos = head_LocalPos;
|
|
this.head_LocalEulerAnglesl = head_LocalEulerAnglesl;
|
|
}
|
|
}
|