Files
aibis-dream/Assets/Scripts/FixSystem/Crowbar/CrowBarSocket.cs
T
bottlefish 5ffa9f6b5f 模块和线的拆除以及重装
view的visual管理,重构了line的初始化方式,支持用yarn初始化
2024-09-01 18:40:46 +08:00

53 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AibisDream;
using System.Drawing;
public class CrowBarSocket : MonoBehaviour, ISocket
{
// Start is called before the first frame update
public bool IsAvailable { get; set; } = true;
public Vector2 InsertionPoint => transform.position;
public GameObject visual;
private YarnOption _option;
public YarnOption Option
{
set => _option = value;
}
private void Awake()
{
visual.SetActive(false);
}
public void InsertPlug()
{
visual.SetActive(true);
}
public void RemovePlug()
{
visual.SetActive(false);
}
public void DisableSocket()
{
gameObject.SetActive(false);
}
public void EnableSocket()
{
gameObject.SetActive(true);
}
public Vector2 GetPosition()
{
return transform.position;
}
public void Completed()
{
_option?.SelectOption();
IsAvailable=false;
}
}