コード例 #1
0
    static void CreateAsset()
    {
        MeshCompiler item = EditorUtil.CreateAsset <MeshCompiler>(NMBEditorUtil.AssetLabel);

        EditorUtility.FocusProjectWindow();
        Selection.activeObject = item;
    }
コード例 #2
0
    /// <summary>
    /// Controls behavior of the inspector.
    /// </summary>
    public override void OnInspectorGUI()
    {
        MeshCompiler targ = (MeshCompiler)target;

        EditorGUILayout.Separator();

        GUILayout.Label("Priority: " + targ.Priority);

        EditorGUILayout.Separator();

        EditorGUIUtility.LookLikeControls(120);

        targ.colocationOption = (MeshColocationOption)
                                EditorGUILayout.EnumPopup("Colocation priority", targ.colocationOption);

        EditorGUILayout.Separator();

        string msg = "Input Build Processor\n\n"
                     + "Loads and compiles the " + typeof(MeshFilter).Name + " components in the scene.";

        if (targ.colocationOption == MeshColocationOption.Collider)
        {
            msg += "\n\nIf a supported collider is colocated with the mesh, then the collider"
                   + " will be compiled instead of the mesh. Supported colliders include:"
                   + " SphereCollider, BoxCollider, and MeshCollider.";
        }

        GUILayout.Box(msg, EditorUtil.HelpStyle, GUILayout.ExpandWidth(true));

        EditorGUILayout.Separator();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(targ);
        }
    }
コード例 #3
0
 public void UpdateAll()
 {
     MeshCompiler.Compile(model, mesh);
 }