refactor(Facility): 使用继承让所有机关都拥有了独自的 可交互 可编辑 可连接设定。大面积重构
This commit is contained in:
15
Assets/Script/Gameplay/Interface/IConnectable.cs
Normal file
15
Assets/Script/Gameplay/Interface/IConnectable.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
3
Assets/Script/Gameplay/Interface/IConnectable.cs.meta
Normal file
3
Assets/Script/Gameplay/Interface/IConnectable.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e75a5e9f5792435baf0d8e6b9ccc19b1
|
||||
timeCreated: 1760778892
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
6
Assets/Script/Gameplay/Interface/IGaze.cs
Normal file
6
Assets/Script/Gameplay/Interface/IGaze.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
public interface IGaze
|
||||
{
|
||||
void OnGazeEnter(GameObject go); // 玩家开始注视时触发
|
||||
void OnGazeExit(GameObject go); // 玩家停止注视时触发
|
||||
}
|
||||
11
Assets/Script/Gameplay/Interface/IGaze.cs.meta
Normal file
11
Assets/Script/Gameplay/Interface/IGaze.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1fd2746b1d1f3641a61981f69313868
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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); // 玩家停止注视时触发
|
||||
}
|
||||
}
|
||||
8
Assets/Script/Gameplay/Interface/ISignalReceiver.cs
Normal file
8
Assets/Script/Gameplay/Interface/ISignalReceiver.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
namespace Script.Gameplay.Interface
|
||||
{
|
||||
public interface ISignalReceiver
|
||||
{
|
||||
public void OnSignalReceived(bool active, GameObject sender);
|
||||
}
|
||||
}
|
||||
11
Assets/Script/Gameplay/Interface/ISignalReceiver.cs.meta
Normal file
11
Assets/Script/Gameplay/Interface/ISignalReceiver.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83ece445f7f45404a9691aad6196f2cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Script/Gameplay/Interface/ISignalSender.cs
Normal file
8
Assets/Script/Gameplay/Interface/ISignalSender.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
namespace Script.Gameplay.Interface
|
||||
{
|
||||
public interface ISignalSender
|
||||
{
|
||||
public void SendSignal(bool active, GameObject sender);
|
||||
}
|
||||
}
|
||||
3
Assets/Script/Gameplay/Interface/ISignalSender.cs.meta
Normal file
3
Assets/Script/Gameplay/Interface/ISignalSender.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc3af72006f342c3b8b7526a5b09e6ee
|
||||
timeCreated: 1760958923
|
||||
Reference in New Issue
Block a user