Exemple #1
0
        /// <param name="drillEntity">Entity to which this drill is attached.</param>
        /// <param name="inventoryCollectionRatio">Ratio (0 to 1) of mined material that will be stored in inventory (if one is assigned), rest will be thrown out in space.</param>
        public MyDrillBase(
            MyEntity drillEntity,
            MyParticleEffectsIDEnum dustEffectId,
            MyParticleEffectsIDEnum dustEffectStonesId,
            MyParticleEffectsIDEnum sparksEffectId,
            MyDrillSensorBase sensor,
            MyDrillCutOut cutOut,
            float animationSlowdownTimeInSeconds,
            float floatingObjectSpawnOffset,
            float floatingObjectSpawnRadius,
            float inventoryCollectionRatio = 0f)
        {
            m_drillEntity                    = drillEntity;
            m_sensor                         = sensor;
            m_cutOut                         = cutOut;
            m_dustEffectId                   = dustEffectId;
            m_dustEffectStonesId             = dustEffectStonesId;
            m_sparksEffectId                 = sparksEffectId;
            m_animationSlowdownTimeInSeconds = animationSlowdownTimeInSeconds;
            m_floatingObjectSpawnOffset      = floatingObjectSpawnOffset;
            m_floatingObjectSpawnRadius      = floatingObjectSpawnRadius;

            Debug.Assert(inventoryCollectionRatio >= 0f && inventoryCollectionRatio <= 1f,
                         "Inventory collection ratio must be in range <0;1>");
            m_inventoryCollectionRatio = (MyFixedPoint)inventoryCollectionRatio;

            m_drilledMaterialBuffer = new Dictionary <MyVoxelMaterialDefinition, int>();

            m_soundEmitter = new MyEntity3DSoundEmitter(m_drillEntity);
        }
        /// <param name="drillEntity">Entity to which this drill is attached.</param>
        /// <param name="inventoryCollectionRatio">Ratio (0 to 1) of mined material that will be stored in inventory (if one is assigned), rest will be thrown out in space.</param>
        public MyDrillBase(
            MyEntity drillEntity,
            MyParticleEffectsIDEnum dustEffectId,
            MyParticleEffectsIDEnum dustEffectStonesId,
            MyParticleEffectsIDEnum sparksEffectId,
            MyDrillSensorBase sensor,
            MyDrillCutOut cutOut,
            float animationSlowdownTimeInSeconds,
            float floatingObjectSpawnOffset,
            float floatingObjectSpawnRadius,
            Sounds sounds,
            float inventoryCollectionRatio = 0f)
        {
            m_drillEntity = drillEntity;
            m_sensor = sensor;
            m_cutOut = cutOut;
            m_dustEffectId = dustEffectId;
            m_dustEffectStonesId = dustEffectStonesId;
            m_sparksEffectId = sparksEffectId;
            m_animationSlowdownTimeInSeconds = animationSlowdownTimeInSeconds;
            m_floatingObjectSpawnOffset = floatingObjectSpawnOffset;
            m_floatingObjectSpawnRadius = floatingObjectSpawnRadius;

            Debug.Assert(inventoryCollectionRatio >= 0f && inventoryCollectionRatio <= 1f,
                "Inventory collection ratio must be in range <0;1>");
            m_inventoryCollectionRatio = (MyFixedPoint)inventoryCollectionRatio;

            m_drilledMaterialBuffer = new Dictionary<MyVoxelMaterialDefinition, int>();

            m_sounds = sounds;
            m_soundEmitter = new MyEntity3DSoundEmitter(m_drillEntity);
        }