private void LoadDummies()
        {
            var finalModel = Engine.Models.MyModels.GetModelOnlyDummies(BlockDefinition.Model);

            m_gunBase.LoadDummies(finalModel.Dummies);

            // backward compatibility for models without dummies or old dummies
            if (!m_gunBase.HasDummies)
            {
                foreach (var dummy in finalModel.Dummies)
                {
                    if (dummy.Key.ToLower().Contains("barrel"))
                    {
                        m_gunBase.AddMuzzleMatrix(MyAmmoType.Missile, dummy.Value.Matrix);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void Init(MyEntity entity, MyLargeTurretBase turretBase)
        {
            m_entity     = entity;
            m_turretBase = turretBase;
            m_gunBase    = turretBase.GunBase as MyGunBase;

            // Check for the dummy cubes for the muzzle flash positions:
            if (m_entity.Model != null)
            {
                if (m_entity.Model.Dummies.ContainsKey("camera"))
                {
                    CameraDummy = m_entity.Model.Dummies["camera"];
                }

                m_gunBase.LoadDummies(m_entity.Model.Dummies);
            }

            m_entity.OnClose += m_entity_OnClose;
        }
Ejemplo n.º 3
0
        public virtual void Init(MyEntity entity, MyLargeTurretBase turretBase)
        {
            m_entity = entity;
            m_turretBase = turretBase;
            m_gunBase = turretBase.GunBase as MyGunBase;

            // Check for the dummy cubes for the muzzle flash positions:
            if (m_entity.Model != null)
            {
                if (m_entity.Model.Dummies.ContainsKey("camera"))
                {
                    CameraDummy = m_entity.Model.Dummies["camera"];
                }

                m_gunBase.LoadDummies(m_entity.Model.Dummies);
            }

            m_entity.OnClose += m_entity_OnClose;

        }