Files
aibis-dream/Assets/Scripts/FixSystem/Cable/Socket.cs
T
2024-08-21 22:13:57 +08:00

28 lines
660 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)
{
// Here you can add the functionality that will be executed when a plug is inserted
IsAvailable = false;
}
}
public void RemovePlug(Plug plug)
{
// Here you can add the functionality that will be executed when a plug is removed
IsAvailable = true;
}
public Vector2 GetPosition()
{
return transform.position;
}
}