public void SetType(SmallCubeType type) { if (_renderer != null) { Category = type.Category; Type = type.TerraformType; _renderer.material = type.Material; } }
/// <summary> /// Gets a random small cube type. /// </summary> /// <returns>A small cube type</returns> public SmallCubeType GetRandomSmallCubeType() { SmallCubeType result = _smallCubeTypes[0]; float random = Random.Range(0, 2.5f); if (random < 2f) { result = _smallCubeTypes[(int)random]; } else { random = Random.Range(0, 2); if (random == 2f) { random = 0f; } result = _smallCubeTypes_Rare[(int)random]; } return(result); }