58 lines
1.1 KiB
C#
58 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using System;
|
|
|
|
/// <summary>
|
|
/// 封印
|
|
/// </summary>
|
|
public class Device_Seal : Device_Base
|
|
{
|
|
/// <summary>
|
|
/// 是否被剪开
|
|
/// </summary>
|
|
public bool isCut;
|
|
/// <summary>
|
|
/// 被剪的位置
|
|
/// </summary>
|
|
public Transform testPosAndRot;
|
|
/// <summary>
|
|
/// 封印剪断回调
|
|
/// </summary>
|
|
public Action cutAction;
|
|
|
|
/// <summary>
|
|
/// 剪开封印
|
|
/// </summary>
|
|
public void Cut()
|
|
{
|
|
isCut = true;
|
|
cutAction?.Invoke();
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 安装封印
|
|
/// </summary>
|
|
public void Install()
|
|
{
|
|
isCut = false;
|
|
gameObject.SetActive(true);
|
|
}
|
|
/// <summary>
|
|
/// 断线重连
|
|
/// </summary>
|
|
/// <param name="triggerInfo"></param>
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
public override void LoadCurrentTriggerStat(string triggerInfo)
|
|
{
|
|
if (triggerInfo != "")
|
|
isCut = bool.Parse(triggerInfo);
|
|
}
|
|
|
|
public override string SaveCurrentTriggerStat()
|
|
{
|
|
return isCut.ToString();
|
|
}
|
|
}
|