riversong code showcase
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class TerrainMaterialsInitializationOperation : IWorldGeneratorOperation
|
||||
{
|
||||
private static readonly int TerrainMapPropertyID = Shader.PropertyToID("_Terrain_Map");
|
||||
|
||||
[InjectService]
|
||||
private GameConfig _config;
|
||||
|
||||
public UniTask Execute(World world)
|
||||
{
|
||||
var map = (Texture2D)_config.WorldGen.MapTextures[0].Asset;
|
||||
Shader.SetGlobalTexture(TerrainMapPropertyID, map);
|
||||
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user