unity and native osx bundles and frameworks build from the same project now

This commit is contained in:
Joseph Henry
2016-06-16 11:47:08 -07:00
parent 621970619d
commit 699edf8f30
111 changed files with 11112 additions and 14 deletions

View File

@@ -0,0 +1,50 @@

using System;
using System.IO;
using System.Collections;
using UnityEngine;
using UnityEditor;
using UnityExtension;
public class OBJWindow : EditorWindow
{
//------------------------------------------------------------------------------------------------------------
private MeshFilter m_MeshFilter = null;
//------------------------------------------------------------------------------------------------------------
[MenuItem("OBJ-IO/OBJ Mesh Exporter")]
public static void Execute()
{
OBJWindow.GetWindow<OBJWindow>();
}
//------------------------------------------------------------------------------------------------------------
private void OnGUI()
{
m_MeshFilter = (MeshFilter)EditorGUILayout.ObjectField("MeshFilter", m_MeshFilter, typeof(MeshFilter), true);
if (m_MeshFilter != null)
{
if (GUILayout.Button("Export OBJ"))
{
var lOutputPath = EditorUtility.SaveFilePanel("Save Mesh as OBJ", "", m_MeshFilter.name + ".obj", "obj");
if (File.Exists(lOutputPath))
{
File.Delete(lOutputPath);
}
var lStream = new FileStream(lOutputPath, FileMode.Create);
var lOBJData = m_MeshFilter.sharedMesh.EncodeOBJ();
OBJLoader.ExportOBJ(lOBJData, lStream);
lStream.Close();
}
}
else
{
GUILayout.Label("Please provide a MeshFilter");
}
}
}