초기 게임속도 1 -> 1.5, 유니티 에디터 결제 등

This commit is contained in:
Ino 2025-09-07 16:13:08 +09:00
parent e07d40d684
commit e08d64fe68
3 changed files with 41 additions and 29 deletions

View File

@ -55,7 +55,7 @@ namespace CodeJay
this.Sound_Toggle = false; this.Sound_Toggle = false;
this.SFX_Toggle = false; this.SFX_Toggle = false;
this.IsRemoveADS = false; this.IsRemoveADS = false;
this.GameSpeed = 0.5f; this.GameSpeed = 1.5f;
this.ProductAdWatchedNumber = Constants.ADS_REWARD_COUNT; this.ProductAdWatchedNumber = Constants.ADS_REWARD_COUNT;
this.FreeHeartCount = Constants.FREE_HEART_DAY; this.FreeHeartCount = Constants.FREE_HEART_DAY;
FreeKeyCount = Constants.FREE_HEART_DAY; FreeKeyCount = Constants.FREE_HEART_DAY;

View File

@ -51,6 +51,9 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener
private void Init_IAP() private void Init_IAP()
{ {
#if UNITY_EDITOR
Init_Google();
#else
Debug.Log("StoreEnvironment.GetStoreType() " + StoreEnvironment.GetStoreType()); Debug.Log("StoreEnvironment.GetStoreType() " + StoreEnvironment.GetStoreType());
if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE) if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE)
{ {
@ -61,6 +64,12 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener
m_PurchaseClientImpl.QueryPurchases(OneStore.Purchasing.ProductType.INAPP); // 미지급된 상품이 있는 지 체크 m_PurchaseClientImpl.QueryPurchases(OneStore.Purchasing.ProductType.INAPP); // 미지급된 상품이 있는 지 체크
} }
else else
Init_Google();
#endif
isInitialize = true;
}
void Init_Google()
{ {
ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
@ -76,12 +85,12 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener
UnityPurchasing.Initialize(this, builder); UnityPurchasing.Initialize(this, builder);
} }
isInitialize = true;
}
/* 구매하는 함수 */ /* 구매하는 함수 */
public void Purchase(string productId) public void Purchase(string productId)
{ {
#if UNITY_EDITOR
BuyItem(productId);
#else
if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE) if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE)
{ {
ProductDetail productDetail = m_OneStoreIapCallBack.Get_ProductDetail(productId); ProductDetail productDetail = m_OneStoreIapCallBack.Get_ProductDetail(productId);
@ -102,6 +111,10 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener
} }
} }
else else
BuyItem(productId);
#endif
}
void BuyItem(string productId)
{ {
if (storeController != null) if (storeController != null)
{ {
@ -119,7 +132,6 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener
else else
Debug.Log("인앱 초기화가 되지 않았습니다."); Debug.Log("인앱 초기화가 되지 않았습니다.");
} }
}
/* 초기화 성공 시 실행되는 함수 */ /* 초기화 성공 시 실행되는 함수 */
public void OnInitialized(IStoreController controller, IExtensionProvider extension) public void OnInitialized(IStoreController controller, IExtensionProvider extension)

View File

@ -114,7 +114,7 @@ public partial class GamePanel : MonoBehaviour
for (EGameWorkFlowType i = 0; i < EGameWorkFlowType.Max; i++) for (EGameWorkFlowType i = 0; i < EGameWorkFlowType.Max; i++)
_dicCoroutineStates.Add(i, EGameStateType.None); _dicCoroutineStates.Add(i, EGameStateType.None);
GameSpeed = (1.8f * GameManager.DB.GameSpeed) + 0.2f; GameSpeed = GameManager.DB.GameSpeed;
} }
private void Start() private void Start()