Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active September 19, 2015 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsubaki/52bf7d466f136e5e725f to your computer and use it in GitHub Desktop.
Save tsubaki/52bf7d466f136e5e725f to your computer and use it in GitHub Desktop.
ライトマップ回りを読み込む
using UnityEngine;
using System.Collections;
public class LoadLightmap : MonoBehaviour {
[SerializeField] Texture2D[] light, dir;
[SerializeField] LightProbes lightprobes;
[SerializeField] Cubemap cubemap;
// 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;
LightmapSettings.lightProbes = lightprobes;
RenderSettings.customReflection = cubemap;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment