博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Unity3D 序列帧
阅读量:1984 次
发布时间:2019-04-27

本文共 728 字,大约阅读时间需要 2 分钟。

接口 

public static GameObject createSpriteAni(GameObject parent,string sprName,string namePrefix,Vector3 size,

        Vector3 pos,UIAtlas atlas,int fps,bool loop,bool makePixelPerfect)
    {
        UISprite sprite = NGUITools.AddWidget<UISprite>(parent);
        sprite.name = sprName;
        sprite.atlas = atlas;
        sprite.spriteName = sprName;
        sprite.type = UISprite.Type.Simple;
        sprite.pivot = UIWidget.Pivot.Center;
        if(makePixelPerfect)
        {
            sprite.MakePixelPerfect();
        }
        else
        {
            sprite.width = (int)size.x;
            sprite.height = (int)size.y;
        }
        GameObject go = sprite.gameObject;
        UISpriteAnimation sprAni = go.AddComponent<UISpriteAnimation>();
        sprAni.framesPerSecond =fps;
        sprAni.namePrefix = namePrefix;
        sprAni.loop = loop;
        go.transform.localPosition = pos;
        return go;
    }

转载地址:http://xrzvf.baihongyu.com/

你可能感兴趣的文章
Go语言并发组件
查看>>
Go语言的并发模式
查看>>
Linux中如何优雅的删除被打开的文件
查看>>
从零开始学Linux内核-----从Unix到Linux
查看>>
Linux内核学习----进程管理
查看>>
linux内核学习-----进程调度
查看>>
算法实现----二分查找go语言实现
查看>>
Redis中面试常见的问题整理
查看>>
Linux学习---中断和中断处理
查看>>
YUV / RGB 格式及快速转换算法
查看>>
共享收集的图像处理方面的一些资源和网站
查看>>
图像基本知识
查看>>
CMarkup
查看>>
网络爬虫(蜘蛛)Scrapy,Python安装!
查看>>
38款 流媒体服务器开源软件
查看>>
Using GDB in Visual Studio
查看>>
网络时间协议简介-----NTP(Network Time Protocol)
查看>>
简析STUN协议
查看>>
Winsock服务器内存资源管理
查看>>
Winsock 完成端口模型简介
查看>>