feat(): 实现EditComponent的UI基础,引入TextMeshPro,添加了在Inside状态下不能互动物体的逻辑控制
This commit is contained in:
@@ -8,7 +8,21 @@ namespace Script.Gameplay.Facility
|
||||
public class DoorInteractController : InteractableBaseController, IEditableComponent
|
||||
{
|
||||
[SerializeField] private LockLevel lockLevel;
|
||||
[SerializeField] private bool isActive = true;
|
||||
public bool IsActive
|
||||
{
|
||||
get => isActive;
|
||||
set
|
||||
{
|
||||
isActive = value;
|
||||
//具体被编辑的逻辑
|
||||
Interactable = isActive;
|
||||
}
|
||||
}
|
||||
public string ComponentName { get; set; } = "DoorSwitch";
|
||||
public LockLevel LockLevel => lockLevel;
|
||||
private bool isOpened = false;
|
||||
|
||||
public override void Interact(GameObject interactor)
|
||||
{
|
||||
if (isOpened)
|
||||
@@ -23,19 +37,11 @@ namespace Script.Gameplay.Facility
|
||||
}
|
||||
}
|
||||
|
||||
public LockLevel LockLevel => lockLevel;
|
||||
|
||||
public void SetActive(bool active)
|
||||
{
|
||||
// 实现激活或禁用门的逻辑
|
||||
Interactable = active;
|
||||
}
|
||||
|
||||
private void OpenDoor()
|
||||
{
|
||||
Debug.Log("Open door");
|
||||
}
|
||||
|
||||
|
||||
private void CloseDoor()
|
||||
{
|
||||
Debug.Log("Close door");
|
||||
|
Reference in New Issue
Block a user