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
|
||||
guid: 13dc68816b7d25e4f852aa863002aec2
|
||||
guid: e7a1af91eedbae34b95b935f45e2ea93
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
@ -1,3 +1,4 @@
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
public class TycoonCharacter : MonoBehaviour
|
||||
@ -8,6 +9,13 @@ public class TycoonCharacter : MonoBehaviour
|
||||
public float smoothSpeed = 5f;
|
||||
private Vector3 targetPosition;
|
||||
|
||||
|
||||
[field: SerializeField]
|
||||
private SkeletonAnimation spine;
|
||||
|
||||
[field: SerializeField]
|
||||
private SkeletonRootMotion spineEye;
|
||||
|
||||
void Start()
|
||||
{
|
||||
selfRectTransform = GetComponent<RectTransform>();
|
||||
@ -24,6 +32,21 @@ public class TycoonCharacter : MonoBehaviour
|
||||
{
|
||||
UpdateTargetPosition();
|
||||
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()
|
||||
|
@ -62,8 +62,13 @@ namespace BlueWater.Uis
|
||||
[field: SerializeField]
|
||||
private string cardText;
|
||||
|
||||
private Coroutine _currentCreateCoroutine;
|
||||
private Coroutine _currentRotationCoroutine;
|
||||
|
||||
[HideInInspector]
|
||||
public bool checkRotation = false;
|
||||
private bool checkCreate = false;
|
||||
|
||||
[FormerlySerializedAs("RotationDurationCard")]
|
||||
[field: Title("카드 회전")]
|
||||
[field: SerializeField]
|
||||
@ -86,6 +91,7 @@ namespace BlueWater.Uis
|
||||
|
||||
private Coroutine _changedLocaleInstance;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
LocalizationSettings.SelectedLocaleChanged += OnChangedLocale;
|
||||
@ -122,6 +128,7 @@ namespace BlueWater.Uis
|
||||
//지정된 IDX값으로 정보값 초기화
|
||||
public void SetCard(CardData cardData)
|
||||
{
|
||||
checkCreate = false;
|
||||
CardDataForIdx = cardData;
|
||||
int count = TycoonManager.Instance.TycoonCardController.GetSelectedCardCount(CardDataForIdx.Idx);
|
||||
|
||||
@ -163,11 +170,19 @@ namespace BlueWater.Uis
|
||||
PriceUi.SetActive(true);
|
||||
}
|
||||
|
||||
[Button("회전")]
|
||||
public void Rotation_Start()
|
||||
|
||||
[Button("등장")]
|
||||
public void Create_Start()
|
||||
{
|
||||
Panel.localRotation = Quaternion.Euler(0, -180, 0);
|
||||
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)
|
||||
{
|
||||
@ -175,22 +190,21 @@ namespace BlueWater.Uis
|
||||
_currentRotationCoroutine = null;
|
||||
}
|
||||
|
||||
_currentRotationCoroutine = StartCoroutine(RotateOverTime());
|
||||
_currentCreateCoroutine = StartCoroutine(CreateOverTime());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 카드를 등장하며 회전시킴!
|
||||
/// 카드를 등장시킴
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IEnumerator RotateOverTime()
|
||||
private IEnumerator CreateOverTime()
|
||||
{
|
||||
BackObject.SetActive(true);
|
||||
_countLayout.SetActive(false);
|
||||
Quaternion startRotation = Panel.localRotation;
|
||||
Quaternion targetRotation = Quaternion.Euler(0, 0, 0);
|
||||
|
||||
Vector3 initialScale = Panel.localScale;
|
||||
|
||||
//확대 시작
|
||||
float elapsedTime = 0.0f;
|
||||
|
||||
while (elapsedTime < 0.5f)
|
||||
@ -205,8 +219,76 @@ namespace BlueWater.Uis
|
||||
yield return null;
|
||||
}
|
||||
|
||||
checkCreate = true;
|
||||
|
||||
if (checkRotation)
|
||||
{
|
||||
_currentRotationCoroutine = StartCoroutine(RotateOverTime());
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
elapsedTime += Time.unscaledDeltaTime;
|
||||
|
@ -132,10 +132,6 @@ namespace BlueWater.Uis
|
||||
_onSelectAction?.Invoke(_tycoonCard);
|
||||
//OnPointerExit(null);
|
||||
}
|
||||
|
||||
//해당 밑줄은 따로 메소드를 만들어주자... 여기서 호출하는게 아니라 SelectCardUi에서 호출받는 방식으로...
|
||||
//this.SetEnable(false);
|
||||
//_isPointerInside = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,7 +220,7 @@ namespace BlueWater.Uis
|
||||
Vector3 initialScale = _panel.localScale;
|
||||
Vector3 targetScale = new Vector3(1.05f, 1.05f, 1.0f); // 타겟 스케일 설정
|
||||
|
||||
/*
|
||||
/* 현재 캔버스 이슈때문에 회전하는 영역은 우선 처리하지 않음...
|
||||
// RectTransform의 화면 좌표를 가져오기 위한 변수
|
||||
RectTransform rectTransform = GetComponent<RectTransform>();
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BlueWater.Audios;
|
||||
using BlueWater.Tycoons;
|
||||
using UnityEngine;
|
||||
using Sirenix.OdinInspector;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace BlueWater.Uis
|
||||
{
|
||||
@ -25,11 +29,17 @@ namespace BlueWater.Uis
|
||||
private string _openSfxName = "RareRewardBox";
|
||||
|
||||
private List<TycoonCard> _tycoonCards = new(5);
|
||||
private int viewCardCount = 0;
|
||||
|
||||
private LevelData _currentLevelData;
|
||||
private TycoonManager _tycoonManager;
|
||||
private TycoonCardController _tycoonCardController;
|
||||
|
||||
[SerializeField]
|
||||
private Button allOpenCardButton;
|
||||
[SerializeField]
|
||||
private Button closeButton;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_panel.SetActive(false);
|
||||
@ -53,6 +63,9 @@ namespace BlueWater.Uis
|
||||
PopupUiController.RegisterPopup(this);
|
||||
_panel.SetActive(true);
|
||||
IsOpened = true;
|
||||
|
||||
allOpenCardButton.gameObject.SetActive(true);
|
||||
closeButton.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
@ -64,11 +77,13 @@ namespace BlueWater.Uis
|
||||
VisualFeedbackManager.Instance.ResetTimeScale();
|
||||
}
|
||||
|
||||
|
||||
[Button("레어 상자 열기")]
|
||||
private void CreateCard()
|
||||
{
|
||||
if (!Application.isPlaying) return;
|
||||
|
||||
viewCardCount = 0;
|
||||
_currentLevelData = TycoonManager.Instance.GetCurrentLevelData();
|
||||
_tycoonCardController.DestroyCardList(_tycoonCards);
|
||||
var randomCount = Random.Range(2, 6);
|
||||
@ -79,6 +94,7 @@ namespace BlueWater.Uis
|
||||
{
|
||||
var newCard = _tycoonCardController.CreateTycoonCard(_contents);
|
||||
newCard.SetName($"Card{i:00}");
|
||||
newCard.CardArea.SetselectAction(OpenCard);
|
||||
switch (randomCount)
|
||||
{
|
||||
case 2: newCard.SetLocalScale(_cardLocalScale_2); break;
|
||||
@ -88,6 +104,7 @@ namespace BlueWater.Uis
|
||||
default: newCard.SetLocalScale(_cardLocalScale_5); break;
|
||||
}
|
||||
|
||||
viewCardCount++;
|
||||
_tycoonCards.Add(newCard);
|
||||
}
|
||||
|
||||
@ -111,10 +128,36 @@ namespace BlueWater.Uis
|
||||
|
||||
hashSet.Add(cardIdx);
|
||||
element.SetCard(cardData);
|
||||
element.Rotation_Start();
|
||||
element.Create_Start();
|
||||
|
||||
_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);
|
||||
newCard.SetName($"Card{i:00}");
|
||||
newCard.transform.localScale = new Vector3(0.9f, 0.9f, 0.9f);
|
||||
_tycoonCards.Add(newCard);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ using System.Collections;
|
||||
using BlueWater.Items;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Sirenix.OdinInspector;
|
||||
|
||||
namespace BlueWater.Uis
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
atlasAssets:
|
||||
- {fileID: 11400000, guid: 715a9baaf9f9f6042bc95860da66b9f2, type: 2}
|
||||
scale: 0.01
|
||||
scale: 0.001
|
||||
skeletonJSON: {fileID: 4900000, guid: 9454208de48a3e7438c4d5e728a20fc6, type: 3}
|
||||
isUpgradingBlendModeMaterials: 0
|
||||
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