コード例 #1
0
        public static PmxMorphOffset Parse(BinaryReader br, PmxDocument doc, PmxMorphKind kind)
        {
            PmxMorphOffset rt;

            switch (kind)
            {
            case PmxMorphKind.Group:
                rt = new PmxGroupMorphOffset();

                break;

            case PmxMorphKind.Vertex:
                rt = new PmxVertexMorphOffset();

                break;

            case PmxMorphKind.Bone:
                rt = new PmxBoneMorphOffset();

                break;

            case PmxMorphKind.UV:
                rt = new PmxUVMorphOffset();

                break;

            case PmxMorphKind.AdditionalUV1:
                rt = new PmxUVMorphOffset();

                break;

            case PmxMorphKind.AdditionalUV2:
                rt = new PmxUVMorphOffset();

                break;

            case PmxMorphKind.AdditionalUV3:
                rt = new PmxUVMorphOffset();

                break;

            case PmxMorphKind.AdditionalUV4:
                rt = new PmxUVMorphOffset();

                break;

            case PmxMorphKind.Material:
                rt = new PmxMaterialMorphOffset();

                break;

            case PmxMorphKind.Flip:
                rt = new PmxFlipMorphOffset();

                break;

            case PmxMorphKind.Impulse:
                rt = new PmxImpulseMorphOffset();

                break;

            default:
                throw new ArgumentException();
            }

            rt.Read(br, doc);

            return(rt);
        }
コード例 #2
0
ファイル: PmxMorphOffset.cs プロジェクト: mfakane/Keystone
        public static PmxMorphOffset Parse(BinaryReader br, PmxDocument doc, PmxMorphKind kind)
        {
            PmxMorphOffset rt;

            switch (kind)
            {
                case PmxMorphKind.Group:
                    rt = new PmxGroupMorphOffset();

                    break;
                case PmxMorphKind.Vertex:
                    rt = new PmxVertexMorphOffset();

                    break;
                case PmxMorphKind.Bone:
                    rt = new PmxBoneMorphOffset();

                    break;
                case PmxMorphKind.UV:
                    rt = new PmxUVMorphOffset();

                    break;
                case PmxMorphKind.AdditionalUV1:
                    rt = new PmxUVMorphOffset();

                    break;
                case PmxMorphKind.AdditionalUV2:
                    rt = new PmxUVMorphOffset();

                    break;
                case PmxMorphKind.AdditionalUV3:
                    rt = new PmxUVMorphOffset();

                    break;
                case PmxMorphKind.AdditionalUV4:
                    rt = new PmxUVMorphOffset();

                    break;
                case PmxMorphKind.Material:
                    rt = new PmxMaterialMorphOffset();

                    break;
                case PmxMorphKind.Flip:
                    rt = new PmxFlipMorphOffset();

                    break;
                case PmxMorphKind.Impulse:
                    rt = new PmxImpulseMorphOffset();

                    break;
                default:
                    throw new ArgumentException();
            }

            rt.Read(br, doc);

            return rt;
        }