Merge branch 'main' of http://shu.sheziwanglo.cn:3000/shurongsen/Cute_demon_attacks
This commit is contained in:
commit
1cbd1bbc74
1461
meng_yao/Assets/Prefabs/ui/MineSelection.prefab
Normal file
1461
meng_yao/Assets/Prefabs/ui/MineSelection.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
meng_yao/Assets/Prefabs/ui/MineSelection.prefab.meta
Normal file
7
meng_yao/Assets/Prefabs/ui/MineSelection.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 128d8e441f9e4a3498635470755d4087
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -787,7 +787,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -763.3795, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &6480420811597574756
|
||||
MonoBehaviour:
|
||||
@ -1369,7 +1369,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6480420812643749074
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -3234,6 +3234,7 @@ MonoBehaviour:
|
||||
shipNumberTextPro: {fileID: 1667584252}
|
||||
shipNumber: 0
|
||||
MaxShipNumber: 10
|
||||
jsk: {fileID: 0}
|
||||
effectPrefab: {fileID: 0}
|
||||
OnBtnAni: {fileID: 0}
|
||||
FishPrice: 0
|
||||
@ -35350,7 +35351,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 414, y: -53.69955}
|
||||
m_AnchoredPosition: {x: 414, y: -53.699463}
|
||||
m_SizeDelta: {x: 458.6698, y: 76.3482}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &373241424
|
||||
@ -37286,6 +37287,7 @@ MonoBehaviour:
|
||||
shipNumberTextPro: {fileID: 685753470}
|
||||
shipNumber: 0
|
||||
MaxShipNumber: 10
|
||||
jsk: {fileID: 0}
|
||||
effectPrefab: {fileID: 0}
|
||||
OnBtnAni: {fileID: 0}
|
||||
FishPrice: 0
|
||||
@ -48126,6 +48128,7 @@ MonoBehaviour:
|
||||
pathsNeedTimer: 10
|
||||
fishingNeedTimer: 30
|
||||
restTimer: 5
|
||||
jsdbuy: {fileID: 0}
|
||||
goldNumerTextPro: {fileID: 1971643584}
|
||||
shipNumberTextPro: {fileID: 1400604628}
|
||||
shipNumber: 0
|
||||
@ -50405,6 +50408,7 @@ MonoBehaviour:
|
||||
shipNumberTextPro: {fileID: 1560771129}
|
||||
shipNumber: 0
|
||||
MaxShipNumber: 10
|
||||
jsk: {fileID: 0}
|
||||
effectPrefab: {fileID: 0}
|
||||
OnBtnAni: {fileID: 0}
|
||||
FishPrice: 0
|
||||
@ -88127,9 +88131,8 @@ MonoBehaviour:
|
||||
- {fileID: 0}
|
||||
shipSelection: {fileID: 0}
|
||||
Canvas: {fileID: 0}
|
||||
Generate1: 0
|
||||
Generate2: 0
|
||||
Generate3: 0
|
||||
itemlist: []
|
||||
mineritemlist: []
|
||||
--- !u!114 &947625782
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -92135,6 +92138,7 @@ MonoBehaviour:
|
||||
pathsNeedTimer: 10
|
||||
fishingNeedTimer: 30
|
||||
restTimer: 5
|
||||
jsdbuy: {fileID: 0}
|
||||
goldNumerTextPro: {fileID: 564324688}
|
||||
shipNumberTextPro: {fileID: 2124790069}
|
||||
shipNumber: 0
|
||||
@ -134961,9 +134965,8 @@ MonoBehaviour:
|
||||
- {fileID: 1583471194}
|
||||
shipSelection: {fileID: 6480420810917194676, guid: 319669884e7e8f841923763965008c35, type: 3}
|
||||
Canvas: {fileID: 1429992428}
|
||||
Generate1: 0
|
||||
Generate2: 0
|
||||
Generate3: 0
|
||||
itemlist: []
|
||||
mineritemlist: []
|
||||
--- !u!114 &1429992425
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -149266,6 +149269,7 @@ MonoBehaviour:
|
||||
pathsNeedTimer: 10
|
||||
fishingNeedTimer: 30
|
||||
restTimer: 5
|
||||
jsdbuy: {fileID: 0}
|
||||
goldNumerTextPro: {fileID: 1070786116}
|
||||
shipNumberTextPro: {fileID: 1704927611}
|
||||
shipNumber: 0
|
||||
@ -158489,6 +158493,7 @@ MonoBehaviour:
|
||||
shipNumberTextPro: {fileID: 1464106938}
|
||||
shipNumber: 0
|
||||
MaxShipNumber: 10
|
||||
jsk: {fileID: 0}
|
||||
effectPrefab: {fileID: 0}
|
||||
OnBtnAni: {fileID: 0}
|
||||
FishPrice: 0
|
||||
@ -181040,6 +181045,7 @@ MonoBehaviour:
|
||||
shipNumberTextPro: {fileID: 948930767}
|
||||
shipNumber: 0
|
||||
MaxShipNumber: 10
|
||||
jsk: {fileID: 0}
|
||||
effectPrefab: {fileID: 0}
|
||||
OnBtnAni: {fileID: 0}
|
||||
FishPrice: 0
|
||||
@ -194040,9 +194046,10 @@ MonoBehaviour:
|
||||
- {fileID: 1921553433}
|
||||
- {fileID: 1676680139}
|
||||
- {fileID: 41060956}
|
||||
Generate1: 0
|
||||
Generate2: 0
|
||||
Generate3: 0
|
||||
MineSelection: {fileID: 2040560311427029885, guid: 128d8e441f9e4a3498635470755d4087, type: 3}
|
||||
Canvas: {fileID: 2055464620}
|
||||
itemlist: []
|
||||
mineritemlist: []
|
||||
--- !u!114 &2055464622
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -57,7 +57,7 @@ public class Scene_main_jiekou :MonoBehaviour
|
||||
Islandownerbidding islandownerbidding=new Islandownerbidding();
|
||||
petdraw petdraw = new petdraw();
|
||||
treeachievement treeachievement = new treeachievement();
|
||||
|
||||
miningActivatelist miningActivatelist = new miningActivatelist();
|
||||
|
||||
public static Scene_main_jiekou instance;
|
||||
|
||||
@ -405,4 +405,10 @@ public class Scene_main_jiekou :MonoBehaviour
|
||||
{
|
||||
return await forgingdatalist.ForgingdatalistInfo(key);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<miningActivatelistResponse> MiningActivatelists(int type)//ÀàÐÍ 0:±¦Ê¯µº 1:±¦Ê¯¿ó³¡ 10:½ð±Òµº 11:½ð±Ò¿ó³¡
|
||||
{
|
||||
return await miningActivatelist.MiningActivatelist(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ public class Scene_jinbikuang : MonoBehaviour
|
||||
|
||||
public List<GameObject> lands = new List<GameObject>();
|
||||
|
||||
List<roomcontroller> allroom = new List<roomcontroller>();
|
||||
|
||||
public GameObject Awaitmusk;
|
||||
void Awake()
|
||||
{
|
||||
@ -37,6 +39,7 @@ public class Scene_jinbikuang : MonoBehaviour
|
||||
foreach (MinngConfigData info in infos)
|
||||
{
|
||||
roomcontroller go = lands[index].GetComponent<roomcontroller>();
|
||||
allroom.Add(go);
|
||||
go.RoomId = info.id;
|
||||
go.ActivateValue = info.price;
|
||||
|
||||
@ -56,4 +59,7 @@ public class Scene_jinbikuang : MonoBehaviour
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,12 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public enum minerShip
|
||||
{
|
||||
miner,
|
||||
ship
|
||||
}
|
||||
public class Buyshipitem : MonoBehaviour
|
||||
{
|
||||
public Image head;
|
||||
@ -11,6 +17,10 @@ public class Buyshipitem : MonoBehaviour
|
||||
public Text prize;
|
||||
public Button Buybtn;
|
||||
public GameObject lands;
|
||||
public minerShip ship;
|
||||
|
||||
public jskPanel jsk;
|
||||
public jishadao_buy jishadao_Buy;
|
||||
void Start()
|
||||
{
|
||||
Buybtn.onClick.AddListener(BuyClick);
|
||||
@ -18,7 +28,17 @@ public class Buyshipitem : MonoBehaviour
|
||||
|
||||
void BuyClick()
|
||||
{
|
||||
lands.GetComponent<jishadao_contorl>().BuyActivation();
|
||||
if (ship == minerShip.ship)
|
||||
{
|
||||
lands.GetComponent<jishadao_contorl>().jsdbuy = this.jishadao_Buy;
|
||||
lands.GetComponent<jishadao_contorl>().BuyActivation();
|
||||
}
|
||||
else
|
||||
{
|
||||
lands.GetComponent<roomcontroller>().jsk = this.jsk;
|
||||
lands.GetComponent<roomcontroller>().BuyActivation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
@ -14,9 +14,13 @@ public class jskPanel : mount
|
||||
|
||||
public List<GameObject> lands = new List<GameObject>();
|
||||
|
||||
public bool Generate1 = false;
|
||||
public bool Generate2 = false;
|
||||
public bool Generate3 = false;
|
||||
public GameObject MineSelection;
|
||||
public Transform Canvas;
|
||||
|
||||
public List<GameObject> itemlist = new List<GameObject>();
|
||||
public List<GameObject> mineritemlist = new List<GameObject>();
|
||||
|
||||
GameObject obj;
|
||||
public override void Awake()
|
||||
{
|
||||
instance = this;
|
||||
@ -24,87 +28,95 @@ public class jskPanel : mount
|
||||
|
||||
public async void buy_ship()
|
||||
{
|
||||
// Cinemachine_2dCon.SetCameraContorl(false);
|
||||
//Debug.LogError("禁用生成船只逻辑");
|
||||
jishadao_contorl.canClick = false;
|
||||
List<BoxType> boxTypes = new List<BoxType>();
|
||||
int index = 1;
|
||||
|
||||
obj = Instantiate(MineSelection, Canvas);
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
boxTypes.Add(new BoxType { Name = index.ToString() + "文本", prompt = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "层", Type = 4, is_required = true });
|
||||
boxTypes.Add(new BoxType { Name = "捕鱼" + index.ToString(), prompt = "挖矿" + 1,prompt2 = "矿工"+(i+1),nametext1="剩余数量:"+ (lands[i].GetComponent<roomcontroller>().MaxShipNumber - lands[i].GetComponent<roomcontroller>().shipNumber), Type = 3, goldNumerobj = lands[i].GetComponent<roomcontroller>().ActivateValue.ToString(), icon = iconS[index - 1] });
|
||||
index++;
|
||||
GameObject ob = Instantiate(obj.GetComponent<ShipSelection>().Buyshipitem, obj.GetComponent<ShipSelection>().BuyshipConnact);
|
||||
itemlist.Add(ob);
|
||||
ob.GetComponent<Buyshipitem>().head.sprite = iconS[i];
|
||||
ob.GetComponent<Buyshipitem>().shipname.text = "矿工" + (i + 1);
|
||||
ob.GetComponent<Buyshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((i + 1).ToString()) + "层";
|
||||
ob.GetComponent<Buyshipitem>().Buynumber.text = "剩余数量:" + (lands[i].GetComponent<roomcontroller>().MaxShipNumber - lands[i].GetComponent<roomcontroller>().shipNumber).ToString();
|
||||
ob.GetComponent<Buyshipitem>().prize.text = lands[i].GetComponent<roomcontroller>().ActivateValue.ToString();
|
||||
ob.GetComponent<Buyshipitem>().lands = lands[i];
|
||||
ob.GetComponent<Buyshipitem>().ship = minerShip.miner;
|
||||
ob.GetComponent<Buyshipitem>().jsk = this;
|
||||
}
|
||||
InitminerItem();
|
||||
}
|
||||
|
||||
|
||||
async void InitminerItem()
|
||||
{
|
||||
miningActivatelistResponse response = await Scene_main_jiekou.instance.MiningActivatelists(11);
|
||||
for (int i = 0; i < response.data.Length; i++)
|
||||
{
|
||||
GameObject item = Instantiate(obj.GetComponent<ShipSelection>().Myshipitem, obj.GetComponent<ShipSelection>().myshipConnact);
|
||||
mineritemlist.Add(item);
|
||||
switch (response.data[i].mining_level)
|
||||
{
|
||||
case 1:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[0];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "矿工1";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((1).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 2:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[1];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "矿工2";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((2).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 3:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[2];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "矿工3";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((3).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 4:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[3];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "矿工4";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((4).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 5:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[4];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "矿工5";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((5).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GameObject gameObject = add_pop_up();
|
||||
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//设置最低高度
|
||||
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(1);//设置滚动模式为滚动
|
||||
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为自动填充
|
||||
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "购买人才");//测试输入框回调处理
|
||||
|
||||
gameObject.GetComponent<input_box_pop_up_window>().OnEnd += () =>
|
||||
{
|
||||
//关闭摄像头逻辑
|
||||
// Cinemachine_2dCon.SetCameraContorl(true);
|
||||
jishadao_contorl.canClick = true;
|
||||
};
|
||||
|
||||
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
if (!Generate1)
|
||||
{
|
||||
lands[0].GetComponent<roomcontroller>().BuyActivation();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
gameObjects[3].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
if (!Generate1)
|
||||
{
|
||||
|
||||
lands[1].GetComponent<roomcontroller>().BuyActivation();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
gameObjects[5].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
if (!Generate1)
|
||||
{
|
||||
lands[2].GetComponent<roomcontroller>().BuyActivation();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
gameObjects[7].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
if (!Generate1)
|
||||
{
|
||||
lands[3].GetComponent<roomcontroller>().BuyActivation();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
gameObjects[9].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
if (!Generate1)
|
||||
{
|
||||
lands[4].GetComponent<roomcontroller>().BuyActivation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void UpdateminerItem()
|
||||
{
|
||||
foreach (GameObject bj in mineritemlist)
|
||||
{
|
||||
Destroy(bj);
|
||||
}
|
||||
mineritemlist.Clear();
|
||||
|
||||
InitminerItem();
|
||||
}
|
||||
|
||||
public async void Updataitem()
|
||||
{
|
||||
List<MinngConfigData> infos = await miner_jiekou.instance.GetMinerInfo(11);
|
||||
|
||||
for (int i = 0; i < itemlist.Count; i++)
|
||||
{
|
||||
itemlist[i].GetComponent<Buyshipitem>().Buynumber.text = "剩余数量:" + (infos[i].activate_limit - infos[i].activate_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public class roomcontroller : MonoBehaviour
|
||||
public int shipNumber;
|
||||
public int MaxShipNumber = 10;
|
||||
|
||||
public jskPanel jsk;
|
||||
public int ShipNumber
|
||||
{
|
||||
get => shipNumber;
|
||||
@ -117,6 +118,9 @@ public class roomcontroller : MonoBehaviour
|
||||
if (await ActivationRoom())
|
||||
{
|
||||
add_fish();
|
||||
|
||||
jsk.Updataitem();
|
||||
jsk.UpdateminerItem();
|
||||
this.ShipNumber += 1;
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ public class jishadao_buy :mount
|
||||
public GameObject shipSelection;
|
||||
public Transform Canvas;
|
||||
|
||||
public bool Generate1 = false;
|
||||
public bool Generate2 = false;
|
||||
public bool Generate3 = false;
|
||||
public List<GameObject> itemlist = new List<GameObject>();
|
||||
public List<GameObject> mineritemlist = new List<GameObject>();
|
||||
|
||||
GameObject obj;
|
||||
public override void Awake()
|
||||
{
|
||||
instance = this;
|
||||
@ -28,78 +29,82 @@ public class jishadao_buy :mount
|
||||
|
||||
public async void buy_ship()
|
||||
{
|
||||
//// Cinemachine_2dCon.SetCameraContorl(false);
|
||||
////Debug.LogError("禁用生成船只逻辑");
|
||||
//jishadao_contorl.canClick = false;
|
||||
//List<BoxType> boxTypes = new List<BoxType>();
|
||||
obj = Instantiate(shipSelection, Canvas);
|
||||
|
||||
//int index = 1;
|
||||
//for (int i = 0; i < 3; i++)
|
||||
//{
|
||||
// boxTypes.Add(new BoxType { Name = index.ToString() + "文本", prompt = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "层", Type = 4, is_required = true });
|
||||
// boxTypes.Add(new BoxType { Name = "捕鱼" + index.ToString(), prompt = "捕鱼" + 1, prompt2 = "捕鱼船" + (i + 1), nametext1 = "剩余数量:" + (lands[i].GetComponent<jishadao_contorl>().MaxShipNumber - lands[i].GetComponent<jishadao_contorl>().shipNumber), Type = 3, goldNumerobj = lands[i].GetComponent<jishadao_contorl>().ActivateValue.ToString(), icon = iconS[index - 1] });
|
||||
// index++;
|
||||
//}
|
||||
|
||||
//GameObject gameObject = add_pop_up();
|
||||
//gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//设置最低高度
|
||||
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(1);//设置滚动模式为滚动
|
||||
////gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为自动填充
|
||||
//List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "购买人才");//测试输入框回调处理
|
||||
|
||||
//gameObject.GetComponent<input_box_pop_up_window>().OnEnd += () =>
|
||||
//{
|
||||
// //关闭摄像头逻辑
|
||||
// // Cinemachine_2dCon.SetCameraContorl(true);
|
||||
// jishadao_contorl.canClick = true;
|
||||
//};
|
||||
GameObject obj = Instantiate(shipSelection, Canvas);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
GameObject ob = Instantiate(obj.GetComponent<ShipSelection>().Buyshipitem, obj.GetComponent<ShipSelection>().BuyshipConnact);
|
||||
itemlist.Add(ob);
|
||||
ob.GetComponent<Buyshipitem>().jishadao_Buy = this;
|
||||
ob.GetComponent<Buyshipitem>().head.sprite = iconS[i];
|
||||
ob.GetComponent<Buyshipitem>().shipname.text = "²¶Óã´¬" + (i + 1);
|
||||
ob.GetComponent<Buyshipitem>().Layernumber.text = "µÚ" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((i + 1).ToString()) + "²ã";
|
||||
ob.GetComponent<Buyshipitem>().Buynumber.text ="Ê£ÓàÊýÁ¿:"+ (lands[i].GetComponent<jishadao_contorl>().MaxShipNumber - lands[i].GetComponent<jishadao_contorl>().shipNumber).ToString();
|
||||
ob.GetComponent<Buyshipitem>().prize.text = lands[i].GetComponent<jishadao_contorl>().ActivateValue.ToString();
|
||||
ob.GetComponent<Buyshipitem>().lands = lands[i];
|
||||
ob.GetComponent<Buyshipitem>().ship = minerShip.ship;
|
||||
}
|
||||
|
||||
|
||||
//gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
//{
|
||||
// if (type == 1)
|
||||
// {
|
||||
// if (!Generate1)
|
||||
// {
|
||||
// lands[0].GetComponent<jishadao_contorl>().BuyActivation();
|
||||
// }
|
||||
// }
|
||||
|
||||
//});
|
||||
//gameObjects[3].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
//{
|
||||
// if (type == 1)
|
||||
// {
|
||||
// if (!Generate1)
|
||||
// {
|
||||
// lands[1].GetComponent<jishadao_contorl>().BuyActivation();
|
||||
// }
|
||||
// }
|
||||
|
||||
//});
|
||||
//gameObjects[5].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||||
//{
|
||||
// if (type == 1)
|
||||
// {
|
||||
// if (!Generate1)
|
||||
// {
|
||||
// lands[2].GetComponent<jishadao_contorl>().BuyActivation();
|
||||
// }
|
||||
// }
|
||||
|
||||
//});
|
||||
InitminerItem();
|
||||
|
||||
}
|
||||
|
||||
async void InitminerItem()
|
||||
{
|
||||
miningActivatelistResponse response = await Scene_main_jiekou.instance.MiningActivatelists(10);
|
||||
for (int i = 0; i < response.data.Length; i++)
|
||||
{
|
||||
GameObject item = Instantiate(obj.GetComponent<ShipSelection>().Myshipitem, obj.GetComponent<ShipSelection>().myshipConnact);
|
||||
mineritemlist.Add(item);
|
||||
switch (response.data[i].mining_level)
|
||||
{
|
||||
case 1:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[0];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "捕鱼船1";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((1).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 2:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[1];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "捕鱼船2";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((2).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
case 3:
|
||||
item.GetComponent<Myshipitem>().head.sprite = iconS[2];
|
||||
item.GetComponent<Myshipitem>().shipname.text = "捕鱼船3";
|
||||
item.GetComponent<Myshipitem>().Layernumber.text = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers((3).ToString()) + "层";
|
||||
item.GetComponent<Myshipitem>().Yieldnumber.text = response.data[i].surplus_yield.ToString();
|
||||
item.GetComponent<Myshipitem>().Daynumber.text = response.data[i].surplus_count.ToString() + "天";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void UpdateminerItem()
|
||||
{
|
||||
foreach (GameObject bj in mineritemlist)
|
||||
{
|
||||
Destroy(bj);
|
||||
}
|
||||
mineritemlist.Clear();
|
||||
|
||||
InitminerItem();
|
||||
}
|
||||
|
||||
public async void Updataitem()
|
||||
{
|
||||
List<MinngConfigData> infos = await miner_jiekou.instance.GetMinerInfo(10);
|
||||
|
||||
for (int i = 0; i < infos.Count; i++)
|
||||
{
|
||||
itemlist[i].GetComponent<Buyshipitem>().Buynumber.text = "剩余数量:" + (infos[i].activate_limit - infos[i].activate_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ public class jishadao_contorl : MonoBehaviour
|
||||
public float restTimer = 5f;
|
||||
|
||||
|
||||
public jishadao_buy jsdbuy;
|
||||
|
||||
[Header("显示金币数量")]
|
||||
public Text goldNumerTextPro;
|
||||
[Header("显示船只数量")]
|
||||
@ -111,6 +113,9 @@ public class jishadao_contorl : MonoBehaviour
|
||||
if (await ActivationRoom())
|
||||
{
|
||||
add_fish();
|
||||
jsdbuy.Updataitem();
|
||||
jsdbuy.UpdateminerItem();
|
||||
|
||||
scene_jingshadao.instance.updatanumber();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public class miningActivatelist : MonoBehaviour
|
||||
{
|
||||
public Dictionary<string, string> CreateHeaders()
|
||||
{
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
|
||||
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<miningActivatelistResponse> MiningActivatelist(int type)//类型 0:宝石岛 1:宝石矿场 10:金币岛 11:金币矿场
|
||||
{
|
||||
string response = await myWeb.SendRequest(myWeb.URL + "/api/mining/activate_list?type=" + type, "GET", "{}", CreateHeaders());
|
||||
Debug.Log("矿场激活列表" + response);
|
||||
miningActivatelistResponse miningActivatelistResponse = JsonConvert.DeserializeObject<miningActivatelistResponse>(response);
|
||||
return miningActivatelistResponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class miningActivatelistData
|
||||
{
|
||||
public int id;
|
||||
public int mining_id;
|
||||
public string mining_name;
|
||||
public int mining_level;
|
||||
public int mining_type;
|
||||
public int surplus_count;
|
||||
public float surplus_yield;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class miningActivatelistResponse:myResponse
|
||||
{
|
||||
public miningActivatelistData[] data;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 002d2a46d16578d43b563973fb28263a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user