public void Init(string hudLabelText, MyMwcObjectBuilder_MysteriousCube objectBuilder, Matrix matrix) { Flags |= EntityFlags.EditableInEditor; StringBuilder hudLabelTextSb = (hudLabelText == null) ? null : new StringBuilder(hudLabelText); switch (objectBuilder.MysteriousCubeType) { case MyMwcObjectBuilder_MysteriousCube_TypesEnum.Type1: base.Init(hudLabelTextSb, MyModelsEnum.MysteriousBox_matt_5m, null, null, null, objectBuilder); m_diffuseColor = new Vector3(0, 0, 0); break; case MyMwcObjectBuilder_MysteriousCube_TypesEnum.Type2: base.Init(hudLabelTextSb, MyModelsEnum.MysteriousBox_spec_5m, null, null, null, objectBuilder); m_diffuseColor = new Vector3(0, 0, 0); break; case MyMwcObjectBuilder_MysteriousCube_TypesEnum.Type3: base.Init(hudLabelTextSb, MyModelsEnum.MysteriousBox_mid_5m, null, null, null, objectBuilder); m_diffuseColor = new Vector3(0, 0, 0); break; } base.InitBoxPhysics(MyMaterialType.METAL, ModelLod0, 1f, 0f, MyConstants.COLLISION_LAYER_DEFAULT, RigidBodyFlag.RBF_RBO_STATIC); SetWorldMatrix(matrix); Save = true; this.Physics.Enabled = true; // NeedsUpdate = true; }
public void Add() { Vector3 position; if (GetAddPosition(out position)) { Matrix matrix = Matrix.CreateTranslation(position); var cube = new MyMwcObjectBuilder_MysteriousCube(new CommonLIB.AppCode.Networking.MyMwcPositionAndOrientation(matrix)); cube.MysteriousCubeType = MyMwcObjectBuilder_MysteriousCube_TypesEnum.Type2; MyEntities.CreateFromObjectBuilderAndAdd(null, cube, matrix); } }
protected override MyMwcObjectBuilder_Base GetObjectBuilderInternal(bool getExactCopy) { MyMwcObjectBuilder_MysteriousCube builder = base.GetObjectBuilderInternal(getExactCopy) as MyMwcObjectBuilder_MysteriousCube; return(builder); }