Пример #1
0
        private static void SpawnBox(DungeonBoostType type, Player player, Vector3 position)
        {
            if (type != DungeonBoostType.None)
            {
                DungeonBoost.DungeonBoostProperties properties2 = new DungeonBoost.DungeonBoostProperties();
                properties2.Type                  = type;
                properties2.ActivationType        = DungeonBoostActivationType.DestructibleHit;
                properties2.DoDestroyOnActivation = true;
                properties2.Radius                = ConfigDungeonBoosts.BOX_RADIUS;
                DungeonBoost.DungeonBoostProperties props = properties2;
                switch (type)
                {
                case DungeonBoostType.BuffBox:
                case DungeonBoostType.ExplosiveBox:
                    props.BuffPerkType = LangUtil.GetRandomValueFromList <PerkType>(ConfigPerks.DUNGEON_BOOST_PERK_POOLS[type]);
                    break;

                case DungeonBoostType.ResourceBox:
                    props.ShopEntryId = CmdRollDungeonBoostResourceBoxLootTable.ExecuteStatic(App.Binder.ConfigLootTables.DungeonBoostResourceBoxLootTable, player);
                    break;
                }
                DungeonBoost dungeonBoost = GameLogic.Binder.DungeonBoostPool.getObject();
                dungeonBoost.gameObject.SetActive(true);
                dungeonBoost.initialize(position, props);
                GameLogic.Binder.EventBus.DungeonBoostSpawned(dungeonBoost);
            }
        }