상점 작업 중...

This commit is contained in:
Ino 2025-08-31 14:52:47 +09:00
parent e9e480af4f
commit a65416f8ca
11 changed files with 2415 additions and 615 deletions

View File

@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: ab759628f97301541855b12ebefe30d5
m_currentHash:
serializedVersion: 2
Hash: 8f454002bfecf27088db2529e681b4a3
Hash: 00000000000000000000000000000000
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 1
m_CatalogRequestsTimeout: 0

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
게등위 버전 이후 작업
아래는 게등위 버전 이후 작업 예정 목록입니다.
멍박 구현 필요 (동물 7마리 이상, 상대는 동물 없을 때 2배)
앨범 수집 목록
미션

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
using CodeJay.Enum;
using UnityEngine;
namespace CodeJay
{
@ -16,21 +17,20 @@ namespace CodeJay
public string productDescription;
/// <summary>Product Price For UI</summary>
public int price;
/// <summary>Product Sprite Index.</summary>
public int spriteIndex;
public Sprite sprite_item;
/// <summary>Reward Type.</summary>
public Enum.EProductReward rewardType;
/// <summary>Reward Amount</summary>
public int rewardAmount;
public ProductData(string productID, EProductType type, string productName, string description, int price, int spriteIndex, Enum.EProductReward reward, int rewardAmount)
public ProductData(string productID, EProductType type, string productName, string description, int price, Sprite sprite, EProductReward reward, int rewardAmount)
{
this.productID = productID;
this.type = type;
this.productName = productName;
this.productDescription = description;
this.price = price;
this.spriteIndex = spriteIndex;
this.sprite_item = sprite;
this.rewardType = reward;
this.rewardAmount = rewardAmount;
}

View File

@ -0,0 +1,45 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[ExecuteAlways]
public class CustomRowGrid : LayoutGroup
{
[Tooltip("각 줄에 몇 개의 아이템을 배치할지 입력")]
public List<int> rowItemCounts = new List<int>() { 3, 2, 3, 3 };
public float spacingX = 100f; // 가로 간격
public float spacingY = 100f; // 세로 간격
public float startX = 0f; // 시작 X 위치 (왼쪽 여백)
public override void CalculateLayoutInputHorizontal()
{
base.CalculateLayoutInputHorizontal();
int childIndex = 0;
for (int row = 0; row < rowItemCounts.Count; row++)
{
int countInRow = rowItemCounts[row];
for (int col = 0; col < countInRow; col++)
{
if (childIndex >= rectChildren.Count)
return;
float totalWidth = (countInRow - 1) * spacingX;
float offsetX = -totalWidth / 2f; // 가운데 정렬
Vector2 pos = new Vector2(startX + offsetX + col * spacingX, row * -spacingY);
SetChildAlongAxis(rectChildren[childIndex], 0, pos.x);
SetChildAlongAxis(rectChildren[childIndex], 1, pos.y);
childIndex++;
}
}
}
public override void CalculateLayoutInputVertical() { }
public override void SetLayoutHorizontal() { }
public override void SetLayoutVertical() { }
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6564f9c2ecc9f674895f016656c5588a

View File

@ -1,14 +1,13 @@
using UnityEngine;
using CodeJay.Classes;
using CodeJay.Defines;
using System;
using System.Text;
using CodeJay.Defines;
using BansheeGz.BGDatabase;
using UnityEngine;
using UnityEngine.UI;
public class ProductSlot : MonoBehaviour
public class ProductSlot : CardBase
{
[SerializeField] private UnityEngine.UI.Image icon;
[SerializeField] private Image icon;
[SerializeField] private TMPro.TextMeshProUGUI NameTMP;
[SerializeField] private TMPro.TextMeshProUGUI ProductTMP;
[SerializeField] private TMPro.TextMeshProUGUI PriceTMP;
@ -77,10 +76,16 @@ public class ProductSlot : MonoBehaviour
}
}
public override void Set<T>(T _base, int iLoop = -1, int idata = -1)
{
base.Set(_base, iLoop, idata);
SetData(_base as ProductData);
}
public void SetData(ProductData data)
{
_data = data;
icon.sprite = GameManager.Resource.GetProductSprite(_data.spriteIndex);
icon.sprite = _data.sprite_item;
NameTMP.text = _data.productName;
ProductTMP.text = _data.productDescription;
PriceTMP.text = _data.price.ToString("c", new System.Globalization.CultureInfo("ko-KR", false));
@ -204,6 +209,9 @@ public class ProductSlot : MonoBehaviour
AdButton.SetActive(false);
PriceTMP.transform.parent.gameObject.SetActive(true);
}
if (data.type == CodeJay.Enum.EProductType.IAP)
PriceTMP.text = $"\\{data.price}";
}
private void SetADSButton()

View File

