# Conflicts:
#	Unity-19050-05-BallPool/Assets/Frozen/Character.prefab
#	Unity-19050-05-BallPool/Assets/Frozen/Frozen.unity
#	Unity-19050-05-BallPool/Assets/Frozen/Script/CharacterBehaviour.cs
#	Unity-19050-05-BallPool/Assets/Frozen/Script/SceneController.cs
master
chwan1 6 years ago
commit 1ffc91ce1a
  1. 15
      .gitmodules
  2. 8
      Unity-19050-01_ForstCoronation/Assets/Materials/IceMaterial.mat
  3. 572
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  4. 2
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice/Scene Settings Profile.asset
  5. 55
      Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  6. 46
      Unity-19050-01_ForstCoronation/Assets/Scripts/VFX_Timer.cs
  7. BIN
      Unity-19050-01_ForstCoronation/Assets/Textures/ice_pattern.jpg
  8. 91
      Unity-19050-01_ForstCoronation/Assets/Textures/ice_pattern.jpg.meta
  9. 52
      Unity-19050-01_ForstCoronation/Assets/Visual Effect Graphs/IceShaderGraph.shadergraph
  10. 10557
      Unity-19050-01_ForstCoronation/Assets/Visual Effect Graphs/frozenVFX.vfx
  11. 2
      Unity-19050-01_ForstCoronation/Packages/manifest.json
  12. 2
      Unity-19050-01_ForstCoronation/ProjectSettings/TagManager.asset
  13. 122
      Unity-19050-05-BallPool/Assets/Frozen/Script/FrozenScreenToWorldSpace.cs
  14. 63
      Unity-19050-05-BallPool/Assets/Frozen/Shader/FrozenUnlitTexture.shader
  15. 70
      Unity-19050-05-BallPool/Assets/Frozen/Shader/UnlitColorAlpha.shader
  16. 43
      Unity-19050-05-BallPool/ProjectSettings/TagManager.asset
  17. 1
      _Package/KlakSpout
  18. 9
      _Package/KlakSpout/.gitattributes
  19. 20
      _Package/KlakSpout/.gitignore
  20. 4
      _Package/KlakSpout/.npmignore
  21. 8
      _Package/KlakSpout/Editor.meta
  22. 125
      _Package/KlakSpout/Editor/SpoutReceiverEditor.cs
  23. 5
      _Package/KlakSpout/Editor/SpoutReceiverEditor.cs.meta
  24. 28
      _Package/KlakSpout/Editor/SpoutSenderEditor.cs
  25. 12
      _Package/KlakSpout/Editor/SpoutSenderEditor.cs.meta
  26. 46
      _Package/KlakSpout/Editor/SpoutSenderListWindow.cs
  27. 12
      _Package/KlakSpout/Editor/SpoutSenderListWindow.cs.meta
  28. 12
      _Package/KlakSpout/Editor/jp.keijiro.klak.spout.Editor.asmdef
  29. 7
      _Package/KlakSpout/Editor/jp.keijiro.klak.spout.Editor.asmdef.meta
  30. 21
      _Package/KlakSpout/LICENSE.md
  31. 4
      _Package/KlakSpout/LICENSE.md.meta
  32. 94
      _Package/KlakSpout/README.md
  33. 7
      _Package/KlakSpout/README.md.meta
  34. 8
      _Package/KlakSpout/Resources.meta
  35. 24
      _Package/KlakSpout/Resources/Fixup.cginc
  36. 9
      _Package/KlakSpout/Resources/Fixup.cginc.meta
  37. 32
      _Package/KlakSpout/Resources/Fixup.shader
  38. 9
      _Package/KlakSpout/Resources/Fixup.shader.meta
  39. 8
      _Package/KlakSpout/Runtime.meta
  40. 9
      _Package/KlakSpout/Runtime/Internal.meta
  41. BIN
      _Package/KlakSpout/Runtime/Internal/KlakSpout.dll
  42. 139
      _Package/KlakSpout/Runtime/Internal/KlakSpout.dll.meta
  43. 74
      _Package/KlakSpout/Runtime/Internal/PluginEntry.cs
  44. 12
      _Package/KlakSpout/Runtime/Internal/PluginEntry.cs.meta
  45. 161
      _Package/KlakSpout/Runtime/SpoutReceiver.cs
  46. 12
      _Package/KlakSpout/Runtime/SpoutReceiver.cs.meta
  47. 106
      _Package/KlakSpout/Runtime/SpoutSender.cs
  48. 12
      _Package/KlakSpout/Runtime/SpoutSender.cs.meta
  49. 3
      _Package/KlakSpout/Runtime/jp.keijiro.klak.spout.Runtime.asmdef
  50. 7
      _Package/KlakSpout/Runtime/jp.keijiro.klak.spout.Runtime.asmdef.meta
  51. 8
      _Package/KlakSpout/package.json
  52. 7
      _Package/KlakSpout/package.json.meta

15
.gitmodules vendored

