| | 1 | | using DCL.Helpers; |
| | 2 | | using System.Collections; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | public class VoxelPrefab : MonoBehaviour |
| | 7 | | { |
| | 8 | | public Material editMaterial, errorMaterial; |
| | 9 | | public Renderer meshRenderer; |
| | 10 | |
|
| 1 | 11 | | bool isAvailable = true; |
| | 12 | | public void SetAvailability(bool isAvailable) |
| | 13 | | { |
| 0 | 14 | | if (isAvailable) |
| | 15 | | { |
| 0 | 16 | | if (meshRenderer.material != editMaterial) |
| 0 | 17 | | meshRenderer.material = editMaterial; |
| 0 | 18 | | } |
| | 19 | | else |
| | 20 | | { |
| 0 | 21 | | if (meshRenderer.material != errorMaterial) |
| 0 | 22 | | meshRenderer.material = errorMaterial; |
| | 23 | | } |
| 0 | 24 | | this.isAvailable = isAvailable; |
| 0 | 25 | | } |
| | 26 | |
|
| 0 | 27 | | public bool IsAvailable() { return isAvailable; } |
| | 28 | | } |