Commit 643cbeba authored by maxiaoliang's avatar maxiaoliang

修改防护罩

parent fbdf378f
......@@ -9072,10 +9072,10 @@ RectTransform:
m_Father: {fileID: 300181109}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 93.36, y: -45.84}
m_SizeDelta: {x: 126.72, y: 31.68}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &409306806
MonoBehaviour:
......@@ -33326,6 +33326,7 @@ GameObject:
- component: {fileID: 1623503949}
- component: {fileID: 1623503951}
- component: {fileID: 1623503950}
- component: {fileID: 1623503952}
m_Layer: 0
m_Name: play_desc
m_TagString: Untagged
......@@ -33389,6 +33390,60 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1623503948}
m_CullTransparentMesh: 0
--- !u!114 &1623503952
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1623503948}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1623503950}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1309034796}
m_MethodName: showPlayDesc
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 &1624969085
GameObject:
m_ObjectHideFlags: 0
......@@ -37031,10 +37086,10 @@ RectTransform:
m_Father: {fileID: 300181109}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 30, y: -97.04}
m_SizeDelta: {x: 0, y: 30.720001}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1853878469
MonoBehaviour:
......@@ -39774,6 +39829,7 @@ MonoBehaviour:
wdFailDesc: {fileID: 431594545}
GetRedHeart: {fileID: 2125038053}
PlayDesc: {fileID: 1741062096}
tv_heart_num: {fileID: 1066341174}
TomorrowWithdrawDialog: {fileID: 3477994}
ProtectionCoverDialog: {fileID: 866608230}
WithdrawShopDialog: {fileID: 810355240}
......@@ -108,4 +108,6 @@ public enum MyEventType
/// 关闭打卡页
/// </summary>
CLOSE_CLOCKIN_PAGE,
//关闭防护罩
CLOSE_PROCTION,
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ReceiverHeartsBean
{
/// <summary>
/// 领取成功
/// </summary>
public string msg { get; set; }
/// <summary>
///
/// </summary>
public int taskId { get; set; }
/// <summary>
///
/// </summary>
public int awardCoins { get; set; }
}
fileFormatVersion: 2
guid: 8901e24fde92741a792c0cd1ca2ea22f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -35,6 +35,7 @@ public class HomePresenter : HomeContract.Presenter
HttpTool.Instance._Get("app/v1/game/fkqcw/parking/info", null, new Action<ParkInfoBean>((bean) =>
{
PlayerDataControl.Instance.VideoUnlockCarID = bean.lockNeedWatchVideoStartNum;
PlayerDataControl.Instance.protectionCountdownSecond = bean.protectionCountdownSecond;
Guide.guide.showGuide(bean.isNewUser);
mView.ParkInfo(bean);
......
......@@ -49,6 +49,8 @@ public class PlayerDataControl
///
/// </summary>
public bool IsNewUser { get; set; }
//防火罩倒计时
public int protectionCountdownSecond { get; set; }
/// <summary>
/// 设置协议弹窗
......
......@@ -40,6 +40,16 @@ public class CarUIControl : MonoBehaviour
private void Awake()
{
mCarImg = GetComponent<CarTypeImg>();
EventCenter.AddListener(MyEventType.CLOSE_PROCTION, closeProction);
}
private void OnDestroy()
{
EventCenter.RemoveListener(MyEventType.CLOSE_PROCTION, closeProction);
}
//关闭防护罩
private void closeProction()
{
proction.SetActive(false);
}
private void Start()
......@@ -70,8 +80,16 @@ public class CarUIControl : MonoBehaviour
{
unLockVideoObj.SetActive(false);
}
Debug.Log("开启保护罩");
proction.SetActive(true);
if (PlayerDataControl.Instance.protectionCountdownSecond > 0)
{
Debug.Log("开启保护罩");
proction.SetActive(true);
}
else
{
proction.SetActive(false);
}
mCarImg.OnSetCarImg(car.id);
CarType(car.status);
setTime(car);
......
......@@ -17,6 +17,7 @@ public class DialogControl : MonoBehaviour
private VideoStatusBean mInfo;
public GameObject GetRedHeart, PlayDesc;
public Text tv_heart_num;
private static Dictionary<string, object> parm = new Dictionary<string, object>();
private void Awake()
{
......@@ -378,9 +379,10 @@ public class DialogControl : MonoBehaviour
WithdrawShopDialog.SetActive(false);
}
//显示开心收下红心
public void showGetRedHeartDialog()
public void showGetRedHeartDialog(int num)
{
GetRedHeart.SetActive(true);
tv_heart_num.text = num.ToString();
}
public void closeGetRedHeartDialog()
{
......
......@@ -46,27 +46,26 @@ public class EveryDayControl : MonoBehaviour
/// <param name="sid"></param>
public void videoGetHeart(int sid)
{
//AdUtils.PlayRewardAd("reward_everydayCash", new Action<bool>((adEntity) =>
//{
// if (null != adEntity)
// {
// EventUtils.OnEvent("reward_receiveLove", "激励视频_天天提现领取红心");
// EventUtils.OnEvent("reward_all", "激励视频_天天提现领取红心");
// Dictionary<string, object> parameters = new Dictionary<string, object>();
// parameters.Add("adCode", AdUtils.getCurrentAdEntity().codeId);
// parameters.Add("id", sid);
// HttpTool.Instance._Get("app/v1/game/module/receiveHearts", parameters,
// new Action<ReceiverHeartsBean>((result) =>
// {
// if (null != result)
// {
// //TODO 弹出弹窗
// // showHappyDialog(result.awardCoins);
// getHeartList();
// }
// }), new Action<string, string>((code, mes) => { }));
// }
//}));
AdUtils.PlayRewardAd("reward_everydayCash", new Action<bool>((adEntity) =>
{
EventUtils.OnEvent("reward_receiveLove", "激励视频_天天提现领取红心");
EventUtils.OnEvent("reward_all", "激励视频_天天提现领取红心");
Dictionary<string, object> parameters = new Dictionary<string, object>();
// parameters.Add("adCode", AdUtils.getCurrentAdEntity().codeId);
parameters.Add("id", sid);
HttpTool.Instance._Get("app/v1/game/module/receiveHearts", parameters,
new Action<ReceiverHeartsBean>((result) =>
{
if (null != result)
{
//TODO 弹出弹窗
GameObject.Find("Dialog").GetComponent<DialogControl>().showGetRedHeartDialog(result.awardCoins);
// showHappyDialog(result.awardCoins);
getHeartList();
}
}), new Action<string, string>((code, mes) => { }));
}));
}
/// <summary>
......@@ -136,5 +135,8 @@ public class EveryDayControl : MonoBehaviour
withdrawpage.SetActive(false);
EventCenter.Broadcast(MyEventType.UPDATE_CAR_LIST_DATA);
}
public void showPlayDesc()
{
GameObject.Find("Dialog").GetComponent<DialogControl>().showPlayDesc();
}
}
......@@ -118,7 +118,7 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
protectionTime = time;
if (protionControl != null)
{
StopCoroutine(protionControl);
}
if (protectionTime > 0)
{
......@@ -142,7 +142,7 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
{
procetTimeObj.SetActive(false);
EventCenter.Broadcast(MyEventType.CLOSE_PROCTION);
StopCoroutine(protionControl);
break;
}
......@@ -363,9 +363,20 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
OnUpdateCarListData();
}
}
//点击天天提现
public void onClickEveryDayWithDraw()
{
AudioUtils.ins.PlayBtnAudio();
EveryDayWithDraw.SetActive(true);
}
//点击防火罩
public void onClickProction()
{
GameObject.Find("Dialog").GetComponent<DialogControl>().showProtectionCoverDialog();
}
//点击提现商店
public void onClickWithDrawShop()
{
GameObject.Find("Dialog").GetComponent<DialogControl>().showWithdrawShopDialog();
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ProtectionControl : MonoBehaviour
{
public GameObject content0, content1;
public Text tv_time,tv_times;
// Start is called before the first frame update
void Start()
{
}
private void OnEnable()
{
OnUseProtionDialog();
}
private void OnUseProtionDialog()
{
//获取保护罩倒计时
HttpTool.Instance._Get("app/v1/game/fkqcw/parking/info", null, new Action<ParkInfoBean>((bean) =>
{
if (null != bean)
{
Debug.Log("保护罩时间" + bean.protectionCountdownSecond);
if (bean.protectionCountdownSecond > 0)
{
content1.SetActive(true);
content0.SetActive(false);
DriverTimeControl = StartCoroutine(DriverTimer(bean.protectionCountdownSecond));
}
else
{
content1.SetActive(false);
content0.SetActive(true);
}
}
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("Get 请求失败" + code + errMsg);
}));
//获取剩余次数
Dictionary<string, object> parm = new Dictionary<string, object>();
parm["slot"] = "fkqcw_protection";
HttpTool.Instance._Get("app/v1/game/reward_video/status", parm, new Action<VideoStatusBean>((bean) =>
{
if (bean.status == 1)
{
tv_times.text = "剩余次数:" + bean.playNum + "次";
//AdUtils.ShowFeedAd("double");
}
else
{
ToastPlugin.ToastHelper.ShowToast(bean.msg);
}
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("保护罩 请求失败" + code + errMsg);
}));
}
/// <summary>
/// 使用保护罩
/// </summary>
public void OnClcikProtion()
{
GameObject.Find("Dialog").GetComponent<DialogControl>().closeProtectionCoverDialog();
AdUtils.PlayRewardAd("proction_reward", new Action<bool>((cb) =>
{
if (cb)
{
HttpTool.Instance._Post("app/v1/game/fkqcw/protection/incr_time_by_video", null, new Action<VideoStatusBean>((bean) =>
{
EventCenter.Broadcast(MyEventType.UPDATE_CAR_LIST_DATA);
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("使用保护罩 请求失败" + code + errMsg);
}));
}
}));
}
private Coroutine DriverTimeControl;
private IEnumerator DriverTimer(int time)
{
while (time >= 0)
{
yield return new WaitForSeconds(1f);
if (time <= 0)
{
//倒计时结束
StopCoroutine(DriverTimeControl);
break;
}
else
{
time--;
}
tv_time.text = "剩余时间:<color=#352B04>" + UnityUtil.getCountdown(time) + "</color>";
}
}
}
fileFormatVersion: 2
guid: a4e407775c9864537b2f30d1597d97f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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