Commit 249c77ef authored by 13정준영's avatar 13정준영

added gun & shader forge

parent ef111022

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun Body
m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
......@@ -61,11 +61,12 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Glossiness: 0.312
- _GlossyReflections: 1
- _Metallic: 0
- _Metallic: 0.659
- _Mode: 0
- _OcclusionStrength: 1
- _Outline: 0.002
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
......@@ -73,5 +74,6 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.38679248, g: 0.38679248, b: 0.38679248, a: 1}
- _Color: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
......@@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun Highlight L
m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
......@@ -61,7 +61,7 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
......
......@@ -61,7 +61,7 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun Rim 1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 0
- _Metallic: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 1, b: 0.94361687, a: 1}
fileFormatVersion: 2
guid: e4af578b66f865f41a456dffac64e431
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun Rim
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 0
- _Metallic: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 1, g: 0, b: 0.6249809, a: 1}
fileFormatVersion: 2
guid: 249717ea946a17e41be68f903a53d903
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
......@@ -101,4 +101,4 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Tint: {r: 1, g: 1, b: 1, a: 0.5}
- _Tint: {r: 0, g: 0, b: 0, a: 0.5}
This diff is collapsed.
......@@ -227,7 +227,7 @@ GameObject:
m_Component:
- component: {fileID: 6944302838222521118}
- component: {fileID: 1538255553353109432}
m_Layer: 0
m_Layer: 8
m_Name: Glock
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -265,10 +265,10 @@ SkinnedMeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7b939e5e799d98a469f594828ebab52e, type: 2}
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 2100000, guid: 9b01d7c0e4dfa854eb5dfe2624e27c0f, type: 2}
- {fileID: 2100000, guid: 7c47e4effaee5f64792990f0ae8fb4d5, type: 2}
- {fileID: 2100000, guid: 7c47e4effaee5f64792990f0ae8fb4d5, type: 2}
- {fileID: 2100000, guid: b2d5c48c07dce9c478038bb4cc5878e2, type: 2}
- {fileID: 2100000, guid: 249717ea946a17e41be68f903a53d903, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
......@@ -495,7 +495,7 @@ GameObject:
m_Component:
- component: {fileID: 2903384417594384234}
- component: {fileID: 2936670206978590435}
m_Layer: 0
m_Layer: 8
m_Name: Laser
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -510,7 +510,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8719247719020841660}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.023, z: 0}
m_LocalPosition: {x: 0.005, y: 0.0445, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8004700759934727795}
......@@ -586,7 +586,7 @@ LineRenderer:
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 0, b: 0.8258381, a: 1}
key0: {r: 1, g: 0.3160377, b: 0.88198316, a: 1}
key1: {r: 1, g: 0, b: 0.8094106, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &443224601743444875
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4863035825010836628}
- component: {fileID: 8832113778749918247}
- component: {fileID: 639241641154850737}
m_Layer: 0
m_Name: Stage Top
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &4863035825010836628
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 443224601743444875}
m_LocalRotation: {x: -0.49991274, y: -0.50008726, z: -0.49991274, w: 0.50008726}
m_LocalPosition: {x: -0.10422493, y: 0.025449807, z: 0}
m_LocalScale: {x: 300, y: 300, z: 300}
m_Children: []
m_Father: {fileID: 7594273089694400589}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -89.98, y: -90, z: 0}
--- !u!33 &8832113778749918247
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 443224601743444875}
m_Mesh: {fileID: 5085995059384740344, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
--- !u!23 &639241641154850737
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 443224601743444875}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 8759029353394399117, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &1987798860735362752
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6039534556703494497}
- component: {fileID: 8220069655495655535}
- component: {fileID: 6056639706327950656}
m_Layer: 0
m_Name: Stage Bottom
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6039534556703494497
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1987798860735362752}
m_LocalRotation: {x: -0.49991274, y: -0.50008726, z: -0.49991274, w: 0.50008726}
m_LocalPosition: {x: -0.10422493, y: -0.14421558, z: 0}
m_LocalScale: {x: 300, y: 300, z: 300}
m_Children: []
m_Father: {fileID: 7594273089694400589}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -89.98, y: -90, z: 0}
--- !u!33 &8220069655495655535
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1987798860735362752}
m_Mesh: {fileID: 6827258281919849101, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
--- !u!23 &6056639706327950656
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1987798860735362752}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 1823334422705943678, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2359997187175622628
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4368444324383980542}
- component: {fileID: 3722770054044228725}
- component: {fileID: 875452231674394315}
m_Layer: 0
m_Name: Stage Bottom Border
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4368444324383980542
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2359997187175622628}
m_LocalRotation: {x: -0.49991274, y: -0.50008726, z: -0.49991274, w: 0.50008726}
m_LocalPosition: {x: -0.10422493, y: -0.14421558, z: 0}
m_LocalScale: {x: 300, y: 300, z: 300}
m_Children: []
m_Father: {fileID: 7594273089694400589}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: -89.98, y: -90, z: 0}
--- !u!33 &3722770054044228725
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2359997187175622628}
m_Mesh: {fileID: -6466467159014845025, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
--- !u!23 &875452231674394315
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2359997187175622628}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 670224309865224971, guid: 4d903fd8ede302944bd18fbe4d9d9d3c, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &6863238422150902366
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7594273089694400589}
m_Layer: 0
m_Name: Stage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7594273089694400589
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6863238422150902366}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6039534556703494497}
- {fileID: 4368444324383980542}
- {fileID: 4863035825010836628}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
fileFormatVersion: 2
guid: 2c9c1e84d44b6f04e9fb51294090c1b2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -67,7 +67,7 @@ ModelImporter:
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
meshOptimizationFlags: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
......
fileFormatVersion: 2
guid: d5b56bcfcc6d9f942be4195f371508d6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: da5e6efbf76c58e4ca5d7611e2f09183
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2d430c5bfdc804d0abab4ea9f96aa950
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: a5a3158fa3c7446fa86767fec63f52a0
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: bda2643522b22874ea0704332ec6d288
folderAsset: yes
timeCreated: 1443376891
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 64acd79479e3143eca9adc8336208092
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
namespace ShaderForge {
[System.Serializable]
public class SFPSC_Console : SFPS_Category {
public SF_NodeTreeStatus treeStatus;
/*
public override string Serialize(){
string s = "";
s += Serialize( "f2p0", force2point0.ToString());
return s;
}
public override void Deserialize(string key, string value){
switch( key ) {
case "f2p0":
force2point0 = bool.Parse( value );
break;
}
}*/
public override void DrawExtraTitleContent( Rect r ) {
if( treeStatus.Errors.Count > 0 && !expanded ) {
r = r.MovedRight();
r.width = SF_Styles.IconErrorSmall.width;
r = r.MovedLeft();
r.height = SF_Styles.IconErrorSmall.height;
r.x -= 1;
r.y += 1;
bool hasError = false;
for( int i = 0; i < treeStatus.Errors.Count; i++ ) {
if( treeStatus.Errors[i].isWarning == false ) {
hasError = true;
break;
}
}
GUI.DrawTexture( r, hasError ? SF_Styles.IconErrorSmall : SF_Styles.IconWarningSmall );
}
}
public override float DrawInner(ref Rect r){
float prevYpos = r.y;
r.y = 0;
r.xMin += 20;
r.y += 20;
//GUI.DrawTexture(r.ClampSize(0,SF_Styles.IconWarningSmall.width),SF_Styles.IconWarningSmall);
//r.xMin += 20;
//GUI.Label(r, "Experimental features may not work");
//r.xMin -= 20;
// r.height += 20;
r.height = 20;
for( int i = 0; i < treeStatus.Errors.Count; i++ ) {
bool isNode = treeStatus.Errors[i].node != null;
Texture2D icon = treeStatus.Errors[i].icon;
Rect blockRect = r;
blockRect.height = treeStatus.Errors[i].rows * 14f + 6;
Rect iconRect = blockRect;
iconRect.width = icon.width;
iconRect.height = icon.height;
//iconRect.x += 1;
//iconRect.y += 1;
Rect textRect = blockRect;
textRect.xMin += iconRect.width + 3;
iconRect.center = new Vector2( iconRect.center.x, textRect.center.y );
bool hasAction = treeStatus.Errors[i].action != null;
if( isNode || hasAction ) {
if( GUI.Button( iconRect.Pad( -2 ).PadHorizontal(-3), "" ) ) {
if( hasAction ) {
treeStatus.Errors[i].OnPress();
break;
} else if( isNode ) {
editor.nodeView.selection.DeselectAll( true );
treeStatus.Errors[i].node.Select( true );
}
}
}
GUI.DrawTexture( iconRect, icon );
EditorGUI.SelectableLabel( textRect, treeStatus.Errors[i].error, SF_Styles.SmallTextArea );
r.y += textRect.height;
}
r.y += prevYpos;
return (int)r.yMax;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 82fffb1e4de9ece4095359142f8821a4
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace ShaderForge {
[System.Serializable]
public class SFPSC_Experimental : SFPS_Category {
public bool force2point0 = false;
public bool forceNoShadowPass = false;
public bool forceNoFallback = false;
public bool forceSkipModelProjection = false;
public override string Serialize(){
string s = "";
s += Serialize( "f2p0", force2point0.ToString() );
s += Serialize( "fnsp", forceNoShadowPass.ToString() );
s += Serialize( "fnfb", forceNoFallback.ToString() );
s += Serialize( "fsmp", forceSkipModelProjection.ToString() );
return s;
}
public override void Deserialize(string key, string value){
switch( key ) {
case "f2p0":
force2point0 = bool.Parse( value );
break;
case "fnsp":
forceNoShadowPass = bool.Parse( value );
break;
case "fnfb":
forceNoFallback = bool.Parse( value );
break;
case "fsmp":
forceSkipModelProjection = bool.Parse( value );
break;
}
}
public override float DrawInner(ref Rect r){
float prevYpos = r.y;
r.y = 0;
r.xMin += 20;
r.y += 20;
GUI.DrawTexture(r.ClampSize(0,SF_Styles.IconWarningSmall.width),SF_Styles.IconWarningSmall);
r.xMin += 20;
GUI.Label(r, "Experimental features may not work");
r.xMin -= 20;
r.y += 20;
force2point0 = UndoableToggle( r, force2point0, "Force Shader Model 2.0", "shader model 2.0 forcing", null );
r.y += 20;
forceNoShadowPass = UndoableToggle( r, forceNoShadowPass, "Force no custom shadow pass", "force no custom shadow pass", null );
r.y += 20;
forceNoFallback = UndoableToggle( r, forceNoFallback, "Force no fallback", "force no fallback", null );
r.y += 20;
forceSkipModelProjection = UndoableToggle( r, forceSkipModelProjection, "Force skip model projection", "force skip model projection", null );
r.y += 20;
r.y += prevYpos;
return (int)r.yMax;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: bb31a79ea298f4f939ce86ad39dc270a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace ShaderForge {
[System.Serializable]
public class SFPSC_Geometry : SFPS_Category {
public enum VertexPositioning { LocalSpace, ClipSpace, Billboard };
public string[] strVertexPositioning = new string[] { "Local space", "Clip space", "Billboard" };
public enum NormalQuality { Interpolated, Normalized };
public string[] strNormalQuality = new string[] { "Interpolated", "Normalized" };
public enum NormalSpace { Tangent, Object, World };
public string[] strNormalSpace = new string[] { "Tangent", "Object", "World" };
public enum TessellationMode { Regular, EdgeLength/*, EdgeLengthCulled*/};
public string[] tessModeStr = new string[] { "Regular", "Edge length based"/*, "Edge length based with frustrum culling"*/};
public enum VertexOffsetMode { Relative, Absolute }
public string[] vertexOffsetModeStr = new string[] { "Relative", "Absolute" };
public enum OutlineMode { FromOrigin, VertexNormals, VertexColors };
public string[] outlineModeStr = new string[] { "From origin", "Vertex normals", "Vertex colors" };
public enum CullMode { BackfaceCulling, FrontfaceCulling, DoubleSided };
public static string[] strCullMode = new string[] { "Back", "Front", "Off" };
public VertexPositioning vertexPositioning = VertexPositioning.LocalSpace;
public NormalQuality normalQuality = NormalQuality.Normalized;
public NormalSpace normalSpace = NormalSpace.Tangent;
public VertexOffsetMode vertexOffsetMode = VertexOffsetMode.Relative;
public bool showPixelSnap = false;
public bool highQualityScreenCoords = true;
public TessellationMode tessellationMode = TessellationMode.Regular;
public OutlineMode outlineMode = OutlineMode.VertexNormals;
public CullMode cullMode = CullMode.BackfaceCulling;
public override string Serialize(){
string s = "";
s += Serialize( "vtps", ( (int)vertexPositioning ).ToString() );
s += Serialize( "hqsc", highQualityScreenCoords.ToString());
s += Serialize( "nrmq", ( (int)normalQuality ).ToString() );
s += Serialize( "nrsp", ( (int)normalSpace ).ToString() );
s += Serialize( "vomd", ( (int)vertexOffsetMode ).ToString() );
s += Serialize( "spxs", showPixelSnap.ToString());
s += Serialize( "tesm", ((int)tessellationMode).ToString());
s += Serialize( "olmd", ( (int)outlineMode ).ToString() );
s += Serialize( "culm", ( (int)cullMode ).ToString() );
return s;
}
public override void Deserialize(string key, string value){
switch( key ) {
case "vtps":
vertexPositioning = (VertexPositioning)int.Parse( value );
break;
case "nrmq":
normalQuality = (NormalQuality)int.Parse( value );
break;
case "nrsp":
normalSpace = (NormalSpace)int.Parse( value );
break;
case "vomd":
vertexOffsetMode = (VertexOffsetMode)int.Parse( value );
break;
case "hqsc":
highQualityScreenCoords = bool.Parse( value );
break;
case "spxs":
showPixelSnap = bool.Parse( value );
break;
case "tesm":
tessellationMode = (TessellationMode)int.Parse( value );
break;
case "olmd":
outlineMode = (OutlineMode)int.Parse( value );
break;
case "culm":
cullMode = (CullMode)int.Parse( value );
break;
}
}
public override float DrawInner(ref Rect r){
float prevYpos = r.y;
r.y = 0;
r.xMin += 20;
r.y += 20;
cullMode = (CullMode)UndoableLabeledEnumPopup( r, "Face Culling", cullMode, "face culling" );
r.y += 20;
GUI.enabled = ps.catLighting.renderPath == SFPSC_Lighting.RenderPath.Forward;
normalQuality = (NormalQuality)UndoableContentScaledToolbar( r, "Normal Quality", (int)normalQuality, strNormalQuality, "normal quality" );
GUI.enabled = true;
r.y += 20;
vertexPositioning = (VertexPositioning)UndoableContentScaledToolbar( r, "Vertex Positioning", (int)vertexPositioning, strVertexPositioning, "vertex positioning" );
r.y += 20;
GUI.enabled = ps.mOut.normal.IsConnectedEnabledAndAvailable();
normalSpace = (NormalSpace)UndoableContentScaledToolbar( r, "Normal Space", (int)normalSpace, strNormalSpace, "normal space" );
GUI.enabled = true;
r.y += 20;
vertexOffsetMode = (VertexOffsetMode)UndoableContentScaledToolbar( r, "Vertex offset mode", (int)vertexOffsetMode, vertexOffsetModeStr, "vertex offset mode" );
r.y += 20;
GUI.enabled = ps.HasTessellation();
tessellationMode = (TessellationMode)UndoableLabeledEnumPopupNamed( r, "Tessellation Mode", tessellationMode, tessModeStr, "tessellation mode" );
GUI.enabled = true;
r.y += 20;
GUI.enabled = ps.HasOutline();
outlineMode = (OutlineMode)UndoableLabeledEnumPopupNamed( r, "Outline Extrude Direction", outlineMode, outlineModeStr, "outline mode" );
GUI.enabled = true;
r.y += 20;
highQualityScreenCoords = UndoableToggle( r, highQualityScreenCoords, "Per-pixel screen coordinates", "per-pixel screen coordinates", null );
r.y += 20;
showPixelSnap = UndoableToggle( r, showPixelSnap, "Show 2D sprite pixel snap option in material", "show pixel snap", null );
r.y += 20;
r.y += prevYpos;
return (int)r.yMax;
}
// TODO: Double sided support
public string GetNormalSign() {
if( cullMode == CullMode.BackfaceCulling )
return "";
if( cullMode == CullMode.FrontfaceCulling )
return "-";
//if( cullMode == CullMode.DoubleSided )
return "";
}
public bool UseCulling() {
return ( cullMode != CullMode.BackfaceCulling );
}
public string GetCullString() {
return "Cull " + strCullMode[(int)cullMode];
}
public bool IsDoubleSided() {
return ( cullMode == CullMode.DoubleSided );
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d931c87bc14d34c86a08c0428175c5a6
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 8ef77982e74294fc4b12878b1651f3d9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
namespace ShaderForge {
[System.Serializable]
public class SFPSC_Meta : SFPS_Category {
public enum Inspector3DPreviewType { Sphere, Plane, Skybox };
public string[] strInspector3DPreviewType = new string[] { "3D object", "2D sprite", "Sky"};
public enum BatchingMode { Enabled, Disabled, DisableDuringLODFade };
public string[] strBatchingMode = new string[] { "Enabled", "Disabled", "Disabled during LOD fade" };
public Inspector3DPreviewType previewType = Inspector3DPreviewType.Sphere;
public BatchingMode batchingMode = BatchingMode.Enabled;
public bool canUseSpriteAtlas = false;
public bool compileToAllPlatforms = true;
public bool[] usedRenderers; // TODO: Serialization?
public string fallback = "";
public int LOD = 0; // TODO: Serialization?
public List<string> cgIncludes = new List<string>();
/*
d3d9 = 0, // - Direct3D 9
d3d11 = 1, // - Direct3D 11
glcore = 2, // - OpenGL Core
gles = 3, // - OpenGL ES 2.0
gles3 = 4, // - OpenGL ES 3.0
metal = 5, // - iOS Metal
d3d11_9x = 6, // - Direct3D 11 windows RT
xboxone = 7, // - Xbox One
ps4 = 8, // - PlayStation 4
psp2 = 10 // - PlayStation Vita
n3ds = 11 // - Nintendo 3DS
wiiu = 12, // - Nintendo Wii U
*/
public override SFPS_Category PostInitialize (){
usedRenderers = new bool[12]{ // TODO: Load from project settings
true, // - Direct3D 9
true, // - Direct3D 11
true, // - OpenGL Core
true, // - OpenGL ES 2.0
true, // - OpenGL ES 3.0
true, // - iOS Metal
false, // - Direct3D 11 windows RT
false, // - Xbox One
false, // - PlayStation 4
false, // - PlayStation Vita
false, // - Nintendo 3DS
false // - Wii U
};
return this;
}
char[] splitChars = new char[] { '|' };
string SerializeCgIncludes() {
string serialized = "";
for( int i = 0; i < cgIncludes.Count; i++ ) {
serialized += cgIncludes[i];
if( i < cgIncludes.Count - 1 )
serialized += splitChars[0];
}
string encoded = SF_Tools.StringToBase64String( serialized );
return encoded;
}
void DeserializeCgIncludes( string serialized ) {
string decoded = SF_Tools.Base64StringToString( serialized );
cgIncludes = new List<string>( decoded.Split( splitChars ) );
// Remove empty entries
for( int i = cgIncludes.Count - 1; i >= 0; i-- )
if( cgIncludes[i] == string.Empty )
cgIncludes.RemoveAt( i );
}
public override string Serialize(){
string s = "";
s += Serialize( "flbk", fallback );
s += Serialize( "iptp", ((int)previewType).ToString() );
s += Serialize( "cusa", canUseSpriteAtlas.ToString() );
s += Serialize( "bamd", ( (int)batchingMode ).ToString() );
s += Serialize( "cgin", SerializeCgIncludes() );
s += Serialize( "cpap", compileToAllPlatforms.ToString() );
return s;
}
public override void Deserialize(string key, string value){
switch( key ) {
case "flbk":
fallback = value;
break;
case "iptp":
previewType = (Inspector3DPreviewType)int.Parse(value);
break;
case "cusa":
canUseSpriteAtlas = bool.Parse(value);
break;
case "bamd":
batchingMode = (BatchingMode)int.Parse( value );
break;
case "cgin":
DeserializeCgIncludes( value );
break;
case "cpap":
compileToAllPlatforms = bool.Parse( value );
break;
}
}
public override float DrawInner(ref Rect r){
float prevYpos = r.y;
r.y = 0;
r.xMin += 20;
r.y += 20;
EditorGUI.LabelField( r, "Path", EditorStyles.miniLabel );
r.xMin += 30;
r.height = 17;
r.xMax -= 3;
ps.StartIgnoreChangeCheck();
GUI.SetNextControlName( "shdrpath" );
string prev = editor.currentShaderPath;
//editor.currentShaderPath = GUI.TextField( r, editor.currentShaderPath,EditorStyles.textField );
editor.currentShaderPath = UndoableTextField( r, editor.currentShaderPath, "shader path", null, editor, showContent:false );
if( editor.currentShaderPath != prev ) {
SF_Tools.FormatShaderPath( ref editor.currentShaderPath );
}
if( Event.current.keyCode == KeyCode.Return && GUI.GetNameOfFocusedControl() == "shdrpath" ) {
editor.Defocus();
editor.OnShaderModified( NodeUpdateType.Hard );
}
ps.EndIgnoreChangeCheck();
r.xMin -= 30;
r.height = 20;
r.xMax += 3;
r.y += 20;
EditorGUI.LabelField( r, "Fallback", EditorStyles.miniLabel );
Rect rStart = new Rect( r );
r.xMin += 50;
r.height = 17;
r.xMax -= 47;
ps.StartIgnoreChangeCheck();
GUI.SetNextControlName( "shdrpath" );
prev = fallback;
fallback = UndoableTextField( r, fallback, "shader fallback", null, null, showContent:false );
r.x += r.width + 2;
r.width = 42;
ShaderPicker( r, "Pick");
if( fallback != prev ) {
SF_Tools.FormatShaderPath( ref fallback );
}
if( Event.current.keyCode == KeyCode.Return && GUI.GetNameOfFocusedControl() == "shdrpath" ) {
editor.Defocus();
editor.OnShaderModified( NodeUpdateType.Hard );
}
ps.EndIgnoreChangeCheck();
r = rStart;
r.y += r.height;
EditorGUI.LabelField( r, "LOD", EditorStyles.miniLabel );
r.xMin += 30;
r.height = 17;
r.xMax -= 3;
LOD = UndoableIntField( r, LOD, "LOD");
r.xMin -= 30;
r.height = 20;
r.xMax += 3;
r.y += 20;
canUseSpriteAtlas = UndoableToggle( r, canUseSpriteAtlas, "Allow using atlased sprites", "allow using atlased sprites", null );
r.y += 20;
batchingMode = (BatchingMode)UndoableLabeledEnumPopupNamed( r, "Draw call batching", batchingMode, strBatchingMode, "draw call batching" );
r.y += 20;
previewType = (Inspector3DPreviewType)UndoableLabeledEnumPopupNamed( r, "Inspector preview mode", previewType, strInspector3DPreviewType, "inspector preview mode" );
r.y += 20;
r.y += 5;
if( cgIncludes.Count == 0 ) {
Rect rBtn = r;
rBtn.height -= 4;
rBtn.width = 100;
if( GUI.Button( rBtn, "Add CG Include", EditorStyles.miniButton ) ) {
Undo.RecordObject( this, "add CG include" );
cgIncludes.Add( "" );
}
//r.y += 20;
} else {
EditorGUI.LabelField( r, "CG Includes:" );
r.y += 20;
int removeTarget = -1;
for( int i = 0; i < cgIncludes.Count; i++ ) {
Rect smallRect = r;
smallRect.width = 20;
smallRect.height -= 2;
if( GUI.Button( smallRect, "-" ) ) {
removeTarget = i;
}
r.xMin += 22;
Rect textFieldRect = r;
textFieldRect.height -= 2;
textFieldRect.width -= 3;
cgIncludes[i] = UndoableTextField( textFieldRect, cgIncludes[i], "cg include", null );
textFieldRect.x += 1;
GUI.color = new Color( 1f, 1f, 1f, 0.3f );
GUI.Label( textFieldRect, "<color=#00000000>" + cgIncludes[i] + "</color>.cginc", SF_Styles.RichLabel );
GUI.color = Color.white;
r.y += 20;
r.xMin -= 22;
}
if( removeTarget != -1 ) {
Undo.RecordObject( this, "remove CG include" );
cgIncludes.RemoveAt( removeTarget );
}
Rect buttonRect = r;
buttonRect.width = 20;
buttonRect.height -= 2;
if( GUI.Button( buttonRect, "+" ) ) {
Undo.RecordObject( this, "add CG include" );
cgIncludes.Add( "" );
}
}
r.y += 30;
compileToAllPlatforms = UndoableToggle( r, compileToAllPlatforms, "Compile to all platforms", "toggle compile to all platforms" );
r.y += r.height;
if( compileToAllPlatforms == false ) {
r.x += 20;
EditorGUI.LabelField( r, "Target renderers:" );
r.xMin += 5;
r.y += 20;
r.height = 17;
float pWidth = r.width;
bool onlyDX11GlCore = ps.mOut.tessellation.IsConnectedAndEnabled();
for(int i=0;i<usedRenderers.Length;i++){
bool isDX11orGlCore = ( i == (int)RenderPlatform.d3d11 ) || i == (int)RenderPlatform.glcore;
r.width = 20;
bool prevEnable = GUI.enabled;
//bool displayBool = usedRenderers[i];
bool shouldDisable = !isDX11orGlCore && onlyDX11GlCore;
if( shouldDisable ) {
GUI.enabled = false;
EditorGUI.Toggle( r, false );
} else {
usedRenderers[i] = UndoableToggle( r, usedRenderers[i], SF_Tools.rendererLabels[i] + " renderer");
//usedRenderers[i] = EditorGUI.Toggle( r, usedRenderers[i] );
}
r.width = pWidth;
r.xMin += 20;
EditorGUI.LabelField( r, SF_Tools.rendererLabels[i], EditorStyles.miniLabel );
if( shouldDisable ) {
GUI.enabled = prevEnable;
}
r.xMin -= 20;
r.y += r.height+1;
}
}
r.x -= 20;
r.y += 5;
r.y += prevYpos;
return (int)r.yMax;
}
MenuCommand mc;
private void DisplayShaderContext(Rect r) {
if( mc == null )
mc = new MenuCommand( this, 0 );
EditorUtility.DisplayPopupMenu( r, "CONTEXT/ShaderPopup", mc ); // Display shader popup
}
private void OnSelectedShaderPopup( string command, Shader shader ) {
if( shader != null ) {
if( fallback != shader.name ) {
Undo.RecordObject(this, "pick fallback shader");
fallback = shader.name;
editor.Defocus();
//editor.OnShaderModified( NodeUpdateType.Hard );
}
}
}
public void ShaderPicker(Rect r, string s){
if( GUI.Button( r, s, EditorStyles.popup ) ) {
DisplayShaderContext(r);
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 89807b5c8da3145e0a06ac5b12704ea3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: d4bb19d25405c413ea8307d77806a00b
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
namespace ShaderForge {
[System.Serializable]
public class SFPS_Category : ScriptableObject {
public SF_Editor editor;
public SF_PassSettings ps;
public string labelExpanded;
public string labelContracted;
public bool expanded = false;
public float targetHeight = 0f;
public float smoothHeight = 0f;
public void OnEnable() {
base.hideFlags = HideFlags.HideAndDontSave;
}
public SFPS_Category Initialize( SF_Editor editor, SF_PassSettings ps, string label ) {
this.editor = editor;
this.ps = ps;
this.labelExpanded = label;
this.labelContracted = label + "...";
return PostInitialize();
}
public virtual SFPS_Category PostInitialize(){
return this; // Override
}
public virtual string Serialize(){
return "";
}
protected string Serialize( string key, string value, bool last = false ) {
return key + ":" + value + (last ? "" : ",");
}
public virtual void Deserialize(string key, string value){
}
public virtual void ToggleExpansion(){
}
public virtual void PreDraw(Rect r){
}
public int Draw(float yOffset){
if(Event.current.type == EventType.Repaint){
if(Mathf.Abs(smoothHeight-targetHeight) > 0.1f)
smoothHeight = Mathf.Lerp(smoothHeight,targetHeight,0.5f);
else
smoothHeight = targetHeight;
}
Rect topRect = new Rect( 0f, yOffset, ps.maxWidth, 20 );
Rect r = new Rect( topRect );
PreDraw(r);
if( !StartExpanderChangeCheck( r, ref expanded, labelContracted, labelExpanded ) ) {
//ps.guiChanged = EndExpanderChangeCheck();
//GUI.color = Color.white;
targetHeight = 0f;
//return (int)(topRect.yMax+smoothHeight);
}
Rect gRect = r;
gRect.height = smoothHeight + 20;
GUI.BeginGroup(gRect);
yOffset = DrawInner(ref r );
GUI.EndGroup();
if(expanded)
targetHeight = yOffset-topRect.yMax;
if( EndExpanderChangeCheck() )
ps.guiChanged = true;
GUI.color = Color.white;
return (int)(topRect.yMax+smoothHeight);
}
public virtual float DrawInner(ref Rect r){
return 0f;
}
public string GetLabelString() {
return expanded ? labelExpanded : labelContracted;
}
public virtual void DrawExtraTitleContent( Rect r ) {
// Override. Currently only used by Console
}
public bool StartExpanderChangeCheck(Rect r, ref bool foldVar, string labelContracted, string labelExpanded ) {
// TOOD: COLOR RECT BEHIND
Color prev = GUI.color;
GUI.color = new Color(0,0,0,0);
if( GUI.Button( r, string.Empty , EditorStyles.foldout ) ){
Event.current.Use();
Undo.RecordObject(this, foldVar ? "collapse " + labelExpanded : "expand " + labelExpanded);
foldVar = !foldVar;
}
GUI.color = prev;
//EditorGUI.Foldout( r, foldVar, foldVar ? smoothHeight + " " + labelExpanded : smoothHeight + " " + labelContracted );
EditorGUI.Foldout( r, foldVar, GetLabelString() );
DrawExtraTitleContent( r );
EditorGUI.BeginChangeCheck();
if( !foldVar )
return false;
return true;
}
public bool EndExpanderChangeCheck() {
return EditorGUI.EndChangeCheck();
}
public void CheckboxEnableLine(ref bool b, ref Rect r){
Rect rCopy = r;
rCopy.width = r.height;
b = GUI.Toggle(rCopy,b,string.Empty);
GUI.enabled = b;
r.xMin += 20;
}
public void CheckboxEnableLineEnd(ref Rect r){
r.y += 20;
r.xMin -= 20;
GUI.enabled = true;
}
public int UndoableContentScaledToolbar(Rect r, string label, int selected, string[] labels, string undoInfix){
int newValue = SF_GUI.ContentScaledToolbar( r, label, selected, labels );
if(newValue != selected){
string undoName = "set " + undoInfix + " to " + labels[newValue];
Undo.RecordObject(this,undoName);
return newValue;
}
return selected;
}
public void UndoableConditionalToggle(Rect r, ref bool value, bool usableIf, bool disabledDisplayValue, string label, string undoSuffix){
bool nextValue = value;
SF_GUI.ConditionalToggle(r,ref nextValue, usableIf,disabledDisplayValue,label);
if(nextValue != value){
string undoName = (nextValue ? "enable" : "disable") + " " + undoSuffix;
Undo.RecordObject(this,undoName);
value = nextValue;
}
}
public bool UndoableToggle(Rect r, bool boolVar, string label, string undoActionName, GUIStyle style = null){
if(style == null)
style = EditorStyles.toggle;
bool newValue = GUI.Toggle(r, boolVar, label, style);
if(newValue != boolVar){
string undoName = (newValue ? "enable" : "disable") + " " + undoActionName;
Undo.RecordObject(this,undoName);
return newValue;
}
return boolVar;
}
public bool UndoableToggle(Rect r, bool boolVar, string undoActionName, GUIStyle style = null){
if(style == null)
style = EditorStyles.toggle;
bool newValue = GUI.Toggle(r, boolVar, new GUIContent(""));
if(newValue != boolVar){
string undoName = (newValue ? "enable" : "disable") + " " + undoActionName;
Undo.RecordObject(this,undoName);
return newValue;
}
return boolVar;
}
public Enum UndoableEnumPopup(Rect r, Enum enumValue, string undoInfix){
Enum nextEnum = EditorGUI.EnumPopup( r, enumValue );
if(nextEnum.ToString() != enumValue.ToString()){
string undoName = "set " + undoInfix + " to " + nextEnum;
Undo.RecordObject(this,undoName);
enumValue = nextEnum;
}
return enumValue;
}
public Enum UndoableLabeledEnumPopup(Rect r, string label, Enum enumValue, string undoInfix){
Enum nextEnum = SF_GUI.LabeledEnumField( r, label, enumValue, EditorStyles.miniLabel );
if(nextEnum.ToString() != enumValue.ToString()){
string undoName = "set " + undoInfix + " to " + nextEnum;
Undo.RecordObject(this,undoName);
enumValue = nextEnum;
}
return enumValue;
}
public int UndoableEnumPopupNamed(Rect r, Enum enumValue, string[] displayedOptions, string undoInfix){
int nextEnum = EditorGUI.Popup( r, (int)((object)enumValue), displayedOptions);
if(nextEnum != ((int)((object)enumValue))){
string undoName = "set " + undoInfix + " to " + displayedOptions[nextEnum];
Undo.RecordObject(this,undoName);
return nextEnum;
}
return (int)((object)enumValue);
}
public int UndoableLabeledEnumPopupNamed(Rect r, string label, Enum enumValue, string[] displayedOptions, string undoInfix){
int nextEnum = SF_GUI.LabeledEnumFieldNamed( r, displayedOptions, new GUIContent(label), (int)((object)enumValue), EditorStyles.miniLabel);
if(nextEnum != ((int)((object)enumValue))){
string undoName = "set " + undoInfix + " to " + displayedOptions[nextEnum];
Undo.RecordObject(this,undoName);
return nextEnum;
}
return (int)((object)enumValue);
}
//UndoablePopup
public float UndoableFloatField(Rect r, float value, string undoInfix, GUIStyle style = null){
if(style == null)
style = EditorStyles.textField;
float newValue = EditorGUI.FloatField( r, value, style );
if(newValue != value){
string undoName = "set " + undoInfix + " to " + newValue;
Undo.RecordObject(this,undoName);
return newValue;
}
return value;
}
public int UndoableIntField(Rect r, int value, string undoInfix, GUIStyle style = null){
if(style == null)
style = EditorStyles.textField;
int newValue = EditorGUI.IntField( r, value, style );
if(newValue != value){
string undoName = "set " + undoInfix + " to " + newValue;
Undo.RecordObject(this,undoName);
return newValue;
}
return value;
}
public string UndoableTextField(Rect r, string value, string undoInfix, GUIStyle style = null){
if(style == null)
style = EditorStyles.textField;
string newValue = EditorGUI.TextField( r, value, style );
if(newValue != value){
string undoName = "change " + undoInfix + " to " + newValue;
Undo.RecordObject(this,undoName);
return newValue;
}
return value;
}
public string UndoableTextField(Rect r, string value, string undoInfix, GUIStyle style = null, UnityEngine.Object extra = null, bool showContent = true){
if(style == null)
style = EditorStyles.textField;
string newValue = EditorGUI.TextField( r, value, style );
if(newValue != value){
string undoName = "change " + undoInfix;
if(showContent)
undoName += " to " + newValue;
Undo.RecordObject(this, undoName);
if(extra != null)
Undo.RecordObject(extra, undoName);
return newValue;
}
return value;
}
public void UndoableEnterableNodeTextField(SF_Node node, Rect r, ref string value, string undoMsg, bool update = true, UnityEngine.Object extra = null){
string nextValue = value;
SF_GUI.EnterableTextField(node, r, ref nextValue, EditorStyles.textField, update );
if(nextValue != value){
Undo.RecordObject(this, undoMsg );
if(extra != null)
Undo.RecordObject(extra, undoMsg);
value = nextValue;
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3cc113fa7d2a64fe09c009b1f5f47983
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 318a4bbf6b13c47e1ac8085a2ebc9850
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 74496bb1dec304ba59a268d77032e300
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 8317eafd51c2b41ee9f29c20218164f3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 89068dde132014929a5aa4e450ff685b
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: b1e7c52e807954f07b3d3f54461b3cc2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
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