public void SetEnvirement(EnvirementSettingHolder newEnvirementSettings) { Material[] tempMaterials = new Material[2]; if (newEnvirementSettings.floorMaterial != null) { floorRenderer.material = newEnvirementSettings.floorMaterial; } if (newEnvirementSettings.backPanelUpMaterial != null && newEnvirementSettings.backPanelDownMaterial != null) { tempMaterials[1] = newEnvirementSettings.backPanelUpMaterial; tempMaterials[0] = newEnvirementSettings.backPanelDownMaterial; backRenderer.materials = tempMaterials; } if (newEnvirementSettings.leftPanelUpMaterial != null && newEnvirementSettings.leftPanelDownMaterial != null) { tempMaterials[1] = newEnvirementSettings.leftPanelUpMaterial; tempMaterials[0] = newEnvirementSettings.leftPanelDownMaterial; leftRenderer.materials = tempMaterials; } if (newEnvirementSettings.rightPanelUpMaterial != null && newEnvirementSettings.rightPanelDownMaterial != null) { tempMaterials[1] = newEnvirementSettings.rightPanelUpMaterial; tempMaterials[0] = newEnvirementSettings.rightPanelDownMaterial; rightRenderer.materials = tempMaterials; } }
public void EquipThis() { this.transform.parent.gameObject.BroadcastMessage("Unequip"); itemOnDisplay.equiped = true; selectionIndicator.SetActive(true); if (itemOnDisplay.thisItemType == TypeOfItemToBuy.Ball) { shopInGameManager.playManager.ballPrefab = itemOnDisplay.gameObject; shopInGameManager.playManager.ChangeBall(); } else if (itemOnDisplay.thisItemType == TypeOfItemToBuy.Obsticle) { shopInGameManager.playManager.allObsticles.obsticleToChangeTo = itemOnDisplay.gameObject; shopInGameManager.playManager.allObsticles.ChangeObsticles(); } else if (itemOnDisplay.thisItemType == TypeOfItemToBuy.Taget) { shopInGameManager.playManager.allTargets.targetToChangeTo = itemOnDisplay.gameObject; shopInGameManager.playManager.allTargets.ChangeTargets(); } else if (itemOnDisplay.thisItemType == TypeOfItemToBuy.Envirement) { EnvirementSettingHolder tempEnv = itemOnDisplay.GetComponent <EnvirementSettingHolder>(); shopInGameManager.playManager.SetEnvirement(tempEnv); } }