유니티 광고 id, 업데이트 확인 로직 추가 등

This commit is contained in:
Ino 2025-12-17 09:20:40 +09:00
parent cd8e78c552
commit 5e7048afcb
8 changed files with 175 additions and 65 deletions

View File

@ -7036,7 +7036,7 @@ RectTransform:
- {fileID: 1738221190} - {fileID: 1738221190}
- {fileID: 201125229} - {fileID: 201125229}
- {fileID: 594813031} - {fileID: 594813031}
m_Father: {fileID: 2090110239} m_Father: {fileID: 1795664158}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -18693,6 +18693,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 1416760061} - {fileID: 1416760061}
- {fileID: 1703079398} - {fileID: 1703079398}
- {fileID: 2090110239}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
@ -26682,10 +26683,10 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 2090110238} - m_Target: {fileID: 2090110240}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_TargetAssemblyTypeName: PopupUI, Assembly-CSharp
m_MethodName: SetActive m_MethodName: OnClick_No
m_Mode: 6 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@ -33509,7 +33510,6 @@ RectTransform:
- {fileID: 1622029479} - {fileID: 1622029479}
- {fileID: 827796987} - {fileID: 827796987}
- {fileID: 2034573239} - {fileID: 2034573239}
- {fileID: 2090110239}
- {fileID: 1357839139} - {fileID: 1357839139}
m_Father: {fileID: 1703079398} m_Father: {fileID: 1703079398}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -72541,7 +72541,6 @@ MonoBehaviour:
m_OptionUI: {fileID: 2034573240} m_OptionUI: {fileID: 2034573240}
m_ProfileUI: {fileID: 827796988} m_ProfileUI: {fileID: 827796988}
m_ToastUI: {fileID: 1357839140} m_ToastUI: {fileID: 1357839140}
m_PopupUI: {fileID: 2090110240}
m_LobbyCenterProfileUI: {fileID: 85747005} m_LobbyCenterProfileUI: {fileID: 85747005}
m_AlbumUI: {fileID: 476355707} m_AlbumUI: {fileID: 476355707}
m_GachaUI: {fileID: 2013608479} m_GachaUI: {fileID: 2013608479}
@ -76412,7 +76411,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1795664158 --- !u!224 &1795664158
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -76424,7 +76423,8 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children:
- {fileID: 190845090}
m_Father: {fileID: 2090110239} m_Father: {fileID: 2090110239}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
@ -76489,10 +76489,10 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 2090110238} - m_Target: {fileID: 2090110240}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_TargetAssemblyTypeName: PopupUI, Assembly-CSharp
m_MethodName: SetActive m_MethodName: OnClick_No
m_Mode: 6 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@ -91481,7 +91481,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!224 &2090110239 --- !u!224 &2090110239
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -91489,14 +91489,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2090110238} m_GameObject: {fileID: 2090110238}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1795664158} - {fileID: 1795664158}
- {fileID: 190845090} m_Father: {fileID: 456601672}
m_Father: {fileID: 817765913}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
@ -91515,6 +91514,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cc0877e3b397a404b933f05b5cb48be7, type: 3} m_Script: {fileID: 11500000, guid: cc0877e3b397a404b933f05b5cb48be7, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
go_child: {fileID: 1795664157}
t_msg: {fileID: 201125227} t_msg: {fileID: 201125227}
--- !u!1001 &2091168890 --- !u!1001 &2091168890
PrefabInstance: PrefabInstance:

View File

@ -34,7 +34,7 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
} }
// =========================================================== // ===========================================================
// 광고 시청 요청 // 窵𡟯<EFBFBD> ?𨰰痍 ?䇹痍
// =========================================================== // ===========================================================
public void Show_AD(bool bshort, Action _success, Action _fail = null) public void Show_AD(bool bshort, Action _success, Action _fail = null)
{ {
@ -58,7 +58,7 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
} }
else else
{ {
LobbyUI.Ins.m_ToastUI.Set("광고를 준비 중입니다.\n잠시 후 다시 시도해주세요."); LobbyUI.Ins.m_ToastUI.Set("窵𡟯<EFBFBD>諝?鴗<>赬?鴗𡢾<E9B497>?<3F>𠹻.\n?𥔱<> ???木<> ?嶅<>?渥ˉ?賄<>.");
GetReward = 3; GetReward = 3;
} }
} }
@ -71,23 +71,23 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
} }
else else
{ {
LobbyUI.Ins.m_ToastUI.Set("광고를 준비 중입니다.\n잠시 후 다시 시도해주세요."); LobbyUI.Ins.m_ToastUI.Set("窵𡟯<EFBFBD>諝?鴗<>赬?鴗𡢾<E9B497>?<3F>𠹻.\n?𥔱<> ???木<> ?嶅<>?渥ˉ?賄<>.");
GetReward = 3; GetReward = 3;
} }
} }
} }
// =========================================================== // ===========================================================
// 배너 광고 제어 // 諻圉<EFBFBD> 窵𡟯<E7AAB5> ?𨰰𩸭
// =========================================================== // ===========================================================
// 외부에서 배너를 켜거나 끌 때 호출 // ?賈??韠<> 諻圉<E8ABBB>諝?儤𨁈掠???????賄<>
public void Set_Banner(bool active) public void Set_Banner(bool active)
{ {
return; // 일단 비활성화 return; // ?潺𡆀 赬<><E8B5AC>?桶<>
if (SaveMgr.Ins.Get_ShopNoAD()) if (SaveMgr.Ins.Get_ShopNoAD())
{ {
// No-AD 유저면 항상 숨김 // No-AD ?𥔱?諰???<3F> ?刷?
if (bannerVisible) if (bannerVisible)
{ {
HideBanner(); HideBanner();
@ -115,14 +115,14 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
{ {
Debug.Log("Banner Load Success"); Debug.Log("Banner Load Success");
bannerLoaded = true; bannerLoaded = true;
// 자동으로 보이게 하려면 아래 호출 // ?韒<>?潺<> 貐渥𦚯窶??䁪𨸹諰??<3F><> ?賄<>
// Advertisement.Banner.Show(placement_Banner); // Advertisement.Banner.Show(placement_Banner);
}, },
errorCallback = (err) => errorCallback = (err) =>
{ {
Debug.LogWarning("Banner Load Fail: " + err); Debug.LogWarning("Banner Load Fail: " + err);
bannerLoaded = false; bannerLoaded = false;
// 필요시 재시도 로직 (예: 일정 시간 후 다시 Load) // ?<3F><>???科<>??諢𨰰<E8ABA2> (?? ?潰<> ?𨁈<> ???木<> Load)
// StartCoroutine(RetryLoadBannerCoroutine()); // StartCoroutine(RetryLoadBannerCoroutine());
} }
}; };
@ -137,10 +137,10 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
if (!bannerLoaded) if (!bannerLoaded)
{ {
// 로드가 안 되어 있으면 우선 로드하고, 로드시 자동으로 보여주게 처리 // 諢嶅<EFBFBD><EFBFBD> ???䁯𩸭 ?<3F>尐諰??域<> 諢嶅<E8ABA2>?瞘<>, 諢嶅<E8ABA2>???韒<>?潺<> 貐渥𤩐鴥澎<E9B4A5> 麮䁪收
LoadBanner(); LoadBanner();
// 간단 처리: 로드 완료 콜백에서 실제로 보여주도록 하거나 즉시 안내 메시지 // <EFBFBD>𡆀 麮䁪收: 諢嶅<E8ABA2> ?<3F><> 儠嶅停?韠<> ?木<>諢?貐渥𤩐鴥潺<E9B4A5>諢??瞘掠??鴞吣<E9B49E> ?<3F><> 諰䇹<E8ABB0><EFBFBD>
LobbyUI.Ins.m_ToastUI.Set("배너 광고 준비 중입니다."); LobbyUI.Ins.m_ToastUI.Set("諻圉<EFBFBD> 窵𡟯<E7AAB5><>赬?鴗𡢾<E9B497>?<3F>𠹻.");
return; return;
} }
@ -157,12 +157,12 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
void HideBanner() void HideBanner()
{ {
Advertisement.Banner.Hide(false); // truedestroy Advertisement.Banner.Hide(false); // true諰?destroy
bannerVisible = false; bannerVisible = false;
} }
// =========================================================== // ===========================================================
// 업데이트 - 광고 결과 처리 // ?<3F>㫲?渣䂻 - 窵𡟯<E7AAB5> 窶國頃 麮䁪收
// =========================================================== // ===========================================================
protected override void Update() protected override void Update()
{ {
@ -200,19 +200,19 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
// =========================================================== // ===========================================================
public void OnInitializationComplete() public void OnInitializationComplete()
{ {
Debug.Log("Unity Ads Initialized"); Debug.Log("??Unity Ads Initialized");
// 초기화 완료 후 광고 미리 로드 (인터스티셜 + 리워드) // <EFBFBD>萼???<3F><> ??窵𡟯<E7AAB5> 諯賈收 諢嶅<E8ABA2> (?貲<>?欠剨??+ 謔科<E8AC94>??
Advertisement.Load(placement_Interstitial, this); Advertisement.Load(placement_Interstitial, this);
Advertisement.Load(placement_Rewarded, this); Advertisement.Load(placement_Rewarded, this);
// 배너도 미리 로드하되, 자동 노출은 하지 않음 // 諻圉<EFBFBD>??諯賈收 諢嶅<E8ABA2>?䁪<>, ?韒<> ?賄<>?<3F> ?䁯? ?𥇣<>
LoadBanner(); LoadBanner();
} }
public void OnInitializationFailed(UnityAdsInitializationError error, string message) public void OnInitializationFailed(UnityAdsInitializationError error, string message)
{ {
Debug.LogError($"Unity Ads Init Failed: {error} - {message}"); Debug.LogError($"??Unity Ads Init Failed: {error} - {message}");
} }
// =========================================================== // ===========================================================
@ -229,7 +229,7 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
public void OnUnityAdsFailedToLoad(string placementId, UnityAdsLoadError error, string message) public void OnUnityAdsFailedToLoad(string placementId, UnityAdsLoadError error, string message)
{ {
Debug.LogError($"Failed to load Ad {placementId}: {error} - {message}"); Debug.LogError($"??Failed to load Ad {placementId}: {error} - {message}");
if (placementId == placement_Interstitial) interstitialReady = false; if (placementId == placement_Interstitial) interstitialReady = false;
else if (placementId == placement_Rewarded) rewardedReady = false; else if (placementId == placement_Rewarded) rewardedReady = false;
} }
@ -244,16 +244,16 @@ public class ADInfo : MonoBehaviourSingletonTemplate<ADInfo>,
else else
GetReward = 2; GetReward = 2;
// 광고 시청 후 즉시 다음 광고 미리 로드 // 窵𡟯<EFBFBD> ?𨰰痍 ??鴞吣<E9B49E> ?木<> 窵𡟯<E7AAB5> 諯賈收 諢嶅<E8ABA2>
Advertisement.Load(placementId, this); Advertisement.Load(placementId, this);
} }
public void OnUnityAdsShowFailure(string placementId, UnityAdsShowError error, string message) public void OnUnityAdsShowFailure(string placementId, UnityAdsShowError error, string message)
{ {
Debug.LogError($"Show failed {placementId}: {error} - {message}"); Debug.LogError($"??Show failed {placementId}: {error} - {message}");
GetReward = 2; GetReward = 2;
// 실패했어도 다음 광고 미리 로드 시도 // ?欠𤔅?<3F>𩸭???木<> 窵𡟯<E7AAB5> 諯賈收 諢嶅<E8ABA2> ?嶅<>
Advertisement.Load(placementId, this); Advertisement.Load(placementId, this);
} }

View File

@ -165,7 +165,7 @@ public class ChatUI : MonoBehaviour
public void OnClick_NewChat() public void OnClick_NewChat()
{ {
LobbyUI.Ins.m_PopupUI.Set("현재의 채팅을 초기화 합니다. 계속하시겠습니까?", () => PopupUI.Ins.Set("현재의 채팅을 초기화 합니다. 계속하시겠습니까?", () =>
{ {
SaveMgr.Ins.Del_ChatSaveData(m_Data.n_GirlID); SaveMgr.Ins.Del_ChatSaveData(m_Data.n_GirlID);
Set(m_Data); Set(m_Data);

View File

@ -1,7 +1,9 @@
using OneStore.Common; // 지우면 안됨 using System;
using System.Collections; using System.Collections;
using OneStore.Common; // 지우면 안됨
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.U2D; using UnityEngine.U2D;
public class TitleInfo : MonoBehaviour public class TitleInfo : MonoBehaviour
@ -9,6 +11,8 @@ public class TitleInfo : MonoBehaviour
[SerializeField] TextMeshProUGUI label_msg, t_ver; [SerializeField] TextMeshProUGUI label_msg, t_ver;
[SerializeField] GameObject go_LobbyUI; [SerializeField] GameObject go_LobbyUI;
const string VERSION_URL = "https://filgoodbanditshomepage.web.app/NightWard.txt";
private void Awake() private void Awake()
{ {
Screen.sleepTimeout = SleepTimeout.NeverSleep; Screen.sleepTimeout = SleepTimeout.NeverSleep;
@ -16,27 +20,107 @@ public class TitleInfo : MonoBehaviour
go_LobbyUI.SetActive(false); go_LobbyUI.SetActive(false);
} }
IEnumerator Start() private void Start()
{
SetVersionText();
label_msg.text = "게임 버전 확인 중...";
StartCoroutine(LoadVersionData(
OnVersionSuccess,
OnVersionFail
));
}
void SetVersionText()
{ {
t_ver.text = Application.version; t_ver.text = Application.version;
#if UNITY_EDITOR #if UNITY_EDITOR
t_ver.text += "(E)"; t_ver.text += "(E)";
#else #else
t_ver.text += StoreEnvironment.GetStoreType() == StoreType.ONESTORE ? "(O)" : "(G)"; t_ver.text += StoreEnvironment.GetStoreType() == StoreType.ONESTORE ? "(O)" : "(G)";
#endif #endif
}
void OnVersionFail()
{
PopupUI.Ins.Set("게임 업데이트가 필요합니다.", DSUtil.Quit, DSUtil.Quit);
}
void OnVersionSuccess()
{
StartCoroutine(Co_Success());
}
IEnumerator Co_Success()
{
label_msg.text = "게임 데이터를 읽고 있습니다."; label_msg.text = "게임 데이터를 읽고 있습니다.";
// 테이블 로딩 기다리기 // 테이블 로딩 대기
while (!TableChecker.Ins.CheckAllLoad()) yield return null; while (!TableChecker.Ins.CheckAllLoad())
yield return null;
// UI 아틀라스 로드 // UI 아틀라스 로드
yield return AddrResourceMgr.Ins.LoadObjectSequential<SpriteAtlas>("MainUI/UIAtlas.spriteatlasv2", atlas => { UIAtlasMgr.Ins.Set(atlas); }); yield return AddrResourceMgr.Ins.LoadObjectSequential<SpriteAtlas>(
"MainUI/UIAtlas.spriteatlasv2",
atlas => UIAtlasMgr.Ins.Set(atlas)
);
label_msg.text = "로비로 진입 중입니다."; label_msg.text = "로비로 진입 중입니다.";
yield return null; yield return null;
// 연출용 대기 (필요 없으면 제거 가능)
yield return new WaitForSeconds(3f); yield return new WaitForSeconds(3f);
gameObject.SetActive(false); gameObject.SetActive(false);
go_LobbyUI.SetActive(true); go_LobbyUI.SetActive(true);
SoundInfo.Ins.Play_BGM(eBGM.b001_BGM); SoundInfo.Ins.Play_BGM(eBGM.b001_BGM);
} }
IEnumerator LoadVersionData(Action success, Action fail)
{
using (UnityWebRequest www = UnityWebRequest.Get(VERSION_URL))
{
yield return www.SendWebRequest();
// 네트워크 에러 처리
if (www.result != UnityWebRequest.Result.Success)
{
Debug.LogError($"Version check failed : {www.error}");
fail?.Invoke();
yield break;
}
string serverVersionText = www.downloadHandler.text;
if (string.IsNullOrEmpty(serverVersionText))
{
Debug.LogError("Version text is empty");
fail?.Invoke();
yield break;
}
// 개행 / 공백 제거
serverVersionText = serverVersionText.Trim();
Version serverVersion;
Version clientVersion;
// 안전한 버전 파싱
if (!Version.TryParse(serverVersionText, out serverVersion) ||
!Version.TryParse(Application.version, out clientVersion))
{
Debug.LogError($"Version parse failed : {serverVersionText}");
fail?.Invoke();
yield break;
}
if (serverVersion > clientVersion)
fail?.Invoke();
else
success?.Invoke();
}
}
} }

View File

@ -17,7 +17,6 @@ public class LobbyUI : MonoBehaviourSingletonTemplate<LobbyUI>
[SerializeField] OptionUI m_OptionUI; [SerializeField] OptionUI m_OptionUI;
[SerializeField] ProfileUI m_ProfileUI; [SerializeField] ProfileUI m_ProfileUI;
public ToastUI m_ToastUI; public ToastUI m_ToastUI;
public PopupUI m_PopupUI;
[Header("Center UI")] [Header("Center UI")]
public LobbyCenterProfileUI m_LobbyCenterProfileUI; public LobbyCenterProfileUI m_LobbyCenterProfileUI;

View File

@ -2,23 +2,31 @@ using System;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
public class PopupUI : MonoBehaviour public class PopupUI : MonoBehaviourSingletonTemplate<PopupUI>
{ {
public GameObject go_child;
public TextMeshProUGUI t_msg; public TextMeshProUGUI t_msg;
Action act_ok; Action act_ok, act_no;
public void Set(string msg, Action ok) public void Set(string msg, Action ok, Action no = null)
{ {
gameObject.SetActive(true); go_child.SetActive(true);
act_ok = ok; act_ok = ok;
act_no = no;
t_msg.text = msg; t_msg.text = msg;
} }
public void OnClick_OK() public void OnClick_OK()
{ {
gameObject.SetActive(false); go_child.SetActive(false);
act_ok?.Invoke(); act_ok?.Invoke();
} }
public void OnClick_No()
{
go_child.SetActive(false);
act_no?.Invoke();
}
} }

File diff suppressed because one or more lines are too long

View File

@ -10,8 +10,8 @@
2. 인게임 피버모드 배경 : Album 테이블의 e_CollectionMethod가 Mission 인 이미지 2. 인게임 피버모드 배경 : Album 테이블의 e_CollectionMethod가 Mission 인 이미지
3. 인게임 섹시 배경(시작할 때 섹시 이미지로 변경하고 진입한 경우) : Album 테이블의 e_CollectionMethod가 FullCollection 인 이미지 3. 인게임 섹시 배경(시작할 때 섹시 이미지로 변경하고 진입한 경우) : Album 테이블의 e_CollectionMethod가 FullCollection 인 이미지
업데이트 확인 팝업 (필굿 홈페이지에 연결)
미니게임 배경 설정 미니게임 배경 설정
사운드 사운드
확률 url 확률 url
업데이트 확인 팝업 (필굿 홈페이지에 연결)
앱 아이콘 앱 아이콘