@ -21,13 +21,20 @@
path = Unity-19050-01_ForstCoronation/Packages/com.ultracombos.osc
url = https://github.com/UltraCombos/com.ultracombos.osc.git
branch = master
[submodule "Unity-19050-01_ForstCoronation/Packages/KlakSpout"]
path = Unity-19050-01_ForstCoronation/Packages/KlakSpout
url = https://github.com/UltraCombos/KlakSpout
branch = upm
[submodule "_Package/com.ultracombos.osc"]
path = _Package/com.ultracombos.osc
url = https://github.com/UltraCombos/com.ultracombos.osc
[submodule "_Package/com.ultracombos.tuio"]
path = _Package/com.ultracombos.tuio
url = https://github.com/UltraCombos/com.ultracombos.tuio
[submodule "_Package/KlakSpout"]
path = _Package/KlakSpout
url = https://github.com/keijiro/KlakSpout
branch = upm
[submodule "_Package/jp.keijiro.klak.spout"]
path = _Package/jp.keijiro.klak.spout
url = "https://github.com/keijiro/KlakSpout#upm"
[submodule "_Package/com.ultracombos.configuration"]
path = _Package/com.ultracombos.configuration
url = https://github.com/UltraCombos/com.ultracombos.configuration.git
branch = master

@ -13,7 +13,7 @@ Material:
m_ShaderKeywords:
m_LightmapFlags: 1
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap:
MotionVector: User
@ -82,6 +82,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_389513AD_Texture_1:
m_Texture: {fileID: 2800000, guid: 958cfbda296458c4faf115404e562d73, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_983A7761_Texture_1:
m_Texture: {fileID: 2800000, guid: fbfffb30efcdb1543aeb718469e1e665, type: 3}
m_Scale: {x: 1, y: 1}
@ -115,7 +119,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_30AC6A9E: 6
- Vector1_30AC6A9E: -0.32
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1

@ -138,7 +138,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!64 &154044455
MeshCollider:
m_ObjectHideFlags: 0
@ -208,7 +208,7 @@ Transform:
m_GameObject: {fileID: 154044454}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -3.08}
m_LocalScale: {x: 2, y: 1, z: 2}
m_LocalScale: {x: 1.5, y: 1, z: 1.5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
@ -245,7 +245,7 @@ RectTransform:
m_Children:
- {fileID: 1859907172}
m_Father: {fileID: 1473451374}
m_RootOrder: 2
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -295,17 +295,6 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1111578220}
m_MethodName: SendEvent
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: MouseUp
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1482770260}
m_MethodName: switchStat
m_Mode: 1
@ -626,7 +615,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 590248846}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: -0.55, y: 6.62, z: -4.99}
m_LocalPosition: {x: -0.21, y: 6.62, z: -4.99}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@ -745,82 +734,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
_sourceTexture: {fileID: 0}
_alphaSupport: 1
--- !u!114 &633193832
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3df29e7cc05fbec4aa43e06ea875565d, type: 3}
m_Name:
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
rotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 0
exposure:
m_OverrideState: 0
m_Value: 0
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 1
min: 0
desiredLuxValue:
m_OverrideState: 0
m_Value: 20000
updateMode:
m_OverrideState: 0
m_Value: 0
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
sunSize:
m_OverrideState: 0
m_Value: 0.04
min: 0
max: 1
sunSizeConvergence:
m_OverrideState: 0
m_Value: 5
min: 1
max: 10
atmosphereThickness:
m_OverrideState: 0
m_Value: 1
min: 0
max: 5
skyTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
groundColor:
m_OverrideState: 0
m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
enableSunDisk:
m_OverrideState: 0
m_Value: 1
--- !u!1 &706372899
GameObject:
m_ObjectHideFlags: 0
@ -913,146 +826,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &775993667
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 775993668}
- component: {fileID: 775993671}
- component: {fileID: 775993670}
- component: {fileID: 775993669}
m_Layer: 5
m_Name: Grow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &775993668
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 775993667}
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: 2022895806}
m_Father: {fileID: 1473451374}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 850, y: -420}
m_SizeDelta: {x: 160, y: 80}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &775993669
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 775993667}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.3186632, g: 0.71655226, b: 0.8773585, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 775993670}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1111578220}
m_MethodName: SendEvent
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: MouseDown
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1482770260}
m_MethodName: enterGrow
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &775993670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 775993667}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &775993671
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 775993667}
m_CullTransparentMesh: 0
--- !u!1 &1111578216
GameObject:
m_ObjectHideFlags: 0
@ -1070,7 +843,6 @@ GameObject:
- component: {fileID: 1111578225}
- component: {fileID: 1111578224}
- component: {fileID: 1111578223}
- component: {fileID: 1111578226}
- component: {fileID: 1111578227}
m_Layer: 0
m_Name: frozenVFX
@ -1108,9 +880,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ExecuteInEditor: 1
m_Bindings:
- {fileID: 1111578227}
- {fileID: 1111578217}
- {fileID: 1111578222}
- {fileID: 1111578227}
m_VisualEffect: {fileID: 1111578220}
--- !u!73398921 &1111578219
VFXRenderer:
@ -1131,7 +903,6 @@ VFXRenderer:
m_Materials:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -1176,7 +947,7 @@ VisualEffect:
- m_Value: {x: 0.94, y: 0, z: 0}
m_Name: _Emitter
m_Overridden: 1
- m_Value: {x: -4.39, y: 0, z: -5.12}
- m_Value: {x: -3.32, y: 0, z: -5.12}
m_Name: _Target
m_Overridden: 1
- m_Value: {x: 2.46, y: 0, z: -5.01}
@ -1273,18 +1044,6 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &1111578226
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1111578216}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a68e2dc3e3b971e44a78a9b57bc67337, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1111578227
MonoBehaviour:
m_ObjectHideFlags: 2
@ -1440,17 +1199,22 @@ PrefabInstance:
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: AddTuioBlobEvent.m_PersistentCalls.m_Calls.Array.size
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: blobFilters.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: AddTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
@ -1461,11 +1225,11 @@ PrefabInstance:
type: 3}
propertyPath: AddTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1111578220}
objectReference: {fileID: 1482770260}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: AddTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: SendEvent
value: switchStat
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
@ -1475,13 +1239,38 @@ PrefabInstance:
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: AddTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: MouseDown
value:
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: blobFilters.Array.data[0]
value:
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1482770260}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: switchStat
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 114872970294644716, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: customRoi.height
@ -1579,8 +1368,6 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1661572663}
- {fileID: 775993668}
- {fileID: 159340526}
m_Father: {fileID: 0}
m_RootOrder: 8
@ -1626,8 +1413,10 @@ MonoBehaviour:
target: {fileID: 2032731583}
emitter: {fileID: 1324214445}
button: {fileID: 1859907171}
growingSpeed: 0.006
stat:
growingSpeed: 0.015
fadeSpeed: 0
smooth: 0
--- !u!4 &1482770261
Transform:
m_ObjectHideFlags: 0
@ -1642,83 +1431,82 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1661572662
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1661572663}
- component: {fileID: 1661572665}
- component: {fileID: 1661572664}
m_Layer: 5
m_Name: Stat
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1661572663
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661572662}
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: []
m_Father: {fileID: 1473451374}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 850, y: -350}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1661572664
--- !u!114 &1611372839
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661572662}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Script: {fileID: 11500000, guid: 3df29e7cc05fbec4aa43e06ea875565d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!222 &1661572665
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661572662}
m_CullTransparentMesh: 0
active: 1
m_AdvancedMode: 0
rotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 0
exposure:
m_OverrideState: 0
m_Value: 0
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 1
min: 0
desiredLuxValue:
m_OverrideState: 0
m_Value: 20000
updateMode:
m_OverrideState: 0
m_Value: 0
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
sunSize:
m_OverrideState: 0
m_Value: 0.04
min: 0
max: 1
sunSizeConvergence:
m_OverrideState: 0
m_Value: 5
min: 1
max: 10
atmosphereThickness:
m_OverrideState: 0
m_Value: 1
min: 0
max: 5
skyTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
groundColor:
m_OverrideState: 0
m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
enableSunDisk:
m_OverrideState: 0
m_Value: 1
--- !u!1 &1743590121
GameObject:
m_ObjectHideFlags: 0
@ -1913,6 +1701,63 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1840994726
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1056807493977812, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_Name
value: ConfigurationServer
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6143453941a05b54582f835773a10d58, type: 3}
--- !u!1 &1859907171
GameObject:
m_ObjectHideFlags: 0
@ -2022,7 +1867,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Profile: {fileID: 11400000, guid: 61403f0eeedb6b84fafb386b66e1edae, type: 2}
m_StaticLightingSkyUniqueID: 2
m_SkySettings: {fileID: 633193832}
m_SkySettings: {fileID: 1611372839}
m_SkySettingsFromProfile: {fileID: -3409118194237871670, guid: 61403f0eeedb6b84fafb386b66e1edae,
type: 2}
--- !u!114 &1937584651
@ -2056,83 +1901,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2022895805
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2022895806}
- component: {fileID: 2022895808}
- component: {fileID: 2022895807}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2022895806
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2022895805}
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: []
m_Father: {fileID: 775993668}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2022895807
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2022895805}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Grow
--- !u!222 &2022895808
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2022895805}
m_CullTransparentMesh: 0
--- !u!1 &2032731583
GameObject:
m_ObjectHideFlags: 0
@ -2219,7 +1987,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2032731583}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.39, y: 0, z: -5.12}
m_LocalPosition: {x: -3.32, y: 0, z: -5.12}
m_LocalScale: {x: 0.7, y: 0.7, z: 0.7}
m_Children: []
m_Father: {fileID: 0}

