Exemplo n.º 1
0
        private Matrix4x4 GetRandomTransform(GrassPrefabData grassPrefabData, Vector3 position)
        {
            Quaternion q        = this.GetRandomRotation() * grassPrefabData.grassPrefab.transform.rotation;
            float      minScale = grassPrefabData.minScale;
            float      x        = minScale + (Random.value * (grassPrefabData.maxScale - minScale));

            return(Matrix4x4.TRS(position, q, new Vector3(x, x, x)));
        }
Exemplo n.º 2
0
        private void ValidateGrassPrefab(GrassPrefabData grassPrefabData)
        {
            string str;

            if (!grassPrefabData.IsValid(out str))
            {
                throw new GrassGeneratorException($"GrassGenerator {base.name}: grass prefab {grassPrefabData} is not valid. {str} ");
            }
        }