Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created May 5, 2015 04:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/6d365d38ef3c98dd88d2 to your computer and use it in GitHub Desktop.
Save tsubaki/6d365d38ef3c98dd88d2 to your computer and use it in GitHub Desktop.
ライトマップ差し替え
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