+ Item관련 Excel, Json, So 수정 + DropItemTable 로직 수정 + 아이템 프리팹에서 Enable Interaction 체크하면 직접 룻팅, 해제하면 자동 룻팅 + 체력회복 아이템 추가 + 개발자 메뉴 상호작용 "F1" 키를 통해 접근 가능 + 보스 맵은 마법진을 상호작용하면 보스전 시작 + 맵 안에서 교전 중일 때, 투명 벽 쉐이더 추가 + 맵 마다의 통로를 통해서 이동 가능 + 선형적인 맵 구조에 맞게 리소스 및 위치 수정 + 타이틀 화면으로 이동할 때 나타나는 오류 수정(CombatUiManager OnDisable 싱글톤 문제) Closes #25, #26
58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using System.Collections;
|
|
using BlueWater.Uis;
|
|
using BlueWater.Utility;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Maps
|
|
{
|
|
public class MapPortal : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Collider _collider;
|
|
|
|
[SerializeField, Required]
|
|
private Transform _targetTransform;
|
|
|
|
[SerializeField]
|
|
private Vector2 _fadeInOutTime = new(1f, 1f);
|
|
|
|
[SerializeField]
|
|
private float _delayAfterFadeIn = 0.5f;
|
|
|
|
[SerializeField]
|
|
private Color _fadeColor = new(0f, 0f, 0f, 0f);
|
|
|
|
private Coroutine _portalCoroutineInstance;
|
|
|
|
private void Awake()
|
|
{
|
|
InitializeComponents();
|
|
}
|
|
|
|
[Button("컴포넌트 초기화")]
|
|
private void InitializeComponents()
|
|
{
|
|
_collider = GetComponent<Collider>();
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (!other.CompareTag("Player") || !_targetTransform) return;
|
|
|
|
Utils.StartUniqueCoroutine(this, ref _portalCoroutineInstance, PortalCoroutine(other));
|
|
}
|
|
|
|
private IEnumerator PortalCoroutine(Collider other)
|
|
{
|
|
PlayerInputKeyManager.Instance.DisableCurrentPlayerInput();
|
|
CombatUiManager.Instance.FadeInOut(_fadeInOutTime.x, _fadeInOutTime.y, _fadeColor, _delayAfterFadeIn);
|
|
yield return new WaitForSeconds(_fadeInOutTime.x);
|
|
|
|
other.transform.position = _targetTransform.position;
|
|
yield return new WaitForSeconds(_delayAfterFadeIn + _fadeInOutTime.y);
|
|
|
|
PlayerInputKeyManager.Instance.EnableCurrentPlayerInput();
|
|
}
|
|
}
|
|
} |