+ 물고기를 잡으면 드랍 가능한 형태의 오브젝트와 아이콘이 생성되게 변경되었습니다. + 플레이어(배)와 아이콘의 위치가 가까워지면 플레이어는 아이콘을 흡수하면서 아이템을 얻게됩니다. + 아이템 획득 시에 효과음을 추가하였습니다. + 아이템 획득 시에 좌측 중단에 UI를 통해서 어떠한 아이템을 얻었는지 확인할 수 있게 표시합니다. + 물고기 스팟 이펙트를 2가지 합치는 방식으로 변경하였습니다. + 물고기 스팟을 기준으로 플레이어와의 거리를 체크해 물고기 스팟이 도망치는 방식으로 변경되었습니다. (기존에는 Bound의 중심) + 물고기 스팟의 크기를 원하는 크기로 변경할 수 있도록 변경했습니다. + 인터페이스 IItem을 추가하였습니다. + Item,FishItem 로직을 변경했습니다.
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class DropItemGroupController : MonoBehaviour
|
|
{
|
|
[field: SerializeField] public List<DropItemInfoUi> dropItemInfoUiList = new(3);
|
|
|
|
private WaitForSeconds coroutineRestartTime = new(0.5f);
|
|
|
|
public void ShowDropItemInfoUi(IItem iItem)
|
|
{
|
|
StartCoroutine(ShowDropItemInfoUiCoroutine(iItem));
|
|
}
|
|
|
|
private IEnumerator ShowDropItemInfoUiCoroutine(IItem iItem)
|
|
{
|
|
while (true)
|
|
{
|
|
foreach (var list in dropItemInfoUiList)
|
|
{
|
|
if (list.UiView.gameObject.activeSelf) continue;
|
|
|
|
var itemText = iItem.ItemName + " x" + iItem.ItemCount;
|
|
list.SetInfo(iItem.ItemIcon, itemText);
|
|
list.ShowUi();
|
|
|
|
while (list.UiView.gameObject.activeSelf)
|
|
{
|
|
yield return null;
|
|
}
|
|
yield break;
|
|
}
|
|
yield return coroutineRestartTime;
|
|
}
|
|
}
|
|
}
|
|
} |