Beispiel #1
0
        public void DropAllItems(Vector3 position)
        {
            Game.Random        random             = new Game.Random();
            SubsystemPickables subsystemPickables = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);

            for (int i = 0; i < SlotsCount; i++)
            {
                int slotCount = GetSlotCount(i);
                if (slotCount > 0)
                {
                    int     slotValue = GetSlotValue(i);
                    int     count     = RemoveSlotItems(i, slotCount);
                    Vector3 value     = random.UniformFloat(5f, 10f) * Vector3.Normalize(new Vector3(random.UniformFloat(-1f, 1f), random.UniformFloat(1f, 2f), random.UniformFloat(-1f, 1f)));
                    subsystemPickables.AddPickable(slotValue, count, position, value, null);
                }
            }
        }