commit
245a0adf78
@ -178,7 +178,6 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 271965289}
|
||||
- component: {fileID: 271965290}
|
||||
- component: {fileID: 271965292}
|
||||
m_Layer: 0
|
||||
m_Name: GameManager
|
||||
m_TagString: Untagged
|
||||
@ -471,6 +470,231 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &1545261105
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1867732347}
|
||||
m_Modifications:
|
||||
- target: {fileID: 180756268084732627, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 180756268084732627, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 180756268084732627, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 180756268084732627, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 1545261107}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
|
||||
value: OnClickGameStart
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
|
||||
value: MainPanelController, Assembly-CSharp
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 713532354933724924, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
||||
value: UnityEngine.Object, UnityEngine
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4282069284025755619, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4733773333797619672, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4733773333797619672, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4733773333797619672, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4733773333797619672, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5033979732381400892, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5033979732381400892, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5033979732381400892, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5033979732381400892, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8446481687955831510, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8446481687955831510, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8446481687955831510, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8446481687955831510, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8564394481744056992, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Main Panel
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8768541925252566370, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8768541925252566370, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8768541925252566370, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8768541925252566370, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
--- !u!224 &1545261106 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6110152713294678410, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
m_PrefabInstance: {fileID: 1545261105}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1545261107 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 7488082087611091670, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
m_PrefabInstance: {fileID: 1545261105}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b4dc3fd9e59f47df80e344680d1b9803, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1867732343
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -548,7 +772,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
|
@ -19,6 +19,12 @@ public class AdManager : MonoBehaviour
|
||||
// 보상형 전면 광고 로드
|
||||
public void LoadRewardedInterstitialAd()
|
||||
{
|
||||
if (rewardedInterstitialAd != null)
|
||||
{
|
||||
rewardedInterstitialAd.Destroy(); // 기존 광고 객체 해제
|
||||
rewardedInterstitialAd = null;
|
||||
}
|
||||
|
||||
AdRequest request = new AdRequest();
|
||||
|
||||
RewardedInterstitialAd.Load(adUnitId, request,
|
||||
@ -30,7 +36,6 @@ public class AdManager : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("보상형 전면 광고 로드 성공");
|
||||
rewardedInterstitialAd = ad;
|
||||
|
||||
// 광고 종료 이벤트 설정
|
||||
@ -39,14 +44,14 @@ public class AdManager : MonoBehaviour
|
||||
}
|
||||
|
||||
// 보상형 전면 광고 실행
|
||||
public void ShowRewardedInterstitialAd()
|
||||
public void ShowRewardedInterstitialAd(CanvasGroup shopPanel)
|
||||
{
|
||||
if (rewardedInterstitialAd != null && rewardedInterstitialAd.CanShowAd())
|
||||
{
|
||||
rewardedInterstitialAd.Show((Reward reward) => //서버에서 500코인을 고정으로 반환하기 때문에 reward는 사용하지 않음.
|
||||
{
|
||||
// 코인 지급 로직
|
||||
GrantReward();
|
||||
GrantReward(shopPanel);
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -58,20 +63,19 @@ public class AdManager : MonoBehaviour
|
||||
// 광고 닫힘 이벤트 처리
|
||||
private void HandleAdClosed()
|
||||
{
|
||||
Debug.Log("보상형 전면 광고 닫힘, 새로운 광고 로드.");
|
||||
LoadRewardedInterstitialAd(); // 광고가 닫힌 후 다시 로드
|
||||
}
|
||||
|
||||
// 코인 지급 함수
|
||||
private void GrantReward()
|
||||
private void GrantReward(CanvasGroup shopPanel)
|
||||
{
|
||||
NetworkManager.Instance.WatchAdForCoins((coinsAdded) =>
|
||||
{
|
||||
// UI 업데이트
|
||||
GameManager.Instance.panelManager.UpdateCoinsPanelUI(coinsAdded);
|
||||
GameManager.Instance.panelManager.UpdateCoinsPanelUI(coinsAdded, shopPanel);
|
||||
}, () =>
|
||||
{
|
||||
Debug.Log("광고 시청 후 코인 추가 실패!");
|
||||
Debug.Log("광고 시청 후 코인 추가 실패");
|
||||
});
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8786799901643631561
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7455536569977767830}
|
||||
- component: {fileID: 2424336103342601865}
|
||||
m_Layer: 0
|
||||
m_Name: Admob
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7455536569977767830
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8786799901643631561}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2424336103342601865
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8786799901643631561}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 644acbaf5d5791242b26c1b1b0a0ceeb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c401513426cb83c4e8759c73d8be4c3a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -413,8 +413,8 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: c06da2c324d0fee43b8b1998cf9fcd09, type: 3}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: 05a670e614d7817429ee256ceb7efbe6, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
|
@ -34,8 +34,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -25, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 100}
|
||||
m_AnchoredPosition: {x: 0.5, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8644449565768019552
|
||||
CanvasRenderer:
|
||||
@ -168,8 +168,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 176.9, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 100}
|
||||
m_AnchoredPosition: {x: 200, y: 0}
|
||||
m_SizeDelta: {x: 160, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7968533753814083057
|
||||
CanvasRenderer:
|
||||
@ -356,6 +356,7 @@ GameObject:
|
||||
- component: {fileID: 5750108967662755581}
|
||||
- component: {fileID: 6941609111617388457}
|
||||
- component: {fileID: -8178793116256795857}
|
||||
- component: {fileID: 1941271810694746857}
|
||||
m_Layer: 5
|
||||
m_Name: ShopScrollItem
|
||||
m_TagString: Untagged
|
||||
@ -413,8 +414,8 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: c06da2c324d0fee43b8b1998cf9fcd09, type: 3}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: 05a670e614d7817429ee256ceb7efbe6, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
@ -491,5 +492,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 4d28917ad20c19e428cbf98ba5609e69, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
profileSprites:
|
||||
- {fileID: 21300000, guid: 307bff9630735f342852f28b1cd5d300, type: 3}
|
||||
--- !u!114 &1941271810694746857
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7605012172595602668}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 644acbaf5d5791242b26c1b1b0a0ceeb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
@ -350,7 +350,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: -392, y: -56.72364}
|
||||
m_AnchoredPosition: {x: -392, y: -5.317383}
|
||||
m_SizeDelta: {x: 784, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &2389273839879143832
|
||||
|
@ -294,12 +294,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 03aef985a8b802a409630fdcab7be09b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
settingsPanel: {fileID: 2861881646994438329, guid: ea820246b5075c54d9f614291ca41c5d, type: 3}
|
||||
confirmPanel: {fileID: 8145365568262946399, guid: 76f1fe6b5243faf4f9b8caee7312d336, type: 3}
|
||||
rankingPanel: {fileID: 154459105952450598, guid: bf4bb18aa323fe748b3eb1d537503596, type: 3}
|
||||
shopPanel: {fileID: 8190964574954487140, guid: eb257b0a685b2254f860f294ce8cba54, type: 3}
|
||||
giboPanel: {fileID: 3090474328172188941, guid: c63914e01332f8d479ada92325335e41, type: 3}
|
||||
_canvas: {fileID: 6741227126671320411}
|
||||
--- !u!222 &71273024816384741
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -347,63 +341,6 @@ MonoBehaviour:
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!1001 &523594383261405864
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8786799901643631561, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Admob
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
--- !u!1 &658145525140724706
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1747,4 +1684,3 @@ SceneRoots:
|
||||
- {fileID: 656468223}
|
||||
- {fileID: 937655098394579964}
|
||||
- {fileID: 1842188762}
|
||||
- {fileID: 523594383261405864}
|
||||
|
@ -16,8 +16,8 @@ public class MainPanelButtonController : MonoBehaviour
|
||||
{
|
||||
ShopItem shopItem = new ShopItem
|
||||
{
|
||||
Name = "코인500개 ",
|
||||
Price = "광고"
|
||||
name = "광고) 코인500개 ",
|
||||
price = 0
|
||||
};
|
||||
shopItems.Add(shopItem);
|
||||
}
|
||||
@ -25,13 +25,12 @@ public class MainPanelButtonController : MonoBehaviour
|
||||
{
|
||||
ShopItem shopItem = new ShopItem
|
||||
{
|
||||
Name = "코인"+i*1000+"개 ",
|
||||
Price = (i * 1000)+ "원"
|
||||
name = i*1000+"개 ",
|
||||
price = i * 1000
|
||||
};
|
||||
shopItems.Add(shopItem);
|
||||
}
|
||||
}
|
||||
|
||||
GameManager.Instance.panelManager.OpenShopPanel(shopItems);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9598d78723880e4f8026beb096f28c4
|
||||
guid: 93bfed50167472f489a27f0518070ed5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -248,17 +248,8 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 35a4c6d5d3a97b444b968e68ec8bb9f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
mainPanel: {fileID: 8564394481744056992, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
signinPanel: {fileID: 925522282249935710, guid: e14c9b2925f0ddb4192af743e5cc166a, type: 3}
|
||||
signupPanel: {fileID: 3181524094944658765, guid: 8827fe7caa3145e40b1369cc42f8697d, type: 3}
|
||||
settingsPanel: {fileID: 2861881646994438329, guid: ea820246b5075c54d9f614291ca41c5d, type: 3}
|
||||
confirmPanel: {fileID: 8145365568262946399, guid: 76f1fe6b5243faf4f9b8caee7312d336, type: 3}
|
||||
rankingPanel: {fileID: 154459105952450598, guid: bf4bb18aa323fe748b3eb1d537503596, type: 3}
|
||||
shopPanel: {fileID: 8190964574954487140, guid: eb257b0a685b2254f860f294ce8cba54, type: 3}
|
||||
giboPanel: {fileID: 3090474328172188941, guid: c63914e01332f8d479ada92325335e41, type: 3}
|
||||
loadingPanel: {fileID: 1942997847427067673, guid: 634a60576b4855940a97d1e7447b9fcc, type: 3}
|
||||
mainBgm: {fileID: 8300000, guid: 1d9c7fb20aa822c48933d00b6bd6a757, type: 3}
|
||||
profileSprites: []
|
||||
panelManagerPrefab: {fileID: 3475740041361426276, guid: 085ca07ca90c92545b2594bd13412701, type: 3}
|
||||
audioManagerPrefab: {fileID: 2946408323859178723, guid: e829818dce39a5d4383e061111bed871, type: 3}
|
||||
--- !u!224 &183715513
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -346,63 +337,52 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &634833532
|
||||
PrefabInstance:
|
||||
--- !u!1 &1280076947
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1280076949}
|
||||
- component: {fileID: 1280076948}
|
||||
m_Layer: 0
|
||||
m_Name: MainPanelManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1280076948
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1280076947}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0696b08f74b24325a7b378405f6170af, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
loadingPanelController: {fileID: 1454248679793356470, guid: 634a60576b4855940a97d1e7447b9fcc, type: 3}
|
||||
mainPanelController: {fileID: 7488082087611091670, guid: e1835a90a4d722a4b99be61179de8789, type: 3}
|
||||
--- !u!4 &1280076949
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1280076947}
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7455536569977767830, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8786799901643631561, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Admob
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c401513426cb83c4e8759c73d8be4c3a, type: 3}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1340395578
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -604,4 +584,4 @@ SceneRoots:
|
||||
- {fileID: 183715513}
|
||||
- {fileID: 1340395582}
|
||||
- {fileID: 521295933}
|
||||
- {fileID: 634833532}
|
||||
- {fileID: 1280076949}
|
||||
|
@ -56,6 +56,7 @@ MonoBehaviour:
|
||||
coinsRemoveAudioClip: {fileID: 8300000, guid: 585a9de0fb7ee4163af5c559ba5b2364, type: 3}
|
||||
coinsAddAudioClip: {fileID: 8300000, guid: 1ec44182fa76a4b3eb1459c0a6d9a8ab, type: 3}
|
||||
coinsEmptyAudioClip: {fileID: 8300000, guid: 908a78cb991984977bea42916bed8684, type: 3}
|
||||
ShopPanel: {fileID: 8190964574954487140, guid: eb257b0a685b2254f860f294ce8cba54, type: 3}
|
||||
--- !u!82 &5499754916380040505
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -120,7 +120,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 3015309825845733259}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 0}
|
||||
m_TargetAssemblyTypeName: PanelManager, Assembly-CSharp
|
||||
m_MethodName: OnRankingPanelClick
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &683375887058748135
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -375,7 +387,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 6468719718473664808}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 0}
|
||||
m_TargetAssemblyTypeName: PanelManager, Assembly-CSharp
|
||||
m_MethodName: OpenSettingsPanel
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &1637449823560643887
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -386,7 +410,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 2720476515686469179}
|
||||
- component: {fileID: 7796730417217941349}
|
||||
- component: {fileID: 8890768496808647529}
|
||||
- component: {fileID: 5873276942444222861}
|
||||
m_Layer: 5
|
||||
m_Name: Buttons
|
||||
m_TagString: Untagged
|
||||
@ -444,7 +468,7 @@ MonoBehaviour:
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &8890768496808647529
|
||||
--- !u!114 &5873276942444222861
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@ -453,7 +477,7 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 1637449823560643887}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c9598d78723880e4f8026beb096f28c4, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 93bfed50167472f489a27f0518070ed5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &2440131775796007731
|
||||
@ -845,7 +869,7 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 8890768496808647529}
|
||||
- m_Target: {fileID: 5873276942444222861}
|
||||
m_TargetAssemblyTypeName: MainPanelButtonController, Assembly-CSharp
|
||||
m_MethodName: OnShopPanelClick
|
||||
m_Mode: 1
|
||||
@ -1283,9 +1307,9 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 8890768496808647529}
|
||||
m_TargetAssemblyTypeName: MainPanelButtonController, Assembly-CSharp
|
||||
m_MethodName: OpenReplayPanelClick
|
||||
- m_Target: {fileID: 0}
|
||||
m_TargetAssemblyTypeName: PanelManager, Assembly-CSharp
|
||||
m_MethodName: OpenReplayPanel
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using TMPro;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@ -66,7 +67,7 @@ public class CoinsPanelController : MonoBehaviour
|
||||
if (isAdd)
|
||||
{
|
||||
var currentHeartCount = coinsCountText.text;
|
||||
coinsCountText.text = (int.Parse(currentHeartCount) + 100).ToString();
|
||||
coinsCountText.text = (int.Parse(currentHeartCount) + 500).ToString();
|
||||
// 코인 텍스트 100씩 증가
|
||||
}
|
||||
else
|
||||
@ -93,13 +94,15 @@ public class CoinsPanelController : MonoBehaviour
|
||||
/// 코인 추가 함수
|
||||
/// </summary>
|
||||
/// <param name="coinsCount"> 추가할 코인 수량</param>
|
||||
/// <param name="shopPanel">상점 패널 캔버스 그룹</param>
|
||||
/// <param name="action">애니메이션 종료 후 동작 EX) 코인 수량 변경</param>
|
||||
public void AddCoins(int coinsCount, Action action)
|
||||
public void AddCoins(int coinsCount, CanvasGroup shopPanel,Action action)
|
||||
{
|
||||
Sequence sequence = DOTween.Sequence();
|
||||
shopPanel.blocksRaycasts = false; //코인 중복 추가 방지 코드
|
||||
|
||||
Sequence sequence = DOTween.Sequence();
|
||||
// i += a 반복 횟수 조절, 100개 단위로 상승 차감 시 100으로 설정
|
||||
for (int i = 0; i < coinsCount; i+=100)
|
||||
for (int i = 0; i < coinsCount; i+=500)
|
||||
{
|
||||
sequence.AppendCallback(() =>
|
||||
{
|
||||
@ -115,6 +118,10 @@ public class CoinsPanelController : MonoBehaviour
|
||||
});
|
||||
sequence.AppendInterval(0.5f);
|
||||
}
|
||||
sequence.OnComplete(() =>
|
||||
{
|
||||
shopPanel.blocksRaycasts = true; //구매 후 클릭 활성화
|
||||
});
|
||||
}
|
||||
|
||||
public void EmptyCoins()
|
||||
|
@ -4,6 +4,6 @@ using UnityEngine;
|
||||
|
||||
public class ShopItem
|
||||
{
|
||||
public string Name;
|
||||
public string Price;
|
||||
public string name;
|
||||
public int price;
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ public class NetworkManager : Singleton<NetworkManager>
|
||||
else
|
||||
{
|
||||
var result = www.downloadHandler.text;
|
||||
success?.Invoke();
|
||||
|
||||
// 회원가입 성공 팝업 표시
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("회원 가입이 완료 되었습니다.", () =>
|
||||
{
|
||||
@ -374,20 +376,29 @@ public class NetworkManager : Singleton<NetworkManager>
|
||||
}
|
||||
}
|
||||
|
||||
//코인 구매 함수
|
||||
public void PurchaseCoins(Action<int> success, Action failure)
|
||||
|
||||
/// <summary>
|
||||
/// 코인 구매 함수
|
||||
/// </summary>
|
||||
/// <param name="amount">충전양</param>
|
||||
/// <param name="paymentId">결제ID(??)</param>
|
||||
/// <param name="paymentType">결제타입(카드,구글페이)</param>
|
||||
/// <param name="success"></param>
|
||||
/// <param name="failure"></param>
|
||||
public void PurchaseCoins(int amount, string paymentId, string paymentType, Action<int> success, Action failure)
|
||||
{
|
||||
StartCoroutine(PurchaseCoinsCoroutine(success, failure));
|
||||
StartCoroutine(PurchaseCoinsCoroutine(amount, paymentId, paymentType, success, failure));
|
||||
}
|
||||
|
||||
private IEnumerator PurchaseCoinsCoroutine(Action<int> success, Action failure)
|
||||
private IEnumerator PurchaseCoinsCoroutine(int amount, string paymentId, string paymentType, Action<int> success, Action failure)
|
||||
{
|
||||
string jsonString = "{\"adCompleted\": true}"; //테스트를 위해 ture로 설정
|
||||
byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonString);
|
||||
string url = Constants.ServerURL + "/coins/purchase"; // 서버 엔드포인트
|
||||
PurchaseData purchaseData = new PurchaseData(amount, paymentId, paymentType);
|
||||
string jsonString = JsonUtility.ToJson(purchaseData);
|
||||
|
||||
using (UnityWebRequest www =
|
||||
new UnityWebRequest(Constants.ServerURL + "/coins/recharge/ad", UnityWebRequest.kHttpVerbPOST))
|
||||
using (UnityWebRequest www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST))
|
||||
{
|
||||
byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonString);
|
||||
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||
www.downloadHandler = new DownloadHandlerBuffer();
|
||||
www.SetRequestHeader("Content-Type", "application/json");
|
||||
@ -406,26 +417,29 @@ public class NetworkManager : Singleton<NetworkManager>
|
||||
|
||||
yield return www.SendWebRequest();
|
||||
|
||||
if (www.result == UnityWebRequest.Result.ConnectionError ||
|
||||
www.result == UnityWebRequest.Result.ProtocolError)
|
||||
if (www.result == UnityWebRequest.Result.ConnectionError || www.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.Log("광고 시청 후 코인 충전 실패: " + www.error);
|
||||
Debug.LogError("결제 요청 실패: " + www.error);
|
||||
failure?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = www.downloadHandler.text;
|
||||
var rechargeResult = JsonUtility.FromJson<CoinsAdResult>(result);
|
||||
var purchaseResult = JsonUtility.FromJson<CoinsPurchaseResult>(result);
|
||||
|
||||
if (rechargeResult.result == "SUCCESS")
|
||||
if (purchaseResult.result == "SUCCESS")
|
||||
{
|
||||
Debug.Log("광고 시청으로 코인 충전 완료: " + rechargeResult.recharged);
|
||||
Debug.Log($"결제 완료 {purchaseResult.purchased} 코인 충전됨, 현재 코인: {purchaseResult.currentCoins}");
|
||||
|
||||
// 유저 데이터 갱신
|
||||
UserManager.Instance.SetCoinsInfo();
|
||||
success?.Invoke(rechargeResult.recharged);
|
||||
|
||||
// 최신 코인 개수를 성공 콜백으로 전달
|
||||
success?.Invoke(purchaseResult.purchased);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("광고 시청 후 충전 실패: " + rechargeResult.result);
|
||||
Debug.LogError("결제 후 코인 충전 실패: " + purchaseResult.result);
|
||||
failure?.Invoke();
|
||||
}
|
||||
}
|
||||
|
@ -55,14 +55,13 @@ public class SigninPanelController : MonoBehaviour
|
||||
|
||||
NetworkManager.Instance.Signin(signinData, (signinResult) =>
|
||||
{
|
||||
if (mainPanel == null) mainPanel = FindObjectOfType<MainPanelManager>();
|
||||
Destroy(gameObject);
|
||||
|
||||
// 유저 정보 저장
|
||||
UserManager.Instance.SetUserInfo(signinResult);
|
||||
|
||||
// 메인 패널 정보 갱신
|
||||
mainPanel.UpdateMainPanelUI(GameManager.Instance.panelManager.OpenMainPanel);
|
||||
Destroy(gameObject);
|
||||
}, result =>
|
||||
{
|
||||
if (result == 0)
|
||||
|
@ -20,6 +20,19 @@ public class CoinsInfoResult
|
||||
public int coins;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 코인 구매 응답 클래스
|
||||
/// </summary>
|
||||
public class CoinsPurchaseResult
|
||||
{
|
||||
public string result;
|
||||
public string message;
|
||||
public int purchased; // 충전된 코인량
|
||||
public int currentCoins; // 현재 보유 코인량
|
||||
}
|
||||
/// <summary>
|
||||
/// 광고 시청 응답 클래스
|
||||
/// </summary>
|
||||
public class CoinsAdResult
|
||||
{
|
||||
public string result;
|
||||
@ -28,6 +41,25 @@ public class CoinsAdResult
|
||||
public int currentCoins; // 현재 보유 코인량
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 코인 구매 요청 데이터 클래스
|
||||
/// </summary>
|
||||
public class PurchaseData
|
||||
{
|
||||
public int amount;
|
||||
public string paymentId;
|
||||
public string paymentType;
|
||||
|
||||
public PurchaseData(int amount, string paymentId, string paymentType)
|
||||
{
|
||||
this.amount = amount;
|
||||
this.paymentId = paymentId;
|
||||
this.paymentType = paymentType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class UserManager : Singleton<UserManager>
|
||||
{
|
||||
public string UserId { get; private set; }
|
||||
|
@ -6,9 +6,8 @@ using UnityEngine.UI;
|
||||
|
||||
public class ShopItemController : MonoBehaviour
|
||||
{
|
||||
|
||||
ShopItem _shopItem;
|
||||
public Sprite[] profileSprites;
|
||||
AdManager _adManager;
|
||||
|
||||
public void Init(ShopItem shopItem)
|
||||
{
|
||||
@ -16,20 +15,35 @@ public class ShopItemController : MonoBehaviour
|
||||
var itemImage = GetComponentsInChildren<Image>()[1];
|
||||
var itemText = GetComponentsInChildren<TextMeshProUGUI>();
|
||||
|
||||
itemText[0].text = this._shopItem.Name;
|
||||
itemText[1].text = this._shopItem.Price;
|
||||
itemText[0].text = this._shopItem.name;
|
||||
itemText[1].text = this._shopItem.price+"원";
|
||||
|
||||
}
|
||||
|
||||
public void OnClickShopItem()
|
||||
{
|
||||
if (_shopItem.Price == "광고")
|
||||
var shopPanel = GetComponentInParent<CanvasGroup>(); //코인 구매시 상점 패널의 캔버스 그룹 raycast를 비활성화하여 중복클릭 방지.
|
||||
|
||||
if (_shopItem.price == 0)
|
||||
{
|
||||
//보상형 전면 광고 로드
|
||||
FindObjectOfType<AdManager>().ShowRewardedInterstitialAd(); //Todo FindOf 함수 수정
|
||||
_adManager = GetComponent<AdManager>();
|
||||
_adManager.ShowRewardedInterstitialAd(shopPanel);
|
||||
}
|
||||
else
|
||||
{
|
||||
//todo 가격별로 구매하기
|
||||
|
||||
NetworkManager.Instance.PurchaseCoins(
|
||||
_shopItem.price, // 충전할 코인 개수
|
||||
_shopItem.name, // 결제 ID
|
||||
"GooglePay", // 결제 방식 (GooglePay, PayPal 등)
|
||||
(coins) => {
|
||||
GameManager.Instance.panelManager.UpdateCoinsPanelUI(coins,shopPanel);
|
||||
},
|
||||
() => {
|
||||
Debug.LogError("결제 후 코인 충전 실패");
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ public class PanelManager : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SetCanvas();
|
||||
// Prefabs 폴더에서 모든 패널 프리팹 로드
|
||||
GameObject[] prefabs = Resources.LoadAll<GameObject>("Prefabs/Panels");
|
||||
|
||||
@ -31,7 +30,7 @@ public class PanelManager : MonoBehaviour
|
||||
Debug.Log($"총 {panelPrefabs.Count}개의 패널이 로드됨.");
|
||||
}
|
||||
|
||||
private void SetCanvas()
|
||||
void Start()
|
||||
{
|
||||
if (_canvas == null)
|
||||
{
|
||||
@ -177,16 +176,15 @@ public class PanelManager : MonoBehaviour
|
||||
//상점 패널 생성
|
||||
public void OnShopPanelClick()
|
||||
{
|
||||
|
||||
List<ShopItem> shopItems = new List<ShopItem>(); //테스트 데이터 리스트 생성
|
||||
for (int i = 0; i < 10; i++)
|
||||
List<ShopItem> shopItems = new List<ShopItem>(); //상점 데이터 리스트 생성
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (i == 0) //광고 항목
|
||||
{
|
||||
ShopItem shopItem = new ShopItem
|
||||
{
|
||||
Name = "코인10개",
|
||||
Price = "광고"
|
||||
name = "광고) 코인500개 ",
|
||||
price = 0
|
||||
};
|
||||
shopItems.Add(shopItem);
|
||||
}
|
||||
@ -194,21 +192,21 @@ public class PanelManager : MonoBehaviour
|
||||
{
|
||||
ShopItem shopItem = new ShopItem
|
||||
{
|
||||
Name = "코인"+i+"개",
|
||||
Price = (i * 1000)+ "원"
|
||||
name = i*1000+"개 ",
|
||||
price = i * 1000
|
||||
};
|
||||
shopItems.Add(shopItem);
|
||||
}
|
||||
}
|
||||
|
||||
OpenShopPanel(shopItems);
|
||||
GameManager.Instance.panelManager.OpenShopPanel(shopItems);
|
||||
}
|
||||
|
||||
public void UpdateCoinsPanelUI(int coinsChanged)
|
||||
//코인 패널 코인 갱신
|
||||
public void UpdateCoinsPanelUI(int coinsChanged, CanvasGroup shopPanel)
|
||||
{
|
||||
if (_coinsPanel != null)
|
||||
{
|
||||
_coinsPanel.AddCoins(coinsChanged, () =>
|
||||
_coinsPanel.AddCoins(coinsChanged, shopPanel, () =>
|
||||
{
|
||||
|
||||
});
|
||||
|
@ -8,10 +8,10 @@ public class CoinUITestScript : MonoBehaviour
|
||||
|
||||
public void OnClickAddCoin()
|
||||
{
|
||||
coinsPanelController.AddCoins(100, () =>
|
||||
{
|
||||
Debug.Log("Add coin 후 동작");
|
||||
});
|
||||
// coinsPanelController.AddCoins(100, () =>
|
||||
// {
|
||||
// Debug.Log("Add coin 후 동작");
|
||||
// });
|
||||
}
|
||||
|
||||
public void OnClickRemoveCoin()
|
||||
|
Loading…
x
Reference in New Issue
Block a user