34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System.IO;
|
|
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
|
using Unity.Collections;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes
|
|
{
|
|
[NodeInfo("Texture Import", "Imports/Texture2D", true)]
|
|
public class Texture2DImport : BaseImageNode
|
|
{
|
|
[NodeAttributes.Input("")]
|
|
public Texture2D textureImport;
|
|
|
|
[NodeAttributes.Output("")]
|
|
public ImageData textureOutput;
|
|
[NodeAttributes.Output("File Name")]
|
|
public string fileName;
|
|
[NodeAttributes.Output("File Path")]
|
|
public string filePath;
|
|
|
|
public override void Process()
|
|
{
|
|
if (this.textureImport != null)
|
|
{
|
|
this.textureOutput = new ImageData(textureImport);
|
|
this.fileName = textureImport.name;
|
|
this.filePath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(textureImport));
|
|
}
|
|
else
|
|
Debug.LogError("UH!");
|
|
}
|
|
}
|
|
} |