Beispiel #1
0
    public AssetBundler setup(uint boss_id)
    {
        m_bSetup = false;
        AssetBundler assetBundler = AssetBundler.Create();

        assetBundler.SetAsUnitTexture(
            boss_id,
            (asset) =>
        {
            var tex2D = asset.GetUncompressedTexture2D();
            if (tex2D != null)
            {
                SpriteImage = Sprite.Create(tex2D, new Rect(0, 0, tex2D.width, tex2D.height), new Vector2(0.5f, 0.5f));
                SpriteColor = new Color(1, 1, 1, 1);
                SpriteSizeX = tex2D.GetUnitTextureWidth();
                SpriteSizeY = tex2D.GetUnitTextureHeight();
            }
            m_bSetup = true;
        });
        return(assetBundler);
    }