コード例 #1
0
    private void SaveJson()
    {
        string jsonData = LitJson.JsonMapper.ToJson(MSystemSortJson);

        EDTool.WriteText(jsonData, Application.dataPath + JsonPath);
        AssetDatabase.Refresh();
    }
コード例 #2
0
        private void SaveDecTreeJson()
        {
            string jsonData = LitJson.JsonMapper.ToJson(MDecTrees);

            EDTool.WriteText(jsonData, Application.dataPath + DecPath);
            AssetDatabase.Refresh();
        }
コード例 #3
0
        private static void OpenWindow()
        {
            if (EDTool.CheckFileInPath(Application.dataPath + DecPath))
            {
                string dataJson = EDTool.ReadText(Application.dataPath + DecPath);
                MDecTrees = LitJson.JsonMapper.ToObject <DecTrees>(dataJson);
            }
            else
            {
                MDecTrees = new DecTrees();
            }

            if (EDTool.CheckFileInPath(Application.dataPath + BevPath))
            {
                string dataJson = EDTool.ReadText(Application.dataPath + BevPath);
                MBevTrees = LitJson.JsonMapper.ToObject <BevTrees>(dataJson);
            }
            else
            {
                MBevTrees = new BevTrees();
            }
            InitJson();

            NodeEditorWindow window = GetWindow <NodeEditorWindow>();

            window.titleContent = new GUIContent("决策及行为树编辑");

            if (EditorApplication.isPlaying == true)
            {
                Timer = Time.realtimeSinceStartup;
            }
        }
コード例 #4
0
        //保存实体Json数据
        private void SaveEntityJsonList()
        {
            if (MEntityJsonList.List.Count == 0)
            {
                return;
            }
            string jsonData = LitJson.JsonMapper.ToJson(MEntityJsonList);

            EDTool.WriteText(jsonData, Application.dataPath + EntityJsonPath);
            AssetDatabase.Refresh();
        }
コード例 #5
0
    static void OpenWindow()
    {
        if (EDTool.CheckFileInPath(Application.dataPath + JsonPath))
        {
            string dataJson = EDTool.ReadText(Application.dataPath + JsonPath);
            MSystemSortJson = LitJson.JsonMapper.ToObject <SystemSortJson>(dataJson);
        }
        var window = GetWindow <SystemSortEditorWindow>();

        window.titleContent = new GUIContent("系统排序");
        window.Show();
    }
コード例 #6
0
        public static void OpenWindow()
        {
            EntityConfigEditorWindow window = GetWindow <EntityConfigEditorWindow>("实体编辑器");

            window.minSize = new Vector2(800, 600);

            if (EDTool.CheckFileInPath(Application.dataPath + EntityJsonPath))
            {
                string dataJson = EDTool.ReadText(Application.dataPath + EntityJsonPath);
                MEntityJsonList = LitJson.JsonMapper.ToObject <EntityJsonList>(dataJson);
            }
        }
コード例 #7
0
        private static void ShowWindow()
        {
            var window = GetWindow <LogicLayerEditorWindow>();

            window.titleContent = new GUIContent("请求权重设置");
            window.Show();

            if (EDTool.CheckFileInPath(Application.dataPath + JsonPath))
            {
                string dataJson = EDTool.ReadText(Application.dataPath + JsonPath);
                MReqWeightJson = LitJson.JsonMapper.ToObject <ReqWeightJson>(dataJson);
                ClearJson();
            }
        }
コード例 #8
0
        private static void OpenWindow()
        {
            SelGo   = null;
            SelAnim = null;
            SelClip = null;
            RunningClip.Clear();

            SkillEditorWindow window = GetWindow <SkillEditorWindow>("技能编辑器");

            window.minSize = new Vector2(1250, 800);

            if (EDTool.CheckFileInPath(Application.dataPath + JsonPath))
            {
                string dataJson = EDTool.ReadText(Application.dataPath + JsonPath);
                Json = LitJson.JsonMapper.ToObject <SkillList>(dataJson);
            }
        }