Esempio n. 1
0
    protected void Delete(string path, NPipeIImportable importable)
    {
        editingImportable     = null;
        lastEditingImportable = null;

        importable.Destroy();
        Undo.DestroyObjectImmediate(importable as UnityEngine.Object);

        AssetDatabase.Refresh();
    }
    private void wipePreviewMeshFactories(string targetSocketName)
    {
//        var tsn = GetPreviewTargetSocketNames();
        foreach (NPVoxFrame f in Frames)
        {
            var p = f.GetPreviewAttachmentForTargetSocket(targetSocketName, false);
            if (p != null && p.outputMeshFactory != null)
            {
                ((NPipeIComposite)p.outputMeshFactory).Input.Invalidate();
                p.outputMeshFactory.Invalidate();

                NPipeIImportable combiner = ((NPipeIComposite)p.outputMeshFactory).Input;
                combiner.Destroy();  // TODO: isn't this called automatically?
                Object.DestroyImmediate((UnityEngine.Object)combiner);

                p.outputMeshFactory.Destroy(); // TODO: isn't this called automatically?
                Object.DestroyImmediate((UnityEngine.Object)p.outputMeshFactory);
                p.outputMeshFactory = null;
            }
        }
    }