@ -350,7 +350,7 @@ MonoBehaviour:
m_AdvancedMode: 0
intensity:
m_OverrideState: 1
m_Value: 0.421
m_Value: 0.281
min: 0
max: 1
scatter:

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
using UnityEngine.UI;
using UltraCombos.Configuration;
public class DebugUI : MonoBehaviour
{
@ -13,9 +14,20 @@ public class DebugUI : MonoBehaviour
public GameObject target;
public GameObject emitter;
public GameObject button;
public float growingSpeed;
public string stat = "wait";
[Config]
[Range(0f, 0.02f)]
public float growingSpeed;
[Config]
[Range(10, 30)]
public float fadeSpeed;
[Config]
[Range(0f, 0.5f)]
public float smooth;
float spawn_t;
float total_t;
float lerp_val;
@ -35,6 +47,7 @@ public class DebugUI : MonoBehaviour
// Update is called once per frame
void Update()
{
updateVFX();
if (Input.GetKeyDown(KeyCode.A))
{
debugMode = !debugMode;
@ -62,7 +75,7 @@ public class DebugUI : MonoBehaviour
{
lerp_val = 1;
stat = "completed";
vfx.SendEvent("Completed");
StartCoroutine("sendCompleted");
setButtonInteractable(true);
button.GetComponent<Text>().text = stat;
Debug.Log(stat);
@ -85,30 +98,15 @@ public class DebugUI : MonoBehaviour
lerp_val = Mathf.Clamp(lerp_val, 0, 1);
vfx.SetFloat("_LerpVal", lerp_val);
Vector3 base_pos = baseEmitter.GetComponent<Transform>().position;
Vector3 target_pos = target.GetComponent<Transform>().position;
emitter.GetComponent<Transform>().position = Vector3.Lerp(base_pos, target_pos, lerp_val);
/*
if (debugMode && Input.GetMouseButtonDown(0))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
GameObject selected_obj = null;
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 200.0f))
{
selected_obj = hit.collider.gameObject;
Debug.Log("hit!!" + selected_obj.name);
}
}
if(selected_obj != null)
{
selected_obj.GetComponent<Renderer>().material.color = new Color(255, 100, 100);
}
}
*/
IEnumerator sendCompleted()
{
yield return new WaitForSeconds(0.5f);
vfx.SendEvent("Completed");
}
public void switchStat()
@ -131,7 +129,7 @@ public class DebugUI : MonoBehaviour
spawn_t = total_t;
stat = "growing";
vfx.SendEvent("MouseDown");
vfx.SetBool("growing", true);
vfx.SetBool("isGrowing", true);
Debug.Log(stat);
}
@ -141,7 +139,7 @@ public class DebugUI : MonoBehaviour
vfx.SetBool("isEnteringVanish", true);
stat = "vanishing";
vfx.SendEvent("MouseUp");
vfx.SetBool("growing", false);
vfx.SetBool("isGrowing", false);
Debug.Log(stat);
}
@ -154,9 +152,12 @@ public class DebugUI : MonoBehaviour
private void setButtonInteractable(bool _stat)
{
//GameObject g = GameObject.Find("Grow");
//GameObject v = GameObject.Find("Vanish");
//g.GetComponent<Button>().interactable = _stat;
button.GetComponentInParent<Button>().interactable = _stat;
}
void updateVFX()
{
vfx.SetFloat("Fade Speed", fadeSpeed);
vfx.SetFloat("Smooth", smooth);
}
}

@ -1,46 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
public class VFX_Timer : MonoBehaviour
{
float spawn_t;
float total_t;
VisualEffect vfx;
// Start is called before the first frame update
void Start()
{
spawn_t = 0;
total_t = 0;
vfx = GetComponent<VisualEffect>();
}
// Update is called once per frame
void Update()
{
if(Input.GetMouseButton(0) == false && total_t > 0)
{
//total_t -= Time.deltaTime;
}
}
void OnMouseEnter()
{
spawn_t = total_t;
vfx.SetFloat("_spawnTime", spawn_t);
}
void OnMouseDrag()
{
total_t += Time.deltaTime;
vfx.SetFloat("_totalTime", total_t);
}
void OnMouseUp()
{
spawn_t = 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: 958cfbda296458c4faf115404e562d73
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

@ -1,5 +1,7 @@
{
"dependencies": {
"com.ultracombos.grpc": "file:<project>/../../../_Package/com.ultracombos.grpc",
"com.ultracombos.configuration": "file:<project>/../../../_Package/com.ultracombos.configuration",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.0",

@ -16,7 +16,7 @@ TagManager:
-
-
- PostProcessing
-
- ClippingMask
-
-
-

@ -1,122 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UltraCombos.Utility.Attributes;
using UnityEngine;
public enum Area
{
LeftWall,
RightWall,
TopWall,
Floor
}
public class FrozenScreenToWorldSpace : MonoBehaviour
{
public static FrozenScreenToWorldSpace Instance
{
get
{
return instacnce;
}
}
private static FrozenScreenToWorldSpace instacnce;
public float width = 8;
public float depth = 5;
public float height = 3;
public float blackLength = 0.89f;
public float PixelsByMeter = 360;
public float finalPixelsByMeter = 90;
[Header("Debug")]
[SerializeField, ReadOnly]
Rect LeftWall;
[SerializeField, ReadOnly]
Rect TopWall;
[SerializeField, ReadOnly]
Rect RightWall;
[SerializeField, ReadOnly]
Rect Floor;
Dictionary<Area, Rect> RenderTextureROIList = new Dictionary<Area, Rect>();
private void Awake()
{
instacnce = this;
InitailROISetting();
}
void InitailROISetting()
{
var totalWidth = height * 2 + width;
var totalHeight = height + depth + blackLength;
var nWidth = width / totalWidth;//normalized
var nWidth2 = height / totalWidth;
var nHeight = height / totalHeight;
var nHeight2 = depth / totalHeight;
TopWall = new Rect(nWidth2, 0, nWidth, nHeight);
LeftWall = new Rect(0, nHeight, nWidth2, nHeight2);
Floor = new Rect(nWidth2, nHeight, nWidth, nHeight2);
RightWall = new Rect(nWidth + nWidth2, nHeight, nWidth2, nHeight2);
RenderTextureROIList = new Dictionary<Area, Rect>()
{
[Area.LeftWall] = LeftWall,
[Area.RightWall] = RightWall,
[Area.TopWall] = TopWall,
[Area.Floor] = Floor,
};
}
public Vector2 GetFinalScreenPos(Area area, Vector2 wallROI)
{
if (!RenderTextureROIList.ContainsKey(area))
return Vector2.zero;
Rect textureROI = RenderTextureROIList[area];
Vector2 currenPos = Vector2.zero;
switch (area)
{
case Area.LeftWall:
currenPos = Rect.NormalizedToPoint(textureROI, new Vector2(1 - wallROI.y, 1 - wallROI.x));
break;
case Area.RightWall:
currenPos = Rect.NormalizedToPoint(textureROI, new Vector2(wallROI.y, 1 - wallROI.x));
break;
case Area.TopWall:
currenPos = Rect.NormalizedToPoint(textureROI, new Vector2(wallROI.x, 1 - wallROI.y));
break;
}
currenPos = new Vector2(currenPos.x * Screen.width, (1 - currenPos.y) * Screen.height);
return currenPos;
}
public Vector2 GetWallRoiFromPosition(Area area, Vector3 position)
{
position -= transform.position;
Vector2 roi = Vector2.zero;
switch (area)
{
case Area.TopWall:
roi.x = (position.x + width * 0.5f) / width;
roi.y = position.y / height;
break;
case Area.LeftWall:
roi.x = (position.z + depth * 0.5f) / depth;
roi.y = position.y / height;
break;
case Area.RightWall:
roi.x = (position.z + depth * 0.5f) / depth;
roi.y = position.y / height;
break;
}
// Debug.Log($"{area} {position.ToString()} {roi.ToString()}");
return roi;
}
public Vector3 Position { get { return transform.position; } }
}

@ -1,63 +0,0 @@
Shader "UltraCombos/Frozen/Unlit/Texture"
{
Properties
{
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color("Color",Color) = (1,1,1,1)
[Toggle] _isGamma("is Gamma", Float) = 0
}
SubShader
{
//Tags { "RenderType"="Opaque" }
Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True" }
LOD 100
ZWrite Off
Cull off
// Blend SrcAlpha OneMinusSrcAlpha
//Blend One OneMinusSrcAlpha
Blend SrcAlpha OneMinusSrcAlpha, Zero One
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
float _Rate;
float _isGamma;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 frag_color = tex2D(_MainTex, i.uv);
frag_color.rgb = lerp(frag_color.rgb, GammaToLinearSpace(frag_color.rgb), _isGamma);
return frag_color * _Color;
}
ENDCG
}
}
}

@ -1,70 +0,0 @@
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Unlit alpha-blended shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Unlit/ColorTransparent" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color("Color",Color) = (1,1,1,1)
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
ZWrite Off
// Blend SrcAlpha OneMinusSrcAlpha
Blend SrcAlpha OneMinusSrcAlpha, Zero One
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata_t {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 vertex : SV_POSITION;
float2 texcoord : TEXCOORD0;
UNITY_FOG_COORDS(1)
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
v2f vert (appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.texcoord) * _Color;
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}

@ -1,43 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
layers:
- Default
- TransparentFX
- Ignore Raycast
-
- Water
- UI
-
-
- Scene
- Particle
- Post
- Post2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
m_SortingLayers:
- name: Default
uniqueID: 0
locked: 0

@ -1 +0,0 @@
Subproject commit a0096e3172c22009678fc94cbd8c8f549a0149f1

@ -0,0 +1,9 @@
* -text
*.cs text eol=lf diff=csharp
*.shader text eol=lf
*.cginc text eol=lf
*.hlsl text eol=lf
*.compute text eol=lf
*.meta text eol=lf

@ -0,0 +1,20 @@
# Windows
Thumbs.db
Desktop.ini
# macOS
.DS_Store
# Code Editors
.idea
.vscode
*.csproj
*.sln
*.swp
# Unity
/Library
/Temp
Assets/Plugins
Assets/Plugins.meta

@ -0,0 +1,4 @@
.git
.gitignore
.gitattributes
.gitmodules

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

@ -0,0 +1,125 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
namespace Klak.Spout
{
[CanEditMultipleObjects]
[CustomEditor(typeof(SpoutReceiver))]
public class SpoutReceiverEditor : Editor
{
SerializedProperty _nameFilter;
SerializedProperty _targetTexture;
SerializedProperty _targetRenderer;
SerializedProperty _targetMaterialProperty;
static GUIContent _labelProperty = new GUIContent("Property");
string[] _propertyList; // cached property list
Shader _cachedShader; // shader used to cache the list
// Retrieve shader from a target renderer.
Shader RetrieveTargetShader(UnityEngine.Object target)
{
var renderer = target as Renderer;
if (renderer == null) return null;
var material = renderer.sharedMaterial;
if (material == null) return null;
return material.shader;
}
// Cache properties of a given shader if it's
// different from a previously given one.
void CachePropertyList(Shader shader)
{
if (_cachedShader == shader) return;
var temp = new List<string>();
var count = ShaderUtil.GetPropertyCount(shader);
for (var i = 0; i < count; i++)
{
var propType = ShaderUtil.GetPropertyType(shader, i);
if (propType == ShaderUtil.ShaderPropertyType.TexEnv)
temp.Add(ShaderUtil.GetPropertyName(shader, i));
}
_propertyList = temp.ToArray();
_cachedShader = shader;
}
// Material property drop-down list.
void ShowMaterialPropertyDropDown()
{
// Try to retrieve the target shader.
var shader = RetrieveTargetShader(_targetRenderer.objectReferenceValue);
if (shader != null)
{
// Cache the property list of the target shader.
CachePropertyList(shader);
// If there are suitable candidates...
if (_propertyList.Length > 0)
{
// Show the drop-down list.
var index = Array.IndexOf(_propertyList, _targetMaterialProperty.stringValue);
var newIndex = EditorGUILayout.Popup("Property", index, _propertyList);
// Update the property if the selection was changed.
if (index != newIndex)
_targetMaterialProperty.stringValue = _propertyList[newIndex];
}
else
_targetMaterialProperty.stringValue = ""; // reset on failure
}
else
_targetMaterialProperty.stringValue = ""; // reset on failure
}
void OnEnable()
{
_nameFilter = serializedObject.FindProperty("_nameFilter");
_targetTexture = serializedObject.FindProperty("_targetTexture");
_targetRenderer = serializedObject.FindProperty("_targetRenderer");
_targetMaterialProperty = serializedObject.FindProperty("_targetMaterialProperty");
}
void OnDisable()
{
_propertyList = null;
_cachedShader = null;
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(_nameFilter);
EditorGUILayout.PropertyField(_targetTexture);
EditorGUILayout.PropertyField(_targetRenderer);
EditorGUI.indentLevel++;
if (_targetRenderer.hasMultipleDifferentValues)
{
// Show a simple text field if there are multiple values.
EditorGUILayout.PropertyField(_targetMaterialProperty, _labelProperty);
}
else if (_targetRenderer.objectReferenceValue != null)
{
// Show the material property drop-down list.
ShowMaterialPropertyDropDown();
}
EditorGUI.indentLevel--;
serializedObject.ApplyModifiedProperties();
}
}
}

@ -1,7 +1,8 @@
fileFormatVersion: 2
guid: a68e2dc3e3b971e44a78a9b57bc67337
guid: e66c46a000456b34e95a2661f5d5391b
timeCreated: 1492008499
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0

@ -0,0 +1,28 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
using UnityEditor;
namespace Klak.Spout
{
[CanEditMultipleObjects]
[CustomEditor(typeof(SpoutSender))]
public class SpoutSenderEditor : Editor
{
SerializedProperty _clearAlpha;
void OnEnable()
{
_clearAlpha = serializedObject.FindProperty("_clearAlpha");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(_clearAlpha);
serializedObject.ApplyModifiedProperties();
}
}
}

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4d54f6c4c801e1148b465b8fb9d50412
timeCreated: 1492008196
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,46 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
using UnityEditor;
namespace Klak.Spout
{
// Spout sender list window
public class SpoutSenderListWindow : EditorWindow
{
[MenuItem("Window/Klak/Spout Sender List")]
static void Init()
{
EditorWindow.GetWindow<SpoutSenderListWindow>("Spout Senders").Show();
}
int _updateCount;
void OnInspectorUpdate()
{
// Update once per eight calls.
if ((_updateCount++ & 7) == 0) Repaint();
}
void OnGUI()
{
var count = PluginEntry.CountSharedObjects();
EditorGUILayout.Space();
EditorGUI.indentLevel++;
if (count == 0)
EditorGUILayout.LabelField("No sender detected.");
else
EditorGUILayout.LabelField(count + " sender(s) detected.");
for (var i = 0; i < count; i++)
{
var name = PluginEntry.GetSharedObjectNameString(i);
if (name != null) EditorGUILayout.LabelField("- " + name);
}
EditorGUI.indentLevel--;
}
}
}

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 66d9365756bb8784faa1774081cc4a3e
timeCreated: 1492007252
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,12 @@
{
"name": "jp.keijiro.klak.spout.Editor",
"references": [
"jp.keijiro.klak.spout.Runtime"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 21435214e6169c649985b5540a63188a
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Keijiro Takahashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 39491758eb9e12c4eabfd1587027ca77
PrefabImporter:
guid: a3a09c268502f7746810f38992bd70b2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:

@ -0,0 +1,94 @@
KlakSpout
=========
![gif](http://i.imgur.com/LxjjcrY.gif)
**KlakSpout** is a Unity plugin that allows sharing rendered frames with other
applications with using the [Spout] protocol.
The Spout protocol is supported by several frameworks (Processing,
openFrameworks, etc.) and software packages (Resolume, AfterEffects, etc.).
The plugin allows Unity to interoperate with them in real time without
incurring much overhead.
[Spout]: http://spout.zeal.co/
System Requirements and Compatibilities
---------------------------------------
- KlakSpout requires Unity 5.6.0 or later.
- KlakSpout only supports Direct3D 11 (DX11) graphics API mode. Other APIs
(DX9, DX12, OpenGL core, etc.) are not supported at the moment.
Features
--------
### Sending frames from a camera
You can send rendered frames from a camera in a scene with attaching the
**SpoutSender** component to it.
### Receiving frames from other applications
You can receive frames from other applications and store them into a render
texture, or set them to a material property as an animating texture.
Installation
------------
Download one of the unitypackage files from the [Releases] page and import it
to a project.
[Releases]: https://github.com/keijiro/KlakSpout/releases
Component Reference
-------------------
### SpoutSender component
![inspector](http://i.imgur.com/6oYHWpu.png)
**SpoutSender** is a component for sending rendered frames to other
Spout-compatible applications.
SpoutSender has only one property. **Clear Alpha** controls whether if contents
of the alpha channel are to be shared or discarded. When it's set to true, it
clears up the contents of the alpha channel with 1.0 (100% opacity). It's
useful when the alpha channel doesn't have any particular use.
### SpoutReceiver component
![inspector](http://i.imgur.com/0BWmM8i.png)
**SpoutReceiver** is a component for receiving frames sent from other
Spout-compatible applications.
**Name Filter** is used to select which Spout sender to connect to. The
receiver only tries to connect to a sender that has the given string in its
name. For instance, when Name Filter is set to "resolume", it doesn't connect
to "Processing 1" nor "maxSender", but "resolumeOut". When Name Filter is kept
empty, it tries to connect to the first found sender without name filtering.
SpoutReceiver supports two ways of storing received frames. When a render
texture is set to **Target Texture**, it updates the render texture with the
received frames. When Target Texture is kept null, it automatically allocates
a temporary render texture for storing frames. These render textures are
accessible from scripts with the `sharedTexture` property.
Received frames can be rendered with using material overriding. To override a
material, set a renderer to **Target Renderer**, then select a property to be
overridden from the drop-down list.
Sender List Window
------------------
![Sender List](http://i.imgur.com/XbN7RvC.png)
The **Spout Sender List** window is available from the menu "Window" -> "Spout"
-> "Spout Sender List". It shows the names of the senders that are currently
available.
License
-------
[MIT](LICENSE.md)

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4825f67de1ac6914bb329d527edf03bb
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

@ -0,0 +1,24 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
#include "UnityCG.cginc"
sampler2D _MainTex;
fixed _ClearAlpha;
v2f_img vert(appdata_img v)
{
v2f_img o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = float2(v.texcoord.x, 1 - v.texcoord.y);
return o;
}
fixed4 frag(v2f_img i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
#if defined(SPOUT_RECEIVER) && !defined(UNITY_COLORSPACE_GAMMA)
col.rgb = GammaToLinearSpace(col.rgb);
#endif
col.a = saturate(col.a + _ClearAlpha);
return col;
}

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 35d67d62b7c939d4e8fdb1c3bed59a83
timeCreated: 1491926074
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,32 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
Shader "Hidden/Spout/Fixup"
{
Properties
{
_MainTex("", 2D) = "white" {}
}
SubShader
{
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define SPOUT_SENDER
#include "Fixup.cginc"
ENDCG
}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ UNITY_COLORSPACE_GAMMA
#define SPOUT_RECEIVER
#include "Fixup.cginc"
ENDCG
}
}
}

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: eb56c59e60b76874692c486f3bdd860d
timeCreated: 1491925542
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

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

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 82c81c4751c9a7145a4d491944d132ab
folderAsset: yes
timeCreated: 1491924284
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,139 @@
fileFormatVersion: 2
guid: dc935766d7c9fd44181cb4b58ef3627e
timeCreated: 1491793810
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXIntel: 0
Exclude OSXIntel64: 0
Exclude OSXUniversal: 0
Exclude PS4: 1
Exclude Win: 1
Exclude Win64: 0
Exclude WindowsStoreApps: 1
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: x86_64
OS: Windows
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
PS4: PS4
second:
enabled: 0
settings: {}
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,74 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
using System.Runtime.InteropServices;
namespace Klak.Spout
{
public static class PluginEntry
{
#region Plugin polling
static int _lastUpdateFrame = -1;
public static void Poll()
{
if (Time.frameCount != _lastUpdateFrame)
{
GL.IssuePluginEvent(GetRenderEventFunc(), 0);
_lastUpdateFrame = Time.frameCount;
}
}
#endregion
#region Native plugin interface
[DllImport("KlakSpout")]
public static extern System.IntPtr GetRenderEventFunc();
[DllImport("KlakSpout")]
public static extern System.IntPtr CreateSender(string name, int width, int height);
[DllImport("KlakSpout")]
public static extern System.IntPtr CreateReceiver(string name);
[DllImport("KlakSpout")]
public static extern void DestroySharedObject(System.IntPtr ptr);
[DllImport("KlakSpout")]
public static extern bool DetectDisconnection(System.IntPtr ptr);
[DllImport("KlakSpout")]
public static extern System.IntPtr GetTexturePointer(System.IntPtr ptr);
[DllImport("KlakSpout")]
public static extern int GetTextureWidth(System.IntPtr ptr);
[DllImport("KlakSpout")]
public static extern int GetTextureHeight(System.IntPtr ptr);
[DllImport("KlakSpout")]
public static extern int CountSharedObjects();
[DllImport("KlakSpout")]
public static extern System.IntPtr GetSharedObjectName(int index);
public static string GetSharedObjectNameString(int index)
{
var ptr = GetSharedObjectName(index);
return ptr != System.IntPtr.Zero ? Marshal.PtrToStringAnsi(ptr) : null;
}
[DllImport("KlakSpout")]
public static extern System.IntPtr SearchSharedObjectName(string keyword);
public static string SearchSharedObjectNameString(string keyword)
{
var ptr = SearchSharedObjectName(keyword);
return ptr != System.IntPtr.Zero ? Marshal.PtrToStringAnsi(ptr) : null;
}
#endregion
}
}

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5833bfa0ae0a90e478f1f90a455ee667
timeCreated: 1491903743
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,161 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
namespace Klak.Spout
{
/// Spout receiver class
[AddComponentMenu("Klak/Spout/Spout Receiver")]
public class SpoutReceiver : MonoBehaviour
{
#region Editable properties
[SerializeField] string _nameFilter;
public string nameFilter {
get { return _nameFilter; }
set { _nameFilter = value; }
}
[SerializeField] RenderTexture _targetTexture;
public RenderTexture targetTexture {
get { return _targetTexture; }
set { _targetTexture = value; }
}
[SerializeField] Renderer _targetRenderer;
public Renderer targetRenderer {
get { return _targetRenderer; }
set { _targetRenderer = value; }
}
[SerializeField] string _targetMaterialProperty;
public string targetMaterialProperty {
get { return _targetMaterialProperty; }
set { targetMaterialProperty = value; }
}
#endregion
#region Public property
Texture2D _sharedTexture;
RenderTexture _fixedTexture;
public Texture receivedTexture {
get { return _targetTexture != null ? _targetTexture : _fixedTexture; }
}
#endregion
#region Private variables
System.IntPtr _receiver;
Material _fixupMaterial;
MaterialPropertyBlock _propertyBlock;
// Search the texture list and create a receiver when found one.
void SearchAndCreateTexture()
{
var name = PluginEntry.SearchSharedObjectNameString(_nameFilter);
if (name != null) _receiver = PluginEntry.CreateReceiver(name);
}
#endregion
#region MonoBehaviour functions
void Start()
{
_fixupMaterial = new Material(Shader.Find("Hidden/Spout/Fixup"));
_propertyBlock = new MaterialPropertyBlock();
// Initial search.
SearchAndCreateTexture();
}
void OnDestroy()
{
if (_receiver != System.IntPtr.Zero)
{
PluginEntry.DestroySharedObject(_receiver);
_receiver = System.IntPtr.Zero;
}
if (_sharedTexture != null)
{
Destroy(_sharedTexture);
_sharedTexture = null;
}
if (_fixedTexture != null)
{
Destroy(_fixedTexture);
_fixedTexture = null;
}
}
void Update()
{
PluginEntry.Poll();
if (_receiver == System.IntPtr.Zero)
{
// The receiver hasn't been set up yet; try to get one.
SearchAndCreateTexture();
}
else
{
// We've received textures via this receiver
// but now it's disconnected from the sender -> Destroy it.
if (PluginEntry.GetTexturePointer(_receiver) != System.IntPtr.Zero &&
PluginEntry.DetectDisconnection(_receiver))
{
OnDestroy();
}
}
if (_receiver != System.IntPtr.Zero)
{
if (_sharedTexture == null)
{
// Try to initialize the shared texture.
var ptr = PluginEntry.GetTexturePointer(_receiver);
if (ptr != System.IntPtr.Zero)
{
_sharedTexture = Texture2D.CreateExternalTexture(
PluginEntry.GetTextureWidth(_receiver),
PluginEntry.GetTextureHeight(_receiver),
TextureFormat.ARGB32, false, false, ptr
);
}
}
else
{
// Update external objects.
if (_targetTexture != null)
{
Graphics.Blit(_sharedTexture, _targetTexture, _fixupMaterial, 1);
}
else
{
if (_fixedTexture == null)
_fixedTexture = new RenderTexture(_sharedTexture.width, _sharedTexture.height, 0);
Graphics.Blit(_sharedTexture, _fixedTexture, _fixupMaterial, 1);
}
if (_targetRenderer != null)
{
_propertyBlock.SetTexture(_targetMaterialProperty, receivedTexture);
_targetRenderer.SetPropertyBlock(_propertyBlock);
}
}
}
}
#endregion
}
}

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 62f7dec0b00674947bc631624c21970a
timeCreated: 1491895289
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,106 @@
// KlakSpout - Spout realtime video sharing plugin for Unity
// https://github.com/keijiro/KlakSpout
using UnityEngine;
namespace Klak.Spout
{
/// Spout sender class
[AddComponentMenu("Klak/Spout/Spout Sender")]
[RequireComponent(typeof(Camera))]
[ExecuteInEditMode]
public class SpoutSender : MonoBehaviour
{
#region Editable properties
[SerializeField] bool _clearAlpha = true;
public bool clearAlpha {
get { return _clearAlpha; }
set { _clearAlpha = value; }
}
#endregion
#region Private members
System.IntPtr _sender;
Texture2D _sharedTexture;
Material _fixupMaterial;
#endregion
#region MonoBehaviour functions
void OnEnable()
{
var camera = GetComponent<Camera>();
_sender = PluginEntry.CreateSender(name, camera.pixelWidth, camera.pixelHeight);
}
void OnDisable()
{
if (_sender != System.IntPtr.Zero)
{
PluginEntry.DestroySharedObject(_sender);
_sender = System.IntPtr.Zero;
}
if (_sharedTexture != null)
{
if (Application.isPlaying)
Destroy(_sharedTexture);
else
DestroyImmediate(_sharedTexture);
_sharedTexture = null;
}
}
void Update()
{
PluginEntry.Poll();
}
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
// Lazy initialization for the shared texture.
if (_sharedTexture == null)
{
var ptr = PluginEntry.GetTexturePointer(_sender);
if (ptr != System.IntPtr.Zero)
{
_sharedTexture = Texture2D.CreateExternalTexture(
PluginEntry.GetTextureWidth(_sender),
PluginEntry.GetTextureHeight(_sender),
TextureFormat.ARGB32, false, false, ptr
);
}
}
// Update the shared texture.
if (_sharedTexture != null)
{
// Lazy initialization for the fix-up shader.
if (_fixupMaterial == null)
_fixupMaterial = new Material(Shader.Find("Hidden/Spout/Fixup"));
// Parameters for the fix-up shader.
_fixupMaterial.SetFloat("_ClearAlpha", _clearAlpha ? 1 : 0);
// Apply the fix-up shader.
var tempRT = RenderTexture.GetTemporary(_sharedTexture.width, _sharedTexture.height);
Graphics.Blit(source, tempRT, _fixupMaterial, 0);
// Copy the result to the shared texture.
Graphics.CopyTexture(tempRT, _sharedTexture);
// Release temporaries.
RenderTexture.ReleaseTemporary(tempRT);
}
// Just transfer the source to the destination.
Graphics.Blit(source, destination);
}
#endregion
}
}

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 45099d624c1e6c14e9514f4e5ea1ed9c
timeCreated: 1491793847
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,3 @@
{
"name": "jp.keijiro.klak.spout.Runtime"
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7cdfac5ef1f961d4ebfe51361a2020bd
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
{
"name": "jp.keijiro.klak.spout",
"displayName": "KlakSpout",
"version": "0.0.1",
"unity": "2018.1",
"description": "KlakSpout is a Unity plugin that allows sharing rendered frames with other applications with using the Spout protocol.",
"dependencies": { }
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 46d658811c8e74d42a9b9d2ee0dd286a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save