27 lines
715 B
C#
27 lines
715 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |