using UnityEngine; #if !VER_CASH_ENABLE public class IapMgr : MonoBehaviour #elif VER_ONESTORE public class IapMgr : MonoBehaviour, IPurchaseCallback #else public class IapMgr : MonoBehaviour, IStoreListener #endif { #region Variables private static IapMgr curMgr = null; private static int rewardId = -1; #endregion Variables #region Base private void Awake() { if (curMgr != null) { Destroy(this.gameObject); return; } curMgr = this; DontDestroyOnLoad(this.gameObject); } public static void SForceStopCoroutines() { if (curMgr != null) curMgr.StopAllCoroutines(); } public static void SInit() { if (curMgr != null) curMgr.Init(); } private void Init() { #if VER_CASH_ENABLE #if VER_ONESTORE #else #endif #endif } #endregion Base #region Custom Method /// /// 인앱 가격 가져오기. /// /// 상품 SKU. /// 현재화된 인앱 가격. public static string SGetPrice(string productid) { //@ 추후 인앱 결제 작업 시 현지화된 가격 리턴하도록 수정. 현재는 null 리턴. return null; } /// /// 구매 시도. /// /// 상점 ID. /// 상품 SKU. /// public static void STryPurchase(int key, string productid) { curMgr.TryPurchase(key); } // 구매 시도. private void TryPurchase(int key) { rewardId = key; //@ 추후 인앱 결제 작업 시 코드 수정. 현재는 바로 성공 처리. ShopMgr.SSubProcessSucc(rewardId); } #endregion Custom Method }