Creating EOS MMORPG part 3, inventory, 制造MMORPG第三步,库存

in #cn6 years ago (edited)


Hello Steemit friends, so this is part 3 of trying to create EOS MMORPG game, so today I have made the inventory where player can collect item after killing monster or cutting tree.

So in Unity the GUI system can do all of that by dragging below GUI object to the game

Canvas -> panel -> image -> button(clone 50 of these)

  1. We need to add content size fitter to the image so that later on we can do the vertical scroll bar(set vertical = preferred size)
  2. We also need to add grid layout group to the images so that it can arrange the 50 item inside it automatically(constraint fixed column count =4)
  3. For the button, we need to add layout element to it so that grid layout group can arrange them properly
  4. For the panel, we add scroll rect, then we drag image into it and also vertical scroll car into it so that we can scroll the inventory for more than 50 or 100 item
  5. We also need to add mask to the panel to hide image bigger than the panel
After these are done, then I created an array to store all item image, and load the item image to those button based on the array of item i get from the server

I think majority of the work will be preparing image for 100 or few hundred item

thanks for reading


大家好,这是第三步尝试做一个MMORPG,通常杀怪后会得到一些物品,然后放入库存

在Unity有一个GUI system可以很快速的完成这一项,先把以下的GUI object拉进游戏

Canvas -> panel -> image -> button(复制50个)

1。 首先image那边要加content size fitter 才能让这个库存有scroll bar(set vertical = preferred size)
2。然后image那边也要加grid layout group,那样就能自动偏排50个button的位置(constraint fixed column count =4)
3。button那边要加layout element那样才能被自动偏排
4。Panel那边加scroll rect,把image和scroll bar拉进去,这样的话这个库存就能scroll上和下,可以放50或100个item
5。最后panel那边加mask把多出来的image遮盖

这些完成后,我会把图全部放入array,然后再根据服务器给我的资料把相应的图放入对的button

其实呢多工的是要准备100或几百个item的图

谢谢阅读

  <br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : http://fundurian.vornix.blog/2018/09/25/creating-eos-mmorpg-part-3-inventory-%e5%88%b6%e9%80%a0mmorpg%e7%ac%ac%e4%b8%89%e6%ad%a5%e5%ba%93%e5%ad%98/ </em><hr/></center>

Sort:  

Hi, @fundurian. I'm a bot. It looks like you may have unclaimed rewards.

The Steem network rewards users for making posts and comments, and for voting on posts and comments. These rewards go into your rewards balance. Currently, you have 3.109 Steem, and 3.748 Steem Power in pending rewards.

You can claim your rewards by visiting your wallet page.

Just reply to this comment, if you need any help.
Don't want to receive these messages? Just reply, asking.

吃了吗?这是哪里?你是谁?我为什么会来这边?你不要给我点赞不要点赞,哈哈哈哈哈哈。假如我的留言打扰到你,请回复“取消”。

你真的是做游戏的专家 :)

不是专家啦,算新手

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63184.34
ETH 2560.17
USDT 1.00
SBD 2.72