public static void BuildInterior(OCGlassBlock glass, OpenCog.Builder.OCMeshBuilder mesh)
        {
            if (glass.GetInterior() == null)
            {
                return;
            }

//		MeshFilter[] meshes = glass.GetInterior().GetComponents<MeshFilter>();
//		foreach(MeshFilter filter in meshes)
//		{
//			mesh = mesh.FromMesh(filter.sharedMesh);
//		}
        }
示例#2
0
    public static void DrawBlockEditor(OCBlock block, OCBlockSet blockSet)
    {
        UnityEngine.GUILayout.BeginVertical(UnityEngine.GUI.skin.box);
        {
            string name = EditorGUILayout.TextField("Name", block.GetName());
            block.SetName(FixNameString(name));

            if (block is OCGlassBlock)
            {
                OCGlassBlock           glass    = (OCGlassBlock)block;
                UnityEngine.GameObject interior = (UnityEngine.GameObject)EditorGUILayout.ObjectField("Interior", glass.GetInterior(), typeof(UnityEngine.GameObject), true, null);
                glass.SetInterior(interior);
            }

            int atlas = BlockEditorUtils.Popup("Atlas", block.AtlasID, blockSet.Atlases);
            block.AtlasID = atlas;

            int light = EditorGUILayout.IntField("Light", block.GetLight());
            block.SetLight(light);
        }
        UnityEngine.GUILayout.EndVertical();

        UnityEngine.Texture texture = block.GetTexture();
        if (texture != null)
        {
            FieldInfo field = DrawFacesList(block, texture);
            int       face  = (int)field.GetValue(block);
            DrawFaceEditor(ref face, block.Atlas, ref atlasMatrix);
            field.SetValue(block, face);
        }
    }