AssetLoaderOptions.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace TriLib
  5. {
  6. [Serializable]
  7. public class AssetLoaderOptions : ScriptableObject
  8. {
  9. public static AssetLoaderOptions CreateInstance()
  10. {
  11. return ScriptableObject.CreateInstance<AssetLoaderOptions>();
  12. }
  13. public void Deserialize(string json)
  14. {
  15. JsonUtility.FromJsonOverwrite(json, this);
  16. }
  17. public string Serialize()
  18. {
  19. return JsonUtility.ToJson(this);
  20. }
  21. public bool AddAssetUnloader;
  22. public bool DontLoadAnimations;
  23. public bool DontLoadLights = true;
  24. public bool DontLoadCameras = true;
  25. public bool AutoPlayAnimations;
  26. public WrapMode AnimationWrapMode = WrapMode.Loop;
  27. public bool UseLegacyAnimations = true;
  28. public RuntimeAnimatorController AnimatorController;
  29. public Avatar Avatar;
  30. public bool DontLoadMaterials;
  31. public bool ApplyAlphaMaterials = true;
  32. public bool DisableAlphaMaterials;
  33. public bool UseCutoutMaterials = true;
  34. public bool UseStandardSpecularMaterial;
  35. public bool GenerateMeshColliders;
  36. public bool ConvexMeshColliders;
  37. public List<Material> MaterialsOverride = new List<Material>();
  38. public Vector3 RotationAngles = new Vector3(0f, 180f, 0f);
  39. public float Scale = 1f;
  40. public AssimpPostProcessSteps PostProcessSteps = AssimpPostProcessSteps.CalcTangentSpace | AssimpPostProcessSteps.JoinIdenticalVertices | AssimpPostProcessSteps.MakeLeftHanded | AssimpPostProcessSteps.Triangulate | AssimpPostProcessSteps.GenSmoothNormals | AssimpPostProcessSteps.SplitLargeMeshes | AssimpPostProcessSteps.LimitBoneWeights | AssimpPostProcessSteps.ValidateDataStructure | AssimpPostProcessSteps.ImproveCacheLocality | AssimpPostProcessSteps.RemoveRedundantMaterials | AssimpPostProcessSteps.SortByPType | AssimpPostProcessSteps.FindInvalidData | AssimpPostProcessSteps.GenUvCoords | AssimpPostProcessSteps.FindInstances | AssimpPostProcessSteps.OptimizeMeshes | AssimpPostProcessSteps.FlipWindingOrder;
  41. public string TexturesPathOverride;
  42. public TextureCompression TextureCompression = TextureCompression.NormalQuality;
  43. public List<AssetAdvancedConfig> AdvancedConfigs = new List<AssetAdvancedConfig>
  44. {
  45. AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.SplitLargeMeshesVertexLimit, 65000),
  46. AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.FBXImportReadLights, false),
  47. AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.FBXImportReadCameras, false)
  48. };
  49. }
  50. }