|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using UnityEditor; |
|
|
|
using UnityEditor.ShaderGraph.Drawing; |
|
|
|
|
|
|
{ |
|
|
|
var textGraph = File.ReadAllText(path, Encoding.UTF8); |
|
|
|
var graph = JsonUtility.FromJson<T>(textGraph); |
|
|
|
graph.LoadedFromDisk(); |
|
|
|
|
|
|
|
var name = Path.GetFileNameWithoutExtension(path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsValidForPath(string path) |
|
|
|
{ |
|
|
|
|
|
|
|
return |
|
|
|
path.EndsWith("LayeredShaderGraph", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
|| path.EndsWith("shaderGraph", StringComparison.InvariantCultureIgnoreCase); |
|
|
|