@ -1,7 +1,7 @@
using System.Collections;
using CodeJay.Classes;
using CodeJay.Enum;
using System.Collections.Generic;
using UnityEngine;
using CodeJay.Enum;
namespace CodeJay.Enum
{
@ -25,10 +25,43 @@ public class StorePanel : MonoBehaviour
[SerializeField] private GameObject SlotPrefab;
[SerializeField] private GameObject BuyKeySlotPrefab;
[SerializeField] private RectTransform content;
private List<ProductSlot> _lstSlots;
[SerializeField] private List<ProductSlot> _lstSlots;
/// <summary>
/// 0 하트, 1 키, 2 냥, 3 광고 제거
/// </summary>
[SerializeField] private List<Sprite> sprites;
private int BuyOneKey = 6;
List<ProductData> list_item = new List<ProductData>();
private void Awake()
{
if (GameManager.Instance != null)
{
GameManager.Event.RegistEvent(EEventType.MoveToStore_Heart, this.MoveToStore_Heart);
GameManager.Event.RegistEvent(EEventType.MoveToStore_Heart_DuringGame, this.MoveToStore_Heart);
GameManager.Event.RegistEvent(EEventType.MoveToStore_Key, this.MoveToStore_Key);
GameManager.Event.RegistEvent(EEventType.OnReturnToGameFromStore, this.OnReturnToGameFromStore);
GameManager.Event.RegistEvent(EEventType.OnSynchronizeKey, this.OnSynchronizeKey);
}
if (list_item.Count == 0)
{
list_item.Add(new ProductData("ads_remove", EProductType.IAP, "강제 광고 제거", "강제 노출 광고 제거", 5500, sprites[3], EProductReward.Delete_Ad, 1));
list_item.Add(new ProductData("heart_free", EProductType.Gold, "일일 하트 I", "무료 하트", 0, sprites[0], EProductReward.Heart, 1));
list_item.Add(new ProductData("heart_ads", EProductType.ADS, "일일 하트 II", "광고 후 무료 하트", 0, sprites[0], EProductReward.Heart, 1));
list_item.Add(new ProductData("key_free", EProductType.Gold, "일일 캐시 I", "무료 캐시", 0, sprites[1], EProductReward.Key, 1));
list_item.Add(new ProductData("key_cash", EProductType.Gold, "하트 1개", "보석으로 하트 획득", 200, sprites[0], EProductReward.Key, 1));
list_item.Add(new ProductData("heart_free", EProductType.Gold, "일일 하트 I", "무료 하트", 0, sprites[0], EProductReward.Heart, 1));
list_item.Add(new ProductData("heart_ads", EProductType.ADS, "일일 하트 II", "광고 후 무료 하트", 0, sprites[0], EProductReward.Heart, 1));
list_item.Add(new ProductData("key_free", EProductType.Gold, "일일 캐시 I", "무료 캐시", 0, sprites[1], EProductReward.Key, 1));
list_item.Add(new ProductData("key_cash", EProductType.Gold, "하트 1개", "보석으로 하트 획득", 200, sprites[0], EProductReward.Key, 1));
list_item.Add(new ProductData("key_free", EProductType.Gold, "일일 캐시 I", "무료 캐시", 0, sprites[1], EProductReward.Key, 1));
list_item.Add(new ProductData("key_cash", EProductType.Gold, "하트 1개", "보석으로 하트 획득", 200, sprites[0], EProductReward.Key, 1));
}
return;
_lstSlots = new List<ProductSlot>();
for (int i = 0; i < 10; i++)
@ -43,33 +76,27 @@ public class StorePanel : MonoBehaviour
}
}
_lstSlots[0].SetData(new CodeJay.Classes.ProductData("ads_remove", EProductType.IAP, "강제 광고 제거", "강제 노출되는 광고를 제거 합니다.", 5500, 0, EProductReward.Delete_Ad, 1));
//_lstSlots[0].SetData(new CodeJay.Classes.ProductData("ads_remove", EProductType.IAP, "강제 광고 제거", "강제 노출되는 광고를 제거 합니다.", 5500, 0, EProductReward.Delete_Ad, 1));
_lstSlots[1].SetData(new CodeJay.Classes.ProductData("heart_free", EProductType.Gold, "일일 무료 하트 I", "무료 하트 획득!", 0, 1, EProductReward.Heart, 1));
_lstSlots[2].SetData(new CodeJay.Classes.ProductData("heart_ads", EProductType.ADS, "일일 무료 하트 II", "광고 시청 후 무료 하트 획득!", 0, 1, EProductReward.Heart, 1));
//_lstSlots[1].SetData(new CodeJay.Classes.ProductData("heart_free", EProductType.Gold, "일일 무료 하트 I", "무료 하트 획득!", 0, 1, EProductReward.Heart, 1));
//_lstSlots[2].SetData(new CodeJay.Classes.ProductData("heart_ads", EProductType.ADS, "일일 무료 하트 II", "광고 시청 후 무료 하트 획득!", 0, 1, EProductReward.Heart, 1));
_lstSlots[3].SetData(new CodeJay.Classes.ProductData("heart_10", EProductType.IAP, "하트 10개 구매", "", 1000, 1, EProductReward.Heart, 10));
_lstSlots[4].SetData(new CodeJay.Classes.ProductData("heart_60", EProductType.IAP, "하트 60개 구매", "", 5500, 1, EProductReward.Heart, 60));
_lstSlots[5].SetData(new CodeJay.Classes.ProductData("heart_130", EProductType.IAP, "하트 130개 구매", "", 11000, 1, EProductReward.Heart, 130));
//_lstSlots[3].SetData(new CodeJay.Classes.ProductData("heart_10", EProductType.IAP, "하트 10개 구매", "", 1000, 1, EProductReward.Heart, 10));
//_lstSlots[4].SetData(new CodeJay.Classes.ProductData("heart_60", EProductType.IAP, "하트 60개 구매", "", 5500, 1, EProductReward.Heart, 60));
//_lstSlots[5].SetData(new CodeJay.Classes.ProductData("heart_130", EProductType.IAP, "하트 130개 구매", "", 11000, 1, EProductReward.Heart, 130));
_lstSlots[BuyOneKey].SetData(new CodeJay.Classes.ProductData("key_1", EProductType.Gold, "열쇠 1 개", "", 100000 + (250000 * (int)GameManager.DB.BuyKeyCount), 2, EProductReward.Key, 1));
_lstSlots[7].SetData(new CodeJay.Classes.ProductData("key_20", EProductType.IAP, "열쇠 20 개", "", 11000, 2, EProductReward.Key, 10));
_lstSlots[8].SetData(new CodeJay.Classes.ProductData("key_45", EProductType.IAP, "열쇠 45 개", "", 22000, 2, EProductReward.Key, 25));
_lstSlots[9].SetData(new CodeJay.Classes.ProductData("key_75", EProductType.IAP, "열쇠 75 개", "", 33000, 2, EProductReward.Key, 45));
if (GameManager.Instance != null)
{
GameManager.Event.RegistEvent(EEventType.MoveToStore_Heart, this.MoveToStore_Heart);
GameManager.Event.RegistEvent(EEventType.MoveToStore_Heart_DuringGame, this.MoveToStore_Heart);
GameManager.Event.RegistEvent(EEventType.MoveToStore_Key, this.MoveToStore_Key);
GameManager.Event.RegistEvent(EEventType.OnReturnToGameFromStore, this.OnReturnToGameFromStore);
GameManager.Event.RegistEvent(EEventType.OnSynchronizeKey, this.OnSynchronizeKey);
}
//_lstSlots[BuyOneKey].SetData(new CodeJay.Classes.ProductData("key_1", EProductType.Gold, "열쇠 1 개", "", 100000 + (250000 * (int)GameManager.DB.BuyKeyCount), 2, EProductReward.Key, 1));
//_lstSlots[7].SetData(new CodeJay.Classes.ProductData("key_20", EProductType.IAP, "열쇠 20 개", "", 11000, 2, EProductReward.Key, 10));
//_lstSlots[8].SetData(new CodeJay.Classes.ProductData("key_45", EProductType.IAP, "열쇠 45 개", "", 22000, 2, EProductReward.Key, 25));
//_lstSlots[9].SetData(new CodeJay.Classes.ProductData("key_75", EProductType.IAP, "열쇠 75 개", "", 33000, 2, EProductReward.Key, 45));
}
private void OnEnable()
{
GameManager.DB.CheckDayReset();
for (int i = 0; i < _lstSlots.Count; i++)
_lstSlots[i].Set(list_item[i]);
}
private void OnDestroy()
@ -104,6 +131,6 @@ public class StorePanel : MonoBehaviour
private void OnSynchronizeKey()
{
_lstSlots[BuyOneKey].SetData(new CodeJay.Classes.ProductData("10", EProductType.Gold, "열쇠 1 개", "", 100000 + (250000 * (int)GameManager.DB.BuyKeyCount), 2, EProductReward.Key, 1));
_lstSlots[BuyOneKey].SetData(new CodeJay.Classes.ProductData("10", EProductType.Gold, "열쇠 1 개", "", 100000 + (250000 * (int)GameManager.DB.BuyKeyCount), sprites[1], EProductReward.Key, 1));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 KiB

View File

@ -1,156 +0,0 @@
fileFormatVersion: 2
guid: a7a5e22394e58ed459c1c140a911ef0b
TextureImporter:
internalIDToNameTable:
- first:
213: 1655045739621930716
second: "\uACE0\uC2A4\uD1B1 \uD754\uB4E4\uAE30 \uD31D\uC5C5 \uC2A4\uC0F7_0"
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: "\uACE0\uC2A4\uD1B1 \uD754\uB4E4\uAE30 \uD31D\uC5C5 \uC2A4\uC0F7_0"
rect:
serializedVersion: 2
x: 0
y: 0
width: 1100
height: 1920
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: cd65035d457e7f610800000000000000
internalID: 1655045739621930716
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
"\uACE0\uC2A4\uD1B1 \uD754\uB4E4\uAE30 \uD31D\uC5C5 \uC2A4\uC0F7_0": 1655045739621930716
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant: