diff options
author | metamuffin <metamuffin@disroot.org> | 2025-03-15 15:18:40 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-03-15 15:18:40 +0100 |
commit | d836e24357b81496c61f3cc9195ba36758523578 (patch) | |
tree | 0028aee5a453cc761dd39e92430a35c55147537f /src/classes/material.rs | |
parent | 07fc3656274117c211ca0d6a54926d390a4d9b68 (diff) | |
download | unity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar unity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar.bz2 unity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar.zst |
more abstraction around unityfs to read multiple files from a single reader
Diffstat (limited to 'src/classes/material.rs')
-rw-r--r-- | src/classes/material.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/classes/material.rs b/src/classes/material.rs index 354e319..9124b0b 100644 --- a/src/classes/material.rs +++ b/src/classes/material.rs @@ -1,4 +1,4 @@ -use super::{pptr::PPtr, texture2d::Texture2D, vectors::ColorRGBA}; +use super::{pptr::PPtr, shader::Shader, texture2d::Texture2D, vectors::ColorRGBA}; use crate::object::{Value, parser::FromValue}; use glam::Vec2; use serde::Serialize; @@ -29,8 +29,11 @@ pub struct UnityTexEnv { pub texture: PPtr<Texture2D>, } -#[derive(Debug, Serialize)] -pub struct Shader {} +impl UnityPropertySheet { + pub fn textures(&self) -> impl Iterator<Item = (&String, &UnityTexEnv)> { + self.textures.iter().filter(|(_, v)| !v.texture.is_null()) + } +} impl FromValue for Material { fn from_value(v: Value) -> anyhow::Result<Self> { |