Exemple #1
0
        public static bool CreateTypedData(Guid typeGuid, out ExternalData result)
        {
#if NETSTANDARD1_3
            if (typeGuid == PhysicsDescriptionData.TYPE_GUID)
            {
                result = new PhysicsDescriptionData();
            }
            else
            {
                result = new ExternalData(typeGuid);
                return(false);
            }

            return(true);
#else
            if (guidToDataTypeMap.ContainsKey(typeGuid))
            {
                var constructor = guidToDataConstructorMap[typeGuid];
                result = (ExternalData)constructor.Invoke(null);
                return(true);
            }
            result = new ExternalData(typeGuid);
            return(false);
#endif
        }
Exemple #2
0
        public static bool CreateTypedData(Guid typeGuid, out ExternalData result)
        {
#if NETSTANDARD1_3
            if (typeGuid == MeshEditData.TYPE_GUID)
            {
                result = new MeshEditData();
            }
            if (typeGuid == VertexStreamData.TYPE_GUID)
            {
                result = new VertexStreamData();
            }
            if (typeGuid == EditmodeMiscData.TYPE_GUID)
            {
                result = new EditmodeMiscData();
            }
            if (typeGuid == TexturePixelData.TYPE_GUID)
            {
                result = new TexturePixelData();
            }
            if (typeGuid == TextureSourceInfoData.TYPE_GUID)
            {
                result = new TextureSourceInfoData();
            }
            if (typeGuid == TextureImportSettingsData.TYPE_GUID)
            {
                result = new TextureImportSettingsData();
            }
            if (typeGuid == PhysicsDescriptionData.TYPE_GUID)
            {
                result = new PhysicsDescriptionData();
            }
            if (typeGuid == PhysicsStaticCookData.TYPE_GUID)
            {
                result = new PhysicsStaticCookData();
            }
            if (typeGuid == PhysicsDynamicCookData.TYPE_GUID)
            {
                result = new PhysicsDynamicCookData();
            }
            if (typeGuid == SkeletonDefinitionData.TYPE_GUID)
            {
                result = new SkeletonDefinitionData();
            }
            if (typeGuid == SkeletonUserData.TYPE_GUID)
            {
                result = new SkeletonUserData();
            }
            if (typeGuid == MorphDefinitionData.TYPE_GUID)
            {
                result = new MorphDefinitionData();
            }
            if (typeGuid == AnimationDefinitionData.TYPE_GUID)
            {
                result = new AnimationDefinitionData();
            }
            if (typeGuid == ParticleEffectData.TYPE_GUID)
            {
                result = new ParticleEffectData();
            }
            else
            {
                result = new ExternalData(typeGuid);
                return(false);
            }

            return(true);
#else
            if (guidToDataTypeMap.ContainsKey(typeGuid))
            {
                var constructor = guidToDataConstructorMap[typeGuid];
                result = (ExternalData)constructor.Invoke(null);
                return(true);
            }
            result = new ExternalData(typeGuid);
            return(false);
#endif
        }