您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
39 行
996 B
39 行
996 B
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(LevelLightmapData))]
|
|
public class LevelLightmapDataManager : MonoBehaviour
|
|
{
|
|
public class Handler
|
|
{
|
|
LevelLightmapData m_Data;
|
|
|
|
public void SetLightingScenario(int index)
|
|
{
|
|
if(m_Data != null)
|
|
{
|
|
try
|
|
{
|
|
m_Data.LoadLightingScenario(index);
|
|
}
|
|
catch { Debug.LogWarning("Warning, tried to load lighting scenario "+index+" but no lightmap data found."); }
|
|
}
|
|
}
|
|
|
|
public void SetLightmapData(LevelLightmapData data)
|
|
{
|
|
m_Data = data;
|
|
}
|
|
}
|
|
|
|
public static Handler handler { get { if (s_Handler == null) s_Handler = new Handler(); return s_Handler; } }
|
|
static Handler s_Handler;
|
|
|
|
void OnEnable()
|
|
{
|
|
handler.SetLightmapData(GetComponent<LevelLightmapData>());
|
|
}
|
|
}
|
|
|