Commit 8676e81f authored by maxiaoliang's avatar maxiaoliang

种树赚钱弹窗数据填充

parent 6ed4134a
......@@ -23,7 +23,7 @@ public class HttpTool : MonoBehaviour
private static HttpTool _instacne = null;
private string TEST_BASE_GAEM_URL = "http://feedapitest.zhangxinhulian.com/";//测试游戏域名
private string TEST_BASE_GAEM_URL = "http://feedapitest3.zhangxinhulian.com/";//测试游戏域名
private string TEST_BASE_AD_URL = "https://bstest.zhangxinhulian.com/";//测试广告域名
private string TEST_BASE_EVENT_URL = "http://reporttest.zhangxinhulian.com/";//测试上报域名
......
This diff is collapsed.
fileFormatVersion: 2
guid: c63feb90348df4797a142633c1e0f7f9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -14441,7 +14441,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.00055163977}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -698, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &508766706
MonoBehaviour:
......@@ -18581,7 +18581,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
BgImg: {fileID: 633442738}
contentParent: {fileID: 1753209877}
harvestItemObj: {fileID: 0}
plantmakemoenyItem: {fileID: 5531816876642120073, guid: c63feb90348df4797a142633c1e0f7f9,
type: 3}
--- !u!1 &646497721
GameObject:
m_ObjectHideFlags: 0
......@@ -20003,7 +20004,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &703432076
RectTransform:
m_ObjectHideFlags: 0
......@@ -28644,7 +28645,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
......@@ -46106,9 +46107,9 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1645377759
MonoBehaviour:
......@@ -49124,8 +49125,8 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1753209880}
- component: {fileID: 1753209879}
- component: {fileID: 1753209878}
- component: {fileID: 1753209879}
m_Layer: 5
m_Name: Content
m_TagString: Untagged
......@@ -49156,22 +49157,21 @@ MonoBehaviour:
m_GameObject: {fileID: 1753209877}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Script: {fileID: 11500000, guid: 8a8695521f0d02e499659fee002a26c2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 35
m_Left: 65
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 5
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_StartCorner: 0
m_StartAxis: 0
m_CellSize: {x: 100, y: 156}
m_Spacing: {x: 32, y: 40}
m_Constraint: 1
m_ConstraintCount: 5
--- !u!224 &1753209880
RectTransform:
m_ObjectHideFlags: 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlantMakeMoneyItem : MonoBehaviour
{
public Text tvname;
public Image img_icon;
public Sprite[] labels;//菜的标签
private WoodConfigList item;
public void setItemData(WoodConfigList bean)
{
item = bean;
tvname.text = bean.name;
img_icon.sprite = labels[bean.id - 1];
}
public void clickPlant()
{
Debug.Log("点击的Id" + item.id+item.name);
}
}
fileFormatVersion: 2
guid: 85544bc0c74314c98865bc889cf42411
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
public class WoodConfigList
{
public int id;
public string name;
}
fileFormatVersion: 2
guid: a6cc5b46e0a9d46fca973c6131214563
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -12,7 +12,7 @@ public class PlantMakeMoney : MonoBehaviour
private float mDefaultPosY;
public GameObject contentParent;
public GameObject harvestItemObj;
public GameObject plantmakemoenyItem;
private void Awake()
{
// mPresenter = new ClockInPresenter(this);
......@@ -23,7 +23,7 @@ public class PlantMakeMoney : MonoBehaviour
private void OnUpdateTaskList()
{
getTaskList();
getWoodCofigList();
}
private void OnDestroy()
......@@ -35,16 +35,17 @@ public class PlantMakeMoney : MonoBehaviour
private void Start()
{
mDefaultPosY = transform.localPosition.y;
getTaskList();
getWoodCofigList();
// mPresenter.GetClockInTaskList();
}
private void getTaskList()
private void getWoodCofigList()
{
Debug.Log("获取任务列表");
HttpTool.Instance._Get("app/v1/wdlc/task/diamond_task_list", null, new Action<TaskDiamondBean>((bean) =>
HttpTool.Instance._Get("app/v2/wdlc/wood_config_list", null, new Action<List<WoodConfigList>>((bean) =>
{
SetTaskListInfo(bean);
//SetTaskListInfo(bean);
setData(bean);
}), new Action<string, string>((code, errMsg) =>
{
Debug.unityLogger.Log("获取任务列表 请求失败" + code + errMsg);
......@@ -52,9 +53,9 @@ public class PlantMakeMoney : MonoBehaviour
}
private void SetTaskListInfo(TaskDiamondBean bean)
private void setData(List<WoodConfigList> bean)
{
if (bean != null)
if (bean != null && bean.Count > 0)
{
int num = contentParent.transform.childCount;
if (num > 0)
......@@ -64,14 +65,16 @@ public class PlantMakeMoney : MonoBehaviour
Destroy(contentParent.transform.GetChild(i).gameObject);
}
}
for (int i = 0; i < bean.taskList.Count; i++)
for (int i = 0; i < bean.Count; i++)
{
GameObject itemObj = Instantiate(harvestItemObj, contentParent.transform);
itemObj.GetComponent<TaskItem>().setItemData(bean.taskList[i]);
GameObject itemObj = Instantiate(plantmakemoenyItem, contentParent.transform);
itemObj.GetComponent<PlantMakeMoneyItem>().setItemData(bean[i]);
}
}
}
//打开打卡任务面板
public void OnClickOpenHarvestInPanel()
{
......
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