static string ConvertJsonToYaml(string json) { JGameObject[] jsonGameObjects = JsonConvert.DeserializeObject <JGameObject[]>(json); OcclusionSettings occlusionSettings = new OcclusionSettings(); LightmapSettings lightmapSettings = new LightmapSettings(HideFlag, SerializedVersionSettings, 1, new FieldId()); MonoBehaviour[] monoBehaviours = { new MonoBehaviour(1, playerScript) }; GameObject[] gameObjects = {}; for (int i = 0; i < jsonGameObjects.Length; i++) { gameObjects[i] = new GameObject(SerializedVersionGameObjects, jsonGameObjects[i].name); } RenderSettings renderSettings = new RenderSettings(HideFlag, SerializedVersionSettings); OcclusionSettings occlusionSettingss = new OcclusionSettings(); Scene scene = new Scene(lightmapSettings, monoBehaviours, gameObjects, renderSettings, occlusionSettingss); var serializer = new SerializerBuilder().Build(); string yamlScene = serializer.Serialize(scene); return(yamlScene); }
public Scene(LightmapSettings lightSettings, MonoBehaviour[] behaviours, GameObject[] gameObjects, RenderSettings renderSettings, OcclusionSettings occlusion) { LightmapSettings = lightSettings; MonoBehaviours = behaviours; GameObjects = gameObjects; RenderSettings = renderSettings; OcclusionSettings = occlusion; }
void OnEnable() { if (_source == null) { _source = GetComponent <AudioSource>(); } if (_lowPassFilter == null) { _lowPassFilter = GetComponent <AudioLowPassFilter>(); } if (_highPassFilter == null) { _highPassFilter = GetComponent <AudioHighPassFilter>(); } if (_settings == null) { _settings = OcclusionSettings.instance; } _lastFrame = -1; Test(Mathf.Infinity); }