예제 #1
0
 public void SetType(SmallCubeType type)
 {
     if (_renderer != null)
     {
         Category           = type.Category;
         Type               = type.TerraformType;
         _renderer.material = type.Material;
     }
 }
예제 #2
0
        /// <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);
        }