feat():大改前的提交,这个版本保存了所有冗余的代码
This commit is contained in:
7
Assets/Script/Gameplay/Facility/EditComponent.cs
Normal file
7
Assets/Script/Gameplay/Facility/EditComponent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Script.Gameplay.Facility
|
||||
{
|
||||
public class EditComponent
|
||||
{
|
||||
|
||||
}
|
||||
}
|
3
Assets/Script/Gameplay/Facility/EditComponent.cs.meta
Normal file
3
Assets/Script/Gameplay/Facility/EditComponent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bca7c28154234ab4b792dca4d2f92354
|
||||
timeCreated: 1760629389
|
69
Assets/Script/Gameplay/Facility/FacilityController.cs
Normal file
69
Assets/Script/Gameplay/Facility/FacilityController.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Gameplay.Player;
|
||||
using UnityEngine;
|
||||
using Interface;
|
||||
|
||||
namespace Script.Gameplay.Facility
|
||||
{
|
||||
public class FacilityController : MonoBehaviour, IInteractable, IEditable
|
||||
{
|
||||
public FacilityModifier facilityModifier;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (facilityModifier == null)
|
||||
{
|
||||
facilityModifier = GetComponent<FacilityModifier>();
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public string GetInteractPrompt()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public void Interact(GameObject interactor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnGazeEnter(GameObject editor)
|
||||
{
|
||||
// 物体弹出按F可交互菜单
|
||||
}
|
||||
|
||||
public void OnGazeExit(GameObject editor)
|
||||
{
|
||||
// 物体取消菜单
|
||||
}
|
||||
|
||||
public void OnGazeEnter(PlayerEditController editor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnGazeExit(PlayerEditController editor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void BeginEdit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void EndEdit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEditable GetEditable()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7986c88b8e1d4944832af56e23188597
|
||||
timeCreated: 1760664530
|
27
Assets/Script/Gameplay/Facility/FacilityModifier.cs
Normal file
27
Assets/Script/Gameplay/Facility/FacilityModifier.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Gameplay.Facility
|
||||
{
|
||||
public class FacilityModifier : MonoBehaviour
|
||||
{
|
||||
private Transform _transform;
|
||||
private Collider _collider;
|
||||
private Rigidbody _rigidbody;
|
||||
|
||||
public void ModifyComponent<T>(bool isOpen, T component) where T : Component
|
||||
{
|
||||
var targetComponent = this.GetComponent<T>();
|
||||
if (targetComponent != null)
|
||||
{
|
||||
if (isOpen)
|
||||
{
|
||||
targetComponent.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetComponent.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Script/Gameplay/Facility/FacilityModifier.cs.meta
Normal file
3
Assets/Script/Gameplay/Facility/FacilityModifier.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1db33a437984a1a8fae09ab8c5de7e4
|
||||
timeCreated: 1760667210
|
Reference in New Issue
Block a user