├── CONTRIBUTING.md ├── README.md ├── Scripts ├── Audio Events │ ├── AudioEvent.cs │ ├── MinMaxRangeAttribute.cs │ ├── RangedFloat.cs │ ├── RangedFloatDrawer.cs │ └── SimpleAudioEvent.cs ├── Debug │ ├── DebugCommandBase.cs │ └── DebugController.cs ├── Extensions │ └── Sliced Filled Image │ │ ├── Editor │ │ └── SlicedFilledImageEditor.cs │ │ └── Extensions │ │ └── SlicedFilledImage.cs ├── Game Events │ ├── GameEvent.cs │ ├── GameEventListener.cs │ └── GameEventListenerWithDelay.cs ├── Hierarchy Separator │ ├── Editor │ │ └── HierarchySeparatorEditor.cs │ └── Runtime │ │ └── HierarchySeparator.cs ├── Parallax │ └── Parallax.cs ├── Scrolling Text │ ├── ScrollingManager.cs │ ├── ScrollingText.cs │ └── ScrollingText.prefab ├── Sprite Animator │ ├── Editor │ │ ├── SpriteAnimationEditor.cs │ │ └── SpriteAnimationFrameDrawer.cs │ ├── SpriteAnimation.cs │ ├── SpriteAnimationFrame.cs │ ├── SpriteAnimationHelper.cs │ ├── SpriteAnimationState.cs │ ├── SpriteAnimationType.cs │ └── SpriteAnimator.cs └── State Machine │ ├── Entities Sample │ └── PlayerEntity.cs │ ├── IState.cs │ ├── StateMachine.cs │ └── States │ ├── IdleState.cs │ └── WalkState.cs ├── Shaders ├── Outline - HLSL │ ├── SpriteInnerOutline.shader │ └── SpriteOuterOutline.shader └── Outline - Shader Graph │ ├── OutlineSample.shadersubgraph │ └── Outline_Unlit.shadergraph └── Sprites └── Prototyping Tilesets ├── Prototype 16x16 └── tiles_16x16.png ├── Prototype 32x32 └── Tiles_32x32.png └── Prototype 64x64 └── Tiles_64x64.png /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | Please note we have a code of conduct, please follow it in all your interactions with the project. 7 | 8 | ## Pull Request Process 9 | 10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 11 | build. 12 | 2. Update the README.md with details of changes to the interface, this includes new environment 13 | variables, exposed ports, useful file locations and container parameters. 14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 15 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you 17 | do not have permission to do that, you may request the second reviewer to merge it for you. 18 | 19 | ## Code of Conduct 20 | 21 | ### Our Pledge 22 | 23 | In the interest of fostering an open and welcoming environment, we as 24 | contributors and maintainers pledge to making participation in our project and 25 | our community a harassment-free experience for everyone, regardless of age, body 26 | size, disability, ethnicity, gender identity and expression, level of experience, 27 | nationality, personal appearance, race, religion, or sexual identity and 28 | orientation. 29 | 30 | ### Our Standards 31 | 32 | Examples of behavior that contributes to creating a positive environment 33 | include: 34 | 35 | * Using welcoming and inclusive language 36 | * Being respectful of differing viewpoints and experiences 37 | * Gracefully accepting constructive criticism 38 | * Focusing on what is best for the community 39 | * Showing empathy towards other community members 40 | 41 | Examples of unacceptable behavior by participants include: 42 | 43 | * The use of sexualized language or imagery and unwelcome sexual attention or 44 | advances 45 | * Trolling, insulting/derogatory comments, and personal or political attacks 46 | * Public or private harassment 47 | * Publishing others' private information, such as a physical or electronic 48 | address, without explicit permission 49 | * Other conduct which could reasonably be considered inappropriate in a 50 | professional setting 51 | 52 | ### Our Responsibilities 53 | 54 | Project maintainers are responsible for clarifying the standards of acceptable 55 | behavior and are expected to take appropriate and fair corrective action in 56 | response to any instances of unacceptable behavior. 57 | 58 | Project maintainers have the right and responsibility to remove, edit, or 59 | reject comments, commits, code, wiki edits, issues, and other contributions 60 | that are not aligned to this Code of Conduct, or to ban temporarily or 61 | permanently any contributor for other behaviors that they deem inappropriate, 62 | threatening, offensive, or harmful. 63 | 64 | ### Scope 65 | 66 | This Code of Conduct applies both within project spaces and in public spaces 67 | when an individual is representing the project or its community. Examples of 68 | representing a project or community include using an official project e-mail 69 | address, posting via an official social media account, or acting as an appointed 70 | representative at an online or offline event. Representation of a project may be 71 | further defined and clarified by project maintainers. 72 | 73 | ### Enforcement 74 | 75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 76 | reported by contacting the project team at [gabrielbigardi@hotmail.com]. All 77 | complaints will be reviewed and investigated and will result in a response that 78 | is deemed necessary and appropriate to the circumstances. The project team is 79 | obligated to maintain confidentiality with regard to the reporter of an incident. 80 | Further details of specific enforcement policies may be posted separately. 81 | 82 | Project maintainers who do not follow or enforce the Code of Conduct in good 83 | faith may face temporary or permanent repercussions as determined by other 84 | members of the project's leadership. 85 | 86 | ### Attribution 87 | 88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 89 | available at [http://contributor-covenant.org/version/1/4][version] 90 | 91 | [homepage]: http://contributor-covenant.org 92 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A pack of utilities useful for any Unity Engine project. 2 | 3 | ## Table of contents 4 | | Content | Type | Location | Description | 5 | | :---: | :---: | :---: | :---: | 6 | | Audio Events | Script | Scripts/Audio Events/ | Audio Events with customizable volume/pitch/random clips based on scriptable objects | 7 | | Game Events | Script | Scripts/Game Events/ | Game Events based on scriptable objects | 8 | | Debug Console | Script | Scripts/Debug/ | Simple useful debug/cheat console | 9 | | Hierarchy Separator | Script | Scripts/Hierarchy Separator/ | A nice way of organizing your hierarchy | 10 | | Parallax | Script | Scripts/Parallax/ | Parallax script based on near/clipping planes | 11 | | State Machine | Script | Scripts/State Machine/ | Basic and powerful state-machine system | 12 | | Scrolling Text System | Script | Scripts/Scrolling Text/ | A simple scrolling text system with singleton | 13 | | Sliced Filled Image | Script | Scripts/Extensions/Sliced Filled Image | UI image that can be sliced AND filled | 14 | | Sprite Animator | Script | Scripts/Sprite Animator/ | A simple and easily customizable sprite animator | 15 | | Inner/Outer Outline Shader (HLSL) | Shader | Shaders/Outline - HLSL/ | Inner and outer outline shader | 16 | | Outline (ShaderGraph) | Shader | Shaders/Outline - Shader Graph/ | Outline shader made in Shader Graph | 17 | | Prototyping Tilesets (16x16, 32x32, 64x64) | Sprite | Sprites/Prototyping Tilesets/ | Set of prototyping tilesets | 18 | 19 | ## Credits 20 | | Credited | Reason | 21 | | :---: | :---: | 22 | | [Ricardo Godoy](https://github.com/RicardoQLG) | Remaking Hierarchy Separator with better/cleaner/flexible code and usability | 23 | | [AdamCYounis](https://www.twitch.tv/adamcyounis) | Making the initial Parallax script | 24 | | [IndieGabo](https://github.com/indiegabo) | Adding LockX/LockY/Smoothing to Parallax | 25 | 26 | ## How do i contribute to this project? 27 | [Click here](CONTRIBUTING.md). 28 | 29 | ## Contact 30 | **Discord**: *Gabriel Bigardi#2292* 31 | **Twitter**: *@BigardiGabriel* 32 | **Email**: *gabrielbigardi@hotmail.com* 33 | -------------------------------------------------------------------------------- /Scripts/Audio Events/AudioEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public abstract class AudioEvent : ScriptableObject 6 | { 7 | public abstract void Play(AudioSource source); 8 | public abstract void PlayLooping(AudioSource source); 9 | public abstract void PlayOneShot(AudioSource source); 10 | } 11 | -------------------------------------------------------------------------------- /Scripts/Audio Events/MinMaxRangeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class MinMaxRangeAttribute : Attribute 4 | { 5 | public MinMaxRangeAttribute(float min, float max) 6 | { 7 | Min = min; 8 | Max = max; 9 | } 10 | public float Min { get; private set; } 11 | public float Max { get; private set; } 12 | } -------------------------------------------------------------------------------- /Scripts/Audio Events/RangedFloat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [Serializable] 4 | public struct RangedFloat 5 | { 6 | public float minValue; 7 | public float maxValue; 8 | 9 | public RangedFloat(float minValue, float maxValue) 10 | { 11 | this.minValue = minValue; 12 | this.maxValue = maxValue; 13 | } 14 | } -------------------------------------------------------------------------------- /Scripts/Audio Events/RangedFloatDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | #if UNITY_EDITOR 6 | [CustomPropertyDrawer(typeof(RangedFloat), true)] 7 | public class RangedFloatDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | label = EditorGUI.BeginProperty(position, label, property); 12 | position = EditorGUI.PrefixLabel(position, label); 13 | 14 | SerializedProperty minProp = property.FindPropertyRelative("minValue"); 15 | SerializedProperty maxProp = property.FindPropertyRelative("maxValue"); 16 | 17 | float minValue = minProp.floatValue; 18 | float maxValue = maxProp.floatValue; 19 | 20 | float rangeMin = 0; 21 | float rangeMax = 1; 22 | 23 | var ranges = (MinMaxRangeAttribute[])fieldInfo.GetCustomAttributes(typeof(MinMaxRangeAttribute), true); 24 | if (ranges.Length > 0) 25 | { 26 | rangeMin = ranges[0].Min; 27 | rangeMax = ranges[0].Max; 28 | } 29 | 30 | const float rangeBoundsLabelWidth = 40f; 31 | 32 | var rangeBoundsLabel1Rect = new Rect(position); 33 | rangeBoundsLabel1Rect.width = rangeBoundsLabelWidth; 34 | GUI.Label(rangeBoundsLabel1Rect, new GUIContent(minValue.ToString("F2"))); 35 | position.xMin += rangeBoundsLabelWidth; 36 | 37 | var rangeBoundsLabel2Rect = new Rect(position); 38 | rangeBoundsLabel2Rect.xMin = rangeBoundsLabel2Rect.xMax - rangeBoundsLabelWidth; 39 | GUI.Label(rangeBoundsLabel2Rect, new GUIContent(maxValue.ToString("F2"))); 40 | position.xMax -= rangeBoundsLabelWidth; 41 | 42 | EditorGUI.BeginChangeCheck(); 43 | EditorGUI.MinMaxSlider(position, ref minValue, ref maxValue, rangeMin, rangeMax); 44 | if (EditorGUI.EndChangeCheck()) 45 | { 46 | minProp.floatValue = minValue; 47 | maxProp.floatValue = maxValue; 48 | } 49 | 50 | EditorGUI.EndProperty(); 51 | } 52 | } 53 | #endif -------------------------------------------------------------------------------- /Scripts/Audio Events/SimpleAudioEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu(menuName = "Unity Utils/Audio Events/Simple")] 6 | public class SimpleAudioEvent : AudioEvent 7 | { 8 | public AudioClip[] clips; 9 | 10 | public RangedFloat volume; 11 | 12 | [MinMaxRange(0, 2)] 13 | public RangedFloat pitch; 14 | 15 | public SimpleAudioEvent() 16 | { 17 | volume = new RangedFloat(1f,1f); 18 | pitch = new RangedFloat(1f, 1f); 19 | 20 | } 21 | 22 | public override void Play(AudioSource source) 23 | { 24 | if (clips.Length == 0) return; 25 | 26 | source.loop = false; 27 | source.clip = clips[Random.Range(0, clips.Length)]; 28 | source.volume = Random.Range(volume.minValue, volume.maxValue); 29 | source.pitch = Random.Range(pitch.minValue, pitch.maxValue); 30 | source.Play(); 31 | } 32 | 33 | public override void PlayLooping(AudioSource source) 34 | { 35 | if (clips.Length == 0) return; 36 | 37 | source.loop = true; 38 | source.clip = clips[Random.Range(0, clips.Length)]; 39 | source.volume = Random.Range(volume.minValue, volume.maxValue); 40 | source.pitch = Random.Range(pitch.minValue, pitch.maxValue); 41 | source.Play(); 42 | } 43 | 44 | public override void PlayOneShot(AudioSource source) 45 | { 46 | source.pitch = Random.Range(pitch.minValue, pitch.maxValue); 47 | source.PlayOneShot(clips[Random.Range(0, clips.Length)], Random.Range(volume.minValue, volume.maxValue)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Scripts/Debug/DebugCommandBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public class DebugCommandBase 7 | { 8 | private string _commandId; 9 | private string _commandDescription; 10 | private string _commandFormat; 11 | 12 | public string commandId { get { return _commandId; } } 13 | public string commandDescription { get { return _commandDescription; } } 14 | public string commandFormat { get { return _commandFormat; } } 15 | 16 | public DebugCommandBase(string id, string description, string format) 17 | { 18 | _commandId = id; 19 | _commandDescription = description; 20 | _commandFormat = format; 21 | } 22 | 23 | } 24 | 25 | public class DebugCommand : DebugCommandBase 26 | { 27 | private Action command; 28 | 29 | public DebugCommand(string id, string description, string format, Action command) : base (id, description, format) 30 | { 31 | this.command = command; 32 | } 33 | 34 | public void Invoke() 35 | { 36 | command.Invoke(); 37 | } 38 | } 39 | 40 | public class DebugCommand : DebugCommandBase 41 | { 42 | private Action command; 43 | 44 | public DebugCommand(string id, string description, string format, Action command) : base(id, description, format) 45 | { 46 | this.command = command; 47 | } 48 | 49 | public void Invoke(T1 value) 50 | { 51 | command.Invoke(value); 52 | } 53 | } -------------------------------------------------------------------------------- /Scripts/Debug/DebugController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | public class DebugController : MonoBehaviour 7 | { 8 | //Styling 9 | GUIStyle boxStyle = null; 10 | GUIStyle borderStyle1 = null; 11 | GUIStyle borderStyle2 = null; 12 | 13 | //Control variables 14 | bool isFocused; 15 | bool showConsole; 16 | bool showHelp; 17 | 18 | string input; 19 | 20 | //Static commands variables 21 | public static DebugCommand INT_COMMAND_HERE; 22 | public static DebugCommand SIMPLE_COMMAND_HERE; 23 | public static DebugCommand HELP; 24 | 25 | public List commandList; 26 | 27 | //Initilize DebugCommands and add to "commandList" 28 | private void Awake() 29 | { 30 | INT_COMMAND_HERE = new DebugCommand("int_command_here", "Example command with int parameter.", "int_command_here ", (x) => 31 | { 32 | Debug.Log("Command with int parameter called. Int value: " + x); 33 | }); 34 | 35 | SIMPLE_COMMAND_HERE = new DebugCommand("simple_command_here", "Example command with no parameter.", "simple_command_here", () => 36 | { 37 | Debug.Log("Command with no parameter called."); 38 | }); 39 | 40 | HELP = new DebugCommand("help", "Show a list of commands.", "help", () => 41 | { 42 | showHelp = true; 43 | isFocused = true; 44 | }); 45 | 46 | commandList = new List 47 | { 48 | INT_COMMAND_HERE, 49 | SIMPLE_COMMAND_HERE, 50 | HELP 51 | }; 52 | 53 | } 54 | 55 | //Listen for input BackQuote to show the debug console 56 | private void Update() 57 | { 58 | if (Input.GetKeyDown(KeyCode.BackQuote)) 59 | { 60 | OnToggleDebug(); 61 | } 62 | } 63 | 64 | public void OnToggleDebug() 65 | { 66 | showConsole = !showConsole; 67 | isFocused = showConsole; 68 | } 69 | 70 | Vector2 scroll; 71 | 72 | //Styles initializator 73 | private void InitStyles() 74 | { 75 | if(boxStyle == null) 76 | { 77 | boxStyle = new GUIStyle( GUI.skin.box ); 78 | boxStyle.normal.background = MakeTex( 2, 2, new Color( 0f, 0f, 0f, 1f ) ); 79 | } 80 | 81 | if (borderStyle1 == null) 82 | { 83 | borderStyle1 = new GUIStyle(GUI.skin.box); 84 | borderStyle1.normal.background = MakeTex( 2, 2, new Color( 0f, 1f, 0f, 1f ) ); 85 | } 86 | 87 | if (borderStyle2 == null) 88 | { 89 | borderStyle2 = new GUIStyle(GUI.skin.box); 90 | borderStyle2.normal.background = MakeTex( 2, 2, new Color( 0f, 1f, 0f, 1f ) ); 91 | } 92 | } 93 | 94 | //Function useful to set color to the console 95 | private Texture2D MakeTex( int width, int height, Color col ) 96 | { 97 | Color[] pix = new Color[width * height]; 98 | for( int i = 0; i < pix.Length; ++i ) 99 | { 100 | pix[ i ] = col; 101 | } 102 | Texture2D result = new Texture2D( width, height ); 103 | result.SetPixels( pix ); 104 | result.Apply(); 105 | return result; 106 | } 107 | 108 | private void OnGUI() 109 | { 110 | InitStyles(); 111 | 112 | if (!showConsole) return; 113 | 114 | //Handle BackQuote input (close the debug console if pressed) 115 | if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.BackQuote) 116 | { 117 | OnToggleDebug(); 118 | } 119 | 120 | float y = 0f; 121 | int borderThickness = 1; 122 | 123 | if (showHelp) 124 | { 125 | GUI.Box(new Rect(0, y, Screen.width, 100), "", borderStyle1); 126 | GUI.Box(new Rect(borderThickness, y + borderThickness, Screen.width - (borderThickness * 2), 100 - (borderThickness * 2)), "", boxStyle); 127 | 128 | Rect viewport = new Rect(0, 0, Screen.width - 30, 20 * commandList.Count); 129 | scroll = GUI.BeginScrollView(new Rect(borderThickness, y+5f+borderThickness, Screen.width - (borderThickness * 2), 90 - (borderThickness * 2)), scroll, viewport); 130 | 131 | for (int i = 0; i < commandList.Count; i++) 132 | { 133 | DebugCommandBase command = commandList[i] as DebugCommandBase; 134 | string label = $"{command.commandFormat} - {command.commandDescription}"; 135 | Rect labelRect = new Rect(5, 20 * i, viewport.width - 100, 20); 136 | GUI.Label(labelRect, label); 137 | } 138 | 139 | GUI.EndScrollView(); 140 | 141 | y += 100; 142 | } 143 | 144 | GUI.Box(new Rect(0, y, Screen.width, 30), "", borderStyle1); 145 | GUI.Box(new Rect(borderThickness, y + borderThickness, Screen.width - (borderThickness * 2), 30 - (borderThickness * 2)),"", boxStyle); 146 | 147 | GUI.backgroundColor = new Color(0, 0, 0, 0); 148 | GUI.SetNextControlName("InputField"); 149 | input = GUI.TextField(new Rect(borderThickness+2f, y + 5f, Screen.width, 20f), input); 150 | 151 | //Set Focus to Input Field just once 152 | if (isFocused) 153 | { 154 | GUI.FocusControl("InputField"); 155 | isFocused = false; 156 | } 157 | 158 | //Handle enter/return input 159 | if (Event.current.type == EventType.KeyDown && Event.current.character == '\n') 160 | { 161 | HandleInput(); 162 | input = ""; 163 | } 164 | } 165 | 166 | //Handle command input/parameters 167 | private void HandleInput() 168 | { 169 | string[] properties = input.Split(' '); 170 | 171 | for (int i = 0; i < commandList.Count; i++) 172 | { 173 | DebugCommandBase commandBase = commandList[i] as DebugCommandBase; 174 | if (input.Contains(commandBase.commandId)) 175 | { 176 | if(commandList[i] is DebugCommand command) 177 | { 178 | command.Invoke(); 179 | }else if(commandList[i] is DebugCommand commandInt) 180 | { 181 | commandInt.Invoke(int.Parse(properties[1])); 182 | } 183 | } 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /Scripts/Extensions/Sliced Filled Image/Editor/SlicedFilledImageEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | 5 | // Custom Editor to order the variables in the Inspector similar to Image component 6 | [CustomEditor(typeof(SlicedFilledImage)), CanEditMultipleObjects] 7 | public class SlicedFilledImageEditor : Editor 8 | { 9 | private SerializedProperty spriteProp, colorProp; 10 | private GUIContent spriteLabel; 11 | 12 | private void OnEnable() 13 | { 14 | spriteProp = serializedObject.FindProperty("m_Sprite"); 15 | colorProp = serializedObject.FindProperty("m_Color"); 16 | spriteLabel = new GUIContent("Source Image"); 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | serializedObject.Update(); 22 | 23 | EditorGUILayout.PropertyField(spriteProp, spriteLabel); 24 | EditorGUILayout.PropertyField(colorProp); 25 | DrawPropertiesExcluding(serializedObject, "m_Script", "m_Sprite", "m_Color", "m_OnCullStateChanged"); 26 | 27 | serializedObject.ApplyModifiedProperties(); 28 | } 29 | } 30 | #endif -------------------------------------------------------------------------------- /Scripts/Extensions/Sliced Filled Image/Extensions/SlicedFilledImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | #if UNITY_2017_4 || UNITY_2018_2_OR_NEWER 6 | using UnityEngine.U2D; 7 | #endif 8 | using Sprites = UnityEngine.Sprites; 9 | 10 | // Credit: https://bitbucket.org/Unity-Technologies/ui/src/2018.4/UnityEngine.UI/UI/Core/Image.cs 11 | [RequireComponent(typeof(CanvasRenderer))] 12 | [AddComponentMenu("UI/Sliced Filled Image", 11)] 13 | public class SlicedFilledImage : MaskableGraphic, ISerializationCallbackReceiver, ILayoutElement, ICanvasRaycastFilter 14 | { 15 | private static class SetPropertyUtility 16 | { 17 | public static bool SetStruct(ref T currentValue, T newValue) where T : struct 18 | { 19 | if (EqualityComparer.Default.Equals(currentValue, newValue)) 20 | return false; 21 | 22 | currentValue = newValue; 23 | return true; 24 | } 25 | 26 | public static bool SetClass(ref T currentValue, T newValue) where T : class 27 | { 28 | if ((currentValue == null && newValue == null) || (currentValue != null && currentValue.Equals(newValue))) 29 | return false; 30 | 31 | currentValue = newValue; 32 | return true; 33 | } 34 | } 35 | 36 | public enum FillDirection { Right = 0, Left = 1, Up = 2, Down = 3 } 37 | 38 | private static readonly Vector3[] s_Vertices = new Vector3[4]; 39 | private static readonly Vector2[] s_UVs = new Vector2[4]; 40 | private static readonly Vector2[] s_SlicedVertices = new Vector2[4]; 41 | private static readonly Vector2[] s_SlicedUVs = new Vector2[4]; 42 | 43 | #pragma warning disable 1692 44 | #pragma warning disable IDE1006 // Suppress 'Naming rule violation' warnings 45 | #pragma warning disable 0649 46 | [SerializeField] 47 | private Sprite m_Sprite; 48 | public Sprite sprite 49 | { 50 | get { return m_Sprite; } 51 | set 52 | { 53 | if (SetPropertyUtility.SetClass(ref m_Sprite, value)) 54 | { 55 | SetAllDirty(); 56 | TrackImage(); 57 | } 58 | } 59 | } 60 | 61 | [SerializeField] 62 | private FillDirection m_FillDirection; 63 | public FillDirection fillDirection 64 | { 65 | get { return m_FillDirection; } 66 | set 67 | { 68 | if (SetPropertyUtility.SetStruct(ref m_FillDirection, value)) 69 | SetVerticesDirty(); 70 | } 71 | } 72 | 73 | [Range(0, 1)] 74 | [SerializeField] 75 | private float m_FillAmount = 1f; 76 | public float fillAmount 77 | { 78 | get { return m_FillAmount; } 79 | set 80 | { 81 | if (SetPropertyUtility.SetStruct(ref m_FillAmount, Mathf.Clamp01(value))) 82 | SetVerticesDirty(); 83 | } 84 | } 85 | 86 | [SerializeField] 87 | private bool m_FillCenter = true; 88 | public bool fillCenter 89 | { 90 | get { return m_FillCenter; } 91 | set 92 | { 93 | if (SetPropertyUtility.SetStruct(ref m_FillCenter, value)) 94 | SetVerticesDirty(); 95 | } 96 | } 97 | 98 | [SerializeField] 99 | private float m_PixelsPerUnitMultiplier = 1f; 100 | public float pixelsPerUnitMultiplier 101 | { 102 | get { return m_PixelsPerUnitMultiplier; } 103 | set { m_PixelsPerUnitMultiplier = Mathf.Max(0.01f, value); } 104 | } 105 | 106 | public float pixelsPerUnit 107 | { 108 | get 109 | { 110 | float spritePixelsPerUnit = 100; 111 | if (activeSprite) 112 | spritePixelsPerUnit = activeSprite.pixelsPerUnit; 113 | 114 | float referencePixelsPerUnit = 100; 115 | if (canvas) 116 | referencePixelsPerUnit = canvas.referencePixelsPerUnit; 117 | 118 | return m_PixelsPerUnitMultiplier * spritePixelsPerUnit / referencePixelsPerUnit; 119 | } 120 | } 121 | #pragma warning restore 0649 122 | 123 | [NonSerialized] 124 | private Sprite m_OverrideSprite; 125 | public Sprite overrideSprite 126 | { 127 | get { return activeSprite; } 128 | set 129 | { 130 | if (SetPropertyUtility.SetClass(ref m_OverrideSprite, value)) 131 | { 132 | SetAllDirty(); 133 | TrackImage(); 134 | } 135 | } 136 | } 137 | 138 | private Sprite activeSprite { get { return m_OverrideSprite != null ? m_OverrideSprite : m_Sprite; } } 139 | 140 | public override Texture mainTexture 141 | { 142 | get 143 | { 144 | if (activeSprite != null) 145 | return activeSprite.texture; 146 | 147 | return material != null && material.mainTexture != null ? material.mainTexture : s_WhiteTexture; 148 | } 149 | } 150 | 151 | public bool hasBorder 152 | { 153 | get 154 | { 155 | if (activeSprite != null) 156 | { 157 | Vector4 v = activeSprite.border; 158 | return v.sqrMagnitude > 0f; 159 | } 160 | 161 | return false; 162 | } 163 | } 164 | 165 | public override Material material 166 | { 167 | get 168 | { 169 | if (m_Material != null) 170 | return m_Material; 171 | 172 | if (activeSprite && activeSprite.associatedAlphaSplitTexture != null) 173 | { 174 | #if UNITY_EDITOR 175 | if (Application.isPlaying) 176 | #endif 177 | return Image.defaultETC1GraphicMaterial; 178 | } 179 | 180 | return defaultMaterial; 181 | } 182 | set { base.material = value; } 183 | } 184 | 185 | public float alphaHitTestMinimumThreshold { get; set; } 186 | #pragma warning restore IDE1006 187 | #pragma warning restore 1692 188 | 189 | protected SlicedFilledImage() 190 | { 191 | useLegacyMeshGeneration = false; 192 | } 193 | 194 | protected override void OnEnable() 195 | { 196 | base.OnEnable(); 197 | TrackImage(); 198 | } 199 | 200 | protected override void OnDisable() 201 | { 202 | base.OnDisable(); 203 | 204 | if (m_Tracked) 205 | UnTrackImage(); 206 | } 207 | 208 | #if UNITY_EDITOR 209 | protected override void OnValidate() 210 | { 211 | base.OnValidate(); 212 | m_PixelsPerUnitMultiplier = Mathf.Max(0.01f, m_PixelsPerUnitMultiplier); 213 | } 214 | #endif 215 | 216 | protected override void OnPopulateMesh(VertexHelper vh) 217 | { 218 | if (activeSprite == null) 219 | { 220 | base.OnPopulateMesh(vh); 221 | return; 222 | } 223 | 224 | GenerateSlicedFilledSprite(vh); 225 | } 226 | 227 | /// 228 | /// Update the renderer's material. 229 | /// 230 | protected override void UpdateMaterial() 231 | { 232 | base.UpdateMaterial(); 233 | 234 | // Check if this sprite has an associated alpha texture (generated when splitting RGBA = RGB + A as two textures without alpha) 235 | if (activeSprite == null) 236 | { 237 | canvasRenderer.SetAlphaTexture(null); 238 | return; 239 | } 240 | 241 | Texture2D alphaTex = activeSprite.associatedAlphaSplitTexture; 242 | if (alphaTex != null) 243 | canvasRenderer.SetAlphaTexture(alphaTex); 244 | } 245 | 246 | private void GenerateSlicedFilledSprite(VertexHelper vh) 247 | { 248 | vh.Clear(); 249 | 250 | if (m_FillAmount < 0.001f) 251 | return; 252 | 253 | Rect rect = GetPixelAdjustedRect(); 254 | Vector4 outer = Sprites.DataUtility.GetOuterUV(activeSprite); 255 | Vector4 padding = Sprites.DataUtility.GetPadding(activeSprite); 256 | 257 | if (!hasBorder) 258 | { 259 | Vector2 size = activeSprite.rect.size; 260 | 261 | int spriteW = Mathf.RoundToInt(size.x); 262 | int spriteH = Mathf.RoundToInt(size.y); 263 | 264 | // Image's dimensions used for drawing. X = left, Y = bottom, Z = right, W = top. 265 | Vector4 vertices = new Vector4( 266 | rect.x + rect.width * (padding.x / spriteW), 267 | rect.y + rect.height * (padding.y / spriteH), 268 | rect.x + rect.width * ((spriteW - padding.z) / spriteW), 269 | rect.y + rect.height * ((spriteH - padding.w) / spriteH)); 270 | 271 | GenerateFilledSprite(vh, vertices, outer, m_FillAmount); 272 | return; 273 | } 274 | 275 | Vector4 inner = Sprites.DataUtility.GetInnerUV(activeSprite); 276 | Vector4 border = GetAdjustedBorders(activeSprite.border / pixelsPerUnit, rect); 277 | 278 | padding = padding / pixelsPerUnit; 279 | 280 | s_SlicedVertices[0] = new Vector2(padding.x, padding.y); 281 | s_SlicedVertices[3] = new Vector2(rect.width - padding.z, rect.height - padding.w); 282 | 283 | s_SlicedVertices[1].x = border.x; 284 | s_SlicedVertices[1].y = border.y; 285 | 286 | s_SlicedVertices[2].x = rect.width - border.z; 287 | s_SlicedVertices[2].y = rect.height - border.w; 288 | 289 | for (int i = 0; i < 4; ++i) 290 | { 291 | s_SlicedVertices[i].x += rect.x; 292 | s_SlicedVertices[i].y += rect.y; 293 | } 294 | 295 | s_SlicedUVs[0] = new Vector2(outer.x, outer.y); 296 | s_SlicedUVs[1] = new Vector2(inner.x, inner.y); 297 | s_SlicedUVs[2] = new Vector2(inner.z, inner.w); 298 | s_SlicedUVs[3] = new Vector2(outer.z, outer.w); 299 | 300 | float rectStartPos; 301 | float _1OverTotalSize; 302 | if (m_FillDirection == FillDirection.Left || m_FillDirection == FillDirection.Right) 303 | { 304 | rectStartPos = s_SlicedVertices[0].x; 305 | 306 | float totalSize = (s_SlicedVertices[3].x - s_SlicedVertices[0].x); 307 | _1OverTotalSize = totalSize > 0f ? 1f / totalSize : 1f; 308 | } 309 | else 310 | { 311 | rectStartPos = s_SlicedVertices[0].y; 312 | 313 | float totalSize = (s_SlicedVertices[3].y - s_SlicedVertices[0].y); 314 | _1OverTotalSize = totalSize > 0f ? 1f / totalSize : 1f; 315 | } 316 | 317 | for (int x = 0; x < 3; x++) 318 | { 319 | int x2 = x + 1; 320 | 321 | for (int y = 0; y < 3; y++) 322 | { 323 | if (!m_FillCenter && x == 1 && y == 1) 324 | continue; 325 | 326 | int y2 = y + 1; 327 | 328 | float sliceStart, sliceEnd; 329 | switch (m_FillDirection) 330 | { 331 | case FillDirection.Right: 332 | sliceStart = (s_SlicedVertices[x].x - rectStartPos) * _1OverTotalSize; 333 | sliceEnd = (s_SlicedVertices[x2].x - rectStartPos) * _1OverTotalSize; 334 | break; 335 | case FillDirection.Up: 336 | sliceStart = (s_SlicedVertices[y].y - rectStartPos) * _1OverTotalSize; 337 | sliceEnd = (s_SlicedVertices[y2].y - rectStartPos) * _1OverTotalSize; 338 | break; 339 | case FillDirection.Left: 340 | sliceStart = 1f - (s_SlicedVertices[x2].x - rectStartPos) * _1OverTotalSize; 341 | sliceEnd = 1f - (s_SlicedVertices[x].x - rectStartPos) * _1OverTotalSize; 342 | break; 343 | case FillDirection.Down: 344 | sliceStart = 1f - (s_SlicedVertices[y2].y - rectStartPos) * _1OverTotalSize; 345 | sliceEnd = 1f - (s_SlicedVertices[y].y - rectStartPos) * _1OverTotalSize; 346 | break; 347 | default: // Just there to get rid of the "Use of unassigned local variable" compiler error 348 | sliceStart = sliceEnd = 0f; 349 | break; 350 | } 351 | 352 | if (sliceStart >= m_FillAmount) 353 | continue; 354 | 355 | Vector4 vertices = new Vector4(s_SlicedVertices[x].x, s_SlicedVertices[y].y, s_SlicedVertices[x2].x, s_SlicedVertices[y2].y); 356 | Vector4 uvs = new Vector4(s_SlicedUVs[x].x, s_SlicedUVs[y].y, s_SlicedUVs[x2].x, s_SlicedUVs[y2].y); 357 | float fillAmount = (m_FillAmount - sliceStart) / (sliceEnd - sliceStart); 358 | 359 | GenerateFilledSprite(vh, vertices, uvs, fillAmount); 360 | } 361 | } 362 | } 363 | 364 | private Vector4 GetAdjustedBorders(Vector4 border, Rect adjustedRect) 365 | { 366 | Rect originalRect = rectTransform.rect; 367 | 368 | for (int axis = 0; axis <= 1; axis++) 369 | { 370 | float borderScaleRatio; 371 | 372 | // The adjusted rect (adjusted for pixel correctness) may be slightly larger than the original rect. 373 | // Adjust the border to match the adjustedRect to avoid small gaps between borders (case 833201). 374 | if (originalRect.size[axis] != 0) 375 | { 376 | borderScaleRatio = adjustedRect.size[axis] / originalRect.size[axis]; 377 | border[axis] *= borderScaleRatio; 378 | border[axis + 2] *= borderScaleRatio; 379 | } 380 | 381 | // If the rect is smaller than the combined borders, then there's not room for the borders at their normal size. 382 | // In order to avoid artefacts with overlapping borders, we scale the borders down to fit. 383 | float combinedBorders = border[axis] + border[axis + 2]; 384 | if (adjustedRect.size[axis] < combinedBorders && combinedBorders != 0) 385 | { 386 | borderScaleRatio = adjustedRect.size[axis] / combinedBorders; 387 | border[axis] *= borderScaleRatio; 388 | border[axis + 2] *= borderScaleRatio; 389 | } 390 | } 391 | 392 | return border; 393 | } 394 | 395 | private void GenerateFilledSprite(VertexHelper vh, Vector4 vertices, Vector4 uvs, float fillAmount) 396 | { 397 | if (m_FillAmount < 0.001f) 398 | return; 399 | 400 | float uvLeft = uvs.x; 401 | float uvBottom = uvs.y; 402 | float uvRight = uvs.z; 403 | float uvTop = uvs.w; 404 | 405 | if (fillAmount < 1f) 406 | { 407 | if (m_FillDirection == FillDirection.Left || m_FillDirection == FillDirection.Right) 408 | { 409 | if (m_FillDirection == FillDirection.Left) 410 | { 411 | vertices.x = vertices.z - (vertices.z - vertices.x) * fillAmount; 412 | uvLeft = uvRight - (uvRight - uvLeft) * fillAmount; 413 | } 414 | else 415 | { 416 | vertices.z = vertices.x + (vertices.z - vertices.x) * fillAmount; 417 | uvRight = uvLeft + (uvRight - uvLeft) * fillAmount; 418 | } 419 | } 420 | else 421 | { 422 | if (m_FillDirection == FillDirection.Down) 423 | { 424 | vertices.y = vertices.w - (vertices.w - vertices.y) * fillAmount; 425 | uvBottom = uvTop - (uvTop - uvBottom) * fillAmount; 426 | } 427 | else 428 | { 429 | vertices.w = vertices.y + (vertices.w - vertices.y) * fillAmount; 430 | uvTop = uvBottom + (uvTop - uvBottom) * fillAmount; 431 | } 432 | } 433 | } 434 | 435 | s_Vertices[0] = new Vector3(vertices.x, vertices.y); 436 | s_Vertices[1] = new Vector3(vertices.x, vertices.w); 437 | s_Vertices[2] = new Vector3(vertices.z, vertices.w); 438 | s_Vertices[3] = new Vector3(vertices.z, vertices.y); 439 | 440 | s_UVs[0] = new Vector2(uvLeft, uvBottom); 441 | s_UVs[1] = new Vector2(uvLeft, uvTop); 442 | s_UVs[2] = new Vector2(uvRight, uvTop); 443 | s_UVs[3] = new Vector2(uvRight, uvBottom); 444 | 445 | int startIndex = vh.currentVertCount; 446 | 447 | for (int i = 0; i < 4; i++) 448 | vh.AddVert(s_Vertices[i], color, s_UVs[i]); 449 | 450 | vh.AddTriangle(startIndex, startIndex + 1, startIndex + 2); 451 | vh.AddTriangle(startIndex + 2, startIndex + 3, startIndex); 452 | } 453 | 454 | int ILayoutElement.layoutPriority { get { return 0; } } 455 | float ILayoutElement.minWidth { get { return 0; } } 456 | float ILayoutElement.minHeight { get { return 0; } } 457 | float ILayoutElement.flexibleWidth { get { return -1; } } 458 | float ILayoutElement.flexibleHeight { get { return -1; } } 459 | 460 | float ILayoutElement.preferredWidth 461 | { 462 | get 463 | { 464 | if (activeSprite == null) 465 | return 0; 466 | 467 | return Sprites.DataUtility.GetMinSize(activeSprite).x / pixelsPerUnit; 468 | } 469 | } 470 | 471 | float ILayoutElement.preferredHeight 472 | { 473 | get 474 | { 475 | if (activeSprite == null) 476 | return 0; 477 | 478 | return Sprites.DataUtility.GetMinSize(activeSprite).y / pixelsPerUnit; 479 | } 480 | } 481 | 482 | void ILayoutElement.CalculateLayoutInputHorizontal() { } 483 | void ILayoutElement.CalculateLayoutInputVertical() { } 484 | 485 | bool ICanvasRaycastFilter.IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera) 486 | { 487 | if (alphaHitTestMinimumThreshold <= 0) 488 | return true; 489 | 490 | if (alphaHitTestMinimumThreshold > 1) 491 | return false; 492 | 493 | if (activeSprite == null) 494 | return true; 495 | 496 | Vector2 local; 497 | if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, screenPoint, eventCamera, out local)) 498 | return false; 499 | 500 | Rect rect = GetPixelAdjustedRect(); 501 | 502 | // Convert to have lower left corner as reference point. 503 | local.x += rectTransform.pivot.x * rect.width; 504 | local.y += rectTransform.pivot.y * rect.height; 505 | 506 | Rect spriteRect = activeSprite.rect; 507 | Vector4 border = activeSprite.border; 508 | Vector4 adjustedBorder = GetAdjustedBorders(border / pixelsPerUnit, rect); 509 | 510 | for (int i = 0; i < 2; i++) 511 | { 512 | if (local[i] <= adjustedBorder[i]) 513 | continue; 514 | 515 | if (rect.size[i] - local[i] <= adjustedBorder[i + 2]) 516 | { 517 | local[i] -= (rect.size[i] - spriteRect.size[i]); 518 | continue; 519 | } 520 | 521 | float lerp = Mathf.InverseLerp(adjustedBorder[i], rect.size[i] - adjustedBorder[i + 2], local[i]); 522 | local[i] = Mathf.Lerp(border[i], spriteRect.size[i] - border[i + 2], lerp); 523 | } 524 | 525 | // Normalize local coordinates. 526 | Rect textureRect = activeSprite.textureRect; 527 | Vector2 normalized = new Vector2(local.x / textureRect.width, local.y / textureRect.height); 528 | 529 | // Convert to texture space. 530 | float x = Mathf.Lerp(textureRect.x, textureRect.xMax, normalized.x) / activeSprite.texture.width; 531 | float y = Mathf.Lerp(textureRect.y, textureRect.yMax, normalized.y) / activeSprite.texture.height; 532 | 533 | switch (m_FillDirection) 534 | { 535 | case FillDirection.Right: 536 | if (x > m_FillAmount) 537 | return false; 538 | break; 539 | case FillDirection.Left: 540 | if (1f - x > m_FillAmount) 541 | return false; 542 | break; 543 | case FillDirection.Up: 544 | if (y > m_FillAmount) 545 | return false; 546 | break; 547 | case FillDirection.Down: 548 | if (1f - y > m_FillAmount) 549 | return false; 550 | break; 551 | } 552 | 553 | try 554 | { 555 | return activeSprite.texture.GetPixelBilinear(x, y).a >= alphaHitTestMinimumThreshold; 556 | } 557 | catch (UnityException e) 558 | { 559 | Debug.LogError("Using alphaHitTestMinimumThreshold greater than 0 on Image whose sprite texture cannot be read. " + e.Message + " Also make sure to disable sprite packing for this sprite.", this); 560 | return true; 561 | } 562 | } 563 | 564 | void ISerializationCallbackReceiver.OnBeforeSerialize() { } 565 | void ISerializationCallbackReceiver.OnAfterDeserialize() 566 | { 567 | m_FillAmount = Mathf.Clamp01(m_FillAmount); 568 | } 569 | 570 | // Whether this is being tracked for Atlas Binding 571 | private bool m_Tracked = false; 572 | 573 | #if UNITY_2017_4 || UNITY_2018_2_OR_NEWER 574 | private static List m_TrackedTexturelessImages = new List(); 575 | private static bool s_Initialized; 576 | #endif 577 | 578 | private void TrackImage() 579 | { 580 | if (activeSprite != null && activeSprite.texture == null) 581 | { 582 | #if UNITY_2017_4 || UNITY_2018_2_OR_NEWER 583 | if (!s_Initialized) 584 | { 585 | SpriteAtlasManager.atlasRegistered += RebuildImage; 586 | s_Initialized = true; 587 | } 588 | 589 | m_TrackedTexturelessImages.Add(this); 590 | #endif 591 | m_Tracked = true; 592 | } 593 | } 594 | 595 | private void UnTrackImage() 596 | { 597 | #if UNITY_2017_4 || UNITY_2018_2_OR_NEWER 598 | m_TrackedTexturelessImages.Remove(this); 599 | #endif 600 | m_Tracked = false; 601 | } 602 | 603 | #if UNITY_2017_4 || UNITY_2018_2_OR_NEWER 604 | private static void RebuildImage(SpriteAtlas spriteAtlas) 605 | { 606 | for (int i = m_TrackedTexturelessImages.Count - 1; i >= 0; i--) 607 | { 608 | SlicedFilledImage image = m_TrackedTexturelessImages[i]; 609 | if (spriteAtlas.CanBindTo(image.activeSprite)) 610 | { 611 | image.SetAllDirty(); 612 | m_TrackedTexturelessImages.RemoveAt(i); 613 | } 614 | } 615 | } 616 | #endif 617 | } -------------------------------------------------------------------------------- /Scripts/Game Events/GameEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | public interface IGameEventListener 5 | { 6 | void RaiseEvent(); 7 | } 8 | 9 | [CreateAssetMenu(menuName = "Game Event", fileName = "New Game Event")] 10 | public class GameEvent : ScriptableObject 11 | { 12 | private HashSet _listeners = new HashSet(); 13 | 14 | public void Invoke() 15 | { 16 | foreach (var globalEventListener in _listeners) 17 | { 18 | globalEventListener.RaiseEvent(); 19 | } 20 | } 21 | 22 | public void Register(IGameEventListener gameEventListener) => _listeners.Add(gameEventListener); 23 | public void Deregister(IGameEventListener gameEventListener) => _listeners.Remove(gameEventListener); 24 | } 25 | -------------------------------------------------------------------------------- /Scripts/Game Events/GameEventListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | 5 | public class GameEventListener : MonoBehaviour, IGameEventListener 6 | { 7 | [SerializeField] protected GameEvent gameEvent; 8 | [SerializeField] protected UnityEvent unityEvent; 9 | 10 | private void Awake() => gameEvent.Register(this); 11 | private void OnDestroy() => gameEvent.Deregister(this); 12 | public virtual void RaiseEvent() => unityEvent?.Invoke(); 13 | } 14 | -------------------------------------------------------------------------------- /Scripts/Game Events/GameEventListenerWithDelay.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | 5 | public class GameEventListenerWithDelay : GameEventListener, IGameEventListener 6 | { 7 | [SerializeField] private float _delay = 1f; 8 | 9 | private void Awake() => gameEvent.Register(this); 10 | private void OnDestroy() => gameEvent.Deregister(this); 11 | 12 | public override void RaiseEvent() 13 | { 14 | unityEvent.Invoke(); 15 | StartCoroutine(RunDelayedEvent()); 16 | } 17 | 18 | private IEnumerator RunDelayedEvent() 19 | { 20 | yield return new WaitForSeconds(_delay); 21 | unityEvent?.Invoke(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Scripts/Hierarchy Separator/Editor/HierarchySeparatorEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | [CustomEditor(typeof(HierarchySeparator))] 5 | [CanEditMultipleObjects] 6 | public class HierarchySeparatorEditor : Editor 7 | { 8 | private SerializedProperty _outlineSize; 9 | private SerializedProperty _outlineColor; 10 | private SerializedProperty _barColor; 11 | private SerializedProperty _textColor; 12 | 13 | public void OnEnable() 14 | { 15 | _outlineSize = serializedObject.FindProperty("m_OutlineSize"); 16 | _outlineColor = serializedObject.FindProperty("m_OutlineColor"); 17 | _barColor = serializedObject.FindProperty("m_BarColor"); 18 | _textColor = serializedObject.FindProperty("m_TextColor"); 19 | } 20 | 21 | public override void OnInspectorGUI() 22 | { 23 | serializedObject.Update(); 24 | 25 | EditorGUILayout.LabelField("Outline Settings", EditorStyles.boldLabel); 26 | EditorGUILayout.PropertyField(_outlineSize); 27 | EditorGUILayout.PropertyField(_outlineColor); 28 | 29 | EditorGUILayout.Space(10); 30 | 31 | EditorGUILayout.LabelField("Bar Settings", EditorStyles.boldLabel); 32 | EditorGUILayout.PropertyField(_barColor); 33 | EditorGUILayout.PropertyField(_textColor); 34 | 35 | serializedObject.ApplyModifiedProperties(); 36 | // 37 | } 38 | } -------------------------------------------------------------------------------- /Scripts/Hierarchy Separator/Runtime/HierarchySeparator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [InitializeOnLoad] 5 | public class HierarchySeparator : MonoBehaviour 6 | { 7 | [HideInInspector] 8 | [SerializeField] 9 | private Color m_OutlineColor = Color.black; 10 | public Color OutlineColor 11 | { 12 | get => m_OutlineColor; 13 | set 14 | { 15 | value.a = 1f; 16 | m_OutlineColor = value; 17 | } 18 | } 19 | 20 | [HideInInspector] 21 | [SerializeField] 22 | private Color m_BarColor = Color.black; 23 | public Color BarColor 24 | { 25 | get => m_BarColor; 26 | set 27 | { 28 | value.a = 1f; 29 | m_BarColor = value; 30 | } 31 | } 32 | 33 | [HideInInspector] 34 | [SerializeField] 35 | private Color m_TextColor = Color.white; 36 | public Color TextColor 37 | { 38 | get => m_TextColor; 39 | set 40 | { 41 | value.a = 1f; 42 | m_TextColor = value; 43 | } 44 | } 45 | 46 | [HideInInspector] 47 | [SerializeField] 48 | private int m_OutlineSize = 0; 49 | public int OutlineSize 50 | { 51 | get => m_OutlineSize; 52 | set 53 | { 54 | m_OutlineSize = value; 55 | } 56 | } 57 | 58 | static HierarchySeparator() 59 | { 60 | EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI; 61 | } 62 | 63 | [MenuItem("GameObject/Separator", false, 30)] 64 | public static void CreateSeparator(MenuCommand menuCommand) 65 | { 66 | GameObject separator = new GameObject("Separator"); 67 | separator.AddComponent(); 68 | GameObjectUtility.SetParentAndAlign(separator, menuCommand.context as GameObject); 69 | Undo.RegisterCreatedObjectUndo(separator, "Create " + separator.name); 70 | Selection.activeObject = separator; 71 | } 72 | 73 | static void HierarchyWindowItemOnGUI(int instanceID, Rect selectionRect) 74 | { 75 | GameObject gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject; 76 | 77 | if (gameObject == null) return; 78 | if (!gameObject.TryGetComponent(out HierarchySeparator hierarchy)) return; 79 | 80 | GUIStyle guiStyle = new GUIStyle(); 81 | guiStyle.fontStyle = FontStyle.Bold; 82 | guiStyle.normal.textColor = hierarchy.TextColor; 83 | guiStyle.alignment = TextAnchor.MiddleCenter; 84 | 85 | EditorGUI.DrawRect(selectionRect, hierarchy.OutlineColor); 86 | EditorGUI.DrawRect(new Rect(selectionRect.x + hierarchy.OutlineSize, selectionRect.y + hierarchy.OutlineSize, selectionRect.width - (hierarchy.OutlineSize * 2), selectionRect.height - (hierarchy.OutlineSize * 2)), hierarchy.BarColor); 87 | EditorGUI.DropShadowLabel(selectionRect, $"{gameObject.name.ToUpperInvariant()}", guiStyle); 88 | } 89 | } -------------------------------------------------------------------------------- /Scripts/Parallax/Parallax.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public enum UpdateMode 6 | { 7 | Update, 8 | FixedUpdate, 9 | LateUpdate 10 | } 11 | 12 | public class Parallax : MonoBehaviour 13 | { 14 | [Header("Needed Objects")] 15 | [SerializeField] private Camera _camera; 16 | [SerializeField] private GameObject _subject; 17 | 18 | [Header("Config")] 19 | [SerializeField] private UpdateMode _updateMode; 20 | [SerializeField] private bool lockY = false; 21 | [SerializeField] private bool lockX = false; 22 | [SerializeField] [Range(0.1f, 2f)] private float _smoothingFactor = 1; 23 | 24 | private Vector3 _startingPos; 25 | 26 | private float TravelX => this._camera.transform.position.x - this._startingPos.x; 27 | private float TravelY => this._camera.transform.position.y - this._startingPos.y; 28 | 29 | private float DistanceFromSubject => this._startingPos.z - this._subject.transform.position.z; 30 | private float ClipPlane => this._camera.transform.position.z + (this.DistanceFromSubject > 0 ? this._camera.farClipPlane : -this._camera.nearClipPlane); 31 | private float ParallaxFactor => Mathf.Abs(this.DistanceFromSubject) / this.ClipPlane; 32 | 33 | private float NewX => this.lockX ? this._startingPos.x : this._startingPos.x + (this.TravelX * this.ParallaxFactor * this._smoothingFactor); 34 | private float NewY => this.lockY ? this._startingPos.y : this._startingPos.y + (this.TravelY * this.ParallaxFactor * this._smoothingFactor); 35 | 36 | 37 | private void Start() 38 | { 39 | this._startingPos = transform.position; 40 | } 41 | 42 | private void Update() 43 | { 44 | if (_updateMode != UpdateMode.Update) return; 45 | 46 | this.transform.position = new Vector3(this.NewX, this.NewY, this._startingPos.z); 47 | } 48 | 49 | private void FixedUpdate() 50 | { 51 | if (_updateMode != UpdateMode.FixedUpdate) return; 52 | 53 | this.transform.position = new Vector3(this.NewX, this.NewY, this._startingPos.z); 54 | } 55 | 56 | private void LateUpdate() 57 | { 58 | if (_updateMode != UpdateMode.LateUpdate) return; 59 | 60 | this.transform.position = new Vector3(this.NewX, this.NewY, this._startingPos.z); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Scripts/Scrolling Text/ScrollingManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TMPro; 5 | 6 | public class ScrollingManager : MonoBehaviour 7 | { 8 | public static ScrollingManager Instance; 9 | 10 | public Transform scrollingTextPrefab; 11 | 12 | private void Awake() 13 | { 14 | if (Instance == null) 15 | Instance = this; 16 | else if (Instance != this) 17 | Destroy(gameObject); 18 | } 19 | 20 | public void EmitText(Vector2 position, string text, Color color, int fontSize) 21 | { 22 | Transform go = Instantiate(scrollingTextPrefab, position, Quaternion.identity); 23 | go.GetComponent().SetText(text); 24 | go.GetComponent().color = color; 25 | go.GetComponent().fontSize = fontSize; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Scripts/Scrolling Text/ScrollingText.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TMPro; 5 | 6 | public class ScrollingText : MonoBehaviour 7 | { 8 | public Vector3 direction; 9 | public float moveSpeed; 10 | public float fadeSpeed; 11 | 12 | TMP_Text textComponent; 13 | 14 | private void Start() 15 | { 16 | textComponent = GetComponent(); 17 | } 18 | 19 | void Update() 20 | { 21 | transform.Translate(direction * moveSpeed * Time.deltaTime); 22 | textComponent.color = new Color(textComponent.color.r, textComponent.color.g, textComponent.color.b, textComponent.color.a - fadeSpeed * Time.deltaTime); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Scripts/Scrolling Text/ScrollingText.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6749943761486861678 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6749943761486861673} 12 | - component: {fileID: 6749943761486861672} 13 | - component: {fileID: 6749943761486861679} 14 | - component: {fileID: 992355216} 15 | m_Layer: 0 16 | m_Name: ScrollingText 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!224 &6749943761486861673 23 | RectTransform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 6749943761486861678} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: 0, y: 0, z: 0} 31 | m_LocalScale: {x: 1, y: 1, z: 1} 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | m_AnchorMin: {x: 0.5, y: 0.5} 37 | m_AnchorMax: {x: 0.5, y: 0.5} 38 | m_AnchoredPosition: {x: 3.5, y: 1} 39 | m_SizeDelta: {x: 20, y: 5} 40 | m_Pivot: {x: 0.5, y: 0.5} 41 | --- !u!23 &6749943761486861672 42 | MeshRenderer: 43 | m_ObjectHideFlags: 0 44 | m_CorrespondingSourceObject: {fileID: 0} 45 | m_PrefabInstance: {fileID: 0} 46 | m_PrefabAsset: {fileID: 0} 47 | m_GameObject: {fileID: 6749943761486861678} 48 | m_Enabled: 1 49 | m_CastShadows: 0 50 | m_ReceiveShadows: 0 51 | m_DynamicOccludee: 1 52 | m_MotionVectors: 1 53 | m_LightProbeUsage: 1 54 | m_ReflectionProbeUsage: 1 55 | m_RayTracingMode: 2 56 | m_RayTraceProcedural: 0 57 | m_RenderingLayerMask: 1 58 | m_RendererPriority: 0 59 | m_Materials: 60 | - {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 61 | m_StaticBatchInfo: 62 | firstSubMesh: 0 63 | subMeshCount: 0 64 | m_StaticBatchRoot: {fileID: 0} 65 | m_ProbeAnchor: {fileID: 0} 66 | m_LightProbeVolumeOverride: {fileID: 0} 67 | m_ScaleInLightmap: 1 68 | m_ReceiveGI: 1 69 | m_PreserveUVs: 0 70 | m_IgnoreNormalsForChartDetection: 0 71 | m_ImportantGI: 0 72 | m_StitchLightmapSeams: 1 73 | m_SelectedEditorRenderState: 3 74 | m_MinimumChartSize: 4 75 | m_AutoUVMaxDistance: 0.5 76 | m_AutoUVMaxAngle: 89 77 | m_LightmapParameters: {fileID: 0} 78 | m_SortingLayerID: 0 79 | m_SortingLayer: 0 80 | m_SortingOrder: 1 81 | m_AdditionalVertexStreams: {fileID: 0} 82 | --- !u!114 &6749943761486861679 83 | MonoBehaviour: 84 | m_ObjectHideFlags: 0 85 | m_CorrespondingSourceObject: {fileID: 0} 86 | m_PrefabInstance: {fileID: 0} 87 | m_PrefabAsset: {fileID: 0} 88 | m_GameObject: {fileID: 6749943761486861678} 89 | m_Enabled: 1 90 | m_EditorHideFlags: 0 91 | m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} 92 | m_Name: 93 | m_EditorClassIdentifier: 94 | m_Material: {fileID: 0} 95 | m_Color: {r: 1, g: 1, b: 1, a: 1} 96 | m_RaycastTarget: 1 97 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 98 | m_Maskable: 1 99 | m_OnCullStateChanged: 100 | m_PersistentCalls: 101 | m_Calls: [] 102 | m_text: -5 103 | m_isRightToLeft: 0 104 | m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 105 | m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 106 | m_fontSharedMaterials: [] 107 | m_fontMaterial: {fileID: 0} 108 | m_fontMaterials: [] 109 | m_fontColor32: 110 | serializedVersion: 2 111 | rgba: 4278190335 112 | m_fontColor: {r: 1, g: 0, b: 0, a: 1} 113 | m_enableVertexGradient: 0 114 | m_colorMode: 3 115 | m_fontColorGradient: 116 | topLeft: {r: 1, g: 1, b: 1, a: 1} 117 | topRight: {r: 1, g: 1, b: 1, a: 1} 118 | bottomLeft: {r: 1, g: 1, b: 1, a: 1} 119 | bottomRight: {r: 1, g: 1, b: 1, a: 1} 120 | m_fontColorGradientPreset: {fileID: 0} 121 | m_spriteAsset: {fileID: 0} 122 | m_tintAllSprites: 0 123 | m_StyleSheet: {fileID: 0} 124 | m_TextStyleHashCode: -1183493901 125 | m_overrideHtmlColors: 0 126 | m_faceColor: 127 | serializedVersion: 2 128 | rgba: 4294967295 129 | m_outlineColor: 130 | serializedVersion: 2 131 | rgba: 4278190080 132 | m_fontSize: 4 133 | m_fontSizeBase: 4 134 | m_fontWeight: 400 135 | m_enableAutoSizing: 0 136 | m_fontSizeMin: 18 137 | m_fontSizeMax: 72 138 | m_fontStyle: 0 139 | m_HorizontalAlignment: 2 140 | m_VerticalAlignment: 512 141 | m_textAlignment: 65535 142 | m_isAlignmentEnumConverted: 1 143 | m_characterSpacing: 0 144 | m_wordSpacing: 0 145 | m_lineSpacing: 0 146 | m_lineSpacingMax: 0 147 | m_paragraphSpacing: 0 148 | m_charWidthMaxAdj: 0 149 | m_enableWordWrapping: 1 150 | m_wordWrappingRatios: 0.4 151 | m_overflowMode: 0 152 | m_firstOverflowCharacterIndex: -1 153 | m_linkedTextComponent: {fileID: 0} 154 | parentLinkedComponent: {fileID: 0} 155 | m_isTextTruncated: 0 156 | m_enableKerning: 1 157 | m_enableExtraPadding: 0 158 | checkPaddingRequired: 0 159 | m_isRichText: 1 160 | m_parseCtrlCharacters: 1 161 | m_isOrthographic: 0 162 | m_isCullingEnabled: 0 163 | m_ignoreCulling: 1 164 | m_horizontalMapping: 0 165 | m_verticalMapping: 0 166 | m_uvLineOffset: 0 167 | m_geometrySortingOrder: 0 168 | m_IsTextObjectScaleStatic: 0 169 | m_VertexBufferAutoSizeReduction: 1 170 | m_firstVisibleCharacter: 0 171 | m_useMaxVisibleDescender: 1 172 | m_pageToDisplay: 1 173 | m_margin: {x: 0, y: 0, z: 0, w: 0} 174 | m_textInfo: 175 | textComponent: {fileID: 6749943761486861679} 176 | characterCount: 2 177 | spriteCount: 0 178 | spaceCount: 0 179 | wordCount: 1 180 | linkCount: 0 181 | lineCount: 1 182 | pageCount: 1 183 | materialCount: 1 184 | m_isUsingLegacyAnimationComponent: 0 185 | m_isVolumetricText: 0 186 | m_spriteAnimator: {fileID: 0} 187 | m_hasFontAssetChanged: 0 188 | m_renderer: {fileID: 6749943761486861672} 189 | m_maskType: 0 190 | --- !u!114 &992355216 191 | MonoBehaviour: 192 | m_ObjectHideFlags: 0 193 | m_CorrespondingSourceObject: {fileID: 0} 194 | m_PrefabInstance: {fileID: 0} 195 | m_PrefabAsset: {fileID: 0} 196 | m_GameObject: {fileID: 6749943761486861678} 197 | m_Enabled: 1 198 | m_EditorHideFlags: 0 199 | m_Script: {fileID: 11500000, guid: b91481e716ee8b948a9d31ab40425a08, type: 3} 200 | m_Name: 201 | m_EditorClassIdentifier: 202 | direction: {x: 0, y: 1, z: 0} 203 | moveSpeed: 1 204 | fadeSpeed: 1 205 | -------------------------------------------------------------------------------- /Scripts/Sprite Animator/Editor/SpriteAnimationEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditorInternal; 3 | using UnityEditor; 4 | 5 | namespace GabrielBigardi.SpriteAnimator 6 | { 7 | [CustomEditor(typeof(SpriteAnimation))] 8 | [CanEditMultipleObjects] 9 | public class SpriteAnimationEditor : Editor 10 | { 11 | private SpriteAnimation SelectedSpriteAnimation => target as SpriteAnimation; 12 | 13 | private float timeTracker = 0; 14 | 15 | private SpriteAnimationFrame currentFrame; 16 | private SpriteAnimationHelper spriteAnimationHelper; 17 | 18 | private SerializedProperty _name; 19 | private SerializedProperty _fps; 20 | private SerializedProperty _frames; 21 | private SerializedProperty _spriteAnimationType; 22 | 23 | private ReorderableList _framesReorderableList; 24 | 25 | private void OnEnable() 26 | { 27 | timeTracker = (float)EditorApplication.timeSinceStartup; 28 | spriteAnimationHelper = new SpriteAnimationHelper(SelectedSpriteAnimation); 29 | 30 | _name = serializedObject.FindProperty("Name"); 31 | _fps = serializedObject.FindProperty("FPS"); 32 | _frames = serializedObject.FindProperty("Frames"); 33 | _spriteAnimationType = serializedObject.FindProperty("SpriteAnimationType"); 34 | 35 | _framesReorderableList = new ReorderableList(serializedObject, _frames, true, true, true, true); 36 | _framesReorderableList.drawElementCallback = DrawFramesListElements; 37 | _framesReorderableList.drawHeaderCallback = DrawFramesListHeader; 38 | 39 | EditorApplication.update += OnUpdate; 40 | } 41 | 42 | private void OnDisable() 43 | { 44 | EditorApplication.update -= OnUpdate; 45 | } 46 | 47 | public override void OnInspectorGUI() 48 | { 49 | serializedObject.Update(); 50 | 51 | EditorGUILayout.PropertyField(_name); 52 | EditorGUILayout.PropertyField(_fps); 53 | _framesReorderableList.DoLayoutList(); 54 | EditorGUILayout.PropertyField(_spriteAnimationType); 55 | 56 | serializedObject.ApplyModifiedProperties(); 57 | } 58 | 59 | public override bool HasPreviewGUI() 60 | { 61 | return HasAnimationAndFrames(); 62 | } 63 | 64 | public override bool RequiresConstantRepaint() 65 | { 66 | return HasAnimationAndFrames(); 67 | } 68 | 69 | public override void OnPreviewGUI(Rect r, GUIStyle background) 70 | { 71 | if (currentFrame != null && currentFrame.Sprite != null) 72 | { 73 | Texture t = currentFrame.Sprite.texture; 74 | Rect tr = currentFrame.Sprite.textureRect; 75 | Rect r2 = new Rect(tr.x / t.width, tr.y / t.height, tr.width / t.width, tr.height / t.height); 76 | 77 | Rect previewRect = r; 78 | 79 | float targetAspectRatio = tr.width / tr.height; 80 | float windowAspectRatio = r.width / r.height; 81 | float scaleHeight = windowAspectRatio / targetAspectRatio; 82 | 83 | if (scaleHeight < 1f) 84 | { 85 | previewRect.width = r.width; 86 | previewRect.height = scaleHeight * r.height; 87 | previewRect.x = r.x; 88 | previewRect.y = r.y + (r.height - previewRect.height) / 2f; 89 | } 90 | else 91 | { 92 | float scaleWidth = 1f / scaleHeight; 93 | 94 | previewRect.width = scaleWidth * r.width; 95 | previewRect.height = r.height; 96 | previewRect.x = r.x + (r.width - previewRect.width) / 2f; 97 | previewRect.y = r.y; 98 | } 99 | 100 | GUI.DrawTextureWithTexCoords(previewRect, t, r2, true); 101 | } 102 | } 103 | 104 | private void DrawFramesListElements(Rect rect, int index, bool isActive, bool isFocused) 105 | { 106 | SerializedProperty element = _framesReorderableList.serializedProperty.GetArrayElementAtIndex(index); // The element in the list 107 | EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, GUIContent.none); 108 | } 109 | 110 | private void DrawFramesListHeader(Rect rect) 111 | { 112 | EditorGUI.LabelField(rect, "Frames List"); 113 | } 114 | 115 | private bool HasAnimationAndFrames() 116 | { 117 | return SelectedSpriteAnimation != null && SelectedSpriteAnimation.Frames.Count > 0; 118 | } 119 | 120 | private void OnUpdate() 121 | { 122 | if (SelectedSpriteAnimation != null && SelectedSpriteAnimation.Frames.Count > 0) 123 | { 124 | float deltaTime = (float)EditorApplication.timeSinceStartup - timeTracker; 125 | timeTracker += deltaTime; 126 | currentFrame = spriteAnimationHelper.UpdateAnimation(deltaTime); 127 | } 128 | } 129 | } 130 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/Editor/SpriteAnimationFrameDrawer.cs: -------------------------------------------------------------------------------- 1 | using GabrielBigardi.SpriteAnimator; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | [CustomPropertyDrawer(typeof(SpriteAnimationFrame))] 8 | public class SpriteAnimationFrameDrawer : PropertyDrawer 9 | { 10 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 11 | { 12 | //base.OnGUI(position, property, label); 13 | EditorGUI.BeginProperty(position, label, property); 14 | 15 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 16 | 17 | int indent = EditorGUI.indentLevel; 18 | EditorGUI.indentLevel = 0; 19 | 20 | Rect minRect = new Rect(position.x, position.y, position.width * 0.5f, position.height); 21 | Rect maxRect = new Rect(position.x + position.width * 0.5f, position.y, position.width * 0.5f - 5, position.height); 22 | 23 | SerializedProperty minProp = property.FindPropertyRelative("Sprite"); 24 | SerializedProperty maxProp = property.FindPropertyRelative("EventName"); 25 | 26 | EditorGUI.PropertyField(minRect, minProp, GUIContent.none); 27 | EditorGUI.PropertyField(maxRect, maxProp, GUIContent.none); 28 | 29 | EditorGUI.EndProperty(); 30 | } 31 | 32 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 33 | { 34 | return base.GetPropertyHeight(property, label); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System; 4 | 5 | namespace GabrielBigardi.SpriteAnimator 6 | { 7 | [CreateAssetMenu] 8 | [Serializable] 9 | public class SpriteAnimation : ScriptableObject 10 | { 11 | public string animationName = "animation"; 12 | 13 | public string Name; 14 | 15 | public int FPS; 16 | 17 | public List Frames; 18 | 19 | public SpriteAnimationType SpriteAnimationType; 20 | } 21 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimationFrame.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | using System.Collections; 4 | using System; 5 | 6 | namespace GabrielBigardi.SpriteAnimator 7 | { 8 | [Serializable] 9 | public class SpriteAnimationFrame 10 | { 11 | public Sprite Sprite; 12 | public string EventName; 13 | } 14 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimationHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace GabrielBigardi.SpriteAnimator 4 | { 5 | public class SpriteAnimationHelper 6 | { 7 | private float _animationTime = 0.0f; 8 | 9 | public SpriteAnimation CurrentAnimation { get; set; } 10 | 11 | private int GetLoopingFrame() => (int)_animationTime % CurrentAnimation.Frames.Count; 12 | private int GetPlayOnceFrame() => Mathf.Min((int)_animationTime, CurrentAnimation.Frames.Count - 1); 13 | 14 | public SpriteAnimationHelper() 15 | { 16 | } 17 | 18 | public SpriteAnimationHelper(SpriteAnimation spriteAnimation) 19 | { 20 | CurrentAnimation = spriteAnimation; 21 | } 22 | 23 | public SpriteAnimationFrame UpdateAnimation(float deltaTime) 24 | { 25 | if (CurrentAnimation) 26 | { 27 | _animationTime += deltaTime * CurrentAnimation.FPS; 28 | 29 | return GetAnimationFrame(); 30 | } 31 | 32 | return null; 33 | } 34 | 35 | public void ChangeAnimation(SpriteAnimation spriteAnimation) 36 | { 37 | _animationTime = 0f; 38 | CurrentAnimation = spriteAnimation; 39 | } 40 | 41 | private SpriteAnimationFrame GetAnimationFrame() 42 | { 43 | int currentFrame = 0; 44 | 45 | switch (CurrentAnimation.SpriteAnimationType) 46 | { 47 | case SpriteAnimationType.Looping: 48 | currentFrame = GetLoopingFrame(); 49 | break; 50 | case SpriteAnimationType.PlayOnce: 51 | currentFrame = GetPlayOnceFrame(); 52 | break; 53 | } 54 | 55 | return CurrentAnimation.Frames[currentFrame]; 56 | } 57 | 58 | public int GetCurrentFrame() 59 | { 60 | int currentFrame = 0; 61 | 62 | switch (CurrentAnimation.SpriteAnimationType) 63 | { 64 | case SpriteAnimationType.Looping: 65 | currentFrame = GetLoopingFrame(); 66 | break; 67 | case SpriteAnimationType.PlayOnce: 68 | currentFrame = GetPlayOnceFrame(); 69 | break; 70 | } 71 | 72 | return currentFrame; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimationState.cs: -------------------------------------------------------------------------------- 1 | namespace GabrielBigardi.SpriteAnimator 2 | { 3 | public enum SpriteAnimationState 4 | { 5 | Playing = 0, 6 | Paused = 1 7 | } 8 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimationType.cs: -------------------------------------------------------------------------------- 1 | namespace GabrielBigardi.SpriteAnimator 2 | { 3 | public enum SpriteAnimationType 4 | { 5 | Looping = 0, 6 | PlayOnce = 1 7 | } 8 | } -------------------------------------------------------------------------------- /Scripts/Sprite Animator/SpriteAnimator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System; 4 | 5 | namespace GabrielBigardi.SpriteAnimator 6 | { 7 | public class SpriteAnimator : MonoBehaviour 8 | { 9 | [SerializeField] private List _spriteAnimations = new List(); 10 | [SerializeField] private bool _playAutomatically = true; 11 | 12 | public SpriteAnimation DefaultAnimation => _spriteAnimations.Count > 0 ? _spriteAnimations[0] : null; 13 | public SpriteAnimation CurrentAnimation => _spriteAnimationHelper.CurrentAnimation; 14 | 15 | public bool Playing => _state == SpriteAnimationState.Playing; 16 | public bool Paused => _state == SpriteAnimationState.Paused; 17 | public int CurrentFrame => _spriteAnimationHelper.GetCurrentFrame(); 18 | public bool IsLastFrame => CurrentFrame == CurrentAnimation.Frames.Count - 1; 19 | 20 | private SpriteRenderer _spriteRenderer; 21 | private SpriteAnimationHelper _spriteAnimationHelper; 22 | private SpriteAnimationState _state = SpriteAnimationState.Playing; 23 | private SpriteAnimationFrame _previousAnimationFrame; 24 | 25 | private bool triggerAnimationEndedEvent = false; 26 | 27 | public event Action SpriteChanged; 28 | public event Action AnimationPlayed; 29 | public event Action AnimationPaused; 30 | public event Action AnimationEnded; 31 | public event Action AnimationEventCalled; 32 | 33 | private void Awake() 34 | { 35 | _spriteRenderer = GetComponent(); 36 | if (_spriteRenderer == null) _spriteRenderer = GetComponentInChildren(); 37 | 38 | _spriteAnimationHelper = new SpriteAnimationHelper(); 39 | } 40 | 41 | private void Start() 42 | { 43 | if (_playAutomatically) 44 | { 45 | Play(DefaultAnimation); 46 | } 47 | } 48 | 49 | private void LateUpdate() 50 | { 51 | if (Playing) 52 | { 53 | SpriteAnimationFrame currentFrame = _spriteAnimationHelper.UpdateAnimation(Time.deltaTime); 54 | 55 | //Change sprite only when animation frame changes, animationended event 56 | if (currentFrame != null) 57 | { 58 | if (currentFrame != _previousAnimationFrame) 59 | { 60 | if (triggerAnimationEndedEvent) 61 | { 62 | AnimationEnded?.Invoke(); 63 | 64 | if (CurrentAnimation.SpriteAnimationType != SpriteAnimationType.Looping) return; 65 | } 66 | 67 | if ((CurrentFrame + 1) > (CurrentAnimation.Frames.Count - 1)) 68 | { 69 | triggerAnimationEndedEvent = true; 70 | } 71 | 72 | _previousAnimationFrame = currentFrame; 73 | 74 | _spriteRenderer.sprite = currentFrame.Sprite; 75 | 76 | SpriteChanged?.Invoke(); 77 | if(currentFrame.EventName != "") AnimationEventCalled?.Invoke(currentFrame.EventName); 78 | } 79 | } 80 | 81 | ////Change sprite every LateUpdate tick, but call sprite changed event based on frame change 82 | //if(currentFrame != null) 83 | //{ 84 | // _spriteRenderer.sprite = currentFrame.Sprite; 85 | // if (currentFrame != _previousAnimationFrame) 86 | // { 87 | // _previousAnimationFrame = currentFrame; 88 | // SpriteChanged?.Invoke(); 89 | // } 90 | //} 91 | 92 | //Change sprite only on frame change 93 | //if (currentFrame != null && currentFrame != _previousAnimationFrame) 94 | //{ 95 | // _previousAnimationFrame = currentFrame; 96 | // _spriteRenderer.sprite = currentFrame.Sprite; 97 | //} 98 | } 99 | } 100 | 101 | public void PlayIfNotPlaying(string name) 102 | { 103 | if(CurrentAnimation.name != name) 104 | { 105 | Play(name); 106 | } 107 | } 108 | 109 | public void Play() 110 | { 111 | if (CurrentAnimation == null) 112 | { 113 | _spriteAnimationHelper.ChangeAnimation(DefaultAnimation); 114 | } 115 | 116 | Play(CurrentAnimation); 117 | } 118 | 119 | public void Play(string name) 120 | { 121 | Play(GetAnimationByName(name)); 122 | } 123 | 124 | public void Play(SpriteAnimation animation) 125 | { 126 | _state = SpriteAnimationState.Playing; 127 | _spriteAnimationHelper.ChangeAnimation(animation); 128 | AnimationPlayed?.Invoke(animation); 129 | 130 | //_previousFrame = 0; 131 | //_currentAnimationLoops = 0; 132 | triggerAnimationEndedEvent = false; 133 | } 134 | 135 | public void Pause() 136 | { 137 | _state = SpriteAnimationState.Paused; 138 | AnimationPaused?.Invoke(CurrentAnimation); 139 | } 140 | 141 | public void Resume() 142 | { 143 | _state = SpriteAnimationState.Playing; 144 | } 145 | 146 | public SpriteAnimation GetAnimationByName(string name) 147 | { 148 | for (int i = 0; i < _spriteAnimations.Count; i++) 149 | { 150 | if (_spriteAnimations[i].Name == name) 151 | { 152 | return _spriteAnimations[i]; 153 | } 154 | } 155 | 156 | return null; 157 | } 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /Scripts/State Machine/Entities Sample/PlayerEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public class PlayerEntity : MonoBehaviour 7 | { 8 | private StateMachine _stateMachine; 9 | private IdleState _idleState; 10 | private WalkState _walkState; 11 | 12 | public StateMachine stateMachine => _stateMachine; 13 | public IdleState idleState => _idleState; 14 | public WalkState walkState => _walkState; 15 | 16 | private void Awake() 17 | { 18 | _stateMachine = new StateMachine(); 19 | _idleState = new IdleState(_stateMachine, this); 20 | _walkState = new WalkState(_stateMachine, this); 21 | } 22 | 23 | private void Update() 24 | { 25 | _stateMachine.Tick(); 26 | } 27 | 28 | private void FixedUpdate() 29 | { 30 | _stateMachine.FixedTick(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Scripts/State Machine/IState.cs: -------------------------------------------------------------------------------- 1 | public interface IState 2 | { 3 | void Tick(); 4 | void FixedTick(); 5 | void OnEnter(); 6 | void OnExit(); 7 | } 8 | -------------------------------------------------------------------------------- /Scripts/State Machine/StateMachine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.AI; 5 | using Object = System.Object; 6 | 7 | // Notes 8 | // 1. What a finite state machine is 9 | // 2. Examples where you'd use one 10 | // AI, Animation, Game State 11 | // 3. Parts of a State Machine 12 | // States & Transitions 13 | // 4. States - 3 Parts 14 | // Tick - Why it's not Update() 15 | // OnEnter / OnExit (setup & cleanup) 16 | // 5. Transitions 17 | // Separated from states so they can be re-used 18 | // Easy transitions from any state 19 | 20 | public class StateMachine 21 | { 22 | private IState _currentState; 23 | 24 | private Dictionary> _transitions = new Dictionary>(); 25 | private List _currentTransitions = new List(); 26 | private List _anyTransitions = new List(); 27 | 28 | private static List EmptyTransitions = new List(0); 29 | 30 | public void Tick() 31 | { 32 | var transition = GetTransition(); 33 | if (transition != null) 34 | SetState(transition.To); 35 | 36 | _currentState?.Tick(); 37 | } 38 | 39 | public void FixedTick() 40 | { 41 | var transition = GetTransition(); 42 | if (transition != null) 43 | SetState(transition.To); 44 | 45 | _currentState?.FixedTick(); 46 | } 47 | 48 | public void SetState(IState state) 49 | { 50 | if (state == _currentState) 51 | return; 52 | 53 | _currentState?.OnExit(); 54 | _currentState = state; 55 | 56 | _transitions.TryGetValue(_currentState.GetType(), out _currentTransitions); 57 | if (_currentTransitions == null) 58 | _currentTransitions = EmptyTransitions; 59 | 60 | _currentState.OnEnter(); 61 | } 62 | 63 | public void AddTransition(IState from, IState to, Func predicate) 64 | { 65 | if (_transitions.TryGetValue(from.GetType(), out var transitions) == false) 66 | { 67 | transitions = new List(); 68 | _transitions[from.GetType()] = transitions; 69 | } 70 | 71 | transitions.Add(new Transition(to, predicate)); 72 | } 73 | 74 | public void AddAnyTransition(IState state, Func predicate) 75 | { 76 | _anyTransitions.Add(new Transition(state, predicate)); 77 | } 78 | 79 | private class Transition 80 | { 81 | public Func Condition {get; } 82 | public IState To { get; } 83 | 84 | public Transition(IState to, Func condition) 85 | { 86 | To = to; 87 | Condition = condition; 88 | } 89 | } 90 | 91 | private Transition GetTransition() 92 | { 93 | foreach(var transition in _anyTransitions) 94 | if (transition.Condition()) 95 | return transition; 96 | 97 | foreach (var transition in _currentTransitions) 98 | if (transition.Condition()) 99 | return transition; 100 | 101 | return null; 102 | } 103 | } -------------------------------------------------------------------------------- /Scripts/State Machine/States/IdleState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class IdleState : IState 4 | { 5 | private readonly StateMachine _stateMachine; 6 | private readonly PlayerEntity _playerEntity; 7 | 8 | public IdleState(StateMachine stateMachine, PlayerEntity playerEntity) 9 | { 10 | _stateMachine = stateMachine; 11 | _playerEntity = playerEntity; 12 | } 13 | 14 | public void Tick() 15 | { 16 | Debug.Log("Idle Tick"); 17 | } 18 | 19 | public void FixedTick() 20 | { 21 | Debug.Log("Idle Physics Tick"); 22 | } 23 | 24 | public void OnEnter() 25 | { 26 | Debug.Log("Idle OnEnter"); 27 | } 28 | 29 | public void OnExit() 30 | { 31 | Debug.Log("Idle OnExit"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Scripts/State Machine/States/WalkState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class WalkState : IState 4 | { 5 | private readonly StateMachine _stateMachine; 6 | private readonly PlayerEntity _playerEntity; 7 | 8 | public WalkState(StateMachine stateMachine, PlayerEntity playerEntity) 9 | { 10 | _stateMachine = stateMachine; 11 | _playerEntity = playerEntity; 12 | } 13 | 14 | public void Tick() 15 | { 16 | Debug.Log("Walk Tick"); 17 | } 18 | 19 | public void FixedTick() 20 | { 21 | Debug.Log("Walk Physics Tick"); 22 | } 23 | 24 | public void OnEnter() 25 | { 26 | Debug.Log("Walk OnEnter"); 27 | } 28 | 29 | public void OnExit() 30 | { 31 | Debug.Log("Walk OnExit"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/Outline - HLSL/SpriteInnerOutline.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/InnerSpriteOutline" 2 | { 3 | Properties 4 | { 5 | _Color("Tint", Color) = (1, 1, 1, 1) 6 | _MainTex("Texture", 2D) = "white" {} 7 | _OutlineColor("Outline Color", Color) = (0,0,0,0) 8 | } 9 | SubShader 10 | { 11 | Tags 12 | { 13 | "Queue" = "Transparent" 14 | } 15 | 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | 18 | Pass 19 | { 20 | ZTest Off 21 | Blend SrcAlpha OneMinusSrcAlpha 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | 26 | #include "UnityCG.cginc" 27 | 28 | struct appdata 29 | { 30 | float4 vertex : POSITION; 31 | float2 uv : TEXCOORD0; 32 | fixed4 color : COLOR; 33 | }; 34 | 35 | struct v2f 36 | { 37 | float2 uv : TEXCOORD0; 38 | float4 vertex : SV_POSITION; 39 | float4 color : COLOR; 40 | }; 41 | 42 | sampler2D _MainTex; 43 | float4 _MainTex_ST; 44 | float4 _MainTex_TexelSize; 45 | 46 | fixed4 _Color; 47 | fixed4 _OutlineColor; 48 | 49 | v2f vert(appdata v) 50 | { 51 | v2f o; 52 | o.vertex = UnityObjectToClipPos(v.vertex); 53 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 54 | o.color = v.color; 55 | return o; 56 | } 57 | 58 | fixed4 frag(v2f i) : SV_Target 59 | { 60 | fixed4 col = tex2D(_MainTex, i.uv); 61 | col *= _Color; 62 | col *= i.color; 63 | 64 | fixed leftPixel = tex2D(_MainTex, i.uv + float2(-_MainTex_TexelSize.x, 0)).a; 65 | fixed upPixel = tex2D(_MainTex, i.uv + float2(0, _MainTex_TexelSize.y)).a; 66 | fixed rightPixel = tex2D(_MainTex, i.uv + float2(_MainTex_TexelSize.x, 0)).a; 67 | fixed bottomPixel = tex2D(_MainTex, i.uv + float2(0, -_MainTex_TexelSize.y)).a; 68 | 69 | fixed outline = (1 - leftPixel * upPixel * rightPixel * bottomPixel) * col.a; 70 | 71 | return lerp(col, _OutlineColor, outline); 72 | } 73 | ENDCG 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /Shaders/Outline - HLSL/SpriteOuterOutline.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/OuterSpriteOutline" 2 | { 3 | Properties 4 | { 5 | _Color("Tint", Color) = (1, 1, 1, 1) 6 | _MainTex("Texture", 2D) = "white" {} 7 | _OutlineColor("Outline Color", Color) = (0,0,0,0) 8 | } 9 | SubShader 10 | { 11 | Tags 12 | { 13 | "Queue" = "Transparent" 14 | } 15 | 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | 18 | Pass 19 | { 20 | ZTest Off 21 | Blend SrcAlpha OneMinusSrcAlpha 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | 26 | #include "UnityCG.cginc" 27 | 28 | struct appdata 29 | { 30 | float4 vertex : POSITION; 31 | float2 uv : TEXCOORD0; 32 | fixed4 color : COLOR; 33 | }; 34 | 35 | struct v2f 36 | { 37 | float2 uv : TEXCOORD0; 38 | float4 vertex : SV_POSITION; 39 | float4 color : COLOR; 40 | }; 41 | 42 | sampler2D _MainTex; 43 | float4 _MainTex_ST; 44 | float4 _MainTex_TexelSize; 45 | 46 | fixed4 _Color; 47 | fixed4 _OutlineColor; 48 | 49 | v2f vert(appdata v) 50 | { 51 | v2f o; 52 | o.vertex = UnityObjectToClipPos(v.vertex); 53 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 54 | o.color = v.color; 55 | return o; 56 | } 57 | 58 | fixed4 frag(v2f i) : SV_Target 59 | { 60 | fixed4 col = tex2D(_MainTex, i.uv); 61 | col *= _Color; 62 | col *= i.color; 63 | 64 | fixed leftPixel = tex2D(_MainTex, i.uv + float2(-_MainTex_TexelSize.x, 0)).a; 65 | fixed upPixel = tex2D(_MainTex, i.uv + float2(0, _MainTex_TexelSize.y)).a; 66 | fixed rightPixel = tex2D(_MainTex, i.uv + float2(_MainTex_TexelSize.x, 0)).a; 67 | fixed bottomPixel = tex2D(_MainTex, i.uv + float2(0, -_MainTex_TexelSize.y)).a; 68 | 69 | fixed outline = max(max(leftPixel, upPixel), max(rightPixel, bottomPixel)) - col.a; 70 | 71 | return lerp(col, _OutlineColor, outline); 72 | } 73 | ENDCG 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /Shaders/Outline - Shader Graph/OutlineSample.shadersubgraph: -------------------------------------------------------------------------------- 1 | { 2 | "m_SerializedProperties": [ 3 | { 4 | "typeInfo": { 5 | "fullName": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty" 6 | }, 7 | "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"bf177dc8-5267-40b0-8f74-b6077c4cbf38\"\n },\n \"m_Name\": \"Texture\",\n \"m_DefaultReferenceName\": \"Texture2D_689FA3DD\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": {\n \"m_SerializedTexture\": \"{\\\"texture\\\":{\\\"instanceID\\\":0}}\",\n \"m_Guid\": \"\"\n },\n \"m_Modifiable\": true,\n \"m_DefaultType\": 0\n}" 8 | }, 9 | { 10 | "typeInfo": { 11 | "fullName": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty" 12 | }, 13 | "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"d6b0e995-4934-4809-8ffd-5b2f1fccff26\"\n },\n \"m_Name\": \"OutlineThickness\",\n \"m_DefaultReferenceName\": \"Vector1_4BBAF6CF\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": 0.0,\n \"m_FloatType\": 0,\n \"m_RangeValues\": {\n \"x\": 0.0,\n \"y\": 1.0\n }\n}" 14 | }, 15 | { 16 | "typeInfo": { 17 | "fullName": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty" 18 | }, 19 | "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"73f78d13-fed2-4bce-9c62-71d2d210ab88\"\n },\n \"m_Name\": \"Direction\",\n \"m_DefaultReferenceName\": \"Vector2_1842CF4\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 0.0,\n \"z\": 0.0,\n \"w\": 0.0\n }\n}" 20 | } 21 | ], 22 | "m_SerializedKeywords": [], 23 | "m_SerializableNodes": [ 24 | { 25 | "typeInfo": { 26 | "fullName": "UnityEditor.ShaderGraph.SubGraphOutputNode" 27 | }, 28 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"034c1084-2cca-4ad8-bbe2-b5bd8bd65dd8\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Out_Vector4\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 712.0000610351563,\n \"y\": -94.99999237060547,\n \"width\": 132.99998474121095,\n \"height\": 76.99999237060547\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 29 | }, 30 | { 31 | "typeInfo": { 32 | "fullName": "UnityEditor.ShaderGraph.PropertyNode" 33 | }, 34 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"0e936acc-eae5-434d-b9a6-2f57adffa6fc\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 255.99998474121095,\n \"y\": -285.9999694824219,\n \"width\": 123.99999237060547,\n \"height\": 33.999996185302737\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"bf177dc8-5267-40b0-8f74-b6077c4cbf38\"\n}" 35 | }, 36 | { 37 | "typeInfo": { 38 | "fullName": "UnityEditor.ShaderGraph.PropertyNode" 39 | }, 40 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"113c3cff-6436-40e7-a8ea-474d1e3d2187\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -1137.0,\n \"y\": 260.9999694824219,\n \"width\": 165.0,\n \"height\": 33.999996185302737\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"OutlineThickness\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"d6b0e995-4934-4809-8ffd-5b2f1fccff26\"\n}" 41 | }, 42 | { 43 | "typeInfo": { 44 | "fullName": "UnityEditor.ShaderGraph.Texture2DPropertiesNode" 45 | }, 46 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"25cbbcf5-1d5f-47c8-b8eb-2cee7c58c2fc\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Texel Size\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -1823.9998779296875,\n \"y\": -332.0,\n \"width\": 184.0,\n \"height\": 101.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Width\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Width\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Height\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Height\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Texture\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Texture\\\": {\\n \\\"m_SerializedTexture\\\": \\\"{\\\\\\\"texture\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n },\\n \\\"m_DefaultType\\\": 0\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 47 | }, 48 | { 49 | "typeInfo": { 50 | "fullName": "UnityEditor.ShaderGraph.ReciprocalNode" 51 | }, 52 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"5d29c252-8397-4c16-992c-46808d66cf9d\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Reciprocal\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -1295.0,\n \"y\": -83.99999237060547,\n \"width\": 207.99998474121095,\n \"height\": 313.9999694824219\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 1.0,\\n \\\"y\\\": 1.0,\\n \\\"z\\\": 1.0,\\n \\\"w\\\": 1.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_ReciprocalMethod\": 0\n}" 53 | }, 54 | { 55 | "typeInfo": { 56 | "fullName": "UnityEditor.ShaderGraph.SampleTexture2DNode" 57 | }, 58 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"61b74e59-a1e4-40a5-b3ad-4c91a9b6427a\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Sample Texture 2D\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 421.0,\n \"y\": -294.0,\n \"width\": 207.99998474121095,\n \"height\": 436.9999694824219\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"RGBA\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGBA\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Texture\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Texture\\\": {\\n \\\"m_SerializedTexture\\\": \\\"{\\\\\\\"texture\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n },\\n \\\"m_DefaultType\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.UVMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"UV\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"UV\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ],\\n \\\"m_Channel\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.SamplerStateMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Sampler\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sampler\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_TextureType\": 0,\n \"m_NormalMapSpace\": 0\n}" 59 | }, 60 | { 61 | "typeInfo": { 62 | "fullName": "UnityEditor.ShaderGraph.UVNode" 63 | }, 64 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"97de3f3a-c21c-4d5d-a946-018e2eee338c\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"UV\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -363.9999694824219,\n \"y\": -537.0,\n \"width\": 207.99998474121095,\n \"height\": 313.9999694824219\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_OutputChannel\": 0\n}" 65 | }, 66 | { 67 | "typeInfo": { 68 | "fullName": "UnityEditor.ShaderGraph.MultiplyNode" 69 | }, 70 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"9f31b537-4524-466d-81a4-71229c778b1c\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -876.9999389648438,\n \"y\": -77.00001525878906,\n \"width\": 207.99998474121095,\n \"height\": 301.9999694824219\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 71 | }, 72 | { 73 | "typeInfo": { 74 | "fullName": "UnityEditor.ShaderGraph.MultiplyNode" 75 | }, 76 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"a47351b7-f839-4b99-9d6b-210ee26664c0\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -478.0,\n \"y\": -85.00003051757813,\n \"width\": 208.00001525878907,\n \"height\": 302.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 77 | }, 78 | { 79 | "typeInfo": { 80 | "fullName": "UnityEditor.ShaderGraph.AddNode" 81 | }, 82 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"be5b838d-5553-4d82-bc4a-5ee5ab2bc931\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Add\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -42.99995422363281,\n \"y\": -316.0,\n \"width\": 207.99998474121095,\n \"height\": 301.9999694824219\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 83 | }, 84 | { 85 | "typeInfo": { 86 | "fullName": "UnityEditor.ShaderGraph.Vector2Node" 87 | }, 88 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"d68773b5-2efa-415c-a11a-264d659ba724\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Vector 2\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -1445.0,\n \"y\": -311.9999694824219,\n \"width\": 127.99999237060547,\n \"height\": 101.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"X\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"X\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Y\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Y\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"Y\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 0.0\n }\n}" 89 | }, 90 | { 91 | "typeInfo": { 92 | "fullName": "UnityEditor.ShaderGraph.PropertyNode" 93 | }, 94 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"dbbafa2c-65b1-40a5-8fcb-bbe0011ac47b\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -2109.0,\n \"y\": -402.99993896484377,\n \"width\": 123.99999237060547,\n \"height\": 33.999996185302737\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"bf177dc8-5267-40b0-8f74-b6077c4cbf38\"\n}" 95 | }, 96 | { 97 | "typeInfo": { 98 | "fullName": "UnityEditor.ShaderGraph.PropertyNode" 99 | }, 100 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"f1f91b76-61cf-407a-9035-34be20df78d2\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -653.9999389648438,\n \"y\": 256.9999694824219,\n \"width\": 125.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Direction\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"73f78d13-fed2-4bce-9c62-71d2d210ab88\"\n}" 101 | } 102 | ], 103 | "m_Groups": [], 104 | "m_StickyNotes": [], 105 | "m_SerializableEdges": [ 106 | { 107 | "typeInfo": { 108 | "fullName": "UnityEditor.Graphing.Edge" 109 | }, 110 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"0e936acc-eae5-434d-b9a6-2f57adffa6fc\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"61b74e59-a1e4-40a5-b3ad-4c91a9b6427a\"\n }\n}" 111 | }, 112 | { 113 | "typeInfo": { 114 | "fullName": "UnityEditor.Graphing.Edge" 115 | }, 116 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"113c3cff-6436-40e7-a8ea-474d1e3d2187\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"9f31b537-4524-466d-81a4-71229c778b1c\"\n }\n}" 117 | }, 118 | { 119 | "typeInfo": { 120 | "fullName": "UnityEditor.Graphing.Edge" 121 | }, 122 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"25cbbcf5-1d5f-47c8-b8eb-2cee7c58c2fc\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"d68773b5-2efa-415c-a11a-264d659ba724\"\n }\n}" 123 | }, 124 | { 125 | "typeInfo": { 126 | "fullName": "UnityEditor.Graphing.Edge" 127 | }, 128 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"25cbbcf5-1d5f-47c8-b8eb-2cee7c58c2fc\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"d68773b5-2efa-415c-a11a-264d659ba724\"\n }\n}" 129 | }, 130 | { 131 | "typeInfo": { 132 | "fullName": "UnityEditor.Graphing.Edge" 133 | }, 134 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"5d29c252-8397-4c16-992c-46808d66cf9d\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"9f31b537-4524-466d-81a4-71229c778b1c\"\n }\n}" 135 | }, 136 | { 137 | "typeInfo": { 138 | "fullName": "UnityEditor.Graphing.Edge" 139 | }, 140 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 7,\n \"m_NodeGUIDSerialized\": \"61b74e59-a1e4-40a5-b3ad-4c91a9b6427a\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"034c1084-2cca-4ad8-bbe2-b5bd8bd65dd8\"\n }\n}" 141 | }, 142 | { 143 | "typeInfo": { 144 | "fullName": "UnityEditor.Graphing.Edge" 145 | }, 146 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"97de3f3a-c21c-4d5d-a946-018e2eee338c\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"be5b838d-5553-4d82-bc4a-5ee5ab2bc931\"\n }\n}" 147 | }, 148 | { 149 | "typeInfo": { 150 | "fullName": "UnityEditor.Graphing.Edge" 151 | }, 152 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"9f31b537-4524-466d-81a4-71229c778b1c\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"a47351b7-f839-4b99-9d6b-210ee26664c0\"\n }\n}" 153 | }, 154 | { 155 | "typeInfo": { 156 | "fullName": "UnityEditor.Graphing.Edge" 157 | }, 158 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"a47351b7-f839-4b99-9d6b-210ee26664c0\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"be5b838d-5553-4d82-bc4a-5ee5ab2bc931\"\n }\n}" 159 | }, 160 | { 161 | "typeInfo": { 162 | "fullName": "UnityEditor.Graphing.Edge" 163 | }, 164 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"be5b838d-5553-4d82-bc4a-5ee5ab2bc931\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"61b74e59-a1e4-40a5-b3ad-4c91a9b6427a\"\n }\n}" 165 | }, 166 | { 167 | "typeInfo": { 168 | "fullName": "UnityEditor.Graphing.Edge" 169 | }, 170 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"d68773b5-2efa-415c-a11a-264d659ba724\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"5d29c252-8397-4c16-992c-46808d66cf9d\"\n }\n}" 171 | }, 172 | { 173 | "typeInfo": { 174 | "fullName": "UnityEditor.Graphing.Edge" 175 | }, 176 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"dbbafa2c-65b1-40a5-8fcb-bbe0011ac47b\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"25cbbcf5-1d5f-47c8-b8eb-2cee7c58c2fc\"\n }\n}" 177 | }, 178 | { 179 | "typeInfo": { 180 | "fullName": "UnityEditor.Graphing.Edge" 181 | }, 182 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"f1f91b76-61cf-407a-9035-34be20df78d2\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"a47351b7-f839-4b99-9d6b-210ee26664c0\"\n }\n}" 183 | } 184 | ], 185 | "m_PreviewData": { 186 | "serializedMesh": { 187 | "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", 188 | "m_Guid": "" 189 | } 190 | }, 191 | "m_Path": "Sub Graphs", 192 | "m_ConcretePrecision": 0, 193 | "m_ActiveOutputNodeGuidSerialized": "" 194 | } -------------------------------------------------------------------------------- /Sprites/Prototyping Tilesets/Prototype 16x16/tiles_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielBigardi/Unity-Utils/b143a8dbace751e242bebe70cc8a501a2d2daea7/Sprites/Prototyping Tilesets/Prototype 16x16/tiles_16x16.png -------------------------------------------------------------------------------- /Sprites/Prototyping Tilesets/Prototype 32x32/Tiles_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielBigardi/Unity-Utils/b143a8dbace751e242bebe70cc8a501a2d2daea7/Sprites/Prototyping Tilesets/Prototype 32x32/Tiles_32x32.png -------------------------------------------------------------------------------- /Sprites/Prototyping Tilesets/Prototype 64x64/Tiles_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielBigardi/Unity-Utils/b143a8dbace751e242bebe70cc8a501a2d2daea7/Sprites/Prototyping Tilesets/Prototype 64x64/Tiles_64x64.png --------------------------------------------------------------------------------