您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
40 行
956 B
40 行
956 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Serializable]
|
|
public class SerializableCubemap
|
|
{
|
|
[SerializeField]
|
|
private string m_SerializedCubemap;
|
|
|
|
[Serializable]
|
|
private class CubemapHelper
|
|
{
|
|
public Cubemap cubemap;
|
|
}
|
|
|
|
public Cubemap cubemap
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(m_SerializedCubemap))
|
|
return null;
|
|
|
|
var cube = new CubemapHelper();
|
|
EditorJsonUtility.FromJsonOverwrite(m_SerializedCubemap, cube);
|
|
return cube.cubemap;
|
|
}
|
|
set
|
|
{
|
|
if (cubemap == value)
|
|
return;
|
|
|
|
var cube = new CubemapHelper();
|
|
cube.cubemap = value;
|
|
m_SerializedCubemap = EditorJsonUtility.ToJson(cube, true);
|
|
}
|
|
}
|
|
}
|
|
}
|