Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public Scene(LightmapSettings lightSettings, MonoBehaviour[] behaviours, GameObject[] gameObjects, RenderSettings renderSettings, OcclusionSettings occlusion)
 {
     LightmapSettings  = lightSettings;
     MonoBehaviours    = behaviours;
     GameObjects       = gameObjects;
     RenderSettings    = renderSettings;
     OcclusionSettings = occlusion;
 }
Ejemplo n.º 3
0
 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);
 }