From 917e9e0b320775634dc2e710f7deac74fd0822f0 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 22 Oct 2020 23:30:02 +0800 Subject: * amplify shader editor --- .../Plugins/Editor/PreMadeShaders.cs | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/PreMadeShaders.cs (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/PreMadeShaders.cs') diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/PreMadeShaders.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/PreMadeShaders.cs new file mode 100644 index 00000000..e6fd5c67 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/PreMadeShaders.cs @@ -0,0 +1,47 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda + +using UnityEngine; + +using System.Collections.Generic; +namespace AmplifyShaderEditor +{ + public class PreMadeShaders + { + public static readonly string FlatColorSequenceId = "Flat Color"; + private Dictionary m_actionLib; + public PreMadeShaders() + { + m_actionLib = new Dictionary(); + ActionSequence sequence = new ActionSequence( FlatColorSequenceId ); + sequence.AddToSequence( new CreateNodeActionData( 1, typeof( ColorNode ), new Vector2( -250, 125 ) ) ); + sequence.AddToSequence( new CreateConnectionActionData( 0, 4, 1, 0 ) ); + m_actionLib.Add( sequence.Name, sequence ); + } + + public ActionSequence GetSequence( string name ) + { + if ( m_actionLib.ContainsKey( name ) ) + { + return m_actionLib[ name ]; + } + return null; + } + + public void Destroy() + { + var items = m_actionLib.GetEnumerator(); + while ( items.MoveNext() ) + { + items.Current.Value.Destroy(); + } + m_actionLib.Clear(); + m_actionLib = null; + } + + public ActionSequence FlatColorSequence + { + get { return m_actionLib[ FlatColorSequenceId ]; } + } + } +} -- cgit v1.1-26-g67d0