Ejemplo n.º 1
0
        private static int GetCountDepthBased(LocalPropSet propSet, Random randomStream, Tile tile)
        {
            float curveValue = Mathf.Clamp(propSet.CountDepthCurve.Evaluate(tile.Placement.NormalizedPathDepth), 0, 1);
            int   count      = Mathf.RoundToInt(Mathf.Lerp(propSet.PropCount.Min, propSet.PropCount.Max, curveValue));

            return(count);
        }
Ejemplo n.º 2
0
        private static int GetCountRandom(LocalPropSet propSet, Random randomStream, Tile tile)
        {
            int count = propSet.PropCount.GetRandom(randomStream);

            count = Mathf.Clamp(count, 0, propSet.Props.Weights.Count);

            return(count);
        }
Ejemplo n.º 3
0
        private static int GetCountDepthMultiply(LocalPropSet propSet, Random randomStream, Tile tile)
        {
            float curveValue = Mathf.Clamp(propSet.CountDepthCurve.Evaluate(tile.Placement.NormalizedPathDepth), 0, 1);
            int   count      = GetCountRandom(propSet, randomStream, tile);

            count = Mathf.RoundToInt(count * curveValue);

            return(count);
        }