Example #1
0
        public void GetPrototype(int index, out Mesh mesh, out GrassPrefabData grassPrefabData)
        {
            if ((index < 0) || (index >= this.grassMeshes.Count))
            {
                throw new GrassPrototypeIndexOutOfRange($"Index: {index}, prototypes count: {this.grassMeshes.Count}");
            }
            mesh = this.grassMeshes[index];
            int num = index - (this.grassPrefabDataList.Count * (index / this.grassPrefabDataList.Count));

            grassPrefabData = this.grassPrefabDataList[num];
        }
Example #2
0
        public void GetRandomPrototype(out Mesh mesh, out GrassPrefabData grassPrefabData)
        {
            int index = Random.Range(0, this.grassMeshes.Count);

            this.GetPrototype(index, out mesh, out grassPrefabData);
        }