Last active
September 19, 2015 07:07
-
-
Save tsubaki/52bf7d466f136e5e725f 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; | |
[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