-
-
Save tsubaki/6d365d38ef3c98dd88d2 to your computer and use it in GitHub Desktop.
ライトマップ差し替え
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class LoadLightmap : MonoBehaviour { | |
[SerializeField] Texture2D[] light, dir; | |
// Use this for initialization | |
void Start () { | |
LightmapData[] datas = new LightmapData[light.Length]; | |
for(int i=0; i<datas.Length; i++){ | |
LightmapData data = new LightmapData(); | |
data.lightmapNear = dir[i]; | |
data.lightmapFar = light[i]; | |
datas[i] = data; | |
} | |
LightmapSettings.lightmaps = datas; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment