Commit fbdf378f authored by zxhljwl's avatar zxhljwl

修改

parent 48e8c2af
......@@ -242,7 +242,7 @@ GameObject:
- component: {fileID: 3429054282211219241}
- component: {fileID: 3429054282211219240}
m_Layer: 5
m_Name: Text
m_Name: pbText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -546,6 +546,7 @@ GameObject:
- component: {fileID: 165009045593183178}
- component: {fileID: 8678038750356840716}
- component: {fileID: 3843624365719166492}
- component: {fileID: 7977656313966607230}
m_Layer: 5
m_Name: button
m_TagString: Untagged
......@@ -611,3 +612,57 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7977656313966607230
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7109538115322957954}
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: 3843624365719166492}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName:
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
This diff is collapsed.
public class TomorrowWithdrawBean
{
public int max;
public string maxStr;
public int now;
public string nowStr;
public string title;
public string text;
public int status;
}
fileFormatVersion: 2
guid: e937aa80eb39a4845884dcb7aa183ccb
guid: 535cf9f747f49c14a849816aa5ffb1e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using System.Collections.Generic;
public class WithdrawShopBean
{
public List<WD> upgradeWdList;
public class WD
{
public int id;
public string showCash;
public ProgressData progressData;
}
public class ProgressData {
public string title;
public int currentProgress;
public int maxProgress;
}
}
fileFormatVersion: 2
guid: fe1fe5654b3ff8341a8cf34cb10fc495
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -7,6 +7,8 @@ public class TomorrowWithdrawDialog : MonoBehaviour
public Text contentText, pbText;
public Image pb, button;
public Sprite[] buttonImages;
public TomorrowWithdrawBean mData;
void OnEnable()
{
......@@ -18,10 +20,14 @@ public class TomorrowWithdrawDialog : MonoBehaviour
/// </summary>
private void GetTomorrowWithdrawData()
{
HttpTool.Instance._Get("app/v1/game/module/withdrawTomorrow", null, new Action<EmptyBean>((bean) =>
HttpTool.Instance._Get("app/v1/game/module/withdrawTomorrow", null, new Action<TomorrowWithdrawBean>((bean) =>
{
if (null != bean) {
contentText.text = bean.text;
pb.fillAmount = (float)Math.Round(((decimal)bean.now / bean.max), 2);
pbText.text = bean.nowStr + "/" + bean.maxStr;
button.sprite = buttonImages[bean.status];
this.mData = bean;
}
}), new Action<string, string>((code, errMsg) =>
{
......@@ -34,6 +40,15 @@ public class TomorrowWithdrawDialog : MonoBehaviour
*/
public void withdraw()
{
HttpTool.Instance._Post("app/v1/game/module/withdrawTomorrow/wd", null, new Action<EmptyBean>((bean) =>
{
if (null != bean)
{
GameObject.Find("Dialog").GetComponent<DialogControl>().closeTomorrowWithdrawDialog();
}
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("Get 请求失败" + code + errMsg);
}));
}
}
using System;
using System.Collections.Generic;
using UnityEngine;
public class WithdrawShopControl : MonoBehaviour
{
public GameObject item;
public void OnEnable()
{
getEverydayTaskList();
}
/**
* 获取提现商店列表
*/
public void getEverydayTaskList()
{
HttpTool.Instance._Get("app/v3/game/fkqcw/wd/info", null, new Action<WithdrawShopBean>((bean) =>
{
print("请求成功==================: ");
if (null != bean)
{
initData(bean.upgradeWdList);
}
}), new Action<string, string>((code, errMsg) =>
{
print("请求失败=================");
Debug.unityLogger.Log("Get 请求失败" + code + errMsg);
}));
}
public void initData(List<WithdrawShopBean.WD> list)
{
print("1");
for (int i = 0; i < transform.childCount; i++)
{
Destroy(transform.GetChild(i).gameObject);
}
print("2");
for (int i = 0; i < list.Count; i++)
{
print("3");
GameObject game = Instantiate(item, transform);
game.name = "" + i;
//game.GetComponent<TaskItemControl>().taskType = tabPosition;
game.GetComponent<WithdrawShopItem>().setItemData(list[i]);
}
}
}
fileFormatVersion: 2
guid: 4922b2a2f003a0a44894ee017008bdbc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEngine;
using UnityEngine.UI;
public class WithdrawShopDialog : MonoBehaviour
{
public Text contentText, pbText;
public Image pb, button;
public Sprite[] buttonImages;
void OnEnable()
{
GetTomorrowWithdrawData();
}
/// <summary>
/// 获取明日提钱罐数据
/// </summary>
private void GetTomorrowWithdrawData()
{
HttpTool.Instance._Get("app/v1/game/module/withdrawTomorrow", null, new Action<EmptyBean>((bean) =>
{
if (null != bean) {
}
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("Get 请求失败" + code + errMsg);
}));
}
/**
* 提现
*/
public void withdraw()
{
}
}
using System;
using UnityEngine;
using UnityEngine.UI;
public class WithdrawShopItem : MonoBehaviour
{
public Text title, pbText, buttonText;
public Image pb;
public void setItemData(WithdrawShopBean.WD data)
{
title.text = data.progressData.title;
pbText.text = data.progressData.currentProgress + "/" + data.progressData.maxProgress;
buttonText.text = data.showCash;
pb.fillAmount = (float)Math.Round(((decimal)data.progressData.currentProgress / data.progressData.maxProgress), 2);
}
}
fileFormatVersion: 2
guid: 01828f63f9434aa48adf1e8a049791bd
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