Ejemplo n.º 1
0
        public static RowEditorWnd Create(string title, EditorWindow parent, LuaReflect luaReflect, string excelPath)
        {
            Rect rect = new Rect(parent.position.x + parent.position.width + 20, parent.position.y, parent.position.width, parent.position.height);

            EditorWindow.FocusWindowIfItsOpen(typeof(RowEditorWnd));
            RowEditorWnd wnd = EditorWindow.CreateWindow <RowEditorWnd>(title);

            wnd.position = rect;
            wnd.ShowWnd(parent, luaReflect, excelPath);
            return(wnd);
        }
Ejemplo n.º 2
0
        void DrawLuaReflectSkill(string camp, LuaReflect luaReflect)
        {
            var skillJsonArray = luaReflect.jsonArrayMap["Skill"];

            for (int i = 0; i < skillJsonArray.Count; i++)
            {
                var skillId = skillJsonArray[i]["id"];
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(skillId.ToString());
                if (GUILayout.Button("Edit"))
                {
                    RowEditorWnd wnd = RowEditorWnd.Create("Skill", this, luaReflect, Setting.skillExcelPath);
                    wnd.rowIndex = wnd.GetRowIndex("id", skillId.ToString());
                    wnd.luaKey   = LuaKey.Skill;
                }
                if (GUILayout.Button("Test"))
                {
                    ManualAttack(camp, luaReflect.keyValueMap["layoutIndex"], skillId.ToString());
                }
                EditorGUILayout.EndHorizontal();
            }
        }