【UNITY3D 游戏开发之三】NGUI && HUDText 的练习源码及资源

不知道有多久没写博客了,竟然有种怀念的感觉 = =。

从今天开始呢,我会陆续更新一些U3D的小教程,主要以备注交流的心态来写了,原因如下:

1. 我也是u3d新手,只能给童鞋们简单的总结一些东西。或者说是备注给自己的小文章吧。

2. u3d学习资料现在网络上多到不想找到都难了程度,所以也没必要赘述一些大家知道的。

3. 由于Himi也是处于学习阶段,更多的时间还是放在学习上,写博的时间会相对少一些。

对于NGUI和HUDText 的学习,Himi也学习了几天,总体而言,比较简单,毕竟是设计2D UI的插件(现在u3d也有新版的UGUI)。

具体NGUI这里不进行讲解了,Himi这里整理了常用控件放出来,需要的同学可以下载交流学习下:

整理的控件有如下:

包括常用的 文本,拖动,缩放,动画,特效,进度条,输入框,CD效果的实现,选择框,多选组建等

这里是个简单实现游戏人物背包的功能,能拖拽交换位置,随机创建一个物品,物品叠加。

这里是实现了一个类似聊天的聊天框功能,包括输入框,滚动文本,滚动条~

    最后这个是实现人物血量显示、加血扣血的效果跟随主角功能~

这些都是一个Scene中的,只是不同的Panel上,所以大家需要看哪个组建可以自行在u3d中对不同的Panel 设置Active显示,然后运行即可看到效果。

资源下载: http://vdisk.weibo.com/s/yZxRoLm4W0FRD

由于Himi也在初学者,可能有错误的地方,希望各位评论指正~

转载自【黑米GameDev街区】 原文链接: http://www.himigame.com/unity3d-game/1584.html 

 【关于我们】

才淇(微信公众号:caiqicehua),专注于国内各大互联网公司社会招聘内推。每天更新最新互联网名企(包括但不限于今日头条、网易游戏、BAT、网易互联网、小米、京东、乐视、携程等名企)内推信息,有技术岗、有产品岗、有运营岗、有设计岗、有交互岗、有销售岗,更有其他N多相关岗位!更多内推信息请扫描以下二维码关注查阅。

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
-------------------------------------------------- NGUI: HUD Text Copyright 漏 2012-2014 Tasharen Entertainment Version 1.11 http://www.tasharen.com/forum/index.php?topic=997.0 -------------------------------------------------- Thank you for buying NGUI HUD Text! This version of HUDText has been tested with NGUI 3.4.9 If you have NGUI 2.7.0 or earlier, delete the Examples and Scripts folders, then import the contents of the hudtext_ngui270.unitypackage instead. ---------------------------------------------- !! IMPORTANT NOTE !! ---------------------------------------------- Upon importing this package into a brand-new project, you will get compile errors unless that project already has NGUI present! You'll need to import NGUI as well. If you don't have NGUI, but still want to use HUDText, then I am guessing you didn't read the package's description! But... you can still use HUDText. Get in touch with me via support@tasharen.com and I will hook you up. ---------------------------------------------- Usage: 1. Attach the HUDText script to a game object underneath your UIRoot and set the font it should use. 2. To make it follow an object drawn with another camera, attach UIFollowTarget to the same object and set its target. 3. From code, use HUDText's Add() function to add new floating text entries. You can also tweak the splines on the HUDText script, changing the motion of the text as you see fit. Video: http://www.youtube.com/watch?v=diql3UP1KQM ---------------------------------------------- Example Usage: ---------------------------------------------- HUDText hudText = GetComponent<HUDText>(); // This will show damage of 123 in red, and the message will immediately start moving. hudText.Add(-123f, Color.red, 0f); // This will show "Hello World!" and make it stay on the screen for 1 second before moving hudText.Add("Hello World!", Color.white, 1f); // If you don't want your numeric damage values to be added up, pass them as a string instead: float myDamage = 123f; hudText.Add(myDamage.ToString(), Color.red, 1f); ---------------------------------------------- If you have any questions, suggestions, comments or feature requests, please drop by the forums, found here: http://www.tasharen.com/forum/index.php?topic=997.0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值