This commit is contained in:
SoulliesOfficial
2026-01-03 18:19:39 -05:00
parent 3bcd7c1cf8
commit 33b1795c1f
7387 changed files with 2762819 additions and 716926 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 21b780eed4a15d9499b0bf1e29080b43
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 858aebaee62fd59438225bcca788b96d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,389 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace INab.WorldScanFX
{
public class ScanFXBaseEditor : Editor
{
// Post Processing
public SerializedProperty updateScanMaterialProperties;
public SerializedProperty scanOrigin;
public SerializedProperty alwaysPassScanOriginPosition;
public SerializedProperty alwaysPassScanOriginDirection;
public SerializedProperty scanDuration;
public SerializedProperty scansLeft;
public SerializedProperty timeLeft;
public SerializedProperty timePassed;
public SerializedProperty currentScanValueTesting;
public SerializedProperty scansNumberTesting;
public SerializedProperty scanMaterial;
// PostProcessingMaterialProperties
public SerializedProperty _SizeAdjust;
public SerializedProperty _Size;
public SerializedProperty _OriginOffset;
public SerializedProperty _MaskRadius;
public SerializedProperty _MaskHardness;
public SerializedProperty _MaskPower;
public SerializedProperty _FovMaskEnabled;
public SerializedProperty _FovMask;
public SerializedProperty _FovMaskSmoothness;
public SerializedProperty _EdgeHardness;
public SerializedProperty _EdgePower;
public SerializedProperty _EdgeMultiplier;
public SerializedProperty _HighlightPower;
public SerializedProperty _HighlightMultiplier;
public SerializedProperty _EdgeColor;
public SerializedProperty _HighlightColor;
public SerializedProperty _OverlayType;
public SerializedProperty _OverlayMultiplier;
public SerializedProperty _OverlayPower;
public SerializedProperty _OverlayColor;
public SerializedProperty _ScreenTexture;
public SerializedProperty _ScreenTextureTiling;
public SerializedProperty _Frequency;
public SerializedProperty _Ratio;
public SerializedProperty _Thickness;
public SerializedProperty _NormalsOffset;
public SerializedProperty _NormalsHardness;
public SerializedProperty _NormalsPower;
public SerializedProperty _DepthThreshold;
public SerializedProperty _DepthHardness;
public SerializedProperty _DepthPower;
public SerializedProperty _EdgeDetectionMultiplier;
public SerializedProperty _GridMultiplier;
private bool waitForFavMaskEnabled = false;
private bool waitForOverlayType = false;
// CustomHighlight
public SerializedProperty useCustomHighlight;
public SerializedProperty DistanceOffset;
public SerializedProperty MaskRadiusOffset;
public SerializedProperty FovOffset;
public SerializedProperty highlightObjects;
public SerializedProperty useScanOverlayOnMaterials;
public SerializedProperty highlightMaterials;
public SerializedProperty useWorldScanMaterials;
public SerializedProperty worldScanMaterials;
public void OnEnable()
{
//currentCamera = serializedObject.FindProperty("currentCamera");
updateScanMaterialProperties = serializedObject.FindProperty("updateScanMaterialProperties");
scanMaterial = serializedObject.FindProperty("scanMaterial");
scanOrigin = serializedObject.FindProperty("scanOrigin");
alwaysPassScanOriginPosition = serializedObject.FindProperty("alwaysPassScanOriginPosition");
alwaysPassScanOriginDirection = serializedObject.FindProperty("alwaysPassScanOriginDirection");
scanDuration = serializedObject.FindProperty("scanDuration");
scansLeft = serializedObject.FindProperty("scansLeft");
timeLeft = serializedObject.FindProperty("timeLeft");
timePassed = serializedObject.FindProperty("timePassed");
currentScanValueTesting = serializedObject.FindProperty("currentScanValueTesting");
scansNumberTesting = serializedObject.FindProperty("scansNumberTesting");
_SizeAdjust = serializedObject.FindProperty("_SizeAdjust");
_Size = serializedObject.FindProperty("_Size");
_OriginOffset = serializedObject.FindProperty("_OriginOffset");
_MaskRadius = serializedObject.FindProperty("_MaskRadius");
_MaskHardness = serializedObject.FindProperty("_MaskHardness");
_MaskPower = serializedObject.FindProperty("_MaskPower");
_FovMaskEnabled = serializedObject.FindProperty("_FovMaskEnabled");
_FovMask = serializedObject.FindProperty("_FovMask");
_FovMaskSmoothness = serializedObject.FindProperty("_FovMaskSmoothness");
_EdgeHardness = serializedObject.FindProperty("_EdgeHardness");
_EdgePower = serializedObject.FindProperty("_EdgePower");
_EdgeMultiplier = serializedObject.FindProperty("_EdgeMultiplier");
_HighlightPower = serializedObject.FindProperty("_HighlightPower");
_HighlightMultiplier = serializedObject.FindProperty("_HighlightMultiplier");
_HighlightColor = serializedObject.FindProperty("_HighlightColor");
_EdgeColor = serializedObject.FindProperty("_EdgeColor");
_OverlayType = serializedObject.FindProperty("_OverlayType");
_OverlayMultiplier = serializedObject.FindProperty("_OverlayMultiplier");
_OverlayPower = serializedObject.FindProperty("_OverlayPower");
_OverlayColor = serializedObject.FindProperty("_OverlayColor");
_ScreenTexture = serializedObject.FindProperty("_ScreenTexture");
_ScreenTextureTiling = serializedObject.FindProperty("_ScreenTextureTiling");
_Frequency = serializedObject.FindProperty("_Frequency");
_Ratio = serializedObject.FindProperty("_Ratio");
_Thickness = serializedObject.FindProperty("_Thickness");
_NormalsOffset = serializedObject.FindProperty("_NormalsOffset");
_NormalsHardness = serializedObject.FindProperty("_NormalsHardness");
_NormalsPower = serializedObject.FindProperty("_NormalsPower");
_DepthThreshold = serializedObject.FindProperty("_DepthThreshold");
_DepthHardness = serializedObject.FindProperty("_DepthHardness");
_DepthPower = serializedObject.FindProperty("_DepthPower");
_EdgeDetectionMultiplier = serializedObject.FindProperty("_EdgeDetectionMultiplier");
_GridMultiplier = serializedObject.FindProperty("_GridMultiplier");
useCustomHighlight = serializedObject.FindProperty("useCustomHighlight");
DistanceOffset = serializedObject.FindProperty("DistanceOffset");
MaskRadiusOffset = serializedObject.FindProperty("MaskRadiusOffset");
FovOffset = serializedObject.FindProperty("FovOffset");
highlightObjects = serializedObject.FindProperty("highlightObjects");
useScanOverlayOnMaterials = serializedObject.FindProperty("useScanOverlayOnMaterials");
highlightMaterials = serializedObject.FindProperty("highlightMaterials");
useWorldScanMaterials = serializedObject.FindProperty("useWorldScanMaterials");
worldScanMaterials = serializedObject.FindProperty("worldScanMaterials");
}
protected virtual void DrawPostProcess()
{
EditorGUILayout.LabelField("Post Process", EditorStyles.boldLabel);
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.PropertyField(scanOrigin);
EditorGUILayout.PropertyField(alwaysPassScanOriginPosition);
EditorGUILayout.PropertyField(alwaysPassScanOriginDirection);
if (scanOrigin.objectReferenceValue == null)
{
EditorGUILayout.HelpBox("Please assign a game object to the scanOrigin field", MessageType.Error);
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(scanDuration);
GUI.enabled = false;
EditorGUILayout.PropertyField(scansLeft);
EditorGUILayout.PropertyField(timeLeft);
EditorGUILayout.PropertyField(timePassed);
GUI.enabled = true;
EditorGUILayout.Space();
}
}
protected void DrawCustomHighlight()
{
EditorGUILayout.LabelField("Other", EditorStyles.boldLabel);
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.PropertyField(useCustomHighlight);
if (useCustomHighlight.boolValue)
{
EditorGUILayout.PropertyField(DistanceOffset);
EditorGUILayout.PropertyField(MaskRadiusOffset);
EditorGUILayout.PropertyField(FovOffset);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(highlightObjects);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(useScanOverlayOnMaterials);
if (useScanOverlayOnMaterials.boolValue)
{
EditorGUILayout.HelpBox("Make sure to turn on UseScanOvelay keyword in the Scan FX Highlight materials", MessageType.Info);
EditorGUILayout.Space();
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(highlightMaterials);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(useWorldScanMaterials);
if (useWorldScanMaterials.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(worldScanMaterials);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
}
}
protected void DrawEditorTesting(ScanFXBase scanFX)
{
EditorGUILayout.LabelField("Testing", EditorStyles.boldLabel);
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.HelpBox("Use the currentScanValueTesting field to check the effect's appearance. It ranges from 0 to 1, after which it loops back to the beginning.", MessageType.Info);
EditorGUILayout.PropertyField(currentScanValueTesting);
EditorGUILayout.Space();
EditorGUILayout.HelpBox("In play mode, activate StartScans to initiate a sequence of scans. The total number of scans will match the value set in scansNumberTesting.", MessageType.Info);
if (GUILayout.Button("StartScans"))
{
scanFX.PassScanOriginProperties();
scanFX.StartScan(scanFX.scansNumberTesting);
}
EditorGUILayout.PropertyField(scansNumberTesting);
EditorGUILayout.Space();
}
}
protected void DrawScanMaterialSettings()
{
EditorGUILayout.LabelField("Scan Material", EditorStyles.boldLabel);
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.PropertyField(scanMaterial);
if (scanMaterial.objectReferenceValue == null)
{
EditorGUILayout.HelpBox("Please assign a Scan FX material to the scanMaterial field", MessageType.Error);
}
EditorGUILayout.PropertyField(updateScanMaterialProperties);
EditorGUILayout.Space();
if (updateScanMaterialProperties.boolValue == false)
{
return;
}
EditorGUILayout.LabelField("Appearance", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_Size);
EditorGUILayout.PropertyField(_SizeAdjust);
EditorGUILayout.PropertyField(_OriginOffset);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_EdgeColor);
EditorGUILayout.PropertyField(_EdgeHardness);
EditorGUILayout.PropertyField(_EdgePower);
EditorGUILayout.PropertyField(_EdgeMultiplier);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_HighlightColor);
EditorGUILayout.PropertyField(_HighlightPower);
EditorGUILayout.PropertyField(_HighlightMultiplier);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Sphere Mask", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_MaskRadius);
EditorGUILayout.PropertyField(_MaskHardness);
EditorGUILayout.PropertyField(_MaskPower);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Fov Mask", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_FovMaskEnabled);
if (_FovMaskEnabled.boolValue)
{
EditorGUILayout.PropertyField(_FovMask);
EditorGUILayout.PropertyField(_FovMaskSmoothness);
}
EditorGUILayout.Space();
EditorGUILayout.LabelField("Overlay", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_OverlayType);
if (_OverlayType.enumValueIndex != 0)
{
EditorGUILayout.PropertyField(_OverlayMultiplier);
EditorGUILayout.PropertyField(_OverlayPower);
EditorGUILayout.PropertyField(_OverlayColor);
EditorGUILayout.Space();
}
switch (_OverlayType.enumValueIndex)
{
case 1:
EditorGUILayout.PropertyField(_ScreenTexture);
EditorGUILayout.PropertyField(_ScreenTextureTiling);
break;
case 2:
EditorGUILayout.PropertyField(_Thickness);
EditorGUILayout.PropertyField(_NormalsOffset);
EditorGUILayout.PropertyField(_NormalsHardness);
EditorGUILayout.PropertyField(_NormalsPower);
EditorGUILayout.PropertyField(_DepthThreshold);
EditorGUILayout.PropertyField(_DepthHardness);
EditorGUILayout.PropertyField(_DepthPower);
break;
case 3:
EditorGUILayout.PropertyField(_Frequency);
EditorGUILayout.PropertyField(_Ratio);
break;
case 4:
EditorGUILayout.LabelField("Grid", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_GridMultiplier);
EditorGUILayout.PropertyField(_Frequency);
EditorGUILayout.PropertyField(_Ratio);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Edge Detection", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_EdgeDetectionMultiplier);
EditorGUILayout.PropertyField(_Thickness);
EditorGUILayout.PropertyField(_NormalsOffset);
EditorGUILayout.PropertyField(_NormalsHardness);
EditorGUILayout.PropertyField(_NormalsPower);
EditorGUILayout.PropertyField(_DepthThreshold);
EditorGUILayout.PropertyField(_DepthHardness);
EditorGUILayout.PropertyField(_DepthPower);
break;
}
EditorGUILayout.Space();
}
}
protected void HaveKeywordsChanged(ScanFXBase scanFX)
{
if ((scanFX._FovMaskEnabled) != _FovMaskEnabled.boolValue)
{
waitForFavMaskEnabled = true;
}
if ((int)(scanFX._OverlayType) != _OverlayType.enumValueIndex)
{
waitForOverlayType = true;
}
}
protected virtual void UpdateKeywords(ScanFXBase scanFX)
{
if (waitForFavMaskEnabled || waitForOverlayType)
{
scanFX.UpdateAllMaterialsKeywords();
waitForFavMaskEnabled = false;
waitForOverlayType = false;
}
}
public override void OnInspectorGUI()
{
//DrawDefaultInspector();
serializedObject.Update();
// get target
ScanFXBase scanFX = (ScanFXBase)target;
DrawPostProcess();
DrawEditorTesting(scanFX);
DrawScanMaterialSettings();
DrawCustomHighlight();
HaveKeywordsChanged(scanFX);
serializedObject.ApplyModifiedProperties();
UpdateKeywords(scanFX);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7c457347a25a1764cae874249ffed806
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace INab.WorldScanFX
{
[CanEditMultipleObjects]
[CustomEditor(typeof(ScanFXHighlight))]
public class ScanFXHighlightEditor : Editor
{
// all serialized properties
SerializedProperty renderers;
SerializedProperty highlightDuration;
SerializedProperty curve;
SerializedProperty highlightEvent;
public void OnEnable()
{
renderers = serializedObject.FindProperty("renderers");
highlightDuration = serializedObject.FindProperty("highlightDuration");
curve = serializedObject.FindProperty("curve");
highlightEvent = serializedObject.FindProperty("highlightEvent");
}
public override void OnInspectorGUI()
{
//DrawDefaultInspector();
serializedObject.Update();
ScanFXHighlight scanFXHighlight = (ScanFXHighlight)target;
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(renderers);
EditorGUI.indentLevel--;
if (GUILayout.Button("Find Renderers"))
{
scanFXHighlight.FindRenderers();
}
if (GUILayout.Button("Find Renderers in children"))
{
scanFXHighlight.FindRenderersInChildren();
}
EditorGUILayout.Space();
}
EditorGUILayout.LabelField("Settings", EditorStyles.boldLabel);
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.PropertyField(highlightDuration);
EditorGUILayout.PropertyField(curve);
EditorGUILayout.PropertyField(highlightEvent);
}
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd9ed4c2d233af54ebdd6501fc2017dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,646 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace INab.WorldScanFX
{
public abstract class ScanFXBase : MonoBehaviour
{
#region Static
// Defines the type of overlay effect applied during the scanning process.
public enum OverlayType
{
None, // No overlay.
ScreenTexture, // Applies a texture overlay.
EdgeDetection, // Highlights edges.
Grid, // Displays a grid pattern.
GridAndEdgeDetection // Combines grid and edge detection overlays.
}
// Keywords for enabling specific overlay shaders in materials.
private static List<string> overlayTypeKeywords = new List<string>()
{
"_OVERLAY_NONE",
"_OVERLAY_SCREENTEXTURE",
"_OVERLAY_EDGEDETECTION",
"_OVERLAY_GRID",
"_OVERLAY_GRIDANDEDGEDETECTION"
};
// Keyword for enabling the field of view mask in materials.
private static string fovMaskEnabledKeyword = "_FOVMASKENABLED";
#endregion
#region LogicProperties
// General settings
[Tooltip("Enables updating the scan material properties based on this script's settings.")]
[SerializeField] private bool updateScanMaterialProperties = false;
[Tooltip("Material used for the scan effect.")]
[SerializeField] protected Material scanMaterial;
[Tooltip("Origin point for the scan effect.")]
[SerializeField] public Transform scanOrigin;
[Tooltip("Disable to manually update the scan origin's position from code.")]
[SerializeField] public bool alwaysPassScanOriginPosition = true;
[Tooltip("Disable to manually update the scan origin's direction from code.")]
[SerializeField] public bool alwaysPassScanOriginDirection = true;
// Internal use for tracking origin position and direction
private Vector3 originForward;
private Vector3 originPosition;
// Scan logic
[Tooltip("How long each scan lasts, in seconds.")]
[SerializeField] public float scanDuration = 5f;
[Tooltip("Tracks the number of scans left to be executed.")]
public int ScansLeft
{
get { return scansLeft; }
private set { }
}
[Tooltip("Counts how many scans are remaining.")]
[SerializeField] private int scansLeft = 0;
[Tooltip("Time remaining for the current scan to finish.")]
[SerializeField] private float timeLeft = 0f;
[Tooltip("Time elapsed since the current scan started.")]
[SerializeField] private float timePassed = 0f;
// Editor Testing
[Tooltip("Adjusts the scan value for editor testing purposes.")]
[Range(0f, 2f)]
[SerializeField] private float currentScanValueTesting = 1f;
[Tooltip("Sets the number of scans for testing.")]
[SerializeField] public int scansNumberTesting = 3;
#endregion
#region PostProcessingMaterialProperties
// Appearance
[Tooltip("Base size of the scan effect.")]
[SerializeField] private float _Size = 8f;
[Tooltip("Adjust this to ensure a smooth fade-out at the end of the scan. Test with the current scan value.")]
[SerializeField] private float _SizeAdjust = 0f;
[Tooltip("Offset from the origin to exclude nearby objects from the scan effect, like the player.")]
[SerializeField] private float _OriginOffset = 2f;
[Tooltip("Color of the scan's edge.")]
[SerializeField][ColorUsage(true, true)] private Color _EdgeColor = new Color(0.09803922f, 0.2039216f, 1f);
[Tooltip("Sharpness of the scan's edge.")]
[SerializeField][Range(0f, 1f)] private float _EdgeHardness = 0.8f;
[Tooltip("Adjusts the edge's size and appearance.")]
[SerializeField] private float _EdgePower = 10f;
[Tooltip("Multiplier for the edge effect.")]
[SerializeField] private float _EdgeMultiplier = 1f;
[Tooltip("Color for the slight highlight of the scan.")]
[SerializeField][ColorUsage(true, true)] private Color _HighlightColor = new Color(0.454902f, 0.4980392f, 1f);
[Tooltip("Adjusts the highlight's size and appearance.")]
[SerializeField] private float _HighlightPower = 3f;
[Tooltip("Multiplier for the highlight effect.")]
[SerializeField][Range(0f, 1f)] private float _HighlightMultiplier = 0.8f;
// Sphere Mask
[Tooltip("Radius of the scan area.")]
[SerializeField] private float _MaskRadius = 50f;
[Tooltip("Defines the edge sharpness of the sphere mask.")]
[SerializeField][Range(0f, 1f)] private float _MaskHardness = 0.5f;
[Tooltip("Adjusts the scan radius mask's intensity.")]
[SerializeField] private float _MaskPower = 1f;
// Fov Mask
[Tooltip("Toggle the FOV mask on or off.")]
[SerializeField] public bool _FovMaskEnabled = false;
[Tooltip("FOV mask value, simulating an angle from 0 to 180 degrees.")]
[SerializeField][Range(0f, 1f)] private float _FovMask = 0.5f;
[Tooltip("Smoothness of the FOV mask edges.")]
[SerializeField][Range(0f, 1f)] private float _FovMaskSmoothness = 0.2f;
// Overlay
[Tooltip("Type of overlay effect.")]
[SerializeField] public OverlayType _OverlayType = OverlayType.None;
[Tooltip("Multiplier for the overlay effect.")]
[SerializeField][Range(0f, 1f)] private float _OverlayMultiplier = 1f;
[Tooltip("Intensity of the overlay effect.")]
[SerializeField] private float _OverlayPower = 1f;
[Tooltip("Color of the overlay effect.")]
[SerializeField][ColorUsage(true, true)] private Color _OverlayColor = Color.white;
// Screen Texture
[Tooltip("Texture used for the screen overlay.")]
[SerializeField] private Texture2D _ScreenTexture = null;
[Tooltip("Tiling rate of the screen texture.")]
[SerializeField] private float _ScreenTextureTiling = 50f;
// Grid
[Tooltip("Frequency of the grid pattern.")]
[SerializeField][Range(0f, 3f)] private float _Frequency = 1f;
[Tooltip("Thickness of the grid lines.")]
[SerializeField][Range(0.5f, 1)] private float _Ratio = 0.50f;
// Edge Detection
[Tooltip("Thickness of the detected edges.")]
[SerializeField][Range(0, 5)] private float _Thickness = 1.0f;
[Tooltip("Offset for normals in edge detection.")]
[SerializeField][Range(.01f, 1.5f)] private float _NormalsOffset = 0.1f;
[Tooltip("Hardness of the normals edge detection.")]
[SerializeField][Range(0, .99f)] private float _NormalsHardness = 0;
[Tooltip("Enhances the effect of normals in edge detection.")]
[SerializeField][Range(1, 5)] private float _NormalsPower = 1;
[Tooltip("Threshold for depth in edge detection.")]
[SerializeField][Range(0, 3)] private float _DepthThreshold = 1;
[Tooltip("Hardness of the depth edge detection.")]
[SerializeField][Range(0, 1)] private float _DepthHardness = .9f;
[Tooltip("Enhances the effect of depth in edge detection.")]
[SerializeField][Range(1, 5)] private float _DepthPower = 5;
// Grid + Edge Detection
[Tooltip("Enhances the edge detection effect within the grid.")]
[SerializeField][Range(0f, 1f)] private float _EdgeDetectionMultiplier = 1f;
[Tooltip("Enhances the grid effect.")]
[SerializeField][Range(0f, 1f)] private float _GridMultiplier = 1f;
#endregion
#region FeaturesProperties
// Used for detecting and highlighting objects in the scan range
[Tooltip("Enables custom highlighting of objects within the scan range.")]
[SerializeField] private bool useCustomHighlight = false;
[Tooltip("Fine-tunes the point of triggering the highlight.")]
[SerializeField] private float DistanceOffset = 0f;
[Tooltip("Adjusts the maximum radius within which highlighting can be triggered.")]
[SerializeField] private float MaskRadiusOffset = 0f;
[Tooltip("Controls the adjustment of FOV for triggering the highlighters.")]
[Range(-0.1f, 0.3f)]
[SerializeField] private float FovOffset = 0f;
[Tooltip("List of objects that will be highlighted during the scan.")]
[SerializeField] public List<ScanFXHighlight> highlightObjects = new List<ScanFXHighlight>();
// Used for having actual scan FX mask overlay on the highlighted objects
[Tooltip("When enabled, highlighting on objects will be visible only within the actual scan range. Useful when using FOV mask.")]
[SerializeField] private bool useScanOverlayOnMaterials = false;
[Tooltip("List of materials to which the scan FX mask overlay will be applied.")]
[SerializeField] public List<Material> highlightMaterials = new List<Material>();
// ScanFX for world-spaced shaders instead of post-processing effect. Useful for transparent objects, for example.
[Tooltip("Enables the use of world scan materials, applied to objects for a world-space shader effect rather than a post-processing effect. Useful for transparent objects.")]
[SerializeField] private bool useWorldScanMaterials = false;
[Tooltip("List of world scan materials to be used for applying the scan effect in world space.")]
[SerializeField] public List<Material> worldScanMaterials = new List<Material>();
#endregion
#region PublicMethods
/// <summary>
/// Initiates the scanning effect with a specified number of scans.
/// </summary>
/// <param name="ScansNumber">The number of scans to enqueue.</param>
public void StartScan(int ScansNumber)
{
if (scansLeft == 0)
{
scansLeft = ScansNumber;
timeLeft = scanDuration;
}
else
{
scansLeft += ScansNumber;
}
// All logic is in the update method
}
/// <summary>
/// Updates the position of the scan origin in the scan materials.
/// </summary>
public void PassScanOriginPosition()
{
PassCustomScanOriginPosition(scanOrigin);
}
/// <summary>
/// Updates the forward direction of the scan origin in the scan materials.
/// </summary>
public void PassScanOriginDirection()
{
PassCustomScanOriginDirection(scanOrigin);
}
/// <summary>
/// Updates both the position and direction of the scan origin in the scan materials.
/// </summary>
public void PassScanOriginProperties()
{
PassCustomScanOriginProperties(scanOrigin);
}
/// <summary>
/// Passes the specified transform's position and direction properties to the scan materials.
/// </summary>
/// <param name="customScanOrigin">The transform that should be used as the scan origin.</param>
public void PassCustomScanOriginProperties(Transform customScanOrigin)
{
PassCustomScanOriginPosition(customScanOrigin);
PassCustomScanOriginDirection(customScanOrigin);
}
/// <summary>
/// Passes the specified transform's position property to the scan materials.
/// </summary>
/// <param name="customScanOrigin">The transform that should be used as the scan origin.</param>
public void PassCustomScanOriginPosition(Transform customScanOrigin)
{
originPosition = customScanOrigin.position;
scanMaterial.SetVector("_Origin", originPosition);
if (useScanOverlayOnMaterials)
{
foreach (var material in highlightMaterials)
{
material.SetVector("_Origin", originPosition);
}
}
if (useWorldScanMaterials)
{
foreach (var material in worldScanMaterials)
{
material.SetVector("_Origin", originPosition);
}
}
}
/// <summary>
/// Passes the specified transform's forward direction property to the scan materials.
/// </summary>
/// <param name="customScanOrigin">The transform that should be used as the scan origin.</param>
public void PassCustomScanOriginDirection(Transform customScanOrigin)
{
originForward = customScanOrigin.forward;
scanMaterial.SetVector("_Forward", originForward);
if (useScanOverlayOnMaterials)
{
foreach (var material in highlightMaterials)
{
material.SetVector("_Forward", originForward);
}
}
if (useWorldScanMaterials)
{
foreach (var material in worldScanMaterials)
{
material.SetVector("_Forward", originForward);
}
}
}
#endregion
#region UnityMethods
/// <summary>
/// Sets up initial scan values and updates material keywords.
/// </summary>
public void Start()
{
SetCurrentScanValue(0);
if(updateScanMaterialProperties || useScanOverlayOnMaterials || useWorldScanMaterials) UpdateAllMaterialsKeywords();
foreach (var item in highlightObjects)
{
item.AlreadyScanned = false;
}
}
/// <summary>
/// Handles the scanning logic and updates per frame.
/// </summary>
public void Update()
{
if (scanOrigin == null || scanMaterial == null)
{
return;
}
// Bug fix, See: CustomHighlightObjects
if (scanOrigin.position == Vector3.zero)
{
scanOrigin.position = scanOrigin.position + Vector3.one * 0.001f;
}
if (alwaysPassScanOriginPosition) PassScanOriginPosition();
if (alwaysPassScanOriginDirection) PassScanOriginDirection();
// Editor Testing
if (!Application.isPlaying)
{
SetCurrentScanValue(currentScanValueTesting);
if (!alwaysPassScanOriginPosition) PassScanOriginPosition();
if (!alwaysPassScanOriginDirection) PassScanOriginDirection();
}
// Scan logic
if (scansLeft > 0)
{
timeLeft -= Time.deltaTime;
timePassed += Time.deltaTime;
float currentScanValue = timePassed / scanDuration;
SetCurrentScanValue(currentScanValue);
if (timeLeft > 0) CustomHighlightObjects(currentScanValue);
if (timeLeft <= 0)
{
scansLeft--;
foreach (var item in highlightObjects)
{
item.AlreadyScanned = false;
}
if (scansLeft > 0)
{
timeLeft = scanDuration;
}
else
{
timePassed = 0;
timeLeft = 9999;
// 1 in order to make highlightMaterials scan mask work
SetCurrentScanValue(1);
}
}
}
}
private void OnValidate()
{
if (updateScanMaterialProperties)
{
if (scanMaterial != null)
{
SetCommonScanProperties(scanMaterial);
SetPostProcessScanProperties(scanMaterial);
}
}
if (useScanOverlayOnMaterials)
{
foreach (var material in highlightMaterials)
{
SetCommonScanProperties(material);
}
}
if (useWorldScanMaterials)
{
foreach (var material in worldScanMaterials)
{
SetCommonScanProperties(material);
SetPostProcessScanProperties(material);
}
}
}
#endregion
#region PrivateMethods
private void SetCurrentScanValue(float value)
{
scanMaterial.SetFloat("_CurrentScanValue", value);
if (useScanOverlayOnMaterials)
{
foreach (var material in highlightMaterials)
{
material.SetFloat("_CurrentScanValue", value);
}
}
if (useWorldScanMaterials)
{
foreach (var material in worldScanMaterials)
{
material.SetFloat("_CurrentScanValue", value);
}
}
}
private void CustomHighlightObjects(float currentScanValue)
{
if (useCustomHighlight)
{
// Go through all the game objects positions and calculate when we should enable the highlight
foreach (var item in highlightObjects)
{
if (item == null) continue;
if (item.gameObject.activeInHierarchy == false || item.enabled == false) continue;
// If we already scanned the object in current scan, skip it
if (item.AlreadyScanned) continue;
// Bad fix for the bug when Always Pass Scan Origin is off we get 0,0,0 position AND the good position
if (originPosition == Vector3.zero) continue;
Vector3 worldPosition = item.transform.position;
float distance = Vector3.Distance(worldPosition, originPosition) + DistanceOffset;
float fmod = _SizeAdjust + 1;
float scan = ((currentScanValue * fmod) % fmod) * (_MaskRadius);
float output = distance - scan > 1 ? 0 : 1;
// Make sure that no object outside the mask radius is highlighted
float maskOffset = (_MaskRadius - MaskRadiusOffset) > distance ? 1 : 0;
output *= maskOffset;
if (_FovMaskEnabled)
{
Vector2 wPos = new Vector2(worldPosition.x, worldPosition.z);
Vector2 oPos = new Vector2(originPosition.x, originPosition.z);
Vector2 dot2 = (wPos - oPos).normalized;
Vector2 forward = new Vector2(originForward.x, originForward.z);
float dot = Vector2.Dot(dot2, forward);
dot = Mathf.Clamp(dot, 0, 1);
float fovMask = dot > 1 - (_FovMask + FovOffset) ? 1 : 0;
output *= fovMask;
}
bool inScanRange = true;
if (output == 0) inScanRange = false;
if (inScanRange)
{
item.PlayEffect();
}
}
}
}
#endregion
#region MaterialsMethods
/// <summary>
/// Updates keywords on materials based on current overlay and FOV mask settings.
/// </summary>
public void UpdateAllMaterialsKeywords()
{
UpdateMaterialKeyowrds(scanMaterial);
if (useScanOverlayOnMaterials)
{
foreach (var material in highlightMaterials)
{
UpdateMaterialKeyowrds(material);
}
}
if (useWorldScanMaterials)
{
foreach (var material in worldScanMaterials)
{
UpdateMaterialKeyowrds(material);
}
}
}
private void UpdateMaterialKeyowrds(Material material)
{
foreach (var keyword in material.enabledKeywords)
{
if (overlayTypeKeywords.Contains(keyword.name))
{
material.DisableKeyword(keyword);
}
if (keyword.name == fovMaskEnabledKeyword)
{
material.DisableKeyword(fovMaskEnabledKeyword);
}
}
material.EnableKeyword(overlayTypeKeywords[(int)_OverlayType]);
if (_FovMaskEnabled)
{
material.EnableKeyword(fovMaskEnabledKeyword);
}
}
private void SetCommonScanProperties(Material material)
{
material.SetFloat("_SizeAdjust", _SizeAdjust);
material.SetFloat("_Size", _Size);
material.SetFloat("_OriginOffset", _OriginOffset);
material.SetFloat("_MaskRadius", _MaskRadius);
material.SetFloat("_MaskHardness", _MaskHardness);
material.SetFloat("_MaskPower", _MaskPower);
material.SetFloat("_FovMask", _FovMask);
material.SetFloat("_FovMaskSmoothness", _FovMaskSmoothness);
material.SetFloat("_EdgeHardness", _EdgeHardness);
}
private void SetPostProcessScanProperties(Material material)
{
material.SetColor("_EdgeColor", _EdgeColor);
material.SetColor("_HighlightColor", _HighlightColor);
material.SetFloat("_EdgePower", _EdgePower);
material.SetFloat("_EdgeMultiplier", _EdgeMultiplier);
material.SetFloat("_HighlightPower", _HighlightPower);
material.SetFloat("_HighlightMultiplier", _HighlightMultiplier);
material.SetFloat("_OverlayMultiplier", _OverlayMultiplier);
material.SetFloat("_OverlayPower", _OverlayPower);
material.SetColor("_OverlayColor", _OverlayColor);
material.SetFloat("_Frequency", _Frequency);
material.SetFloat("_Ratio", _Ratio);
material.SetFloat("_ScreenTextureTiling", _ScreenTextureTiling);
material.SetTexture("_ScreenTexture", _ScreenTexture != null ? _ScreenTexture : Texture2D.whiteTexture);
material.SetFloat("_Thickness", _Thickness);
material.SetFloat("_NormalsOffset", _NormalsOffset);
material.SetFloat("_NormalsHardness", _NormalsHardness);
material.SetFloat("_NormalsPower", _NormalsPower);
material.SetFloat("_DepthThreshold", _DepthThreshold);
material.SetFloat("_DepthHardness", _DepthHardness);
material.SetFloat("_DepthPower", _DepthPower);
material.SetFloat("_EdgeDetectionMultiplier", _EdgeDetectionMultiplier);
material.SetFloat("_GridMultiplier", _GridMultiplier);
}
#endregion
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83d88eb01e9cebf46a7c551336b26019
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,137 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace INab.WorldScanFX
{
public class ScanFXHighlight : MonoBehaviour
{
[Tooltip("Renderers to be highlighted.")]
public List<Renderer> renderers = new List<Renderer>();
[Tooltip("Duration of the highlight effect, in seconds.")]
public float highlightDuration = 5f;
[Tooltip("Animation curve for the highlight effect, defining its intensity over time.")]
public AnimationCurve curve = AnimationCurve.EaseInOut(0, 1, 1, 0);
[Tooltip("Events triggered when the highlight effect starts.")]
public UnityEvent highlightEvent;
// Used internally for managing the highlight effect coroutine.
private IEnumerator enumerator;
// Used internally for applying changes to the renderer materials without affecting shared materials.
private MaterialPropertyBlock materialPropertyBlock;
private bool effectIsPlaying = false;
private bool alreadyScanned = false;
public bool AlreadyScanned
{
get
{
return alreadyScanned;
}
set
{
alreadyScanned = value;
}
}
#region PrivateMethods
private IEnumerator EffectEnumerator()
{
float value;
float elapsedTime = 0f;
effectIsPlaying = true;
if (materialPropertyBlock == null) { materialPropertyBlock = new MaterialPropertyBlock(); }
while (elapsedTime < highlightDuration)
{
elapsedTime += Time.deltaTime;
float effectTime = elapsedTime / highlightDuration;
value = curve.Evaluate(effectTime);
UpdateHighlightValue(value);
yield return null;
}
effectIsPlaying = false;
}
private void UpdateHighlightValue(float value)
{
foreach (var item in renderers)
{
materialPropertyBlock.SetFloat("_HighlightValue", value);
item.SetPropertyBlock(materialPropertyBlock);
}
}
private void OnEnable()
{
materialPropertyBlock = new MaterialPropertyBlock();
}
private void Start()
{
effectIsPlaying = false;
UpdateHighlightValue(0);
}
#endregion
#region PublicMethods
/// <summary>
/// Play the highlight effect.
/// </summary>
public virtual void PlayEffect()
{
if(highlightEvent != null) highlightEvent.Invoke();
alreadyScanned = true;
// If the effect is playing, stop coroutine
if (effectIsPlaying == true)
{
if (enumerator != null) StopCoroutine(enumerator);
}
enumerator = EffectEnumerator();
StartCoroutine(enumerator);
}
/// <summary>
/// Find renderers using GetComponentsInChildren.
/// </summary>
public void FindRenderersInChildren()
{
renderers.Clear();
foreach (var item in GetComponentsInChildren<Renderer>())
{
renderers.Add(item);
}
}
/// <summary>
/// Find renderers using GetComponents.
/// </summary>
public void FindRenderers()
{
renderers.Clear();
foreach (var item in GetComponents<Renderer>())
{
renderers.Add(item);
}
}
#endregion
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cc5464005770cd845acaa9652afa5ff9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 47f8d3912d7c078478b24ff859f34311
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 2a13ffa96cff69947ac360813f45d01f
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 81a4b259df8b97f4d80a476b5ef3edcf
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e020bf785d042004e9d9e94e7d7fe727
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: b9df1dd7686496c4bba73a48a8d86c8d
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 99f3509a28fbf0c41bd69902c069b979
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@@ -0,0 +1,458 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "99ff7094edcf456dbcc6c73a5f5a7984",
"m_Properties": [
{
"m_Id": "0eaf2afe41da40c889850665d95b98f0"
},
{
"m_Id": "416ebae02d8c434eb599ac3a4acb2a42"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "84cad14f211e409c897d280aa76ab837"
}
],
"m_Nodes": [
{
"m_Id": "8fdf709db6614ef2bb22c118397a44c3"
},
{
"m_Id": "726c42dbd5c84a299439271836352c12"
},
{
"m_Id": "a9ad7885643e46be8232c1435d125d78"
},
{
"m_Id": "12ae6d885b3347fc951970e67024ff06"
}
],
"m_GroupDatas": [
{
"m_Id": "2316e1132ddc4f03b8b678c939496726"
}
],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "12ae6d885b3347fc951970e67024ff06"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "726c42dbd5c84a299439271836352c12"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "726c42dbd5c84a299439271836352c12"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "8fdf709db6614ef2bb22c118397a44c3"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "a9ad7885643e46be8232c1435d125d78"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "726c42dbd5c84a299439271836352c12"
},
"m_SlotId": 1
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Sub Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": "8fdf709db6614ef2bb22c118397a44c3"
},
"m_ActiveTargets": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty",
"m_ObjectId": "0eaf2afe41da40c889850665d95b98f0",
"m_Guid": {
"m_GuidSerialized": "11c9596f-8fef-47f7-8213-f80e17520873"
},
"m_Name": "_Origin",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "_Origin",
"m_DefaultReferenceName": "_Origin",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "12ae6d885b3347fc951970e67024ff06",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -216.0,
"y": -58.0,
"width": 119.0,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "311e14c9783547289e2cdef5ac95b02d"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "416ebae02d8c434eb599ac3a4acb2a42"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.GroupData",
"m_ObjectId": "2316e1132ddc4f03b8b678c939496726",
"m_Title": "Sphere SDF",
"m_Position": {
"x": -63.000003814697269,
"y": -83.0000228881836
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "311e14c9783547289e2cdef5ac95b02d",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty",
"m_ObjectId": "416ebae02d8c434eb599ac3a4acb2a42",
"m_Guid": {
"m_GuidSerialized": "21e09868-fcca-4235-b832-2957be892605"
},
"m_Name": "Position",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Position",
"m_DefaultReferenceName": "_Position",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "5660622278a04133b7e93f680bbb2ffb",
"m_Id": 0,
"m_DisplayName": "A",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "6575113a5eab46fcaca5a0d42e869361",
"m_Id": 1,
"m_DisplayName": "Out_Vector1",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "OutVector1",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DistanceNode",
"m_ObjectId": "726c42dbd5c84a299439271836352c12",
"m_Group": {
"m_Id": "2316e1132ddc4f03b8b678c939496726"
},
"m_Name": "Distance",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -38.5,
"y": -23.75,
"width": 128.0,
"height": 118.0
}
},
"m_Slots": [
{
"m_Id": "5660622278a04133b7e93f680bbb2ffb"
},
{
"m_Id": "aaa43c97610a443db57341f851805abf"
},
{
"m_Id": "a1e691459f6e43a0a50bd00491b9e7c2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": false,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "84cad14f211e409c897d280aa76ab837",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "0eaf2afe41da40c889850665d95b98f0"
},
{
"m_Id": "416ebae02d8c434eb599ac3a4acb2a42"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
"m_ObjectId": "8fdf709db6614ef2bb22c118397a44c3",
"m_Group": {
"m_Id": ""
},
"m_Name": "Output",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 174.0,
"y": -11.999987602233887,
"width": 117.0,
"height": 77.00000762939453
}
},
"m_Slots": [
{
"m_Id": "6575113a5eab46fcaca5a0d42e869361"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"IsFirstSlotValid": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "a1e691459f6e43a0a50bd00491b9e7c2",
"m_Id": 2,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "a9ad7885643e46be8232c1435d125d78",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -188.5,
"y": 65.25,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "e2b97b7ec6e646e081db1ad995fc3005"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "0eaf2afe41da40c889850665d95b98f0"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "aaa43c97610a443db57341f851805abf",
"m_Id": 1,
"m_DisplayName": "B",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "e2b97b7ec6e646e081db1ad995fc3005",
"m_Id": 0,
"m_DisplayName": "_Origin",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ecf502acae112404f8a68958f30ff601
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}