Merge branch 'main' of http://192.168.2.19:3000/shurongsen/Cute_demon_attacks
This commit is contained in:
commit
4fd5b121c1
@ -3534,6 +3534,7 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 616677247}
|
- component: {fileID: 616677247}
|
||||||
- component: {fileID: 616677246}
|
- component: {fileID: 616677246}
|
||||||
|
- component: {fileID: 616677248}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: GameObject
|
m_Name: GameObject
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -3569,6 +3570,18 @@ Transform:
|
|||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 10
|
m_RootOrder: 10
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &616677248
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 616677245}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1e00e010e22b19d4f87d0a1463802854, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &620653246
|
--- !u!1 &620653246
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -44,7 +44,7 @@ public class Item//
|
|||||||
public List<float> ReferrerBouns;
|
public List<float> ReferrerBouns;
|
||||||
public string CreateDateTime;
|
public string CreateDateTime;
|
||||||
}
|
}
|
||||||
public class VoucherItem//返回的代金卷数据
|
public class VoucherItem:Res//返回的代金卷数据
|
||||||
{
|
{
|
||||||
public string Id;
|
public string Id;
|
||||||
public int Num;
|
public int Num;
|
||||||
@ -57,6 +57,26 @@ public class VoucherItem//
|
|||||||
public float EndureTime;
|
public float EndureTime;
|
||||||
public string CreateDateTime;
|
public string CreateDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AllVocherItem
|
||||||
|
{
|
||||||
|
public string Id;
|
||||||
|
public string GeneratorId;
|
||||||
|
public string OwnerId;
|
||||||
|
public float Type;
|
||||||
|
public float Num;
|
||||||
|
public bool IsUsed;
|
||||||
|
public bool IsAdmin;
|
||||||
|
public string UsedDateTime;
|
||||||
|
public string CreateDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class AllVocherItemRes : Res {
|
||||||
|
public object Ids;
|
||||||
|
public AllVocherItem[] List;
|
||||||
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Response : Res//挖矿精灵数据
|
public class Response : Res//挖矿精灵数据
|
||||||
{
|
{
|
||||||
|
40
meng_yao/Assets/script/ConnactServer/Get_a_voucher.cs
Normal file
40
meng_yao/Assets/script/ConnactServer/Get_a_voucher.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Get_a_voucher : mount
|
||||||
|
{
|
||||||
|
|
||||||
|
List<AllVocherItem> Wakuanglist = new List<AllVocherItem>();
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
InvokeRepeating("ExecuteTask", 1.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void iii()
|
||||||
|
{
|
||||||
|
Login login = new Login();
|
||||||
|
login.Phone = "123";
|
||||||
|
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async void ExecuteTask()
|
||||||
|
{
|
||||||
|
string userponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
|
||||||
|
Debug.Log(userponse);
|
||||||
|
AllVocherItemRes itemList = JsonUtility.FromJson<AllVocherItemRes>(userponse);
|
||||||
|
Debug.Log(itemList.List);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
meng_yao/Assets/script/ConnactServer/Get_a_voucher.cs.meta
Normal file
11
meng_yao/Assets/script/ConnactServer/Get_a_voucher.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1e00e010e22b19d4f87d0a1463802854
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -37,7 +37,7 @@ public class JinShaBuy : mount
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Show_buy(string IconPath,int CurrencyId)//¹ºÂòµ¯´°
|
public void Show_buy(string IconPath,int CurrencyId,int Num)//¹ºÂòµ¯´°
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -97,12 +97,15 @@ public class JinShaBuy : mount
|
|||||||
}
|
}
|
||||||
else if (type == 1)
|
else if (type == 1)
|
||||||
{
|
{
|
||||||
string response = await web.SendRequest("http://47.109.133.52/MinerElf/GetList", "POST");
|
Debug.Log(Num);
|
||||||
|
GenerateForFisherElf generateForFisherElf = new GenerateForFisherElf(); // ¹ºÂò¿ó¹¤
|
||||||
|
generateForFisherElf.Num = Num;
|
||||||
|
generateForFisherElf.Count =Convert.ToInt32( boxTypes[1].content);
|
||||||
|
//Debug.Log(generateForFisherElf);
|
||||||
|
string response = await web.SendRequest(web.URL+ "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf));
|
||||||
Debug.Log(response);
|
Debug.Log(response);
|
||||||
|
|
||||||
|
// Debug.Log(boxTypes[1].content);
|
||||||
|
|
||||||
Debug.Log(boxTypes[1].content);
|
|
||||||
//number = int.Parse(boxTypes[0].content);
|
//number = int.Parse(boxTypes[0].content);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,12 @@ public class AssestPanel : MonoBehaviour
|
|||||||
async void ExecuteTask()
|
async void ExecuteTask()
|
||||||
{
|
{
|
||||||
|
|
||||||
string userponse = await web.SendRequest(web.URL + "/Player/GetInfo", "POST");
|
string userponse = await web.SendRequest(web.URL + "/Player/GetInfo", "POST");
|
||||||
|
//Debug.Log(userponse.ToString());
|
||||||
infopyler res = JsonUtility.FromJson<infopyler>(userponse);
|
infopyler res = JsonUtility.FromJson<infopyler>(userponse);
|
||||||
SetCoinText(res.Info.Gold);
|
SetCoinText(res.Info.Gold);
|
||||||
SetStoneText(res.Info.Gem);
|
SetStoneText(res.Info.Gem);
|
||||||
//SetCoinText(res.Info.Gold);
|
//SetForgingText(res.Info.Gold);
|
||||||
//SetCoinText(res.Info.Gold);
|
//SetCoinText(res.Info.Gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,106 +25,43 @@ public class jinsha : mount
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public int type = 0;
|
||||||
|
|
||||||
public async void buy_miners()//购买金币矿工界面
|
public async void buy_miners()//购买金币矿工界面
|
||||||
{
|
{
|
||||||
string jsonString = @"{
|
|
||||||
""List"": [
|
|
||||||
{
|
|
||||||
""Id"": 69,
|
|
||||||
""Num"": 1,
|
|
||||||
""Name"": ""红精灵"",
|
|
||||||
""ActivateValue"": 12,
|
|
||||||
""StoreValue"": 600,
|
|
||||||
""Yield"": 0.16,
|
|
||||||
""Limit"": 3,
|
|
||||||
""EndureTime"": 30,
|
|
||||||
""ReferrerBouns"": [1, 0.3],
|
|
||||||
""CreateDateTime"": ""2024-09-03T04:02:48.290196Z""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
""Id"": 70,
|
|
||||||
""Num"": 2,
|
|
||||||
""Name"": ""蓝精灵"",
|
|
||||||
""ActivateValue"": 60,
|
|
||||||
""StoreValue"": 3000,
|
|
||||||
""Yield"": 0.18,
|
|
||||||
""Limit"": 3,
|
|
||||||
""EndureTime"": 30,
|
|
||||||
""ReferrerBouns"": [1, 0.3],
|
|
||||||
""CreateDateTime"": ""2024-09-03T04:02:48.290196Z""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
""Id"": 71,
|
|
||||||
""Num"": 3,
|
|
||||||
""Name"": ""绿精灵"",
|
|
||||||
""ActivateValue"": 240,
|
|
||||||
""StoreValue"": 12000,
|
|
||||||
""Yield"": 0.2,
|
|
||||||
""Limit"": 2,
|
|
||||||
""EndureTime"": 30,
|
|
||||||
""ReferrerBouns"": [1, 0.3],
|
|
||||||
""CreateDateTime"": ""2024-09-03T04:02:48.290196Z""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
""Id"": 72,
|
|
||||||
""Num"": 4,
|
|
||||||
""Name"": ""黑精灵"",
|
|
||||||
""ActivateValue"": 1080,
|
|
||||||
""StoreValue"": 54000,
|
|
||||||
""Yield"": 0.22,
|
|
||||||
""Limit"": 1,
|
|
||||||
""EndureTime"": 30,
|
|
||||||
""ReferrerBouns"": [1, 0.3],
|
|
||||||
""CreateDateTime"": ""2024-09-03T04:02:48.290196Z""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
""Id"": 73,
|
|
||||||
""Num"": 5,
|
|
||||||
""Name"": ""黄精灵"",
|
|
||||||
""ActivateValue"": 2160,
|
|
||||||
""StoreValue"": 54000,
|
|
||||||
""Yield"": 0.25,
|
|
||||||
""Limit"": 1,
|
|
||||||
""EndureTime"": 30,
|
|
||||||
""ReferrerBouns"": [1, 0.3],
|
|
||||||
""CreateDateTime"": ""2024-09-03T04:02:48.290196Z""
|
|
||||||
}
|
|
||||||
],
|
|
||||||
""ErrorCode"": 0,
|
|
||||||
""ErrorMessage"": """"
|
|
||||||
}";
|
|
||||||
|
|
||||||
|
//测试用
|
||||||
|
Login login = new Login();
|
||||||
|
login.Phone = "1";
|
||||||
|
await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
|
||||||
|
////测试用
|
||||||
|
//Login login = new Login();
|
||||||
|
//login.Phone = "1";
|
||||||
|
//await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login));
|
||||||
|
|
||||||
|
Response response = new Response();
|
||||||
|
|
||||||
|
|
||||||
Response response = JsonUtility.FromJson<Response>(jsonString);
|
|
||||||
//关闭摄像头逻辑
|
//关闭摄像头逻辑
|
||||||
Cinemachine_2dCon.SetCameraContorl(false);
|
Cinemachine_2dCon.SetCameraContorl(false);
|
||||||
|
|
||||||
string userponse = await web.SendRequest("http://47.109.133.52/MinerElf/GetList", "POST");
|
string userponse = await web.SendRequest(web.URL+ "/MinerElf/GetList", "POST");
|
||||||
Debug.Log(userponse);
|
Debug.Log(userponse);
|
||||||
Response itemList = JsonUtility.FromJson<Response>(userponse);
|
Response itemList = JsonUtility.FromJson<Response>(userponse);
|
||||||
foreach (Item item in itemList.List)
|
|
||||||
{
|
|
||||||
|
|
||||||
Debug.Log(item.Type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<BoxType> boxTypes = new List<BoxType>();
|
List<BoxType> boxTypes = new List<BoxType>();
|
||||||
int index = 1;
|
int index = 1;
|
||||||
List<GameObject> list_kg = new List<GameObject>();//矿工
|
List<GameObject> list_kg = new List<GameObject>();//矿工
|
||||||
List<GameObject> list_sb = new List<GameObject>();//设备
|
List<GameObject> list_sb = new List<GameObject>();//设备
|
||||||
foreach (Item item in response.List)
|
foreach (Item item in itemList.List)
|
||||||
{
|
{
|
||||||
boxTypes.Add(new BoxType { Name = index.ToString()+ "文本", prompt = "第"+ ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "层", Type = 4, is_required = true });
|
if (type == item.Type)
|
||||||
boxTypes.Add(new BoxType { Name = "矿工" + index.ToString(), prompt = item.Name, Type = 3, icon = icons[index - 1] , customData = new BoxData<Item>(item) });
|
{
|
||||||
boxTypes.Add(new BoxType { Name = "挖矿设备" + index.ToString(), prompt = "挖矿设备·" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()), Type = 3, icon = toolsicons[0] });
|
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 = item.Name, Type = 3, icon = icons[index - 1], customData = new BoxData<Item>(item) });
|
||||||
|
boxTypes.Add(new BoxType { Name = "挖矿设备" + index.ToString(), prompt = "挖矿设备·" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()), Type = 3, icon = toolsicons[0] });
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
GameObject gameObject = add_pop_up();
|
GameObject gameObject = add_pop_up();
|
||||||
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//设置最低高度
|
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//设置最低高度
|
||||||
@ -139,8 +76,10 @@ public class jinsha : mount
|
|||||||
{
|
{
|
||||||
if (boxType.customData is BoxData<Item> intData)//通过储存的泛型来查找挖矿精灵对应的item数据
|
if (boxType.customData is BoxData<Item> intData)//通过储存的泛型来查找挖矿精灵对应的item数据
|
||||||
{
|
{
|
||||||
|
|
||||||
Item item = intData.GetTypedData();
|
Item item = intData.GetTypedData();
|
||||||
go.Show_buy(mount.mountitem.itemDataList[item.Id].IconPath,64);
|
go.Show_buy(mount.mountitem.itemDataList[item.Id].IconPath,64, item.Num);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -170,7 +109,7 @@ public class jinsha : mount
|
|||||||
List<BoxType> boxTypes = new List<BoxType>();//搜索到的用户添加到弹窗
|
List<BoxType> boxTypes = new List<BoxType>();//搜索到的用户添加到弹窗
|
||||||
for (int i = 0; i < itemList.List.Length; i++)
|
for (int i = 0; i < itemList.List.Length; i++)
|
||||||
{
|
{
|
||||||
boxTypes.Add(new BoxType { textName = "查找到的玩家",content = "lv."+itemList.List[i].Level.ToString(), prompt = itemList.List[i].Name, Type = 7 });
|
boxTypes.Add(new BoxType { textName = "查找到的玩家",content = "lv."+itemList.List[i].Level.ToString(), prompt = itemList.List[i].Name, Type = 7, customData = new BoxData<PlayerData>(itemList.List[i]) });
|
||||||
}
|
}
|
||||||
|
|
||||||
gameObjectitems = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "赠送好友");
|
gameObjectitems = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "赠送好友");
|
||||||
@ -182,6 +121,13 @@ public class jinsha : mount
|
|||||||
foreach (GameObject item in gameObjectitems)
|
foreach (GameObject item in gameObjectitems)
|
||||||
{
|
{
|
||||||
item.GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) => {
|
item.GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) => {
|
||||||
|
Debug.Log(boxType.customData);
|
||||||
|
if (boxType.customData is BoxData<PlayerData> intData)//通过储存的泛型来查找挖矿精灵对应的item数据
|
||||||
|
{
|
||||||
|
|
||||||
|
PlayerData pldata = intData.GetTypedData();
|
||||||
|
Debug.Log(pldata.Id);
|
||||||
|
}
|
||||||
|
|
||||||
List<BoxType> boxTypeser = new List<BoxType>();
|
List<BoxType> boxTypeser = new List<BoxType>();
|
||||||
boxTypeser.Add(new BoxType { Name = "account_number", textName = "二次确定", content = "1.请确认赠送的玩家身份\r\n2.免责声明:\r\n赠送及视为您已同意将该道具赠送于玩家,点击确认按钮后无法取消和撤回.\r\n3.请谨慎操作", Type = 9, is_required = true });
|
boxTypeser.Add(new BoxType { Name = "account_number", textName = "二次确定", content = "1.请确认赠送的玩家身份\r\n2.免责声明:\r\n赠送及视为您已同意将该道具赠送于玩家,点击确认按钮后无法取消和撤回.\r\n3.请谨慎操作", Type = 9, is_required = true });
|
||||||
@ -194,6 +140,7 @@ public class jinsha : mount
|
|||||||
if (type == 1)
|
if (type == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//赠送逻辑
|
//赠送逻辑
|
||||||
ercitanchuang.GetComponent<input_box_pop_up_window>().destroy();
|
ercitanchuang.GetComponent<input_box_pop_up_window>().destroy();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user