Beispiel #1
0
        static void WriteJson()
        {
            var w = new Window
            {
                StartPosition = new Point(200, 200),
                Width         = 640,
                Height        = 480,
                Title         = "尝试",
                RootContainer = new Canvas()
            };
            Label l = new Label
            {
                Position = new Vector2(100, 100),
                Width    = 200,
                Height   = 50,
                Text     = "这是测试的文本"
            };

            w.RootContainer.Add(l);
            w.RootContainer.Relayout();
            DescriptionGenerator dg = new DescriptionGenerator(w);

            dg.Generate();
            var    d    = dg.GetDescription();
            string json = JsonConvert.SerializeObject(d);
            //string json = EditorJsonUtility.ToJson(d);
            var sw = File.CreateText(Application.dataPath + "/Editor/data/test.json");

            sw.WriteLine(json);
            sw.Flush();
            sw.Close();
            Debug.Log(json);
        }
Beispiel #2
0
 private static void WriteLogMessage()
 {
     AnsiConsole.MarkupLine(
         "[grey]LOG:[/] " +
         DescriptionGenerator.Generate() +
         "[grey]...[/]");
 }