public bool BindTextures( TexContainer texContainer ) { foreach( var entry in modelTable ){ BasicModel model = entry.Value as BasicModel; model.BindTextures( texContainer ); } return true; }
/// 使用するデータのセット public void Start(DemoModel.BasicModel useModel, DemoModel.TexContainer useTexCnr, DemoModel.ShaderContainer useShaderCnr) { this.useModel = useModel; this.useTexCnr = useTexCnr; this.useShaderCnr = useShaderCnr; this.useModel.BindTextures(this.useTexCnr); }
// START============================================================ /// TexContainer から利用するテクスチャをバインドする /** * texture の所有権は持たない(TexContainer 側で管理すること) */ public void BindTextures(TexContainer texContainer) { for (int i = 0; i < Textures.Length; i++) { if (Textures[i].Texture == null) { Textures[i].Texture = texContainer.Find(Textures[i].FileName); } } }
/// 終了 public void End() { useModel = null; useTexCnr = null; useShaderCnr = null; }
/// 破棄 public void Term() { useModel = null; useTexCnr = null; useShaderCnr = null; }
/// コンストラクタ public ModelHandle() { useModel = null; useTexCnr = null; useShaderCnr = null; }