public override void Init(MyObjectBuilder_EntityBase objectBuilder) { m_handItemDefinitionId = objectBuilder.GetId(); m_physItemDef = MyDefinitionManager.Static.GetPhysicalItemForHandItem(m_handItemDefinitionId); base.Init(objectBuilder); Init(null, PhysicalItemDefinition.Model, null, null, null); Save = false; PhysicalObject = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_PhysicalGunObject>(m_handItemDefinitionId.SubtypeName); PhysicalObject.GunEntity = (MyObjectBuilder_EntityBase)objectBuilder.Clone(); PhysicalObject.GunEntity.EntityId = this.EntityId; m_toolItemDef = PhysicalItemDefinition as MyToolItemDefinition; m_notEnoughStatNotification = new MyHudNotification(MyCommonTexts.NotificationStatNotEnough, disappearTimeMs: 1000, font: MyFontEnum.Red, level: MyNotificationLevel.Important); InitToolComponents(); NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME; var builder = objectBuilder as MyObjectBuilder_HandToolBase; if (builder.DeviceBase != null) { GunBase.Init(builder.DeviceBase); } }
public override void Init() { key = KeyNum.Skill1; time = new FixedNumber(0.7f); timer = new FixedNumber(0); gun = new GunBase(); gun.Init(20, data); }