public void CreateAllEntity()
    {
        this.CreateMyself();
        Level level    = LevelManager.singleton.GetCurLevel();
        int   waveSize = level.waves.Count;

        for (int i = 0; i < waveSize; i++)
        {
            for (int j = 0; j < level.waves[i].entitys.Count; j++)
            {
                MasterWave master = level.waves[i].entitys[j];
                for (int k = 0; k < master.num; k++)
                {
                    //不包含当前波数
                    if (!this.curWaveDicEntitys.ContainsKey(i))
                    {
                        List <int> entityIndex = new List <int>();
                        int        index       = ++WaveEntityIndex;
                        //排除主角索引id
                        if (index == 1)
                        {
                            index = ++WaveEntityIndex;
                        }
                        entityIndex.Add(index);
                        this.curWaveDicEntitys.Add(i, entityIndex);
                    }
                    else
                    {
                        this.curWaveDicEntitys[i].Add(++WaveEntityIndex);
                    }
                }
            }
        }
        this.StartWave(level, LevelManager.singleton.curWaveIndex);
    }
    public void CreateMaster(MasterWave master)
    {
        EntityParent masterEntity = new EntityMonster();
        EntityInfo   info         = new EntityInfo(++CreateEntityIndex, (int)master.type, master.maxHp, master.demage, master.type.ToString(), master.speed);

        masterEntity.SetEntityInfo(info);
        masterEntity.EnterLevel();
        this.dicCreateEntitys.Add(masterEntity.EntityId, masterEntity);
    }
    public void LevelListDrawCallback(Rect rect, int index, bool isactive, bool isfocused)
    {
        const float GAP    = 5;
        MasterWave  master = m_oWave.entitys[index];

        rect.y++;
        Rect r = rect;

        r.width     = 200;
        r.height    = 18;
        master.type = (EntityType)EditorGUI.EnumPopup(r, "怪物类型", master.type);
        r.xMin      = r.xMax + GAP;
        r.xMax      = r.xMax + 200;
        if (LevelEditor.config != null)
        {
            switch (master.type)
            {
            case EntityType.纹身男:
                master.speed = LevelEditor.config.WenShenSpeed;
                break;

            case EntityType.胖子男:
                master.speed = LevelEditor.config.PangziSpeed;
                break;

            case EntityType.飞机男:
                master.speed = LevelEditor.config.FeijiSpeed;
                break;

            case EntityType.跳跳男:
                master.speed = LevelEditor.config.TiaoTiaoSpeed;
                break;

            case EntityType.匐怪:
                master.speed = LevelEditor.config.PufuSpeed;
                break;

            case EntityType.挖掘机:
                master.speed = LevelEditor.config.WajuejiSpeed;
                break;

            case EntityType.瞬移怪:
                master.speed = LevelEditor.config.ShunxiSpeed;
                break;
            }
        }
        else
        {
            Debug.LogError("Config == null");
        }
        r.xMin          = r.xMax + GAP;
        r.xMax          = r.xMax + 200;
        master.duration = EditorGUI.FloatField(r, "下个怪物生成时间", master.duration);
        r.xMin          = r.xMax + GAP;
        r.xMax          = r.xMax + 200;
        master.num      = EditorGUI.IntField(r, "数量", master.num);
        r.xMin          = r.xMax + GAP;
        r.xMax          = r.xMax + 200;
        if (LevelEditor.config != null)
        {
            switch (master.type)
            {
            case EntityType.纹身男:
                master.maxHp = LevelEditor.config.WenShenMaxHp;
                break;

            case EntityType.胖子男:
                master.maxHp = LevelEditor.config.PangziMaxHp;
                break;

            case EntityType.飞机男:
                master.maxHp = LevelEditor.config.FeijiMaxHp;
                break;

            case EntityType.跳跳男:
                master.maxHp = LevelEditor.config.TiaoTiaoMaxHp;
                break;

            case EntityType.匐怪:
                master.maxHp = LevelEditor.config.PufuMaxHp;
                break;

            case EntityType.挖掘机:
                master.maxHp = LevelEditor.config.WajuejiMaxHp;
                break;

            case EntityType.瞬移怪:
                master.maxHp = LevelEditor.config.ShunxiMaxHp;
                break;
            }
        }
        else
        {
            Debug.LogError("Config == null");
        }
        r.xMin        = r.xMax + GAP;
        r.xMax        = r.xMax + 200;
        master.demage = 1;
    }
    public void AddMasterWave()
    {
        MasterWave master = new MasterWave();

        m_oWave.entitys.Add(master);
    }