mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
增加漏斗图基础代码支持
This commit is contained in:
54
Editor/Window/PraseJsonDataEditor.cs
Normal file
54
Editor/Window/PraseJsonDataEditor.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
public class PraseJsonDataEditor : EditorWindow
|
||||
{
|
||||
public static BaseChart chart;
|
||||
public static int serieIndex;
|
||||
private static PraseJsonDataEditor window;
|
||||
private string inputJsonText = "";
|
||||
|
||||
public static void ShowWindow()
|
||||
{
|
||||
window = GetWindow<PraseJsonDataEditor>();
|
||||
window.titleContent = new GUIContent("PraseJsonData");
|
||||
window.minSize = new Vector2(450, 550);
|
||||
window.Focus();
|
||||
window.Show();
|
||||
}
|
||||
|
||||
void OnInspectorUpdate()
|
||||
{
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (chart == null)
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
EditorGUILayout.LabelField("Input json data, or echarts serie data:");
|
||||
inputJsonText = EditorGUILayout.TextArea(inputJsonText, GUILayout.Height(400));
|
||||
if (GUILayout.Button("Add"))
|
||||
{
|
||||
var serie = chart.series.GetSerie(serieIndex);
|
||||
if (serie != null)
|
||||
{
|
||||
serie.ParseJsonData(inputJsonText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/Window/PraseJsonDataEditor.cs.meta
Normal file
11
Editor/Window/PraseJsonDataEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dca7fd076eaf147c8839394e0652ecd0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user