示例#1
0
    private void Clear()
    {
        Cur_Level         = null;
        Row_CardSelection = null;
        Row_ShopItems     = null;
        Row_BonusGroups   = null;

        foreach (PropertyFormRow pfr in MyPropertiesRows)
        {
            pfr.PoolRecycle();
        }

        MyPropertiesRows.Clear();
        LevelTypePropertiesDict.Clear();
        EnemyTypePropertiesDict.Clear();
        LevelPropertiesCommon.Clear();
    }
示例#2
0
    private void InitializeCardPropertyForm()
    {
        Clear();

        IEnumerable <LevelTypes> types_level   = Enum.GetValues(typeof(LevelTypes)) as IEnumerable <LevelTypes>;
        List <string>            levelTypeList = new List <string>();

        foreach (LevelTypes levelType in types_level)
        {
            levelTypeList.Add(levelType.ToString());
            LevelTypePropertiesDict.Add(levelType, new List <PropertyFormRow>());
        }

        IEnumerable <EnemyType> types_enemy   = Enum.GetValues(typeof(EnemyType)) as IEnumerable <EnemyType>;
        List <string>           enemyTypeList = new List <string>();

        foreach (EnemyType enemyType in types_enemy)
        {
            enemyTypeList.Add(enemyType.ToString());
            EnemyTypePropertiesDict.Add(enemyType, new List <PropertyFormRow>());
        }

        PropertyFormRow Row_LevelType = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.Dropdown, "LevelEditorPanel_LevelType", OnLevelTypeChange, out SetLevelType, levelTypeList);

        Row_LevelType.SetReadOnly(true);
        PropertyFormRow Row_LevelPicID = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_LevelPicIDLabelText", OnLevelPicIDChange, out SetLevelPicID);

        Row_LevelPicID.SetReadOnly(true);
        PropertyFormRow Row_LevelName_zh         = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_LevelNameLabelText_zh", OnLevelNameChange_zh, out SetLevelName_zh);
        PropertyFormRow Row_LevelName_en         = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_LevelNameLabelText_en", OnLevelNameChange_en, out SetLevelName_en);
        PropertyFormRow Row_LevelDifficultyLevel = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_LevelDifficultyLevel", OnLevelDifficultyLevelChange, out SetLevelDifficultyLevel);

        PropertyFormRow Row_EnemyType        = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.Dropdown, "LevelEditorPanel_EnemyType", OnEnemyTypeChange, out SetEnemyType, enemyTypeList);
        PropertyFormRow Row_EnemyDrawCardNum = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_EnemyDrawCardNum", OnEnemyDrawCardNumChange, out SetEnemyDrawCardNum);
        PropertyFormRow Row_EnemyLife        = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_EnemyLife", OnEnemyLifeChange, out SetEnemyLife);
        PropertyFormRow Row_EnemyEnergy      = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_EnemyEnergy", OnEnemyEnergyChange, out SetEnemyEnergy);
        PropertyFormRow Row_EnemyBeginMetal  = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_EnemyBeginMetal", OnEnemyBeginMetalChange, out SetEnemyBeginMetal);

        PropertyFormRow Row_ShopItemCardCount   = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_ShopItemCardCount", OnShopItemCardCountChange, out SetShopItemCardCount);
        PropertyFormRow Row_ShopItemOthersCount = GeneralizeRow(PropertyFormRow.CardPropertyFormRowType.InputField, "LevelEditorPanel_ShopItemOthersCount", OnShopItemOthersCount, out SetShopItemOthersCount);

        Row_CardSelection = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.LevelPropertyForm_CardSelection].AllocateGameObject <LevelPropertyForm_CardSelection>(LevelPropertiesContainer);
        MyPropertiesRows.Add(Row_CardSelection);
        Row_ShopItems = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.LevelPropertyForm_ShopItems].AllocateGameObject <LevelPropertyForm_ShopItems>(LevelPropertiesContainer);
        MyPropertiesRows.Add(Row_ShopItems);
        Row_BonusGroups = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.LevelPropertyForm_BonusGroups].AllocateGameObject <LevelPropertyForm_BonusGroups>(LevelPropertiesContainer);
        MyPropertiesRows.Add(Row_BonusGroups);

        LevelPropertiesCommon = new List <PropertyFormRow>
        {
            Row_LevelType,
            Row_LevelPicID,
            Row_LevelName_zh,
            Row_LevelName_en,
            Row_LevelDifficultyLevel,
        };

        LevelTypePropertiesDict[LevelTypes.Enemy] = new List <PropertyFormRow>
        {
            Row_EnemyType,
            Row_EnemyDrawCardNum,
            Row_EnemyLife,
            Row_EnemyEnergy,
            Row_EnemyBeginMetal,
            Row_CardSelection,
            Row_BonusGroups
        };

        LevelTypePropertiesDict[LevelTypes.Shop] = new List <PropertyFormRow>
        {
            Row_ShopItems,
            Row_ShopItemCardCount,
            Row_ShopItemOthersCount,
        };

        SetLevel(null);
    }