コード例 #1
0
ファイル: ItemPickUp.cs プロジェクト: Theerapon/GDSG
    public void Unequip()
    {
        List <ItemPropertyAmount> properties = new List <ItemPropertyAmount>();

        properties = itemDefinition.ItemProperties;
        int count = properties.Count;

        if (count > 0)
        {
            for (int i = 0; i < count; i++)
            {
                ItemPropertyType type  = properties[i].PropertyType;
                float            value = properties[i].Amount;
                switch (type)
                {
                case ItemPropertyType.Charm:
                    otherBonusController.ReduceCharm(value);
                    break;

                case ItemPropertyType.BonusProject:
                    otherBonusController.ReduceReduceBugChance(value);
                    break;

                case ItemPropertyType.BonusProjectGoldenTime:
                    otherBonusController.ReduceBootupProjectInGoldenTime(value);
                    break;

                case ItemPropertyType.BonusMotivation:
                    otherBonusController.ReduceBootupMotivation(value);
                    break;

                case ItemPropertyType.BonusMotivationGoldenTime:
                    otherBonusController.ReduceBootupMotivationInGoldenTime(value);
                    break;

                case ItemPropertyType.ReduceEnergyConsume:
                    otherBonusController.ReduceEnergyConsume(value);
                    break;

                case ItemPropertyType.ReduceEnergyConsumeGoldenTime:
                    otherBonusController.ReduceEnergyConsumeInGoldenTime(value);
                    break;

                case ItemPropertyType.ReduceChanceBug:
                    otherBonusController.ReduceReduceBugChance(value);
                    break;

                case ItemPropertyType.ReduceCourseTime:
                    otherBonusController.ReduceReduceTimeCourse(value);
                    break;

                case ItemPropertyType.ReduceTransportTime:
                    otherBonusController.ReduceReduceTimeTransport(value);
                    break;

                case ItemPropertyType.IncreaseDropRate:
                    otherBonusController.ReduceDropRate(value);
                    break;

                case ItemPropertyType.MaxEnergy:
                    otherBonusController.ReduceMaxEnergy((int)value);
                    break;

                case ItemPropertyType.Coding:
                    otherBonusController.ReduceCodingStatus((int)value);
                    break;

                case ItemPropertyType.Design:
                    otherBonusController.ReduceDesignStatus((int)value);
                    break;

                case ItemPropertyType.Testing:
                    otherBonusController.ReduceTestingStatus((int)value);
                    break;

                case ItemPropertyType.Art:
                    otherBonusController.ReduceArtStatus((int)value);
                    break;

                case ItemPropertyType.Sound:
                    otherBonusController.ReduceSoundStatus((int)value);
                    break;
                }
            }
        }
    }