28 lines
486 B
C#
28 lines
486 B
C#
using UnityEngine;
|
|
|
|
public class Socket : MonoBehaviour, ISocket
|
|
{
|
|
public bool IsAvailable { get; private set; } = true;
|
|
public Vector2 InsertionPoint => transform.position;
|
|
|
|
public void InsertPlug(Plug plug)
|
|
{
|
|
if (IsAvailable)
|
|
{
|
|
|
|
IsAvailable = false;
|
|
}
|
|
}
|
|
|
|
public void RemovePlug(Plug plug)
|
|
{
|
|
|
|
IsAvailable = true;
|
|
}
|
|
public Vector2 GetPosition()
|
|
{
|
|
return transform.position;
|
|
}
|
|
|
|
}
|