public static object CreateCubeBlock(MyObjectBuilder_CubeBlock builder)
        {
            var obj = m_objectFactory.CreateInstance(builder.TypeId);

            MyEntityFactory.AddScriptGameLogic(obj as MyEntity, builder.TypeId, builder.SubtypeName);
            return(obj);
        }
Example #2
0
        public static object CreateCubeBlock(MyObjectBuilder_CubeBlock builder)
        {
            object local1 = m_objectFactory.CreateInstance(builder.TypeId);

            VRage.Game.Entity.MyEntity entity = local1 as VRage.Game.Entity.MyEntity;
            if (entity != null)
            {
                MyEntityFactory.AddScriptGameLogic(entity, builder.TypeId, builder.SubtypeName);
            }
            return(local1);
        }
Example #3
0
        public static object CreateCubeBlock(MyObjectBuilder_CubeBlock builder)
        {
            var obj    = m_objectFactory.CreateInstance(builder.TypeId);
            var entity = obj as MyEntity; // Some are SlimBlocks

            if (entity != null)
            {
                MyEntityFactory.AddScriptGameLogic(entity, builder.TypeId, builder.SubtypeName);
            }
            return(obj);
        }