OldBlueWater/BlueWater/Assets/02.Scripts/Props/Jail.cs

33 lines
709 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BlueWaterProject
{
public class Jail : MonoBehaviour
{
private InShipMapInfo inShipMapInfo;
[field: SerializeField] public bool IsUsed { get; set; }
private void Awake()
{
inShipMapInfo = GameObject.Find("InShipMap").GetComponent<InShipMapInfo>();
inShipMapInfo.Jails.Add(this);
}
public void UseJail()
{
if (IsUsed) return;
IsUsed = true;
}
public void ReleaseJail()
{
if (!IsUsed) return;
IsUsed = false;
}
}
}