当前位置: 首页 > news >正文

外贸公司应该怎样做外贸网站wordpress 需要zend

外贸公司应该怎样做外贸网站,wordpress 需要zend,wordpress高校主题,网站高端我们打开上一篇62QFrameWork背包框架的项目, 上文将功能实现在一个脚本中 本章要做的事情让脚本实现背包框架思想 首先按照图示创建脚本: 创建脚本:Item.cs namespace QFramework {public class Item{//道具public string Key;public string …

我们打开上一篇62QFrameWork背包框架的项目,

上文将功能实现在一个脚本中

本章要做的事情让脚本实现背包框架思想

首先按照图示创建脚本:

创建脚本:Item.cs

namespace QFramework {public class Item{//道具public string Key;public string Name;public Item(string key, string name){Key = key;Name = name;}}
}

创建脚本:Slot.cs

namespace QFramework {//插槽格子Slotpublic class Slot{public Item Item;public int Count;public Slot(Item item, int count){Item = item;Count = count;}}
}

创建脚本:QFramework.cs

using System.Collections.Generic;
namespace QFramework {public class ItemKit{//数据public static Item Item1 = new("item_1", "物品1");public static Item Item2 = new("item_2", "物品2");public static Item Item3 = new("item_3", "物品3");public static Item Item4 = new("item_4", "物品4");public static Item Item5 = new("item_5", "物品5");//插槽格子Slot列表public static List<Slot> Slots = new List<Slot>() {new Slot(Item1,1),new Slot(Item2,10),new Slot(Item3,1),new Slot(Item4,1),};//根据Key获取Itempublic static Dictionary<string, Item> ItemByKey = new Dictionary<string, Item>() {{ Item1.Key,Item1 },{ Item2.Key,Item2 },{ Item3.Key,Item3 },{ Item4.Key,Item4 },{ Item5.Key,Item5 },};//获取道具方法//Slot FindSlotByKey(string itemKey) {//    return mSlots.Find(s => s.Item != null && s.Item.Key == itemKey && s.Count != 0);//}//获取道具方法public static Slot FindSlotByKey(string itemKey) => ItemKit.Slots.Find(s => s.Item != null && s.Item.Key == itemKey && s.Count != 0);//获取空格子方法public static Slot FindEmptySlot() => ItemKit.Slots.Find(s => s.Count == 0);//可以增加格子方法public static Slot FindAddableSlot(string itemKey){var slot = FindSlotByKey(itemKey);if (slot == null){slot = FindEmptySlot();if (slot != null)slot.Item = ItemKit.ItemByKey[itemKey];}return slot;}//增加道具方法public static bool AddItem(string itemKey, int addCount = 1){var slot = FindAddableSlot(itemKey);if (slot == null)return false;elseslot.Count += addCount;return true;}//减少道具方法public static bool SubItem(string itemKey, int subCount = 1){var slot = FindSlotByKey(itemKey);if (slot != null){slot.Count -= subCount;return true;}return false;}}
}

修改脚本:InventoryExample1.cs

using UnityEngine;
namespace QFramework.Example{public partial class InventoryExample1 : ViewController {void OnGUI(){//调用IM帮助类的设置设计分辨率函数IMGUIHelper.SetDesignResolution(640,360);foreach (var slot in ItemKit.Slots) {//创建一个"box"类型的水平布局图形用户界面GUILayout.BeginHorizontal("box");if (slot.Count == 0)GUILayout.Label($"格子:空");else//在水平布局图形用户界面中添加一个标签GUILayout.Label($"格子:{slot.Item.Name} x {slot.Count}");//结束水平布局组GUILayout.EndHorizontal();}GUILayout.BeginHorizontal();GUILayout.Label("物品1");//创建一个按钮 - 增加if (GUILayout.Button("+")){if (!ItemKit.AddItem("item_1"))Debug.Log("物品栏已满");}//减少if (GUILayout.Button("-")){ ItemKit.SubItem("item_1"); }GUILayout.EndHorizontal();GUILayout.BeginHorizontal();GUILayout.Label("物品2");//创建一个按钮 - 增加if (GUILayout.Button("+")) {if (!ItemKit.AddItem("item_2"))Debug.Log("物品栏已满");}//减少if (GUILayout.Button("-")) { ItemKit.SubItem("item_2"); }GUILayout.EndHorizontal();GUILayout.BeginHorizontal();GUILayout.Label("物品3");//创建一个按钮 - 增加if (GUILayout.Button("+")) {if (!ItemKit.AddItem("item_3"))Debug.Log("物品栏已满");}//减少if (GUILayout.Button("-")) { ItemKit.SubItem("item_3"); }GUILayout.EndHorizontal();GUILayout.BeginHorizontal();GUILayout.Label("物品4");//创建一个按钮 - 增加if (GUILayout.Button("+")) {if (!ItemKit.AddItem("item_4"))Debug.Log("物品栏已满");}//减少if (GUILayout.Button("-")) { ItemKit.SubItem("item_4"); }GUILayout.EndHorizontal();GUILayout.BeginHorizontal();GUILayout.Label("物品5");//创建一个按钮 - 增加if (GUILayout.Button("+")) {if (!ItemKit.AddItem("item_5"))Debug.Log("物品栏已满");}//减少if (GUILayout.Button("-")) { ItemKit.SubItem("item_5"); }GUILayout.EndHorizontal();}}
}

本章做了让脚本实现背包框架思想

接下来的文章内容:

1.QFrameWork道具栏物品生成

2.窗口可拖拽脚本

3.点击名称寻找地点功能

4.隐藏怪物的生成

5.怪物I攻击范围内的主动攻击

6.掉落坐骑蛋的获取

7.异步传送转换场景

以及开放回合制、坐骑系统、宠物系统、背包系统、神炼系统、商城系统、Boss的目标跟随任务导航系统以及UI播放3D动画效果等等。

具体项目运行效果请关注water1024的b站视频项目演示《破碎纪元》

【Unity回合2.5D】破碎纪元_单机游戏热门视频 (bilibili.com)icon-default.png?t=O83Ahttps://www.bilibili.com/video/BV1rZY4e9Ebs/?spm_id_from=333.999.0.0&vd_source=547091a95b03acfa8e8a9e46ef499cd6

http://www.yayakq.cn/news/780072/

相关文章:

  • 视频多的网站建设湖南长沙微信平台号
  • 提供网站空间服务器怎么开发属于自己的app软件
  • indesign做网站网站标题优化怎么做
  • d网站建设的目的小程序公司开发
  • 桐城58网站在那里做网站开发一键上架淘宝
  • 建盏公司官方网站购物网站个人中心模板
  • 德州网站制作哪家好全网营销图片
  • 西安模板做网站老外做摄影网站花多少钱
  • 白云外贸型网站建设淘宝网发布网站建设
  • 云阳有没有做网站的北京网络法庭
  • 地图定位网站开发网站简繁切换js
  • 自己做网站需要什么技能佛山营销型网站
  • 口腔医院网站做优化做饲料机的川工网站
  • 北京网站建设公司哪家好网页设计与制作简历
  • 网站服务器多少钱网站备案时核验单
  • 网站建设费用能否计入广告费拟一份饰品网站建设合同
  • 网站开发工具最适合专门做餐饮运营的网站
  • 博客推广那个网站列好北京改网站
  • 电子商务网站开发与建设34线城市做网站推广
  • 现在清算组备案在哪个网站做上海搬家公司价目表
  • 扬州市城市建设投资公司网站连云港网站建设电话
  • 咸阳做网站开发公司网站开发所需具备的基础
  • 网站开发网页ui设计公司商城模板
  • 怎么做图片展示网站做新房网站怎么弄
  • 偃师建网站那家公司好本地电脑搭建服务器
  • 做网站免费的域名网站维护运营
  • 网站功能需求怎么写铁岭做网站公司信息
  • 做手机网站的公司wordpress 女性主题
  • 东营远见网站建设公司建设银行网银盾官方网站下载
  • 做网站的需要花多少钱做网站建设优化的公司