Commit 45003df7 authored by zhangzhe's avatar zhangzhe

实物奖励

parent 704b020a
fileFormatVersion: 2
guid: e8fc61bed8a2640c7a2c6d5a51574621
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9b3f9e305d4804719b5f4505912accf2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a75f8ac9bc3f8414cb9b1aca48735084
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -58,7 +58,7 @@ MonoBehaviour: ...@@ -58,7 +58,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1 m_RaycastTarget: 1
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:
......
...@@ -880,7 +880,7 @@ RectTransform: ...@@ -880,7 +880,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 1495} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &3807820572441849827 --- !u!114 &3807820572441849827
MonoBehaviour: MonoBehaviour:
...@@ -1509,7 +1509,7 @@ MonoBehaviour: ...@@ -1509,7 +1509,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: "\u5F53\u524D\u6392\u540D\uFF1A199" m_Text: "\u5F53\u524D\u6392\u540D\uFF1A"
--- !u!1 &3807820573071006504 --- !u!1 &3807820573071006504
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1846,7 +1846,7 @@ MonoBehaviour: ...@@ -1846,7 +1846,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: "\u59D323v\u4E2A\u540D" m_Text:
--- !u!1 &3807820573243681190 --- !u!1 &3807820573243681190
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -24,6 +24,8 @@ public class AdUtils ...@@ -24,6 +24,8 @@ public class AdUtils
public static void PlayRewardAd(string actionName,Action<bool> callback) public static void PlayRewardAd(string actionName,Action<bool> callback)
{ {
IsShowRewardAd = true;
//GetAdCd(actionName, callback); //GetAdCd(actionName, callback);
#if UNITY_EDITOR #if UNITY_EDITOR
// ReportVideo(slot); // ReportVideo(slot);
......
...@@ -206,6 +206,8 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View ...@@ -206,6 +206,8 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
//mPresenter.GetParkInfo(); //mPresenter.GetParkInfo();
mPresenter.GetHomeInfo(); mPresenter.GetHomeInfo();
mPresenter.GetLandList(); mPresenter.GetLandList();
transform.Find("Title/shiwujiangli").gameObject.AddComponent<Button>().onClick.AddListener(DidSelectedShiwujiangli);
} }
private void refreshHomeInfo() private void refreshHomeInfo()
{ {
...@@ -646,4 +648,24 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View ...@@ -646,4 +648,24 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
AudioUtils.ins.PlayBtnAudio(); AudioUtils.ins.PlayBtnAudio();
caomeiDialog.SetActive(true); caomeiDialog.SetActive(true);
} }
/// <summary>
/// 实物奖励按钮点击事件
/// </summary>
public void DidSelectedShiwujiangli()
{
if (RealAwardsVM.dataModel != null)
{
if (RealAwardsVM.didChooseAward)
{
// 已经选择过奖品, 直接弹出排行榜
FindObjectOfType<DialogControl>().ShowRARankList();
}
else
{
// 未选择奖品, 显示抽奖页
FindObjectOfType<DialogControl>().ShowRealAwards();
}
}
}
} }
...@@ -86,6 +86,26 @@ public class FlipAnimation : MonoBehaviour ...@@ -86,6 +86,26 @@ public class FlipAnimation : MonoBehaviour
StartCoroutine(ToFront()); StartCoroutine(ToFront());
} }
/// <summary>
/// 外部调用的转到背面无动画方法
/// </summary>
public void StartBackNoAnimator()
{
if (isActive)
return;
StartCoroutine(ToBackNoAnimator());
}
/// <summary>
/// 外部调用的转到正面无动画方法
/// </summary>
public void StartFrontNoAnimator()
{
if (isActive)
return;
StartCoroutine(ToFrontNoAnimator());
}
/// <summary> /// <summary>
/// 翻转到背面 /// 翻转到背面
/// </summary> /// </summary>
...@@ -114,4 +134,33 @@ public class FlipAnimation : MonoBehaviour ...@@ -114,4 +134,33 @@ public class FlipAnimation : MonoBehaviour
mCardState = CardState.Front; mCardState = CardState.Front;
isActive = false; isActive = false;
} }
/// <summary>
/// 翻转到背面(无动画)
/// </summary>
IEnumerator ToBackNoAnimator()
{
isActive = true;
mFront.transform.DORotate(new Vector3(0, 90, 0), 0);
for (float i = mTime; i >= 0; i -= Time.deltaTime)
yield return 0;
mBack.transform.DORotate(new Vector3(0, 0, 0), 0);
mCardState = CardState.Back;
isActive = false;
}
/// <summary>
/// 翻转到正面(无动画)
/// </summary>
IEnumerator ToFrontNoAnimator()
{
isActive = true;
mBack.transform.DORotate(new Vector3(0, 90, 0), 0);
for (float i = mTime; i >= 0; i -= Time.deltaTime)
yield return 0;
mFront.transform.DORotate(new Vector3(0, 0, 0), 0);
mCardState = CardState.Front;
isActive = false;
}
} }
...@@ -28,6 +28,8 @@ public class RAInputPhone : MonoBehaviour ...@@ -28,6 +28,8 @@ public class RAInputPhone : MonoBehaviour
{ {
if (cb) if (cb)
{ {
RealAwardsVM.RequestInternetForChooseAward(RealAwardsVM.awardModel.id);
FindObjectOfType<DialogControl>().CloseRAInputPhone(); FindObjectOfType<DialogControl>().CloseRAInputPhone();
FindObjectOfType<DialogControl>().ShowRARankList(); FindObjectOfType<DialogControl>().ShowRARankList();
......
...@@ -23,6 +23,21 @@ public class RealAwards : MonoBehaviour ...@@ -23,6 +23,21 @@ public class RealAwards : MonoBehaviour
{ {
RealAwardsVM.RequestInternetForData(); RealAwardsVM.RequestInternetForData();
//// 把卡牌翻转到背面
//for (int i = 1; i <= 6; i++)
//{
// Transform AwardCard = transform.Find("BgImage/AwardCards/AwardCard" + i);
// if (AwardCard != null && AwardCard.gameObject.activeSelf)
// {
// FlipAnimation flipAnimation = AwardCard.GetComponent<FlipAnimation>();
// flipAnimation.StartFrontNoAnimator();
// }
//}
//ifPlayedAnimator = false;
RefreshData(); RefreshData();
} }
......
...@@ -38,8 +38,6 @@ public class RealAwardsCard : MonoBehaviour ...@@ -38,8 +38,6 @@ public class RealAwardsCard : MonoBehaviour
/// <returns></returns> /// <returns></returns>
private IEnumerator LoadAwardImage(string url) private IEnumerator LoadAwardImage(string url)
{ {
AwardImage.color = new Color(1, 1, 1, 0);
UnityWebRequest www = UnityWebRequestTexture.GetTexture(url); UnityWebRequest www = UnityWebRequestTexture.GetTexture(url);
yield return www.SendWebRequest(); yield return www.SendWebRequest();
...@@ -68,18 +66,16 @@ public class RealAwardsCard : MonoBehaviour ...@@ -68,18 +66,16 @@ public class RealAwardsCard : MonoBehaviour
} }
// 选择奖品后点击无效 // 选择奖品后点击无效
if (RealAwardsVM.didChooseAward) if (RealAwardsVM.cannotChooseOthers)
{ {
return; return;
} }
RealAwardsVM.didChooseAward = true; RealAwardsVM.cannotChooseOthers = true;
// 把数据变成抽中的奖品的数据 // 把数据变成抽中的奖品的数据
SetUpSubviews(RealAwardsVM.awardModel); SetUpSubviews(RealAwardsVM.awardModel);
RealAwardsVM.RequestInternetForChooseAward(RealAwardsVM.awardModel.id);
// 把卡牌翻到正面 // 把卡牌翻到正面
FlipAnimation flipAnimation = gameObject.GetComponent<FlipAnimation>(); FlipAnimation flipAnimation = gameObject.GetComponent<FlipAnimation>();
flipAnimation.StartFront(); flipAnimation.StartFront();
...@@ -96,6 +92,10 @@ public class RealAwardsCard : MonoBehaviour ...@@ -96,6 +92,10 @@ public class RealAwardsCard : MonoBehaviour
{ {
yield return new WaitForSeconds(1); yield return new WaitForSeconds(1);
RealAwardsVM.cannotChooseOthers = false;
gameObject.GetComponent<FlipAnimation>().StartBackNoAnimator();
FindObjectOfType<DialogControl>().CloseRealAwards(); FindObjectOfType<DialogControl>().CloseRealAwards();
FindObjectOfType<DialogControl>().ShowRealAwardsWinDialog(); FindObjectOfType<DialogControl>().ShowRealAwardsWinDialog();
......
...@@ -31,11 +31,15 @@ public class RealAwardsVM : SingletonMono<RealAwardsVM> ...@@ -31,11 +31,15 @@ public class RealAwardsVM : SingletonMono<RealAwardsVM>
/// <summary> /// <summary>
/// 是否已经选择了奖品 /// 是否已经选择了奖品
/// 选择奖品后, 点击其他卡牌无效
/// 选择后, 下次直接弹出奖品页, 不显示抽奖页 /// 选择后, 下次直接弹出奖品页, 不显示抽奖页
/// </summary> /// </summary>
public static bool didChooseAward; public static bool didChooseAward;
/// <summary>
/// 点击奖品后, 不可点击其他奖品
/// </summary>
public static bool cannotChooseOthers;
/// <summary> /// <summary>
/// 获取实物奖励数据, 包括我的奖品、奖品列表、排行榜、我的排行 /// 获取实物奖励数据, 包括我的奖品、奖品列表、排行榜、我的排行
/// </summary> /// </summary>
...@@ -48,6 +52,8 @@ public class RealAwardsVM : SingletonMono<RealAwardsVM> ...@@ -48,6 +52,8 @@ public class RealAwardsVM : SingletonMono<RealAwardsVM>
if (dataModel.award != null) if (dataModel.award != null)
{ {
awardModel = dataModel.award; awardModel = dataModel.award;
didChooseAward = true;
} }
else else
{ {
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
"depth": 0, "depth": 0,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.ext.nunit": { "com.unity.ext.nunit": {
"version": "1.0.6", "version": "1.0.6",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.ide.rider": { "com.unity.ide.rider": {
"version": "1.1.4", "version": "1.1.4",
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
"dependencies": { "dependencies": {
"com.unity.test-framework": "1.1.1" "com.unity.test-framework": "1.1.1"
}, },
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.ide.vscode": { "com.unity.ide.vscode": {
"version": "1.2.3", "version": "1.2.3",
"depth": 0, "depth": 0,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.test-framework": { "com.unity.test-framework": {
"version": "1.1.20", "version": "1.1.20",
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"com.unity.modules.imgui": "1.0.0", "com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0" "com.unity.modules.jsonserialize": "1.0.0"
}, },
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.textmeshpro": { "com.unity.textmeshpro": {
"version": "2.1.1", "version": "2.1.1",
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
"dependencies": { "dependencies": {
"com.unity.ugui": "1.0.0" "com.unity.ugui": "1.0.0"
}, },
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.timeline": { "com.unity.timeline": {
"version": "1.2.17", "version": "1.2.17",
"depth": 0, "depth": 0,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.cn" "url": "https://packages.unity.com"
}, },
"com.unity.ugui": { "com.unity.ugui": {
"version": "1.0.0", "version": "1.0.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment