private void GenerateClothesViews(Clothes[] materials, Transform container) { for (int i = 0, l = materials.Length; i < l; i++) { ClothesView clothesView = Instantiate(_template, container); clothesView.ButtonClicked += OnSelectClothesButtonClick; clothesView.Render(materials[i]); } }
private void OnSelectClothesButtonClick(Clothes clothesObject, ClothesView view) { _playerRenderer.material = clothesObject.ClothesMaterial; }