
+ ItemLootUi 클래스 및 프리팹 생성 + VisualFeedbackManager에서 사용하던 PostProcessing 기능을 OceanCamera로 변경 + OceanUi에 있던 ProcessBar 클래스 따로 생성 + Cannon 공격 로직 변경 ㄴ Boids의 FishSpot과 상호작용으로 변경
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class ItemLootUi : MonoBehaviour
|
|
{
|
|
[SerializeField] private RectTransform rectTransform;
|
|
[SerializeField] private Image border;
|
|
[SerializeField] private Image icon;
|
|
[SerializeField] private RectTransform line;
|
|
|
|
[SerializeField] private bool useAutoDestroy = true;
|
|
[ShowIf("@useAutoDestroy")]
|
|
[SerializeField] private float autoDestroyTime = 10f;
|
|
|
|
private Vector3 lootWorldPos;
|
|
|
|
public void Init(Vector3 value, Sprite sprite = null)
|
|
{
|
|
lootWorldPos = value;
|
|
if (sprite)
|
|
{
|
|
icon.sprite = sprite;
|
|
}
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
if (useAutoDestroy)
|
|
{
|
|
Destroy(gameObject, autoDestroyTime);
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
rectTransform.position = CameraManager.Inst.MainCam.WorldToScreenPoint(lootWorldPos);
|
|
}
|
|
}
|
|
} |