칵테일 제조 Ui 변경
This commit is contained in:
parent
9d7723d0ee
commit
2856d83f25
@ -9424,8 +9424,9 @@ MonoBehaviour:
|
|||||||
_colorLerpSpeed: 0.5
|
_colorLerpSpeed: 0.5
|
||||||
_colorIntensity: 2
|
_colorIntensity: 2
|
||||||
_objectPoolCount: 1000
|
_objectPoolCount: 1000
|
||||||
_moveDuration: 0.5
|
_moveToPlayerDuration: 0.3
|
||||||
_endPosition: {x: -300, y: 0, z: 0}
|
_moveToCenterDuration: 0.1
|
||||||
|
_centerPosition: {x: -300, y: 0, z: 0}
|
||||||
_endPositionOffset: {x: 0, y: 20, z: 0}
|
_endPositionOffset: {x: 0, y: 20, z: 0}
|
||||||
_endScale: {x: 0.3, y: 0.3, z: 0.3}
|
_endScale: {x: 0.3, y: 0.3, z: 0.3}
|
||||||
--- !u!1001 &1011627381
|
--- !u!1001 &1011627381
|
||||||
@ -11795,7 +11796,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &1247057679
|
--- !u!4 &1247057679
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -14215,7 +14216,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &1400792458
|
--- !u!4 &1400792458
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -14317,6 +14318,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: f0f3dc568d0721b48ad5f24339d24951, type: 3}
|
m_Script: {fileID: 11500000, guid: f0f3dc568d0721b48ad5f24339d24951, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
_tycoonPlayer: {fileID: 0}
|
||||||
|
_isEntered: 0
|
||||||
--- !u!114 &1400792463
|
--- !u!114 &1400792463
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -18915,7 +18918,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 1774013116}
|
m_GameObject: {fileID: 1774013116}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: -250, y: 0, z: -10}
|
m_LocalPosition: {x: -300, y: 0, z: -10}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
@ -22735,7 +22738,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 2105041732}
|
m_GameObject: {fileID: 2105041732}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -250, y: 0, z: 0}
|
m_LocalPosition: {x: -300, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 100, y: 100, z: 1}
|
m_LocalScale: {x: 100, y: 100, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
@ -123,8 +123,8 @@ namespace BlueWater.Players.Tycoons
|
|||||||
TycoonInput.OnMoveInputReceived += TycoonMovement.HandleInputMovement;
|
TycoonInput.OnMoveInputReceived += TycoonMovement.HandleInputMovement;
|
||||||
|
|
||||||
var balloonUi = InteractionCanvas.BalloonUi;
|
var balloonUi = InteractionCanvas.BalloonUi;
|
||||||
EventManager.OnLiquidRegionEntered += balloonUi.EnterLiquidRegion;
|
// EventManager.OnLiquidRegionEntered += balloonUi.EnterLiquidRegion;
|
||||||
EventManager.OnLiquidRegionExited += balloonUi.ExitLiquidRegion;
|
// EventManager.OnLiquidRegionExited += balloonUi.ExitLiquidRegion;
|
||||||
EventManager.OnCocktailStarted += balloonUi.PickupUnfinishedCocktail;
|
EventManager.OnCocktailStarted += balloonUi.PickupUnfinishedCocktail;
|
||||||
EventManager.OnCocktailCompleted += balloonUi.SetItemImage;
|
EventManager.OnCocktailCompleted += balloonUi.SetItemImage;
|
||||||
EventManager.OnCocktailDiscarded += balloonUi.DiscardItem;
|
EventManager.OnCocktailDiscarded += balloonUi.DiscardItem;
|
||||||
@ -136,8 +136,8 @@ namespace BlueWater.Players.Tycoons
|
|||||||
TycoonInput.OnMoveInputReceived -= TycoonMovement.HandleInputMovement;
|
TycoonInput.OnMoveInputReceived -= TycoonMovement.HandleInputMovement;
|
||||||
|
|
||||||
var balloonUi = InteractionCanvas.BalloonUi;
|
var balloonUi = InteractionCanvas.BalloonUi;
|
||||||
EventManager.OnLiquidRegionEntered -= balloonUi.EnterLiquidRegion;
|
// EventManager.OnLiquidRegionEntered -= balloonUi.EnterLiquidRegion;
|
||||||
EventManager.OnLiquidRegionExited -= balloonUi.ExitLiquidRegion;
|
// EventManager.OnLiquidRegionExited -= balloonUi.ExitLiquidRegion;
|
||||||
EventManager.OnCocktailStarted -= balloonUi.PickupUnfinishedCocktail;
|
EventManager.OnCocktailStarted -= balloonUi.PickupUnfinishedCocktail;
|
||||||
EventManager.OnCocktailCompleted -= balloonUi.SetItemImage;
|
EventManager.OnCocktailCompleted -= balloonUi.SetItemImage;
|
||||||
EventManager.OnCocktailDiscarded -= balloonUi.DiscardItem;
|
EventManager.OnCocktailDiscarded -= balloonUi.DiscardItem;
|
||||||
|
@ -33,8 +33,8 @@ namespace BlueWater
|
|||||||
public static Action OnTycoonOpenedEvent;
|
public static Action OnTycoonOpenedEvent;
|
||||||
public static Action OnTycoonClosedEvent;
|
public static Action OnTycoonClosedEvent;
|
||||||
|
|
||||||
public static Action OnLiquidRegionEntered;
|
// public static Action OnLiquidRegionEntered;
|
||||||
public static Action OnLiquidRegionExited;
|
// public static Action OnLiquidRegionExited;
|
||||||
|
|
||||||
public static Action OnCocktailStarted;
|
public static Action OnCocktailStarted;
|
||||||
public static Action<CocktailData> OnCocktailCompleted;
|
public static Action<CocktailData> OnCocktailCompleted;
|
||||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using BlueWater.Items;
|
using BlueWater.Items;
|
||||||
using BlueWater.Players.Tycoons;
|
using BlueWater.Players.Tycoons;
|
||||||
using BlueWater.Tycoons;
|
using BlueWater.Tycoons;
|
||||||
|
using BlueWater.Utility;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
@ -82,10 +83,13 @@ namespace BlueWater
|
|||||||
|
|
||||||
[Title("패널")]
|
[Title("패널")]
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private float _moveDuration = 0.5f;
|
private float _moveToPlayerDuration = 0.5f;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Vector3 _endPosition = new(-300f, 0f, 0f);
|
private float _moveToCenterDuration = 0.2f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Vector3 _centerPosition = new(-300f, 0f, 0f);
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Vector3 _endPositionOffset = new(0f, 20f, 0f);
|
private Vector3 _endPositionOffset = new(0f, 20f, 0f);
|
||||||
@ -100,11 +104,10 @@ namespace BlueWater
|
|||||||
private List<Garnish> _activeGarnishDatas = new();
|
private List<Garnish> _activeGarnishDatas = new();
|
||||||
private Dictionary<LiquidData, int> _liquidDataCounts = new(7);
|
private Dictionary<LiquidData, int> _liquidDataCounts = new(7);
|
||||||
private Material _instanceMaterial;
|
private Material _instanceMaterial;
|
||||||
private Tween _showTween;
|
|
||||||
private Tween _hideTween;
|
|
||||||
|
|
||||||
private bool _isShowingPanel;
|
private bool _isShowingPanel;
|
||||||
private bool _isPouring;
|
private bool _isPouring;
|
||||||
|
private bool _isCompleted;
|
||||||
private float _startTime = float.PositiveInfinity;
|
private float _startTime = float.PositiveInfinity;
|
||||||
private int _instanceLiquidCount;
|
private int _instanceLiquidCount;
|
||||||
private float _currentLiquidAmount;
|
private float _currentLiquidAmount;
|
||||||
@ -115,6 +118,9 @@ namespace BlueWater
|
|||||||
private Camera _overlayCamera;
|
private Camera _overlayCamera;
|
||||||
private TycoonPlayer _tycoonPlayer;
|
private TycoonPlayer _tycoonPlayer;
|
||||||
private Vector3 _lastPlayerPosition;
|
private Vector3 _lastPlayerPosition;
|
||||||
|
private Vector3 _originalPanelScale;
|
||||||
|
private Coroutine _movePanelToPlayerInstance;
|
||||||
|
private Coroutine _movePanelToCenterInstance;
|
||||||
|
|
||||||
// Hashes
|
// Hashes
|
||||||
private static readonly int LiquidAmountHash = Shader.PropertyToID("_LiquidAmount");
|
private static readonly int LiquidAmountHash = Shader.PropertyToID("_LiquidAmount");
|
||||||
@ -129,18 +135,12 @@ namespace BlueWater
|
|||||||
{
|
{
|
||||||
_liquidObjectPool = new ObjectPool<Liquid>(CreateLiquidObject, OnGetLiquidObject, OnReleaseLiquidObject, OnDestroyLiquidObject, maxSize: _objectPoolCount);
|
_liquidObjectPool = new ObjectPool<Liquid>(CreateLiquidObject, OnGetLiquidObject, OnReleaseLiquidObject, OnDestroyLiquidObject, maxSize: _objectPoolCount);
|
||||||
_garnishObjectPool = new ObjectPool<Garnish>(CreateGarnishObject, OnGetGarnishObject, OnReleaseGarnishObject, OnDestroyGarnishObject, maxSize: _objectPoolCount);
|
_garnishObjectPool = new ObjectPool<Garnish>(CreateGarnishObject, OnGetGarnishObject, OnReleaseGarnishObject, OnDestroyGarnishObject, maxSize: _objectPoolCount);
|
||||||
|
|
||||||
_hideTween = _liquidPanel.transform.DOMoveX(_endPosition.x + 100f, _moveDuration).Pause()
|
|
||||||
.SetAutoKill(false);
|
|
||||||
|
|
||||||
_showTween = _liquidPanel.transform.DOMoveX(_endPosition.x, _moveDuration).Pause()
|
|
||||||
.SetAutoKill(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
EventManager.OnLiquidRegionEntered += ShowPanel;
|
//EventManager.OnLiquidRegionEntered += ShowPanel;
|
||||||
EventManager.OnLiquidRegionExited += HidePanel;
|
//EventManager.OnLiquidRegionExited += HidePanel;
|
||||||
EventManager.OnCocktailDiscarded += ReleaseAllObject;
|
EventManager.OnCocktailDiscarded += ReleaseAllObject;
|
||||||
EventManager.OnPlaceOnServingTable += ReleaseAllObject;
|
EventManager.OnPlaceOnServingTable += ReleaseAllObject;
|
||||||
LiquidIngredient.OnReachedTarget += OnTargetReached;
|
LiquidIngredient.OnReachedTarget += OnTargetReached;
|
||||||
@ -151,7 +151,8 @@ namespace BlueWater
|
|||||||
_tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
_tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
||||||
_instanceMaterial = Instantiate(_liquidRenderer.material);
|
_instanceMaterial = Instantiate(_liquidRenderer.material);
|
||||||
_liquidRenderer.material = _instanceMaterial;
|
_liquidRenderer.material = _instanceMaterial;
|
||||||
|
|
||||||
|
_originalPanelScale = _liquidPanel.transform.localScale;
|
||||||
_instanceMaterial.SetFloat(LiquidAmountHash, 0f);
|
_instanceMaterial.SetFloat(LiquidAmountHash, 0f);
|
||||||
_timeInterval = 1f / _liquidsPerSecond;
|
_timeInterval = 1f / _liquidsPerSecond;
|
||||||
_shaker.SetActive(true);
|
_shaker.SetActive(true);
|
||||||
@ -201,22 +202,22 @@ namespace BlueWater
|
|||||||
_startTime = Time.time;
|
_startTime = Time.time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
if (_instanceLiquidCount <= 0) return;
|
// if (_instanceLiquidCount <= 0) return;
|
||||||
|
//
|
||||||
var playerPosition = _tycoonPlayer.transform.position;
|
// var playerPosition = _tycoonPlayer.transform.position;
|
||||||
var playerScreenPosition = TycoonCameraManager.Instance.MainCamera.WorldToScreenPoint(playerPosition);
|
// var playerScreenPosition = TycoonCameraManager.Instance.MainCamera.WorldToScreenPoint(playerPosition);
|
||||||
var panelWorldPosition = _overlayCamera.ScreenToWorldPoint(new Vector3(playerScreenPosition.x,
|
// var panelWorldPosition = _overlayCamera.ScreenToWorldPoint(new Vector3(playerScreenPosition.x,
|
||||||
playerScreenPosition.y, _overlayCamera.nearClipPlane));
|
// playerScreenPosition.y, _overlayCamera.nearClipPlane));
|
||||||
panelWorldPosition += _endPositionOffset;
|
// panelWorldPosition += _endPositionOffset;
|
||||||
|
//
|
||||||
if (_activeLiquidDatas.Count == 0 && _activeGarnishDatas.Count == 0)
|
// if (_activeLiquidDatas.Count == 0 && _activeGarnishDatas.Count == 0)
|
||||||
{
|
// {
|
||||||
_liquidPanel.transform.DOScale(_endScale, _moveDuration).SetEase(Ease.Linear);
|
// _liquidPanel.transform.DOScale(_endScale, _moveDuration).SetEase(Ease.Linear);
|
||||||
_liquidPanel.transform.DOMove(panelWorldPosition, _moveDuration).SetEase(Ease.Linear);
|
// _liquidPanel.transform.DOMove(panelWorldPosition, _moveDuration).SetEase(Ease.Linear);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (_liquidReachedTime + _colorLerpSpeed >= Time.time)
|
if (_liquidReachedTime + _colorLerpSpeed >= Time.time)
|
||||||
{
|
{
|
||||||
@ -227,8 +228,8 @@ namespace BlueWater
|
|||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
EventManager.OnLiquidRegionEntered -= ShowPanel;
|
//EventManager.OnLiquidRegionEntered -= ShowPanel;
|
||||||
EventManager.OnLiquidRegionExited -= HidePanel;
|
//EventManager.OnLiquidRegionExited -= HidePanel;
|
||||||
EventManager.OnCocktailDiscarded -= ReleaseAllObject;
|
EventManager.OnCocktailDiscarded -= ReleaseAllObject;
|
||||||
EventManager.OnPlaceOnServingTable -= ReleaseAllObject;
|
EventManager.OnPlaceOnServingTable -= ReleaseAllObject;
|
||||||
|
|
||||||
@ -315,6 +316,7 @@ namespace BlueWater
|
|||||||
}
|
}
|
||||||
|
|
||||||
_liquidDataCounts.Clear();
|
_liquidDataCounts.Clear();
|
||||||
|
_isCompleted = false;
|
||||||
_instanceLiquidCount = 0;
|
_instanceLiquidCount = 0;
|
||||||
_instanceMaterial.SetFloat(LiquidAmountHash, 0f);
|
_instanceMaterial.SetFloat(LiquidAmountHash, 0f);
|
||||||
SetCurrentAmount(0f);
|
SetCurrentAmount(0f);
|
||||||
@ -326,11 +328,12 @@ namespace BlueWater
|
|||||||
_currentBarrel = barrel;
|
_currentBarrel = barrel;
|
||||||
if (_instanceLiquidCount == 0)
|
if (_instanceLiquidCount == 0)
|
||||||
{
|
{
|
||||||
ShowPanelFast();
|
ShowPanelStarted();
|
||||||
_shaker.SetActive(true);
|
_shaker.SetActive(true);
|
||||||
_amountText.enabled = true;
|
_amountText.enabled = true;
|
||||||
_completeCocktailImage.enabled = false;
|
_completeCocktailImage.enabled = false;
|
||||||
_completeText.enabled = false;
|
_completeText.enabled = false;
|
||||||
|
_isCompleted = false;
|
||||||
_currentMixedColor = barrel.GetLiquidData().Color;
|
_currentMixedColor = barrel.GetLiquidData().Color;
|
||||||
_instanceMaterial.SetColor(LiquidColorHash, _currentMixedColor * _colorIntensity);
|
_instanceMaterial.SetColor(LiquidColorHash, _currentMixedColor * _colorIntensity);
|
||||||
EventManager.OnCocktailStarted?.Invoke();
|
EventManager.OnCocktailStarted?.Invoke();
|
||||||
@ -338,37 +341,27 @@ namespace BlueWater
|
|||||||
|
|
||||||
_startTime = Time.time;
|
_startTime = Time.time;
|
||||||
_isPouring = true;
|
_isPouring = true;
|
||||||
|
|
||||||
|
// To Center 이동 코루틴이 활성화 중이지 않을 때
|
||||||
|
if (_movePanelToCenterInstance == null)
|
||||||
|
{
|
||||||
|
// To Player 이동 코루틴이 활성화 중이라면 멈추고 To Center 활성화
|
||||||
|
if (_movePanelToPlayerInstance != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_movePanelToPlayerInstance);
|
||||||
|
_movePanelToPlayerInstance = null;
|
||||||
|
}
|
||||||
|
Utils.StartUniqueCoroutine(this, ref _movePanelToCenterInstance, MovePanelToCenter());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleBarrelCancelInteraction()
|
public void HandleBarrelCancelInteraction()
|
||||||
{
|
{
|
||||||
_isPouring = false;
|
_isPouring = false;
|
||||||
|
|
||||||
|
Utils.StartUniqueCoroutine(this, ref _movePanelToPlayerInstance, MovePanelToPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void ActiveIsPouring(Barrel barrel)
|
|
||||||
// {
|
|
||||||
// _currentBarrel = barrel;
|
|
||||||
// if (_instanceLiquidCount == 0)
|
|
||||||
// {
|
|
||||||
// ShowPanelFast();
|
|
||||||
// _shaker.SetActive(true);
|
|
||||||
// _amountText.enabled = true;
|
|
||||||
// _completeCocktailImage.enabled = false;
|
|
||||||
// _completeText.enabled = false;
|
|
||||||
// _currentMixedColor = _currentBarrel.GetLiquidData().Color;
|
|
||||||
// _instanceMaterial.SetColor(LiquidColorHash, _currentMixedColor * _colorIntensity);
|
|
||||||
// EventManager.OnCocktailStarted?.Invoke();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// _startTime = Time.time;
|
|
||||||
// _isPouring = true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public void InActiveIsPouring()
|
|
||||||
// {
|
|
||||||
// _isPouring = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void SetCurrentAmount(float value)
|
private void SetCurrentAmount(float value)
|
||||||
{
|
{
|
||||||
_currentLiquidAmount = value;
|
_currentLiquidAmount = value;
|
||||||
@ -392,6 +385,7 @@ namespace BlueWater
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private IEnumerator CompleteCocktail()
|
private IEnumerator CompleteCocktail()
|
||||||
{
|
{
|
||||||
|
_isCompleted = true;
|
||||||
HandleBarrelCancelInteraction();
|
HandleBarrelCancelInteraction();
|
||||||
|
|
||||||
yield return new WaitUntil(() => _currentLiquidAmount >= _maxLiquidCount);
|
yield return new WaitUntil(() => _currentLiquidAmount >= _maxLiquidCount);
|
||||||
@ -520,25 +514,82 @@ namespace BlueWater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowPanelFast()
|
public void ShowPanelStarted()
|
||||||
{
|
{
|
||||||
if (_isShowingPanel) return;
|
if (_isShowingPanel) return;
|
||||||
|
|
||||||
_liquidPanel.transform.localScale = Vector3.one;
|
_liquidPanel.transform.localScale = _originalPanelScale;
|
||||||
_liquidPanel.transform.position = _endPosition;
|
_liquidPanel.transform.position = _centerPosition;
|
||||||
_liquidPanel.SetActive(true);
|
_liquidPanel.SetActive(true);
|
||||||
_isShowingPanel = true;
|
_isShowingPanel = true;
|
||||||
_hideTween.Pause();
|
|
||||||
_showTween.Pause();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowPanel()
|
private IEnumerator MovePanelToPlayer()
|
||||||
{
|
{
|
||||||
if (_isShowingPanel || _instanceLiquidCount <= 0) return;
|
if (_isCompleted)
|
||||||
|
{
|
||||||
|
_movePanelToPlayerInstance = null;
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return new WaitUntil(() => _activeLiquidDatas.Count == 0 && _activeGarnishDatas.Count == 0);
|
||||||
|
|
||||||
|
var startScale = _liquidPanel.transform.localScale;
|
||||||
|
var startPosition = _liquidPanel.transform.position;
|
||||||
|
var elapsedTime = 0f;
|
||||||
|
while (elapsedTime <= _moveToPlayerDuration)
|
||||||
|
{
|
||||||
|
var playerPosition = _tycoonPlayer.transform.position;
|
||||||
|
var playerScreenPosition = TycoonCameraManager.Instance.MainCamera.WorldToScreenPoint(playerPosition);
|
||||||
|
var panelWorldPosition = _overlayCamera.ScreenToWorldPoint(new Vector3(playerScreenPosition.x,
|
||||||
|
playerScreenPosition.y, _overlayCamera.nearClipPlane));
|
||||||
|
panelWorldPosition += _endPositionOffset;
|
||||||
|
|
||||||
|
var lerpTime = elapsedTime / _moveToPlayerDuration;
|
||||||
|
_liquidPanel.transform.position = Vector3.Lerp(startPosition, panelWorldPosition, lerpTime);
|
||||||
|
_liquidPanel.transform.localScale = Vector3.Lerp(startScale, _endScale, lerpTime);
|
||||||
|
|
||||||
|
elapsedTime += Time.deltaTime;
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
_liquidPanel.transform.localScale = _endScale;
|
||||||
|
|
||||||
|
// 완성되지 않았거나, 따르고 있지 않으면 플레이어를 추적함
|
||||||
|
var waitTime = new WaitForFixedUpdate();
|
||||||
|
while (!_isCompleted && !_isPouring)
|
||||||
|
{
|
||||||
|
var playerPosition = _tycoonPlayer.transform.position;
|
||||||
|
var playerScreenPosition = TycoonCameraManager.Instance.MainCamera.WorldToScreenPoint(playerPosition);
|
||||||
|
var panelWorldPosition = _overlayCamera.ScreenToWorldPoint(new Vector3(playerScreenPosition.x,
|
||||||
|
playerScreenPosition.y, _overlayCamera.nearClipPlane));
|
||||||
|
panelWorldPosition += _endPositionOffset;
|
||||||
|
|
||||||
|
_liquidPanel.transform.position = panelWorldPosition;
|
||||||
|
yield return waitTime;
|
||||||
|
}
|
||||||
|
|
||||||
_isShowingPanel = true;
|
_movePanelToPlayerInstance = null;
|
||||||
_hideTween.Pause();
|
}
|
||||||
_showTween.Restart();
|
|
||||||
|
private IEnumerator MovePanelToCenter()
|
||||||
|
{
|
||||||
|
var startScale = _liquidPanel.transform.localScale;
|
||||||
|
var startPosition = _liquidPanel.transform.position;
|
||||||
|
var elapsedTime = 0f;
|
||||||
|
while (elapsedTime <= _moveToCenterDuration)
|
||||||
|
{
|
||||||
|
var lerpTime = elapsedTime / _moveToCenterDuration;
|
||||||
|
_liquidPanel.transform.position = Vector3.Lerp(startPosition, _centerPosition, lerpTime);
|
||||||
|
_liquidPanel.transform.localScale = Vector3.Lerp(startScale, _originalPanelScale, lerpTime);
|
||||||
|
|
||||||
|
elapsedTime += Time.deltaTime;
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
_liquidPanel.transform.position = _centerPosition;
|
||||||
|
_liquidPanel.transform.localScale = _originalPanelScale;
|
||||||
|
_movePanelToCenterInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HidePanel()
|
public void HidePanel()
|
||||||
@ -546,8 +597,7 @@ namespace BlueWater
|
|||||||
if (!_isShowingPanel) return;
|
if (!_isShowingPanel) return;
|
||||||
|
|
||||||
_isShowingPanel = false;
|
_isShowingPanel = false;
|
||||||
_showTween.Pause();
|
_liquidPanel.SetActive(false);
|
||||||
_hideTween.Restart();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
using System;
|
// using System;
|
||||||
using BlueWater.Players.Tycoons;
|
// using BlueWater.Players.Tycoons;
|
||||||
using UnityEngine;
|
// using UnityEngine;
|
||||||
|
//
|
||||||
namespace BlueWater
|
// namespace BlueWater
|
||||||
{
|
// {
|
||||||
public class LiquidInteractionRegion : MonoBehaviour
|
// public class LiquidInteractionRegion : MonoBehaviour
|
||||||
{
|
// {
|
||||||
private TycoonPlayer _tycoonPlayer;
|
// private TycoonPlayer _tycoonPlayer;
|
||||||
private bool _isEntered;
|
// private bool _isEntered;
|
||||||
|
//
|
||||||
private void Start()
|
// private void Start()
|
||||||
{
|
// {
|
||||||
_tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
// _tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private void Update()
|
// private void Update()
|
||||||
{
|
// {
|
||||||
if (!_isEntered) return;
|
// if (!_isEntered) return;
|
||||||
|
//
|
||||||
if (_tycoonPlayer.TycoonPickupHandler.IsPickedUpItem()) return;
|
// if (_tycoonPlayer.TycoonPickupHandler.IsPickedUpItem()) return;
|
||||||
|
//
|
||||||
EventManager.OnLiquidRegionEntered?.Invoke();
|
// EventManager.OnLiquidRegionEntered?.Invoke();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private void OnTriggerEnter(Collider other)
|
// private void OnTriggerEnter(Collider other)
|
||||||
{
|
// {
|
||||||
if (!other.CompareTag("Player")) return;
|
// if (!other.CompareTag("Player")) return;
|
||||||
|
//
|
||||||
_isEntered = true;
|
// _isEntered = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private void OnTriggerExit(Collider other)
|
// private void OnTriggerExit(Collider other)
|
||||||
{
|
// {
|
||||||
if (!other.CompareTag("Player")) return;
|
// if (!other.CompareTag("Player")) return;
|
||||||
|
//
|
||||||
_isEntered = false;
|
// _isEntered = false;
|
||||||
EventManager.OnLiquidRegionExited?.Invoke();
|
// EventManager.OnLiquidRegionExited?.Invoke();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
@ -676,6 +676,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5297442833789713246, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}
|
||||||
|
propertyPath: m_SortingOrder
|
||||||
|
value: 6
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5611097802189151736, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}
|
- target: {fileID: 5611097802189151736, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: InteractionCanvas
|
value: InteractionCanvas
|
||||||
|
@ -327,20 +327,6 @@
|
|||||||
"m_SlotId": 0
|
"m_SlotId": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"m_OutputSlot": {
|
|
||||||
"m_Node": {
|
|
||||||
"m_Id": "9305fd09fafc42488b36734a733d4e6a"
|
|
||||||
},
|
|
||||||
"m_SlotId": 4
|
|
||||||
},
|
|
||||||
"m_InputSlot": {
|
|
||||||
"m_Node": {
|
|
||||||
"m_Id": "d7ae6f9dead049e1b58ece60b1867ee6"
|
|
||||||
},
|
|
||||||
"m_SlotId": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"m_OutputSlot": {
|
"m_OutputSlot": {
|
||||||
"m_Node": {
|
"m_Node": {
|
||||||
@ -593,6 +579,20 @@
|
|||||||
"m_SlotId": 1
|
"m_SlotId": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"m_OutputSlot": {
|
||||||
|
"m_Node": {
|
||||||
|
"m_Id": "f207d005495148b0a7fb864588751ee2"
|
||||||
|
},
|
||||||
|
"m_SlotId": 7
|
||||||
|
},
|
||||||
|
"m_InputSlot": {
|
||||||
|
"m_Node": {
|
||||||
|
"m_Id": "d7ae6f9dead049e1b58ece60b1867ee6"
|
||||||
|
},
|
||||||
|
"m_SlotId": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"m_OutputSlot": {
|
"m_OutputSlot": {
|
||||||
"m_Node": {
|
"m_Node": {
|
||||||
|
Loading…
Reference in New Issue
Block a user