This commit is contained in:
SweetJJuya 2024-11-12 18:33:07 +09:00
parent 90e4326faf
commit 7d45253810
8 changed files with 1300 additions and 15 deletions

View File

@ -1947,13 +1947,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 191889754}
serializedVersion: 2
m_LocalRotation: {x: 0.060784396, y: -0, z: -0, w: 0.99815094}
m_LocalPosition: {x: 2.66, y: 2.25, z: -3.43}
m_LocalRotation: {x: 0.17213742, y: -0, z: -0, w: 0.985073}
m_LocalPosition: {x: 1.61, y: 7.54, z: -22.23}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 6.97, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 19.824, y: 0, z: 0}
--- !u!1 &193579421
GameObject:
m_ObjectHideFlags: 0
@ -6635,6 +6635,55 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_IsOn: 1
--- !u!1001 &690971627
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2700294535905665279, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2700294535905665279, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2700294535905665279, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3040169690825224014, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: _instanceLocation
value:
objectReference: {fileID: 0}
- target: {fileID: 4119089025960676272, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7503695429122129295, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 7640850047456124134, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalPosition.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8858452115783968250, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_LocalPosition.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 9041926907780427371, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
propertyPath: m_Name
value: NewTycoonMap
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9a394d3c65c71084d8345c36df67c89c, type: 3}
--- !u!1 &706003668
GameObject:
m_ObjectHideFlags: 0
@ -17482,3 +17531,4 @@ SceneRoots:
- {fileID: 550723026}
- {fileID: 55913709}
- {fileID: 1047375462}
- {fileID: 690971627}

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,8 @@ public class TycoonCard : MonoBehaviour
private Transform _cardComTransform;
private TycoonCardArea _cardArea;
private Coroutine _changedLocaleInstance;
private Action selectAction;
private void Awake()
{
@ -65,6 +67,11 @@ public class TycoonCard : MonoBehaviour
_cardArea = transform.Find("Area").GetComponent<TycoonCardArea>();
}
public void SetselectAction(Action<TycoonCard> action)
{
_cardArea.SetselectAction(action);
}
private void Start()
{
LocalizationSettings.SelectedLocaleChanged += OnChangedLocale;

View File

@ -1,14 +1,8 @@
using System;
using System.Collections;
using BlueWater;
using BlueWater.Tycoons;
using BlueWater.Uis;
using Sirenix.OdinInspector;
using UnityEngine;
using TMPro;
using UnityEngine.Android;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI;
/*
@ -47,6 +41,8 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
private Transform _cardComTransform;
private Camera _uiCamera;
private Action<TycoonCard> selectAction;
private void Awake()
{
_tycoonCard = transform.parent.GetComponent<TycoonCard>();
@ -62,6 +58,12 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
_uiCamera = TycoonCameraManager.Instance.MainCamera;
}
public void SetselectAction(Action<TycoonCard> action)
{
selectAction = action;
}
// 마우스가 이미지 위에 올라갔을 때 호출
public void OnPointerEnter(PointerEventData eventData)
{
@ -120,7 +122,12 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
{
if (_enable)
{
_tycoonCard.transform.parent.parent.GetComponent<TycoonSelectCard>().SelectedCard(_tycoonCard);
//_tycoonCard.transform.parent.parent.GetComponent<TycoonSelectCard>().SelectedCard(_tycoonCard);
if (selectAction != null)
{
selectAction?.Invoke(_tycoonCard);
}
//해당 밑줄은 따로 메소드를 만들어주자... 여기서 호출하는게 아니라 SelectCardUi에서 호출받는 방식으로...
this.SetEnable(false);
@ -171,6 +178,7 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
}
Quaternion startRotation = _cardComTransform.GetComponent<RectTransform>().localRotation;
Quaternion startRotationImg = _image.GetComponent<RectTransform>().localRotation;
Quaternion endRotation = Quaternion.identity;
Vector3 initialScale = _cardComTransform.localScale;
@ -179,6 +187,7 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
while (_returnSpeedTime > 0.0f)
{
_cardComTransform.GetComponent<RectTransform>().localRotation = Quaternion.Slerp(startRotation, endRotation, 1.0f - _returnSpeedTime);
_image.GetComponent<RectTransform>().localRotation = Quaternion.Slerp(startRotationImg, endRotation, 1.0f - _returnSpeedTime);
_returnSpeedTime -= Time.unscaledDeltaTime * _returnSpeed;
float t = (1.0f - _returnSpeedTime);
@ -192,6 +201,7 @@ public class TycoonCardArea : MonoBehaviour, IPointerEnterHandler, IPointerExitH
_returnSpeedTime = 0.0f;
_cardComTransform.GetComponent<RectTransform>().localRotation = Quaternion.identity;
_image.GetComponent<RectTransform>().localRotation = Quaternion.identity;
_endRotationCoroutine = null;
}

View File

@ -76,6 +76,9 @@ namespace BlueWater.Uis
[Button("카드 생성하기(레벨업)")]
private void CreateCard()
{
_lvData = TycoonManager.Instance.GetCurrentLevelData();
if (!Application.isPlaying) return;
// 기존 카드가 있으면 삭제
@ -171,8 +174,12 @@ namespace BlueWater.Uis
//-------------
_tycoonCard01Componet.SetselectAction(SelectedCard);
_tycoonCard01Componet.Rotation_Start();
_tycoonCard02Componet.SetselectAction(SelectedCard);
_tycoonCard02Componet.Rotation_Start();
_tycoonCard03Componet.SetselectAction(SelectedCard);
_tycoonCard03Componet.Rotation_Start();
}

View File

@ -0,0 +1,21 @@
using UnityEngine;
using Sirenix.OdinInspector;
using TMPro;
public class TycoonShopUi : MonoBehaviour
{
[field: SerializeField, CLabel("카드 프리펫")]
private GameObject cardPerfab;
[field: SerializeField, CLabel("골드TextMesh")]
private TextMeshProUGUI goldTextmesh;
//goldTextMesh.text =
[Button("Shop 열기")]
private void CreateCard()
{
goldTextmesh.text = $"Gold : {ES3.Load("EndGold", 0)}";
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0cfa9cbc5b043f24ab4261dbae11597d

View File

@ -104,7 +104,7 @@ Material:
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Opacity: 1
- _Opacity: 0.89
- _Parallax: 0.005
- _Position: 0.38
- _QueueOffset: 0