-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle SubAssetKey instead of string strictly #974
Conversation
UnityPath m_textureDirectory; | ||
|
||
public TextureExtractor(GltfParser parser, UnityPath textureDirectory, (SubAssetKey, UnityEngine.Texture2D)[] subAssets) | ||
public TextureExtractor(GltfParser parser, UnityPath textureDirectory, IReadOnlyDictionary<SubAssetKey, Texture> subAssets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(SubAssetKey, UnityEngine.Texture2D)[]
=> IReadOnlyDictionary<SubAssetKey, Texture>
public class TextureFactory : IDisposable | ||
{ | ||
public readonly Dictionary<string, Texture2D> ExternalMap; | ||
private readonly Dictionary<SubAssetKey, Texture> m_temporaryTextures = new Dictionary<SubAssetKey, Texture>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SubAssetKey
/// </summary> | ||
public bool ExtractConverted => TextureType == TextureImportTypes.StandardMap; | ||
public SubAssetKey SubAssetKey => new SubAssetKey(SubAssetKey.TextureType, UnityObjectName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
掃除されたぽい
Object
や SubAsset のObject
に対する取り回しがstring
で曖昧なのをSubAssetKey
で厳密に取り扱うSubAssetKey
を不用意に外部でnew
しないようにするSubAssetKey
をTexture2D
ではなくTexture
で取り扱うTextureImportParam
は「Import した結果生成される Texture Asset 1 つ」に対応する。TextureFactory
には残さず、処理中に破棄する.gltf
形式のインポート時も、Texture は SubAsset となる