Exemple #1
0
        private TerrainObjectInstance CreateEmptyObjectInstance(Vector3 vertexPos, Transform parent, TerrainObjectAsset asset)
        {
            var item = new TerrainObjectInstance();

            item.SetPos(vertexPos);
            item.SetRot(GetRandomObjectRotation(asset, parent.rotation));
            item.SetScale(asset.GetRandomScale());
            item.SetAsset(asset);

            return(item);
        }
Exemple #2
0
 public void SetAsset(TerrainObjectAsset asset)
 {
     m_asset = asset;
 }
Exemple #3
0
 private Vector3 GetRandomObjectRotation(TerrainObjectAsset asset, Quaternion baseRotation)
 {
     return(asset.GetRandomRot(baseRotation.eulerAngles));
 }