void UpdateManager() { if (_manager != null) { _manager.Release(); } if (_texture != null) { _manager = MaterialManager.GetInstance(_texture, _shader, _materialKeywords); } else { _manager = null; } }
public void SetShaderAndTexture(string shader, NTexture texture) { _shader = shader; _texture = texture; if (_texture != null) { _manager = MaterialManager.GetInstance(_texture, _shader); if (_material != null) { _material.mainTexture = _texture.nativeTexture; } } else { if (_material != null) { _material.mainTexture = null; } _manager = null; } }