Commit 9f956b1b authored by 林杨欢's avatar 林杨欢

删除没用的高光系统

parent 1626e870
fileFormatVersion: 2
guid: 8710f4a429bfb9b40a0fe20c4fad5524
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4de23785d38293b47b1aa97aef36ef95
folderAsset: yes
DefaultImporter:
userData:
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
namespace HighlightingSystem
{
[CustomEditor(typeof(Highlighter)), CanEditMultipleObjects]
public class HighlighterEditor : Editor
{
private const string kShowTweenKey = "HighlightingSystem.Highlighter.ShowTween";
private const string kShowConstantKey = "HighlightingSystem.Highlighter.ShowConstant";
private const string kShowFilterKey = "HighlightingSystem.Highlighter.ShowFilter";
static private readonly GUIContent labelOverlay = new GUIContent("Overlay");
static private readonly GUIContent labelOccluder = new GUIContent("Occluder");
static private readonly GUIContent labelColor = new GUIContent("Color (Current)");
static private readonly GUIContent labelForceRender = new GUIContent("Force Render");
static private readonly GUIContent labelTween = new GUIContent("Tween");
static private readonly GUIContent labelGradient = new GUIContent("Gradient");
static private readonly GUIContent labelDuration = new GUIContent("Duration");
static private readonly GUIContent labelUseUnscaledTime = new GUIContent("Use Unscaled Time");
static private readonly GUIContent labelDelay = new GUIContent("Delay");
static private readonly GUIContent labelLoopMode = new GUIContent("Loop Mode");
static private readonly GUIContent labelEasing = new GUIContent("Easing");
static private readonly GUIContent labelReverse = new GUIContent("Reverse");
static private readonly GUIContent labelRepeatCount = new GUIContent("Repeat Count");
static private readonly GUIContent labelConstant = new GUIContent("Constant");
static private readonly GUIContent labelConstantColor = new GUIContent("Constant Color");
static private readonly GUIContent labelFadeInTime = new GUIContent("Fade In Time");
static private readonly GUIContent labelFadeOutTime = new GUIContent("Fade Out Time");
static private readonly GUIContent labelFilterMode = new GUIContent("Mode");
static private readonly GUIContent labelFilterList = new GUIContent("Transform Filtering List");
static private readonly GUIContent labelGroupTween = new GUIContent("Tween");
static private readonly GUIContent labelGroupConstant = new GUIContent("Constant");
static private readonly GUIContent labelGroupFilter = new GUIContent("Filter");
private Dictionary<string, SerializedProperty> fieldCache = new Dictionary<string, SerializedProperty>();
private Highlighter highlighter;
private SerializedProperty propertyFilterList;
private ReorderableList listFilter;
private bool showTween;
private bool showConstant;
private bool showFilter;
//
void OnEnable()
{
highlighter = target as Highlighter;
propertyFilterList = serializedObject.FindProperty("_filterList");
showTween = EditorPrefs.GetBool(kShowTweenKey, false);
showConstant = EditorPrefs.GetBool(kShowConstantKey, false);
showFilter = EditorPrefs.GetBool(kShowFilterKey, false);
listFilter = new ReorderableList(serializedObject, propertyFilterList, true, true, true, true);
listFilter.drawHeaderCallback = new ReorderableList.HeaderCallbackDelegate(FilterListDrawHeader);
listFilter.onAddCallback = new ReorderableList.AddCallbackDelegate(FilterListAdd);
listFilter.onRemoveCallback = new ReorderableList.RemoveCallbackDelegate(FilterListRemove);
listFilter.drawElementCallback = new ReorderableList.ElementCallbackDelegate(FilterListDrawElement);
listFilter.elementHeight = EditorGUIUtility.singleLineHeight + 2f;
}
//
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
DoGeneralGUI();
DoHighlighterGUI();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
}
//
private void DoGeneralGUI()
{
// General
EditorGUILayout.PropertyField(FindField("_overlay"), labelOverlay);
EditorGUILayout.PropertyField(FindField("_occluder"), labelOccluder);
EditorGUILayout.PropertyField(FindField("forceRender"), labelForceRender);
// Current color (readonly, since Highlighter component overrides it's value every frame)
using (new EditorGUI.DisabledScope(true))
{
EditorGUILayout.PropertyField(FindField("color"), labelColor);
}
}
//
private void DoHighlighterGUI()
{
// Tween
if (Foldout(labelGroupTween, ref showTween, kShowTweenKey))
{
using (new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(FindField("_tween"), labelTween);
EditorGUILayout.PropertyField(FindField("_tweenGradient"), labelGradient);
//DoSpectrumButtonGUI();
EditorGUILayout.PropertyField(FindField("_tweenDuration"), labelDuration);
EditorGUILayout.PropertyField(FindField("_tweenReverse"), labelReverse);
EditorGUILayout.PropertyField(FindField("_tweenLoop"), labelLoopMode);
EditorGUILayout.PropertyField(FindField("_tweenEasing"), labelEasing);
EditorGUILayout.PropertyField(FindField("_tweenDelay"), labelDelay);
EditorGUILayout.PropertyField(FindField("_tweenRepeatCount"), labelRepeatCount);
EditorGUILayout.PropertyField(FindField("_tweenUseUnscaledTime"), labelUseUnscaledTime);
}
}
// Constant
if (Foldout(labelGroupConstant, ref showConstant, kShowConstantKey))
{
using (new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(FindField("_constant"), labelConstant);
EditorGUILayout.PropertyField(FindField("_constantColor"), labelConstantColor);
EditorGUILayout.PropertyField(FindField("_constantFadeInTime"), labelFadeInTime);
EditorGUILayout.PropertyField(FindField("_constantFadeOutTime"), labelFadeOutTime);
EditorGUILayout.PropertyField(FindField("_constantEasing"), labelEasing);
EditorGUILayout.PropertyField(FindField("_constantUseUnscaledTime"), labelUseUnscaledTime);
}
}
if (Foldout(labelGroupFilter, ref showFilter, kShowFilterKey))
{
using (new EditorGUI.IndentLevelScope())
{
// filterMode
SerializedProperty fieldFilterMode = FindField("_filterMode");
EditorGUILayout.PropertyField(fieldFilterMode, labelFilterMode);
if (!fieldFilterMode.hasMultipleDifferentValues)
{
RendererFilterMode filterMode = (RendererFilterMode)fieldFilterMode.enumValueIndex;
if (highlighter.rendererFilter != null)
{
EditorGUILayout.HelpBox("Custom RendererFilter assigned to this Highlighter. Filtering list disabled.", MessageType.Warning);
}
else
{
switch (filterMode)
{
case RendererFilterMode.None:
EditorGUILayout.HelpBox("All Renderers found in child GameObjects will be highlighted.", MessageType.Info);
break;
case RendererFilterMode.Include:
EditorGUILayout.HelpBox("Renderers only on specified Transforms (and any of their children) will be highlighted.", MessageType.Info);
break;
case RendererFilterMode.Exclude:
EditorGUILayout.HelpBox("Renderers on specified Transforms (and any of their children) will be excluded from highlighting.", MessageType.Info);
break;
}
}
}
// filterList
Rect rect = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(0f, listFilter.GetHeight()));
listFilter.DoList(rect);
}
}
}
//
private SerializedProperty FindField(string fieldPath)
{
SerializedProperty field;
if (!fieldCache.TryGetValue(fieldPath, out field))
{
field = serializedObject.FindProperty(fieldPath);
fieldCache.Add(fieldPath, field);
}
return field;
}
//
private bool Foldout(GUIContent content, ref bool isExpanded, string key)
{
Rect rect = GUILayoutUtility.GetRect(content, EditorStyles.foldout);
bool expanded = EditorGUI.Foldout(rect, isExpanded, content, true, EditorStyles.foldout);
if (expanded != isExpanded && !string.IsNullOrEmpty(key))
{
isExpanded = expanded;
EditorPrefs.SetBool(key, isExpanded);
}
return isExpanded;
}
//
private void DoSpectrumButtonGUI()
{
// Spectrum
if (GUILayout.Button("Spectrum"))
{
highlighter.tweenGradient = new Gradient()
{
colorKeys = new GradientColorKey[]
{
new GradientColorKey(new Color(1f, 0f, 0f, 1f), 0f / 6f),
new GradientColorKey(new Color(1f, 1f, 0f, 1f), 1f / 6f),
new GradientColorKey(new Color(0f, 1f, 0f, 1f), 2f / 6f),
new GradientColorKey(new Color(0f, 1f, 1f, 1f), 3f / 6f),
new GradientColorKey(new Color(0f, 0f, 1f, 1f), 4f / 6f),
new GradientColorKey(new Color(1f, 0f, 1f, 1f), 5f / 6f),
new GradientColorKey(new Color(1f, 0f, 0f, 1f), 6f / 6f),
},
alphaKeys = new GradientAlphaKey[]
{
new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f),
}
};
GUI.changed = true;
}
}
//
private void FilterListDrawHeader(Rect rect)
{
EditorGUI.LabelField(rect, labelFilterList);
}
//
private void FilterListAdd(ReorderableList list)
{
ReorderableList.defaultBehaviours.DoAddButton(list);
}
//
private void FilterListRemove(ReorderableList list)
{
ReorderableList.defaultBehaviours.DoRemoveButton(list);
}
//
private void FilterListDrawElement(Rect rect, int index, bool selected, bool focused)
{
rect.height -= 2f;
var propertyElement = propertyFilterList.GetArrayElementAtIndex(index);
EditorGUI.ObjectField(rect, propertyElement);
//EditorGUIUtility.ShowObjectPicker;
}
}
}
fileFormatVersion: 2
guid: eaf65e4acd958f242864d8748239d7c0
timeCreated: 1516708826
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
namespace HighlightingSystem
{
[CustomEditor(typeof(HighlightingBlitter), true)]
public class HighlightingBlitterEditor : Editor
{
//
public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("Use order of this component (relatively to other Image Effects on this camera) to control the point at which highlighting will be applied to the framebuffer (click on a little gear icon to the right and choose Move Up / Move Down).", MessageType.Info);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f2c076edfe3724942afcb2b87d77e050
timeCreated: 1454882223
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
namespace HighlightingSystem
{
[CustomPropertyDrawer(typeof(HighlightingPreset), true)]
public class HighlightingPresetEditor : PropertyDrawer
{
#region Static Fields and Constants
static public readonly GUIContent labelFillAlpha = new GUIContent("Fill Alpha", "Inner fill alpha value.");
static public readonly GUIContent labelDownsampling = new GUIContent("Downsampling:", "Downsampling factor.");
static public readonly GUIContent labelIterations = new GUIContent("Iterations:", "Blur iterations. Number of blur iterations performed. Larger number means more blur.");
static public readonly GUIContent labelBlurMinSpread = new GUIContent("Min Spread:", "Blur Min Spread. Lower values give better looking blur, but require more iterations to get large blurs. Pixel offset for each blur iteration is calculated as 'Min Spread + Spread * Iteration Index'. Usually 'Min Spread + Spread' value is between 0.5 and 1.0.");
static public readonly GUIContent labelBlurSpread = new GUIContent("Spread:", "Blur Spread. Lower values give better looking blur, but require more iterations to get large blurs. Pixel offset for each blur iteration is calculated as 'Min Spread + Spread * Iteration Index'. Usually 'Min Spread + Spread' value is between 0.5 and 1.0.");
static public readonly GUIContent labelBlurIntensity = new GUIContent("Intensity:", "Highlighting Intensity. Internally defines the value by which highlighting buffer alpha channel will be multiplied after each blur iteration.");
static public readonly GUIContent labelBlurDirections = new GUIContent("Blur Directions:", "Blur directions.");
static public readonly GUIContent[] downsampleOptions = new GUIContent[] { new GUIContent("None"), new GUIContent("Half"), new GUIContent("Quarter") };
static public readonly int[] downsampleGet = new int[] { -1, 0, 1, -1, 2 }; // maps downsampleFactor to the downsampleOptions index
static public readonly int[] downsampleSet = new int[] { 1, 2, 4 }; // maps downsampleOptions index to the downsampleFactor
static public readonly GUIContent[] blurDirections = new GUIContent[] { new GUIContent("Diagonal"), new GUIContent("Straight"), new GUIContent("All") };
private const float rowSpace = 2f;
#endregion
#region Private Fields
private Rect[] rects = new Rect[8];
#endregion
#region PropertyDrawer
//
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
int l = rects.Length;
return 16f * l + rowSpace * (l - 1);
}
//
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
// Draw label
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
int indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
// Calculate rects
HighlightingRendererEditor.GetRowRects(position, rowSpace, rects);
// Find properties
SerializedProperty propertyName = property.FindPropertyRelative("_name");
SerializedProperty propertyFillAlpha = property.FindPropertyRelative("_fillAlpha");
SerializedProperty propertyDownsampleFactor = property.FindPropertyRelative("_downsampleFactor");
SerializedProperty propertyIterations = property.FindPropertyRelative("_iterations");
SerializedProperty propertyBlurMinSpread = property.FindPropertyRelative("_blurMinSpread");
SerializedProperty propertyBlurSpread = property.FindPropertyRelative("_blurSpread");
SerializedProperty propertyBlurIntensty = property.FindPropertyRelative("_blurIntensity");
SerializedProperty propertyBlurDirections = property.FindPropertyRelative("_blurDirections");
// Draw properties
int index = 0;
propertyName.stringValue = EditorGUI.TextField(rects[index], propertyName.stringValue); index++;
propertyFillAlpha.floatValue = EditorGUI.Slider(rects[index], labelFillAlpha, propertyFillAlpha.floatValue, 0f, 1f); index++;
propertyDownsampleFactor.intValue = downsampleSet[EditorGUI.Popup(rects[index], labelDownsampling, downsampleGet[propertyDownsampleFactor.intValue], downsampleOptions)]; index++;
propertyIterations.intValue = Mathf.Clamp(EditorGUI.IntField(rects[index], labelIterations, propertyIterations.intValue), 0, 50); index++;
propertyBlurMinSpread.floatValue = EditorGUI.Slider(rects[index], labelBlurMinSpread, propertyBlurMinSpread.floatValue, 0f, 3f); index++;
propertyBlurSpread.floatValue = EditorGUI.Slider(rects[index], labelBlurSpread, propertyBlurSpread.floatValue, 0f, 3f); index++;
propertyBlurIntensty.floatValue = EditorGUI.Slider(rects[index], labelBlurIntensity, propertyBlurIntensty.floatValue, 0f, 1f); index++;
propertyBlurDirections.enumValueIndex = (int)EditorGUI.Popup(rects[index], labelBlurDirections, propertyBlurDirections.enumValueIndex, blurDirections); index++;
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f38067eff9f5f884cbbc58b840c98311
timeCreated: 1480274718
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 183043fd0398e0148aefaae999f3c9f3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 2e2dd921d0779af4dad3fbd326388e14
folderAsset: yes
DefaultImporter:
userData:
Shader "Hidden/Highlighted/Blur"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
[HideInInspector] _HighlightingIntensity ("", Range (0.25,0.5)) = 0.3
}
SubShader
{
Pass
{
ZTest Always
Cull Off
ZWrite Off
Lighting Off
Fog { Mode Off }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#pragma multi_compile DIAGONAL_DIRECTIONS STRAIGHT_DIRECTIONS ALL_DIRECTIONS
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float4 _MainTex_TexelSize;
uniform float _HighlightingBlurOffset;
uniform half _HighlightingIntensity;
struct vs_input
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct ps_input
{
float4 pos : SV_POSITION;
#if defined(ALL_DIRECTIONS)
float4 uv0 : TEXCOORD0;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 uv3 : TEXCOORD3;
#else
float4 uv0 : TEXCOORD0;
float4 uv1 : TEXCOORD1;
#endif
};
ps_input vert(vs_input v)
{
ps_input o;
o.pos = UnityObjectToClipPos(v.vertex);
float2 uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
float2 offs = _HighlightingBlurOffset * _MainTex_TexelSize.xy;
#if defined(ALL_DIRECTIONS)
// Diagonal
o.uv0.x = uv.x - offs.x;
o.uv0.y = uv.y - offs.y;
o.uv0.z = uv.x + offs.x;
o.uv0.w = uv.y - offs.y;
o.uv1.x = uv.x + offs.x;
o.uv1.y = uv.y + offs.y;
o.uv1.z = uv.x - offs.x;
o.uv1.w = uv.y + offs.y;
// Straight
o.uv2.x = uv.x - offs.x;
o.uv2.y = uv.y;
o.uv2.z = uv.x + offs.x;
o.uv2.w = uv.y;
o.uv3.x = uv.x;
o.uv3.y = uv.y - offs.y;
o.uv3.z = uv.x;
o.uv3.w = uv.y + offs.y;
#elif defined(STRAIGHT_DIRECTIONS)
// Straight
o.uv0.x = uv.x - offs.x;
o.uv0.y = uv.y;
o.uv0.z = uv.x + offs.x;
o.uv0.w = uv.y;
o.uv1.x = uv.x;
o.uv1.y = uv.y - offs.y;
o.uv1.z = uv.x;
o.uv1.w = uv.y + offs.y;
#else
// Diagonal
o.uv0.x = uv.x - offs.x;
o.uv0.y = uv.y - offs.y;
o.uv0.z = uv.x + offs.x;
o.uv0.w = uv.y - offs.y;
o.uv1.x = uv.x + offs.x;
o.uv1.y = uv.y + offs.y;
o.uv1.z = uv.x - offs.x;
o.uv1.w = uv.y + offs.y;
#endif
return o;
}
half4 frag(ps_input i) : SV_Target
{
half4 color1 = tex2D(_MainTex, i.uv0.xy);
fixed4 color2;
// For straight or diagonal directions
color2 = tex2D(_MainTex, i.uv0.zw);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
color2 = tex2D(_MainTex, i.uv1.xy);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
color2 = tex2D(_MainTex, i.uv1.zw);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
// For all directions
#if defined(ALL_DIRECTIONS)
color2 = tex2D(_MainTex, i.uv2.xy);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
color2 = tex2D(_MainTex, i.uv2.zw);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
color2 = tex2D(_MainTex, i.uv3.xy);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
color2 = tex2D(_MainTex, i.uv3.zw);
color1.rgb = max(color1.rgb, color2.rgb);
color1.a += color2.a;
#endif
color1.a *= _HighlightingIntensity;
return color1;
}
ENDCG
}
}
Fallback off
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3070218404d1de94c9d081d248597046
ShaderImporter:
defaultTextures: []
userData:
Shader "Hidden/Highlighted/Composite"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
[HideInInspector] _HighlightingBuffer ("", 2D) = "" {}
}
SubShader
{
Pass
{
Lighting Off
Fog { Mode off }
ZWrite Off
ZTest Always
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#include "UnityCG.cginc"
struct vs_input
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct ps_input
{
float4 pos : SV_POSITION;
half2 uv0 : TEXCOORD0;
half2 uv1 : TEXCOORD1;
};
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float4 _MainTex_TexelSize;
uniform sampler2D _HighlightingBuffer;
ps_input vert(vs_input v)
{
ps_input o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv0 = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
o.uv1 = o.uv0;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
{
o.uv1.y = 1-o.uv1.y;
}
#endif
return o;
}
fixed4 frag(ps_input i) : SV_Target
{
fixed4 c1 = tex2D(_MainTex, i.uv0);
fixed4 c2 = tex2D(_HighlightingBuffer, i.uv1);
c1.rgb = lerp(c1.rgb, c2.rgb, c2.a);
return c1;
}
ENDCG
}
}
FallBack Off
}
\ No newline at end of file
fileFormatVersion: 2
guid: b0bd9de6a4f20954f9704e56568224a6
ShaderImporter:
defaultTextures: []
userData:
Shader "Hidden/Highlighted/Cut"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
[HideInInspector] _HighlightingFillAlpha ("", Range(0.0, 1.0)) = 1.0
}
SubShader
{
Lighting Off
Fog { Mode off }
ZWrite Off
ZTest Always
Cull Back
Pass
{
Stencil
{
Ref 1
Comp NotEqual
Pass Keep
ZFail Keep
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#include "UnityCG.cginc"
struct vs_input
{
float4 vertex : POSITION;
half2 texcoord : TEXCOORD0;
};
struct ps_input
{
float4 pos : SV_POSITION;
half2 uv : TEXCOORD0;
};
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
ps_input vert(vs_input v)
{
ps_input o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
return o;
}
fixed4 frag(ps_input i) : SV_Target
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
Pass
{
Stencil
{
Ref 1
Comp Equal
Pass Keep
ZFail Keep
}
ColorMask A
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#include "UnityCG.cginc"
struct vs_input
{
float4 vertex : POSITION;
};
struct ps_input
{
float4 pos : SV_POSITION;
};
uniform float _HighlightingFillAlpha;
ps_input vert(vs_input v)
{
ps_input o;
o.pos = UnityObjectToClipPos(v.vertex);
return o;
}
fixed4 frag() : SV_Target
{
return fixed4(0, 0, 0, _HighlightingFillAlpha);
}
ENDCG
}
}
FallBack Off
}
fileFormatVersion: 2
guid: 376af14ed82e64793b326012b8591fa9
ShaderImporter:
defaultTextures: []
userData:
Shader "Hidden/Highlighted/Opaque"
{
Properties
{
[HideInInspector] _HighlightingColor ("", Color) = (1, 1, 1, 1)
}
SubShader
{
Lighting Off
Fog { Mode Off }
ZWrite Off // Manual depth test
ZTest Always // Manual depth test
Pass
{
Stencil
{
Ref 1
Comp Always
Pass Replace
ZFail Keep
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#pragma multi_compile __ HIGHLIGHTING_OVERLAY
#include "UnityCG.cginc"
uniform fixed4 _HighlightingColor;
#ifndef HIGHLIGHTING_OVERLAY
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
#endif
struct vs_input
{
float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct ps_input
{
float4 pos : SV_POSITION;
#ifndef HIGHLIGHTING_OVERLAY
float4 screen : TEXCOORD0;
#endif
};
ps_input vert(vs_input v)
{
ps_input o;
UNITY_SETUP_INSTANCE_ID(v);
o.pos = UnityObjectToClipPos(v.vertex);
#ifndef HIGHLIGHTING_OVERLAY
o.screen = ComputeScreenPos(o.pos);
COMPUTE_EYEDEPTH(o.screen.z);
#endif
return o;
}
fixed4 frag(ps_input i) : SV_Target
{
#ifndef HIGHLIGHTING_OVERLAY
float z = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screen));
float perspZ = LinearEyeDepth(z); // LinearEyeDepth automatically handles UNITY_REVERSED_Z case
#if defined(UNITY_REVERSED_Z)
z = 1 - z;
#endif
float orthoZ = _ProjectionParams.y + z * (_ProjectionParams.z - _ProjectionParams.y); // near + z * (far - near)
float sceneZ = lerp(perspZ, orthoZ, unity_OrthoParams.w);
clip(sceneZ - i.screen.z + 0.01);
#endif
return _HighlightingColor;
}
ENDCG
}
}
Fallback Off
}
\ No newline at end of file
fileFormatVersion: 2
guid: ce3b12ca636563c48afb814d9aeb5b90
ShaderImporter:
defaultTextures: []
userData:
Shader "Hidden/Highlighted/Transparent"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
[HideInInspector] _HighlightingColor ("", Color) = (1, 1, 1, 1)
[HideInInspector] _Cutoff ("", Float) = 0.5
[HideInInspector] _HighlightingCull ("", Int) = 2 // UnityEngine.Rendering.CullMode.Back
}
SubShader
{
Lighting Off
Fog { Mode Off }
ZWrite Off // Manual depth test
ZTest Always // Manual depth test
Cull [_HighlightingCull] // For rendering both sides of the Sprite
Pass
{
Stencil
{
Ref 1
Comp Always
Pass Replace
ZFail Keep
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 2.0
#pragma multi_compile __ HIGHLIGHTING_OVERLAY
#include "UnityCG.cginc"
uniform fixed4 _HighlightingColor;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform fixed _Cutoff;
#ifndef HIGHLIGHTING_OVERLAY
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
#endif
struct vs_input
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct ps_input
{
float4 pos : SV_POSITION;
float2 texcoord : TEXCOORD0;
fixed alpha : TEXCOORD1;
#ifndef HIGHLIGHTING_OVERLAY
float4 screen : TEXCOORD2;
#endif
};
ps_input vert(vs_input v)
{
ps_input o;
UNITY_SETUP_INSTANCE_ID(v);
o.pos = UnityObjectToClipPos(v.vertex);
#ifndef HIGHLIGHTING_OVERLAY
o.screen = ComputeScreenPos(o.pos);
COMPUTE_EYEDEPTH(o.screen.z);
#endif
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
o.alpha = v.color.a;
return o;
}
fixed4 frag(ps_input i) : SV_Target
{
fixed a = tex2D(_MainTex, i.texcoord).a;
clip(a - _Cutoff);
#ifndef HIGHLIGHTING_OVERLAY
float z = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screen));
float perspZ = LinearEyeDepth(z); // LinearEyeDepth automatically handles UNITY_REVERSED_Z case
#if defined(UNITY_REVERSED_Z)
z = 1 - z;
#endif
float orthoZ = _ProjectionParams.y + z * (_ProjectionParams.z - _ProjectionParams.y); // near + z * (far - near)
float sceneZ = lerp(perspZ, orthoZ, unity_OrthoParams.w);
clip(sceneZ - i.screen.z + 0.01);
#endif
fixed4 c = _HighlightingColor;
c.a *= i.alpha;
return c;
}
ENDCG
}
}
Fallback Off
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9fc04a058c8768648a6532aa07540ca5
ShaderImporter:
defaultTextures: []
userData:
fileFormatVersion: 2
guid: 4b92650ecd71b67409ab3aafea97bd7d
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: 67d4de287b46eb34e83a61e4f9115070
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
namespace HighlightingSystem
{
[AddComponentMenu("Highlighting System/Highlighter Blocker", 1)]
public class HighlighterBlocker : MonoBehaviour
{
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: fa287908d1b1c094189eb8515f1387ef
timeCreated: 1438594893
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections.Generic;
namespace HighlightingSystem
{
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Highlighting System/Highlighting Blitter", 3)]
public class HighlightingBlitter : MonoBehaviour
{
protected List<HighlightingBase> renderers = new List<HighlightingBase>();
#region MonoBehaviour
//
protected virtual void OnRenderImage(RenderTexture src, RenderTexture dst)
{
bool oddEven = true;
for (int i = 0; i < renderers.Count; i++)
{
HighlightingBase renderer = renderers[i];
if (oddEven)
{
renderer.Blit(src, dst);
}
else
{
renderer.Blit(dst, src);
}
oddEven = !oddEven;
}
// Additional blit because final result should be in dst RenderTexture
if (oddEven)
{
Graphics.Blit(src, dst);
}
}
#endregion
#region Public Methods
//
[UnityEngine.Internal.ExcludeFromDocs]
public virtual void Register(HighlightingBase renderer)
{
if (!renderers.Contains(renderer))
{
renderers.Add(renderer);
}
enabled = renderers.Count > 0;
}
//
[UnityEngine.Internal.ExcludeFromDocs]
public virtual void Unregister(HighlightingBase renderer)
{
int index = renderers.IndexOf(renderer);
if (index != -1)
{
renderers.RemoveAt(index);
}
enabled = renderers.Count > 0;
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 278a95e6bd76df347879c9b2b9f887f9
timeCreated: 1445810792
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections.ObjectModel;
using System.Collections.Generic;
namespace HighlightingSystem
{
[AddComponentMenu("Highlighting System/Highlighting Renderer", 2)]
public class HighlightingRenderer : HighlightingBase
{
#region Static Fields
static public readonly List<HighlightingPreset> defaultPresets = new List<HighlightingPreset>()
{
new HighlightingPreset() { name = "Default", fillAlpha = 0f, downsampleFactor = 4, iterations = 2, blurMinSpread = 0.65f, blurSpread = 0.25f, blurIntensity = 0.3f, blurDirections = BlurDirections.Diagonal },
new HighlightingPreset() { name = "Wide", fillAlpha = 0f, downsampleFactor = 4, iterations = 4, blurMinSpread = 0.65f, blurSpread = 0.25f, blurIntensity = 0.3f, blurDirections = BlurDirections.Diagonal },
new HighlightingPreset() { name = "Strong", fillAlpha = 0f, downsampleFactor = 4, iterations = 2, blurMinSpread = 0.5f, blurSpread = 0.15f, blurIntensity = 0.325f, blurDirections = BlurDirections.Diagonal },
new HighlightingPreset() { name = "Speed", fillAlpha = 0f, downsampleFactor = 4, iterations = 1, blurMinSpread = 0.75f, blurSpread = 0f, blurIntensity = 0.35f, blurDirections = BlurDirections.Diagonal },
new HighlightingPreset() { name = "Quality", fillAlpha = 0f, downsampleFactor = 2, iterations = 3, blurMinSpread = 0.5f, blurSpread = 0.5f, blurIntensity = 0.28f, blurDirections = BlurDirections.Diagonal },
new HighlightingPreset() { name = "Solid 1px", fillAlpha = 0f, downsampleFactor = 1, iterations = 1, blurMinSpread = 1f, blurSpread = 0f, blurIntensity = 1f, blurDirections = BlurDirections.All },
new HighlightingPreset() { name = "Solid 2px", fillAlpha = 0f, downsampleFactor = 1, iterations = 2, blurMinSpread = 1f, blurSpread = 0f, blurIntensity = 1f, blurDirections = BlurDirections.All }
};
#endregion
#region Public Fields
public ReadOnlyCollection<HighlightingPreset> presets
{
get
{
if (_presetsReadonly == null)
{
_presetsReadonly = _presets.AsReadOnly();
}
return _presetsReadonly;
}
}
#endregion
#region Private Fields
[SerializeField]
private List<HighlightingPreset> _presets = new List<HighlightingPreset>(defaultPresets);
private ReadOnlyCollection<HighlightingPreset> _presetsReadonly;
#endregion
#region Public Methods
// Get stored preset by name
public bool GetPreset(string name, out HighlightingPreset preset)
{
for (int i = 0; i < _presets.Count; i++)
{
HighlightingPreset p = _presets[i];
if (p.name == name)
{
preset = p;
return true;
}
}
preset = new HighlightingPreset();
return false;
}
// Add (store) preset
public bool AddPreset(HighlightingPreset preset, bool overwrite)
{
for (int i = 0; i < _presets.Count; i++)
{
HighlightingPreset p = _presets[i];
if (p.name == preset.name)
{
if (overwrite)
{
_presets[i] = preset;
return true;
}
else
{
return false;
}
}
}
_presets.Add(preset);
return true;
}
// Find stored preset by name and remove it
public bool RemovePreset(string name)
{
for (int i = 0; i < _presets.Count; i++)
{
HighlightingPreset p = _presets[i];
if (p.name == name)
{
_presets.RemoveAt(i);
return true;
}
}
return false;
}
// Find stored preset by name and apply it's settings
public bool LoadPreset(string name)
{
HighlightingPreset preset;
if (GetPreset(name, out preset))
{
ApplyPreset(preset);
}
return false;
}
// Apply preset settings
public void ApplyPreset(HighlightingPreset preset)
{
downsampleFactor = preset.downsampleFactor;
iterations = preset.iterations;
blurMinSpread = preset.blurMinSpread;
blurSpread = preset.blurSpread;
blurIntensity = preset.blurIntensity;
blurDirections = preset.blurDirections;
}
//
public void ClearPresets()
{
_presets.Clear();
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 8b765e0b5af3bcf4a9deb5895e477da8
labels:
- Glow
- Effect
- Outline
- Highlight
- Selection
- System
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: f6bc2c4ad60bfac40b7c81889c62dc5c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3e2a98eec43f4f04788ccf35d4ae8ec4
folderAsset: yes
DefaultImporter:
userData:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HighlightingSystem
{
[UnityEngine.Internal.ExcludeFromDocs]
public class EndOfFrame : MonoBehaviour
{
[UnityEngine.Internal.ExcludeFromDocs]
public delegate void OnEndOfFrame();
#region Static Fields
static private EndOfFrame _singleton;
static private EndOfFrame singleton
{
get
{
if (_singleton == null)
{
GameObject go = new GameObject("EndOfFrameHelper");
go.hideFlags = HideFlags.HideAndDontSave;
_singleton = go.AddComponent<EndOfFrame>();
}
return _singleton;
}
}
#endregion
#region Private Fields
private WaitForEndOfFrame waitForEndOfFrame = new WaitForEndOfFrame();
private Coroutine coroutine;
private List<OnEndOfFrame> listeners = new List<OnEndOfFrame>();
#endregion
#region MonoBehaviour
//
void OnEnable()
{
coroutine = StartCoroutine(EndOfFrameRoutine());
}
//
void OnDisable()
{
if (coroutine != null)
{
StopCoroutine(coroutine);
}
}
#endregion
#region Public Methods
//
static public void AddListener(OnEndOfFrame listener)
{
if (listener == null) { return; }
singleton.listeners.Add(listener);
}
//
static public void RemoveListener(OnEndOfFrame listener)
{
if (listener == null || _singleton == null) { return; }
singleton.listeners.Remove(listener);
}
#endregion
#region Private Methods
//
private IEnumerator EndOfFrameRoutine()
{
while (true)
{
yield return waitForEndOfFrame;
for (int i = listeners.Count - 1; i >= 0; i--)
{
OnEndOfFrame listener = listeners[i];
if (listener != null)
{
listener();
}
else
{
listeners.RemoveAt(i);
}
}
}
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3116e6cc88ed97b4d8eb4053f451aaf7
timeCreated: 1505081746
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 00769d7dc66ce2a49a2ad03dc19d205e
timeCreated: 1516141170
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
using System.Collections.Generic;
namespace HighlightingSystem
{
[DisallowMultipleComponent]
[AddComponentMenu("")] // Hide in 'Add Component' menu
[UnityEngine.Internal.ExcludeFromDocs]
public class HighlighterRenderer : MonoBehaviour
{
[UnityEngine.Internal.ExcludeFromDocs]
private struct Data
{
public Material material;
public int submeshIndex;
public bool transparent;
}
#region Constants
// Default transparency cutoff value (used for shaders without _Cutoff property)
static private float transparentCutoff = 0.5f;
// Flags to hide and don't save this component in editor
private const HideFlags flags = HideFlags.HideInInspector | HideFlags.DontSaveInEditor | HideFlags.NotEditable | HideFlags.DontSaveInBuild;
// Cull Off
private const int cullOff = (int)CullMode.Off;
#endregion
#region Static Fields
static private readonly string sRenderType = "RenderType";
static private readonly string sOpaque = "Opaque";
static private readonly string sTransparent = "Transparent";
static private readonly string sTransparentCutout = "TransparentCutout";
static private readonly string sMainTex = "_MainTex";
#endregion
#region Public Fields
public bool isAlive = false;
#endregion
#region Private Fields
private Renderer r;
private List<Data> data = new List<Data>();
#endregion
#region MonoBehaviour
//
void Awake()
{
this.hideFlags = flags;
}
//
void OnEnable()
{
EndOfFrame.AddListener(OnEndOfFrame);
}
//
void OnDisable()
{
EndOfFrame.RemoveListener(OnEndOfFrame);
}
// Called once (before OnPreRender) for each camera if the object is visible.
// The function is called during the culling process just before rendering each culled object.
void OnWillRenderObject()
{
HighlightingBase.SetVisible(this);
}
//
void OnDestroy()
{
// Data will be null if Undo / Redo was performed in Editor to delete / restore object with this component
if (data == null) { return; }
for (int i = 0, imax = data.Count; i < imax; i++)
{
Data d = data[i];
// Unity never garbage-collects unreferenced materials, so it is our responsibility to destroy them
if (d.transparent)
{
Destroy(d.material);
}
}
}
#endregion
#region Public Methods
//
public void Initialize(Material sharedOpaqueMaterial, Shader transparentShader, List<int> submeshIndices)
{
data.Clear();
r = GetComponent<Renderer>();
Material[] materials = r.sharedMaterials;
int materialsLength = materials.Length;
if (materials == null || materialsLength == 0) { return; }
// Highlight all submeshes
if (submeshIndices.Count == 1 && submeshIndices[0] == -1)
{
submeshIndices.Clear();
for (int i = 0; i < materialsLength; i++)
{
submeshIndices.Add(i);
}
}
// Prepare specified submeshIndices
for (int i = 0, imax = submeshIndices.Count; i < imax; i++)
{
int submeshIndex = submeshIndices[i];
// Invalid submeshIndex
if (submeshIndex >= materialsLength) { continue; }
Material sourceMat = materials[submeshIndex];
if (sourceMat == null) { continue; }
Data d = new Data();
string tag = sourceMat.GetTag(sRenderType, true, sOpaque);
if (tag == sTransparent || tag == sTransparentCutout)
{
Material replacementMat = new Material(transparentShader);
// To render both sides of the Sprite
if (r is SpriteRenderer) { replacementMat.SetInt(ShaderPropertyID._HighlightingCull, cullOff); }
if (sourceMat.HasProperty(ShaderPropertyID._MainTex))
{
replacementMat.SetTexture(ShaderPropertyID._MainTex, sourceMat.mainTexture);
replacementMat.SetTextureOffset(sMainTex, sourceMat.mainTextureOffset);
replacementMat.SetTextureScale(sMainTex, sourceMat.mainTextureScale);
}
int cutoff = ShaderPropertyID._Cutoff;
replacementMat.SetFloat(cutoff, sourceMat.HasProperty(cutoff) ? sourceMat.GetFloat(cutoff) : transparentCutoff);
d.material = replacementMat;
d.transparent = true;
}
else
{
d.material = sharedOpaqueMaterial;
d.transparent = false;
}
d.submeshIndex = submeshIndex;
data.Add(d);
}
}
//
public void SetOverlay(bool overlay)
{
for (int i = 0, imax = data.Count; i < imax; i++)
{
Data d = data[i];
if (d.transparent)
{
d.material.SetKeyword(HighlighterCore.keywordOverlay, overlay);
}
}
}
// Sets given color as highlighting color on all transparent materials of this renderer
public void SetColor(Color clr)
{
for (int i = 0, imax = data.Count; i < imax; i++)
{
Data d = data[i];
if (d.transparent)
{
d.material.SetColor(ShaderPropertyID._HighlightingColor, clr);
}
}
}
//
public void FillBuffer(CommandBuffer buffer)
{
for (int i = 0, imax = data.Count; i < imax; i++)
{
Data d = data[i];
buffer.DrawRenderer(r, d.material, d.submeshIndex);
}
}
//
public bool IsValid()
{
return r != null;
}
#endregion
#region Private Methods
//
private void OnEndOfFrame()
{
if (!isAlive)
{
Destroy(this);
}
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 23ffcf5db409ff94baada0048d38c89d
timeCreated: 1454246717
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c9a69acb2622340e39a2b84d908232e3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using System;
namespace HighlightingSystem
{
[Serializable]
public struct HighlightingPreset : IEquatable<HighlightingPreset>
{
public string name { get { return _name; } set { _name = value; } }
public float fillAlpha { get { return _fillAlpha; } set { _fillAlpha = value; } }
public int downsampleFactor { get { return _downsampleFactor; } set { _downsampleFactor = value; } }
public int iterations { get { return _iterations; } set { _iterations = value; } }
public float blurMinSpread { get { return _blurMinSpread; } set { _blurMinSpread = value; } }
public float blurSpread { get { return _blurSpread; } set { _blurSpread = value; } }
public float blurIntensity { get { return _blurIntensity; } set { _blurIntensity = value; } }
public BlurDirections blurDirections { get { return _blurDirections; } set { _blurDirections = value; } }
[SerializeField] private string _name;
[SerializeField] private float _fillAlpha;
[SerializeField] private int _downsampleFactor;
[SerializeField] private int _iterations;
[SerializeField] private float _blurMinSpread;
[SerializeField] private float _blurSpread;
[SerializeField] private float _blurIntensity;
[SerializeField] private BlurDirections _blurDirections;
#region IEquatable implementation
//
bool IEquatable<HighlightingPreset>.Equals(HighlightingPreset other)
{
return
_name == other._name &&
_fillAlpha == other._fillAlpha &&
_downsampleFactor == other._downsampleFactor &&
_iterations == other._iterations &&
_blurMinSpread == other._blurMinSpread &&
_blurSpread == other._blurSpread &&
_blurIntensity == other._blurIntensity &&
_blurDirections == other._blurDirections;
}
#endregion
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: bf36fd3853ef7584bb8c13c22fff962e
timeCreated: 1480207882
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace HighlightingSystem
{
[UnityEngine.Internal.ExcludeFromDocs]
static public class MaterialExtensions
{
// Helper method to enable or disable keyword on material
static public void SetKeyword(this Material material, string keyword, bool state)
{
if (state) { material.EnableKeyword(keyword); }
else { material.DisableKeyword(keyword); }
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f2b5d57c66061e548b250a8d44c4f43a
timeCreated: 1521664113
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace HighlightingSystem
{
// Shader property ID cached constants
[UnityEngine.Internal.ExcludeFromDocs]
public class ShaderPropertyID
{
// Common
static public readonly int _MainTex = Shader.PropertyToID("_MainTex");
static public readonly int _Cutoff = Shader.PropertyToID("_Cutoff");
static public readonly int _HighlightingIntensity = Shader.PropertyToID("_HighlightingIntensity");
static public readonly int _HighlightingCull = Shader.PropertyToID("_HighlightingCull");
static public readonly int _HighlightingColor = Shader.PropertyToID("_HighlightingColor");
static public readonly int _HighlightingBlurOffset = Shader.PropertyToID("_HighlightingBlurOffset");
static public readonly int _HighlightingFillAlpha = Shader.PropertyToID("_HighlightingFillAlpha");
static public readonly int _HighlightingBuffer = Shader.PropertyToID("_HighlightingBuffer");
static public readonly int _HighlightingBlur1 = Shader.PropertyToID("_HighlightingBlur1");
static public readonly int _HighlightingBlur2 = Shader.PropertyToID("_HighlightingBlur2");
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: bdf8fd90b69cf684cbbb8f6ec27bf953
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using System;
public class Class1
{
public Class1()
{
}
}
{"App":{"Title":"转向架智能制造二期数字孪生系统","WebUrl":"http://192.168.70.2:8080","IsSim":false},"Data":{"ServerIP":"http://218.75.205.85:8082","IntervalSecond":5000.0,"StartSecond":1000.0,"RobotSecond":1000.0,"IsRequests":["Y","Y","Y","Y","Y","Y","Y"]}}
\ No newline at end of file
using UnityEditor;
using UnityEngine;
namespace
{
public class NewEditorScript1 : ScriptableObject
{
[MenuItem("Tools/MyTool/Do It in C#")]
static void DoIt()
{
EditorUtility.DisplayDialog("MyTool", "Do It in C# !", "OK", "");
}
}
}
\ No newline at end of file
# 1 使用项目模板创建新的项目
* Fork数字孪生模板项目
```
https://gitlab.sd-zeus.com/zeuslib/UnityTemplateLib/DigitalTwinTemplate
```
* 修改新Fork的项目,包括项目名、描述等,包括路径
![image](https://gitlab.sd-zeus.com/zeuslib/UnityTemplateLib/DigitalTwinTemplate/wikis/uploads/4dccc2f609749f03038ddc77b81a6b7e/image.png)
![image](https://gitlab.sd-zeus.com/zeuslib/UnityTemplateLib/DigitalTwinTemplate/wikis/uploads/f418222a15551db653a54e7c6c59e47a/image.png)
* 克隆项目到本地
* 初始化子模块
```
git submodule init
```
更新子模块
```
git submodule update
```
# ZeusHub用户端程序
\ No newline at end of file
[{"Scene":"\u793A\u4F8B\u573A\u666F","Datas":[{"KeyCode":"Alpha1","Position":"2.600677,0.07999986,54.56703","Rotation":"1.94338,11.83981","BodyYaw":0},{"KeyCode":"Alpha2","Position":"14.39753,0.07999986,89.39561","Rotation":"35.38406,59.92626","BodyYaw":0},{"KeyCode":"Alpha3","Position":"12.53551,0.07999986,22.85287","Rotation":"0.6841983,191.5358","BodyYaw":0}]}]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment