Merge branch 'lmg' of http://gitea.capers.co.kr:3000/capers/CapersRepo into ntg
This commit is contained in:
commit
a131e6cc67
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 13dc68816b7d25e4f852aa863002aec2
|
guid: e7a1af91eedbae34b95b935f45e2ea93
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
@ -1,3 +1,4 @@
|
|||||||
|
using Spine.Unity;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class TycoonCharacter : MonoBehaviour
|
public class TycoonCharacter : MonoBehaviour
|
||||||
@ -6,8 +7,15 @@ public class TycoonCharacter : MonoBehaviour
|
|||||||
public RectTransform parentRectTransform; // 부모 UI 객체의 RectTransform
|
public RectTransform parentRectTransform; // 부모 UI 객체의 RectTransform
|
||||||
|
|
||||||
public float smoothSpeed = 5f;
|
public float smoothSpeed = 5f;
|
||||||
private Vector3 targetPosition;
|
private Vector3 targetPosition;
|
||||||
|
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
private SkeletonAnimation spine;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
private SkeletonRootMotion spineEye;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
selfRectTransform = GetComponent<RectTransform>();
|
selfRectTransform = GetComponent<RectTransform>();
|
||||||
@ -24,6 +32,21 @@ public class TycoonCharacter : MonoBehaviour
|
|||||||
{
|
{
|
||||||
UpdateTargetPosition();
|
UpdateTargetPosition();
|
||||||
SmoothMoveToTarget();
|
SmoothMoveToTarget();
|
||||||
|
|
||||||
|
if (spineEye != null)
|
||||||
|
{
|
||||||
|
// 본의 위치 변경 (예: 마우스 위치로 이동)
|
||||||
|
Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
spineEye.RootMotionBone.WorldX = mousePosition.x;
|
||||||
|
spineEye.RootMotionBone.WorldY = mousePosition.y;
|
||||||
|
|
||||||
|
Debug.Log(mousePosition);
|
||||||
|
|
||||||
|
spineEye.RootMotionBone.UpdateWorldTransform();
|
||||||
|
// 스켈레톤을 다시 업데이트
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateTargetPosition()
|
void UpdateTargetPosition()
|
||||||
|
@ -62,7 +62,12 @@ namespace BlueWater.Uis
|
|||||||
[field: SerializeField]
|
[field: SerializeField]
|
||||||
private string cardText;
|
private string cardText;
|
||||||
|
|
||||||
|
private Coroutine _currentCreateCoroutine;
|
||||||
private Coroutine _currentRotationCoroutine;
|
private Coroutine _currentRotationCoroutine;
|
||||||
|
|
||||||
|
[HideInInspector]
|
||||||
|
public bool checkRotation = false;
|
||||||
|
private bool checkCreate = false;
|
||||||
|
|
||||||
[FormerlySerializedAs("RotationDurationCard")]
|
[FormerlySerializedAs("RotationDurationCard")]
|
||||||
[field: Title("카드 회전")]
|
[field: Title("카드 회전")]
|
||||||
@ -86,6 +91,7 @@ namespace BlueWater.Uis
|
|||||||
|
|
||||||
private Coroutine _changedLocaleInstance;
|
private Coroutine _changedLocaleInstance;
|
||||||
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
LocalizationSettings.SelectedLocaleChanged += OnChangedLocale;
|
LocalizationSettings.SelectedLocaleChanged += OnChangedLocale;
|
||||||
@ -122,6 +128,7 @@ namespace BlueWater.Uis
|
|||||||
//지정된 IDX값으로 정보값 초기화
|
//지정된 IDX값으로 정보값 초기화
|
||||||
public void SetCard(CardData cardData)
|
public void SetCard(CardData cardData)
|
||||||
{
|
{
|
||||||
|
checkCreate = false;
|
||||||
CardDataForIdx = cardData;
|
CardDataForIdx = cardData;
|
||||||
int count = TycoonManager.Instance.TycoonCardController.GetSelectedCardCount(CardDataForIdx.Idx);
|
int count = TycoonManager.Instance.TycoonCardController.GetSelectedCardCount(CardDataForIdx.Idx);
|
||||||
|
|
||||||
@ -163,34 +170,41 @@ namespace BlueWater.Uis
|
|||||||
PriceUi.SetActive(true);
|
PriceUi.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Button("회전")]
|
|
||||||
public void Rotation_Start()
|
|
||||||
{
|
|
||||||
Panel.localRotation = Quaternion.Euler(0, -180, 0);
|
|
||||||
Panel.localScale = new Vector3(0, 0, 0);
|
|
||||||
|
|
||||||
|
[Button("등장")]
|
||||||
|
public void Create_Start()
|
||||||
|
{
|
||||||
|
Panel.localRotation = Quaternion.Euler(0, 0, 0);
|
||||||
|
Panel.localScale = new Vector3(0, 0, 0);
|
||||||
|
checkRotation = false;
|
||||||
|
|
||||||
|
if (_currentCreateCoroutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_currentCreateCoroutine);
|
||||||
|
_currentCreateCoroutine = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (_currentRotationCoroutine != null)
|
if (_currentRotationCoroutine != null)
|
||||||
{
|
{
|
||||||
StopCoroutine(_currentRotationCoroutine);
|
StopCoroutine(_currentRotationCoroutine);
|
||||||
_currentRotationCoroutine = null;
|
_currentRotationCoroutine = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentRotationCoroutine = StartCoroutine(RotateOverTime());
|
_currentCreateCoroutine = StartCoroutine(CreateOverTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 카드를 등장하며 회전시킴!
|
/// 카드를 등장시킴
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private IEnumerator RotateOverTime()
|
private IEnumerator CreateOverTime()
|
||||||
{
|
{
|
||||||
BackObject.SetActive(true);
|
BackObject.SetActive(true);
|
||||||
_countLayout.SetActive(false);
|
_countLayout.SetActive(false);
|
||||||
Quaternion startRotation = Panel.localRotation;
|
|
||||||
Quaternion targetRotation = Quaternion.Euler(0, 0, 0);
|
|
||||||
|
|
||||||
Vector3 initialScale = Panel.localScale;
|
Vector3 initialScale = Panel.localScale;
|
||||||
|
|
||||||
|
//확대 시작
|
||||||
float elapsedTime = 0.0f;
|
float elapsedTime = 0.0f;
|
||||||
|
|
||||||
while (elapsedTime < 0.5f)
|
while (elapsedTime < 0.5f)
|
||||||
@ -205,7 +219,75 @@ namespace BlueWater.Uis
|
|||||||
yield return null;
|
yield return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkCreate = true;
|
||||||
|
|
||||||
|
if (checkRotation)
|
||||||
|
{
|
||||||
|
_currentRotationCoroutine = StartCoroutine(RotateOverTime());
|
||||||
|
}
|
||||||
|
|
||||||
elapsedTime = 0.0f;
|
elapsedTime = 0.0f;
|
||||||
|
|
||||||
|
while (elapsedTime < rotationDurationCard)
|
||||||
|
{
|
||||||
|
elapsedTime += Time.unscaledDeltaTime;
|
||||||
|
|
||||||
|
if (elapsedTime > rotationDurationCard / 1.8)
|
||||||
|
{
|
||||||
|
CardArea.SetEnable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Button("회전")]
|
||||||
|
public void Rotation_Start()
|
||||||
|
{
|
||||||
|
if (checkRotation) return;
|
||||||
|
Panel.localRotation = Quaternion.Euler(0, -180, 0);
|
||||||
|
checkRotation = true;
|
||||||
|
|
||||||
|
if (_currentCreateCoroutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_currentCreateCoroutine);
|
||||||
|
_currentCreateCoroutine = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_currentRotationCoroutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_currentRotationCoroutine);
|
||||||
|
_currentRotationCoroutine = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkCreate == false)
|
||||||
|
{
|
||||||
|
Panel.localScale = new Vector3(0, 0, 0);
|
||||||
|
_currentRotationCoroutine = StartCoroutine(CreateOverTime());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currentRotationCoroutine = StartCoroutine(RotateOverTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 카드를 회전시킴!
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private IEnumerator RotateOverTime()
|
||||||
|
{
|
||||||
|
BackObject.SetActive(true);
|
||||||
|
_countLayout.SetActive(false);
|
||||||
|
Quaternion startRotation = Panel.localRotation;
|
||||||
|
Quaternion targetRotation = Quaternion.Euler(0, 0, 0);
|
||||||
|
Panel.localScale = new Vector3(0.95f, 0.95f, 0.95f);
|
||||||
|
|
||||||
|
//회전 시작
|
||||||
|
float elapsedTime = 0.0f;
|
||||||
|
|
||||||
while (elapsedTime < rotationDurationCard)
|
while (elapsedTime < rotationDurationCard)
|
||||||
{
|
{
|
||||||
|
@ -132,10 +132,6 @@ namespace BlueWater.Uis
|
|||||||
_onSelectAction?.Invoke(_tycoonCard);
|
_onSelectAction?.Invoke(_tycoonCard);
|
||||||
//OnPointerExit(null);
|
//OnPointerExit(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
//해당 밑줄은 따로 메소드를 만들어주자... 여기서 호출하는게 아니라 SelectCardUi에서 호출받는 방식으로...
|
|
||||||
//this.SetEnable(false);
|
|
||||||
//_isPointerInside = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +220,7 @@ namespace BlueWater.Uis
|
|||||||
Vector3 initialScale = _panel.localScale;
|
Vector3 initialScale = _panel.localScale;
|
||||||
Vector3 targetScale = new Vector3(1.05f, 1.05f, 1.0f); // 타겟 스케일 설정
|
Vector3 targetScale = new Vector3(1.05f, 1.05f, 1.0f); // 타겟 스케일 설정
|
||||||
|
|
||||||
/*
|
/* 현재 캔버스 이슈때문에 회전하는 영역은 우선 처리하지 않음...
|
||||||
// RectTransform의 화면 좌표를 가져오기 위한 변수
|
// RectTransform의 화면 좌표를 가져오기 위한 변수
|
||||||
RectTransform rectTransform = GetComponent<RectTransform>();
|
RectTransform rectTransform = GetComponent<RectTransform>();
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using BlueWater.Audios;
|
using BlueWater.Audios;
|
||||||
using BlueWater.Tycoons;
|
using BlueWater.Tycoons;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
|
using TMPro;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
namespace BlueWater.Uis
|
namespace BlueWater.Uis
|
||||||
{
|
{
|
||||||
@ -25,11 +29,17 @@ namespace BlueWater.Uis
|
|||||||
private string _openSfxName = "RareRewardBox";
|
private string _openSfxName = "RareRewardBox";
|
||||||
|
|
||||||
private List<TycoonCard> _tycoonCards = new(5);
|
private List<TycoonCard> _tycoonCards = new(5);
|
||||||
|
private int viewCardCount = 0;
|
||||||
|
|
||||||
private LevelData _currentLevelData;
|
private LevelData _currentLevelData;
|
||||||
private TycoonManager _tycoonManager;
|
private TycoonManager _tycoonManager;
|
||||||
private TycoonCardController _tycoonCardController;
|
private TycoonCardController _tycoonCardController;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Button allOpenCardButton;
|
||||||
|
[SerializeField]
|
||||||
|
private Button closeButton;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
_panel.SetActive(false);
|
_panel.SetActive(false);
|
||||||
@ -53,6 +63,9 @@ namespace BlueWater.Uis
|
|||||||
PopupUiController.RegisterPopup(this);
|
PopupUiController.RegisterPopup(this);
|
||||||
_panel.SetActive(true);
|
_panel.SetActive(true);
|
||||||
IsOpened = true;
|
IsOpened = true;
|
||||||
|
|
||||||
|
allOpenCardButton.gameObject.SetActive(true);
|
||||||
|
closeButton.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Close()
|
public override void Close()
|
||||||
@ -64,21 +77,24 @@ namespace BlueWater.Uis
|
|||||||
VisualFeedbackManager.Instance.ResetTimeScale();
|
VisualFeedbackManager.Instance.ResetTimeScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Button("레어 상자 열기")]
|
[Button("레어 상자 열기")]
|
||||||
private void CreateCard()
|
private void CreateCard()
|
||||||
{
|
{
|
||||||
if (!Application.isPlaying) return;
|
if (!Application.isPlaying) return;
|
||||||
|
|
||||||
|
viewCardCount = 0;
|
||||||
_currentLevelData = TycoonManager.Instance.GetCurrentLevelData();
|
_currentLevelData = TycoonManager.Instance.GetCurrentLevelData();
|
||||||
_tycoonCardController.DestroyCardList(_tycoonCards);
|
_tycoonCardController.DestroyCardList(_tycoonCards);
|
||||||
var randomCount = Random.Range(2, 6);
|
var randomCount = Random.Range(2, 6);
|
||||||
|
|
||||||
_contents.GetComponent<HorizontalLayoutGroup>().spacing = randomCount * 10;
|
_contents.GetComponent<HorizontalLayoutGroup>().spacing = randomCount * 10;
|
||||||
|
|
||||||
for (int i = 0; i < randomCount; i++)
|
for (int i = 0; i < randomCount; i++)
|
||||||
{
|
{
|
||||||
var newCard = _tycoonCardController.CreateTycoonCard(_contents);
|
var newCard = _tycoonCardController.CreateTycoonCard(_contents);
|
||||||
newCard.SetName($"Card{i:00}");
|
newCard.SetName($"Card{i:00}");
|
||||||
|
newCard.CardArea.SetselectAction(OpenCard);
|
||||||
switch (randomCount)
|
switch (randomCount)
|
||||||
{
|
{
|
||||||
case 2: newCard.SetLocalScale(_cardLocalScale_2); break;
|
case 2: newCard.SetLocalScale(_cardLocalScale_2); break;
|
||||||
@ -87,7 +103,8 @@ namespace BlueWater.Uis
|
|||||||
case 5: newCard.SetLocalScale(_cardLocalScale_5); break;
|
case 5: newCard.SetLocalScale(_cardLocalScale_5); break;
|
||||||
default: newCard.SetLocalScale(_cardLocalScale_5); break;
|
default: newCard.SetLocalScale(_cardLocalScale_5); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewCardCount++;
|
||||||
_tycoonCards.Add(newCard);
|
_tycoonCards.Add(newCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,10 +128,36 @@ namespace BlueWater.Uis
|
|||||||
|
|
||||||
hashSet.Add(cardIdx);
|
hashSet.Add(cardIdx);
|
||||||
element.SetCard(cardData);
|
element.SetCard(cardData);
|
||||||
element.Rotation_Start();
|
element.Create_Start();
|
||||||
|
|
||||||
_tycoonCardController.SelectCard(element);
|
_tycoonCardController.SelectCard(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenCard(TycoonCard tycoonCard)
|
||||||
|
{
|
||||||
|
tycoonCard.Rotation_Start();
|
||||||
|
tycoonCard.SetSelectAction(null);
|
||||||
|
viewCardCount--;
|
||||||
|
|
||||||
|
if (viewCardCount > 0) return;
|
||||||
|
|
||||||
|
allOpenCardButton.gameObject.SetActive(false);
|
||||||
|
closeButton.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Button("카드 모두 열기")]
|
||||||
|
public void AllOpenCard()
|
||||||
|
{
|
||||||
|
viewCardCount = 0;
|
||||||
|
//남은 카드가 열리는 연출만 추가하자
|
||||||
|
foreach (var element in _tycoonCards)
|
||||||
|
{
|
||||||
|
element.SetSelectAction(null);
|
||||||
|
element.Rotation_Start();
|
||||||
|
}
|
||||||
|
allOpenCardButton.gameObject.SetActive(false);
|
||||||
|
closeButton.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -70,6 +70,7 @@ namespace BlueWater.Uis
|
|||||||
{
|
{
|
||||||
var newCard = _tycoonCardController.CreateTycoonCard(_contents);
|
var newCard = _tycoonCardController.CreateTycoonCard(_contents);
|
||||||
newCard.SetName($"Card{i:00}");
|
newCard.SetName($"Card{i:00}");
|
||||||
|
newCard.transform.localScale = new Vector3(0.9f, 0.9f, 0.9f);
|
||||||
_tycoonCards.Add(newCard);
|
_tycoonCards.Add(newCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ using System.Collections;
|
|||||||
using BlueWater.Items;
|
using BlueWater.Items;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using Sirenix.OdinInspector;
|
||||||
|
|
||||||
namespace BlueWater.Uis
|
namespace BlueWater.Uis
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
atlasAssets:
|
atlasAssets:
|
||||||
- {fileID: 11400000, guid: 715a9baaf9f9f6042bc95860da66b9f2, type: 2}
|
- {fileID: 11400000, guid: 715a9baaf9f9f6042bc95860da66b9f2, type: 2}
|
||||||
scale: 0.01
|
scale: 0.001
|
||||||
skeletonJSON: {fileID: 4900000, guid: 9454208de48a3e7438c4d5e728a20fc6, type: 3}
|
skeletonJSON: {fileID: 4900000, guid: 9454208de48a3e7438c4d5e728a20fc6, type: 3}
|
||||||
isUpgradingBlendModeMaterials: 0
|
isUpgradingBlendModeMaterials: 0
|
||||||
blendModeMaterials:
|
blendModeMaterials:
|
||||||
|
6
Assets/08.Spines/TitleCharacter/NewEmptyCSharpScript.cs
Normal file
6
Assets/08.Spines/TitleCharacter/NewEmptyCSharpScript.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class NewEmptyCSharpScript
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a5ecfd35711704418594a91dd23b9cd
|
Loading…
Reference in New Issue
Block a user