Exemplo n.º 1
0
        public PackingType Get(long PackingTypeID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@PackingType", PackingTypeID)
                };

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_PackingTypeByID", paramList);


                PackingType obj = new PackingType();


                obj.Type         = Convert.ToString(dt.Rows[0]["Type"]);
                obj.PackingID    = Convert.ToInt64(dt.Rows[0]["PackingID"]);
                obj.PackingTitle = Convert.ToString(dt.Rows[0]["PackingTitle"]);
                obj.PackingQty   = Convert.ToDecimal(dt.Rows[0]["PackingQty"]);
                obj.PackingUnit  = objUnit_DL.Get(Convert.ToInt64(dt.Rows[0]["PackingUnitID"]));


                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemplo n.º 2
0
        public FileEntry(string filename, ulong type, ulong osize, ulong timestamp, ulong datasize,
                         ulong startOffset = 0x0)
        {
            _fileName = filename;
            switch (type)
            {
            case 0x0:
                PackingMethod = PackingType.Uncompressed;
                break;

            case 0x43707273:
                PackingMethod = PackingType.Packed;
                break;

            case 0x56657273:     //Vers
                PackingMethod = PackingType.Uncompressed;
                break;

            case 0x456e6372:     //Encr
                PackingMethod = PackingType.Encrypted;
                break;
            }

            OriginalSize = osize;
            TimeStamp    = timestamp;
            DataSize     = datasize;
            StartOffset  = startOffset;
        }
Exemplo n.º 3
0
 public static CloudEntity<ContainerState> Container(string accountName, string snapshotId, DateTime created, ContainerType containerType, PackingType packingType, string liveName, string snapshotName)
 {
     return new ContainerState
            	{
                 AccountName = accountName,
                 SnapshotId = snapshotId,
                 Created = created,
                 ContainerType = containerType,
                 PackingType = packingType,
                 LiveName = liveName,
                 SnapshotName = snapshotName
            	}.ToCloudEntity();
 }
        public IPacking GetPacking(PackingType type)
        {
            switch (type)
            {
            case PackingType.BOTTLE:
                return(new Bottle());

            case PackingType.CUP:
                return(new Cup());

            case PackingType.WRAPPER:
            default:
                return(new Wrapper());
            }
        }
Exemplo n.º 5
0
        private Texture2D GetDefaultTexture(PackingType type)
        {
            switch (type)
            {
            case PackingType.White:
                return(Texture2D.whiteTexture);

            case PackingType.Black:
                return(Texture2D.blackTexture);

            case PackingType.Normal:
                return(Texture2D.normalTexture);
            }

            return(Texture2D.whiteTexture);
        }
Exemplo n.º 6
0
 public FileEntry(string filename, ulong type, ulong osize, ulong timestamp, ulong datasize, ulong unknown = 0x0)
 {
     _fileName = filename;
     switch (type)
     {
         case 0x43707273:
             PackingMethod = PackingType.Packed;
             break;
         case 0x0:
             PackingMethod = PackingType.Uncompressed;
             break;
     }
     OriginalSize = osize;
     TimeStamp = timestamp;
     DataSize = datasize;
     Unknown = unknown;
 }
Exemplo n.º 7
0
        public FileEntry(string filename, ulong type, ulong osize, ulong timestamp, ulong datasize, ulong unknown = 0x0)
        {
            _fileName = filename;
            switch (type)
            {
            case 0x43707273:
                PackingMethod = PackingType.Packed;
                break;

            case 0x0:
                PackingMethod = PackingType.Uncompressed;
                break;
            }
            OriginalSize = osize;
            TimeStamp    = timestamp;
            DataSize     = datasize;
            Unknown      = unknown;
        }
Exemplo n.º 8
0
        public int Update(PackingType obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@PackingTitle", obj.PackingTitle),
                    new SqlParameter("@Type", obj.Type),
                    new SqlParameter("@PackingUnitID", obj.PackingUnit.UnitID),
                    new SqlParameter("@PackingQty", obj.PackingQty),
                    new SqlParameter("@PackingID", obj.PackingID)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_PackingType", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemplo n.º 9
0
 public FileEntry(PboArchive parent, string filename, ulong type, ulong osize, ulong timestamp, ulong datasize, byte[] file, ulong unknown = 0x0)
 {
     _parentArchive = parent;
     _fileName = filename;
     OrgName = file;
     switch (type)
     {
         case 0x43707273:
             PackingMethod = PackingType.Packed;
             break;
         case 0x0:
             PackingMethod = PackingType.Uncompressed;
             break;
         case 0x56657273:
             PackingMethod = PackingType.Uncompressed;
             break;
     }
     OriginalSize = osize;
     TimeStamp = timestamp;
     DataSize = datasize;
     Unknown = unknown;
 }
Exemplo n.º 10
0
        public FileEntry(PboArchive parent, string filename, ulong type, ulong osize, ulong timestamp, ulong datasize, byte[] file, ulong unknown = 0x0)
        {
            _parentArchive = parent;
            _fileName      = filename;
            OrgName        = file;
            switch (type)
            {
            case 0x43707273:
                PackingMethod = PackingType.Packed;
                break;

            case 0x0:
                PackingMethod = PackingType.Uncompressed;
                break;

            case 0x56657273:
                PackingMethod = PackingType.Uncompressed;
                break;
            }
            OriginalSize = osize;
            TimeStamp    = timestamp;
            DataSize     = datasize;
            Unknown      = unknown;
        }
    void OnGUI()
    {
        GUILayout.BeginVertical();

        GUILayout.Space(5);

        if (AtlasPacking == PackingType.TexturePack)
        {
            EditorGUILayout.HelpBox("使用外部插件Texture Packer 打包的图集(Json)生成可用于富文本的图集数据", MessageType.Info);
        }
        else if (AtlasPacking == PackingType.Custom)
        {
            EditorGUILayout.HelpBox("使用自定义打包的图集生成可用于富文本的图集数据", MessageType.Info);
        }
        else if (AtlasPacking == PackingType.UnityPack)
        {
            EditorGUILayout.HelpBox("使用Unity Sprite Edtor打包的图集生成可用于富文本的图集数据", MessageType.Info);
        }

        AtlasPacking = (PackingType)EditorGUILayout.EnumPopup("生成方式", AtlasPacking);
        if (AtlasPacking == PackingType.TexturePack)
        {
            TexturePackGUI();
        }
        else if (AtlasPacking == PackingType.Custom)
        {
            CustomPackGUI();
        }
        else if (AtlasPacking == PackingType.UnityPack)
        {
            UnityPackGUI();
        }

        if (RichTextAsset != null)
        {
            this.ConsoleContent = string.Concat(new object[]
            {
                "生成富文本图集成功\n",
                string.Format("本次生成精灵数量:{0}\n", RichTextAsset.spriteInfoList.Count),
                string.Format("本次生成动画数量:{0}\n", RichTextAsset.animateList.Count),
            });
        }
        else
        {
            this.ConsoleContent = string.Concat(new object[]
            {
                "未生成富文本图集",
            });
        }


        GUILayout.Space(5f);
        GUILayout.BeginVertical("box", new GUILayoutOption[]
        {
            GUILayout.Height(80)
        });



        EditorGUILayout.LabelField(this.ConsoleContent, LabelStyle, new GUILayoutOption[0]);
        GUILayout.EndVertical();
        GUILayout.Space(5f);
        GUILayout.EndVertical();
    }