位置: 编程技术 - 正文
推荐整理分享Unity3D 进度条组件(unity进度条有百分比代码),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:unity进度条滑动数值,unity安装进度条不动,unity 视频进度条预览,unity 视频进度条预览,unity进度条有百分比代码,unity进度条有百分比代码,unity进度条有百分比代码,unity进度条有百分比代码,内容如对您有帮助,希望把文章链接给更多的朋友!
接口
public static GameObject createSprite(GameObject parent, string name, UIAtlas atlas, string spriteInAtlas, Vector3 size, Vector3 pos) { int depth = NGUITools.CalculateNextDepth(parent); UISprite sprite = NGUITools.AddWidget<UISprite>(parent); sprite.depth = depth; sprite.name = name; sprite.atlas = atlas; sprite.spriteName = spriteInAtlas; GameObject gameObject = sprite.gameObject; Transform transform = gameObject.transform; transform.localPosition = pos; sprite.width = (int)size.x; sprite.height = (int)size.y; return gameObject; }
public static GameObject createProgressBar(GameObject parent, string name, Vector3 pos, UIAtlas atlas,
string bgSpName, Vector3 bgSize, string fgSpName, Vector3 fgSize, bool makePixelPerfect) { int depth = NGUITools.CalculateNextDepth(parent); GameObject go = NGUITools.AddChild(parent); go.name = name; go.transform.localPosition = pos; UISprite bg = null; if (atlas.GetSprite(bgSpName) != null) { bg = go.AddComponent<UISprite>(); bg.depth = depth; bg.atlas = atlas; bg.spriteName = bgSpName; bg.width = (int)bgSize.x; bg.height = (int)bgSize.y; bg.type = UIBasicSprite.Type.Sliced; if (makePixelPerfect) { bg.MakePixelPerfect(); } } UISprite fg = createSprite(go, "foreground", atlas, fgSpName, fgSize, Vector3.zero).GetComponent<UISprite>(); fg.type = UIBasicSprite.Type.Sliced; fg.fillDirection = UIBasicSprite.FillDirection.Horizontal; if (makePixelPerfect) { fg.MakePixelPerfect(); } UISlider slider = go.AddComponent<UISlider>(); slider.value = 0f; slider.foregroundWidget = fg; slider.backgroundWidget = bg; slider.fillDirection = UIProgressBar.FillDirection.LeftToRight; return go; }}
调用createProgressBar,返回的GameObject获取UISlider组件,对value赋即可
unity 插件 UMA 2 Unity Multipurpose Avatar 手册翻译 UMA-UnityMultipurposeAvatar(UMA2的手冊跟1是一樣的)AvatarsgeneratedbyUMAframeworkWhatisUMA?UMA-UnityMultipurposeAvatar,isanopenavatarcreationframework,itprovidesbothbasecodeandexampleconten
u3d中脚本的知识点 一创建和使用脚本1概述GameObject的行为都是被附加到其上面的组件控制,脚本本质上也是一个组件。在unity中创建一个脚本,脚本通过实现一个派生自Mono
关于kinect和unity3d联合开发应用 两者结合的案例比较少,不过还是可以用中间插件来做的。在unity的资源商店里搜索kinect,然后搜索的结果会有免费的手势封装包,下载下来,里面会有
标签: unity进度条有百分比代码
本文链接地址:https://www.jiuchutong.com/biancheng/369284.html 转载请保留说明!上一篇:格斗游戏角色控制之U3D状态机的编写(角色格斗类游戏)
下一篇:unity 插件 UMA 2 Unity Multipurpose Avatar 手册翻译(unity 插件开发)
友情链接: 武汉网站建设