コード例 #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);
        }
コード例 #2
0
 public Scene(LightmapSettings lightSettings, MonoBehaviour[] behaviours, GameObject[] gameObjects, RenderSettings renderSettings, OcclusionSettings occlusion)
 {
     LightmapSettings  = lightSettings;
     MonoBehaviours    = behaviours;
     GameObjects       = gameObjects;
     RenderSettings    = renderSettings;
     OcclusionSettings = occlusion;
 }