public void Sort()
    {
        List <EnemyManager.EnemyInfo> spawnFirstList = new List <EnemyManager.EnemyInfo>();

        while (s1EnemyMinionMoveList.Count != 0)
        {
            EnemyManager.EnemyInfo minSpawnTimeInfo = s1EnemyMinionMoveList[0];
            float minSpwTime = minSpawnTimeInfo.spawnTime;
            int   index      = 0;

            for (int i = 1; i < s1EnemyMinionMoveList.Count; i++)
            {
                EnemyManager.EnemyInfo currInfo = s1EnemyMinionMoveList[i];
                if (currInfo.spawnTime < minSpwTime)
                {
                    index            = i;
                    minSpwTime       = currInfo.spawnTime;
                    minSpawnTimeInfo = currInfo;
                }
            }

            s1EnemyMinionMoveList.RemoveAt(index);
            spawnFirstList.Add(minSpawnTimeInfo);
        }

        s1EnemyMinionMoveList = spawnFirstList;

//        for (int i = 0; i < s1EnemyMinionMoveList.Count; i++)
//        {
////            s1EnemyMinionMoveList[i].attackPatternTrans.
////            s1EnemyMinionMoveList.Add(spawnFirstList[i]);
//        }
    }
    public void AddToList(int index, EnemyManager.EnemyInfo info)
    {
        EnemyManager.EnemyInfo newInfo = new EnemyManager.EnemyInfo();
        newInfo.groupIndex         = info.groupIndex;
        newInfo.attackPatternTrans = info.attackPatternTrans;
        newInfo.movePattern        = info.movePattern;
        newInfo.spawnPosition      = info.spawnPosition;
        newInfo.spawnTime          = info.spawnTime;

        s1EnemyMinionMoveList.Insert(index, newInfo);
    }
 void CopyPaste(EnemyManager.EnemyInfo info, int index)
 {
     Copy(info);
     Paste(index);
 }
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(serializedObject.FindProperty("playerTransList"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("enemyBossTransList"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("enemyMinionTransList"), true);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("startStageDelay"), true);
//        EditorGUILayout.PropertyField(serializedObject.FindProperty("s1EnemyMinionMoveList"), true);

        EditorGUILayout.BeginHorizontal();
        mSelf.isShowEnemyList = EditorGUILayout.Foldout(mSelf.isShowEnemyList, "S1EnemyMinionMoveList", true);
        if (GUILayout.Button("Add", GUILayout.Width(60)))
        {
            Add();
        }
        if (GUILayout.Button("Refresh", GUILayout.Width(60)))
        {
            Refresh();
        }
        EditorGUILayout.EndHorizontal();

        if (mSelf.isShowEnemyList)
        {
            for (int i = 0; i < mSelf.s1EnemyMinionMoveList.Count; i++)
            {
                EditorGUI.indentLevel++;
                mSelf.isShowEnemyFoldoutList[i] = EditorGUILayout.Foldout(mSelf.isShowEnemyFoldoutList[i], "Element " + i, true);

                if (mSelf.isShowEnemyFoldoutList[i])
                {
                    EditorGUI.indentLevel++;
                    EnemyManager.EnemyInfo currInfo = mSelf.s1EnemyMinionMoveList[i];

                    currInfo.groupIndex         = (EnemyManager.GroupIndex)EditorGUILayout.EnumPopup("Group Index", currInfo.groupIndex);
                    currInfo.attackPatternTrans = (Transform)EditorGUILayout.ObjectField("Attack Pattern", currInfo.attackPatternTrans, typeof(Transform), false);
                    currInfo.movePattern        = (EnemyMovement)EditorGUILayout.ObjectField("Move Pattern", currInfo.movePattern, typeof(EnemyMovement), false);
                    currInfo.spawnPosition      = (Transform)EditorGUILayout.ObjectField("Spawn Position", currInfo.spawnPosition, typeof(Transform), false);
                    currInfo.spawnTime          = EditorGUILayout.FloatField("Spawn Time", currInfo.spawnTime);

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();

                    if (GUILayout.Button("Copy", GUILayout.Width(50)))
                    {
                        Copy(currInfo);
                    }
                    else if (GUILayout.Button("Paste", GUILayout.Width(50)))
                    {
                        Paste(i);
                    }
                    else if (GUILayout.Button("CP", GUILayout.Width(50)))
                    {
                        CopyPaste(currInfo, i);
                    }
                    else if (GUILayout.Button("Delete", GUILayout.Width(50)))
                    {
                        Delete(i);
                    }
                    else if (GUILayout.Button("Sort", GUILayout.Width(50)))
                    {
                        Sort();
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUI.indentLevel--;
                }
                EditorGUI.indentLevel--;
            }
        }

        EditorGUILayout.PropertyField(serializedObject.FindProperty("s1RockSpawnList"), true);

        serializedObject.ApplyModifiedProperties();
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }
 void Copy(EnemyManager.EnemyInfo info)
 {
     copiedInfo = info;
 }