refactor(Facility): 使用继承让所有机关都拥有了独自的 可交互 可编辑 可连接设定。大面积重构

This commit is contained in:
2025-10-22 17:34:58 +08:00
parent acd8282ff0
commit 5198a80318
61 changed files with 1516 additions and 889 deletions

View File

@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections.Generic;
using Script.Gameplay.Connect;
namespace Script.Gameplay.Interface
{
public interface IConnectable
{
public bool IsEnableConnect { get; set; }
Vector3 GetPosition(); // 获取连接点位置
GameObject GetGameObject(); // 获取连接点物体
string GetConnectableName(); // 获取连接点名称
public List<ConnectionLine> ConnectionLines { get; set; }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e75a5e9f5792435baf0d8e6b9ccc19b1
timeCreated: 1760778892

View File

@@ -9,8 +9,10 @@ namespace Script.Gameplay.Interface
public interface IEditableComponent
{
public bool IsEditableActive { get; set; }
public bool IsEnableEdit { get; set; }
//public bool IsComponentActive { get; set; }
public bool IsOpenInEditor { get; set; }
public string ComponentName { get; set; }
public LockLevel LockLevel { get; }
//public LockLevel LockLevel { get; }
}
}

View File

@@ -0,0 +1,6 @@
using UnityEngine;
public interface IGaze
{
void OnGazeEnter(GameObject go); // 玩家开始注视时触发
void OnGazeExit(GameObject go); // 玩家停止注视时触发
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a1fd2746b1d1f3641a61981f69313868
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,9 +3,8 @@ namespace Script.Gameplay.Interface
{
public interface IInteractable
{
public bool IsEnableInteract { get; set; }
string GetInteractPrompt(); // 返回提示文字例如“按E打开门”
void Interact(GameObject interactor); // 当玩家交互时触发
void OnGazeEnter(GameObject editor); // 玩家开始注视时触发
void OnGazeExit(GameObject editor); // 玩家停止注视时触发
}
}

View File

@@ -0,0 +1,8 @@
using UnityEngine;
namespace Script.Gameplay.Interface
{
public interface ISignalReceiver
{
public void OnSignalReceived(bool active, GameObject sender);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83ece445f7f45404a9691aad6196f2cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
using UnityEngine;
namespace Script.Gameplay.Interface
{
public interface ISignalSender
{
public void SendSignal(bool active, GameObject sender);
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: dc3af72006f342c3b8b7526a5b09e6ee
timeCreated: 1760958923