update layout in BallPool

master
chwan1 6 years ago
parent e862c994ea
commit 8a073cdded
  1. 335
      Unity-19050-05-BallPool/Assets/Frozen/Frozen.unity
  2. 9
      Unity-19050-05-BallPool/Assets/Frozen/Script/CharacterBehaviour.cs
  3. 19
      Unity-19050-05-BallPool/Assets/Frozen/Script/FrozenCharacterController.cs
  4. 13
      Unity-19050-05-BallPool/Assets/Frozen/Script/FrozenCharacterController.cs.meta
  5. 10
      Unity-19050-05-BallPool/Assets/UnityUtils.meta
  6. 16
      Unity-19050-05-BallPool/Assets/UnityUtils/.gitignore
  7. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect.meta
  8. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/Fade.meta
  9. 61
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/Fade/ScreenSpaceFade.cs
  10. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/Fade/ScreenSpaceFade.cs.meta
  11. 39
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/Fade/ScreenSpaceFade.shader
  12. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/Fade/ScreenSpaceFade.shader.meta
  13. 38
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/ImageEffectHelper.cs
  14. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/ImageEffectHelper.cs.meta
  15. 64
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCast.cginc
  16. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCast.cginc.meta
  17. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud.meta
  18. 169
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/RayCastCloud.cs
  19. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/RayCastCloud.cs.meta
  20. 264
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/RayCastCloud.shader
  21. 11
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/RayCastCloud.shader.meta
  22. BIN
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/download.png
  23. 57
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastCloud/download.png.meta
  24. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastPointLight.meta
  25. 15
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastPointLight/RayCastPointLight.cs
  26. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastPointLight/RayCastPointLight.cs.meta
  27. 63
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastUtils.cs
  28. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/ImageEffect/RayCastUtils.cs.meta
  29. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Math.meta
  30. 139
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Math.cs
  31. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Math.cs.meta
  32. 427
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Noise.cs
  33. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Noise.cs.meta
  34. 90
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Spline.cs
  35. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Math/Spline.cs.meta
  36. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc.meta
  37. 58
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/Misc.cs
  38. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/Misc.cs.meta
  39. 30
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/RectExtention.cs
  40. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/RectExtention.cs.meta
  41. 53
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/StringExtention.cs
  42. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/StringExtention.cs.meta
  43. 23
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/TextureUtil.cs
  44. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/TextureUtil.cs.meta
  45. 37
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/UCGraphicRaycaster.cs
  46. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/UCGraphicRaycaster.cs.meta
  47. 26
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/UCRaycaster.cs
  48. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/UCRaycaster.cs.meta
  49. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/shader.meta
  50. 63
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/shader/AlphaPremultiplied.shader
  51. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Misc/shader/AlphaPremultiplied.shader.meta
  52. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound.meta
  53. 292
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound/AudioManager.cs
  54. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound/AudioManager.cs.meta
  55. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound/Editor.meta
  56. 86
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound/Editor/AudioManagerEditor.cs
  57. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/Sound/Editor/AudioManagerEditor.cs.meta
  58. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI.meta
  59. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Editor.meta
  60. 52
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Editor/PinchZoomImageEditor.cs
  61. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Editor/PinchZoomImageEditor.cs.meta
  62. 34
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/HomographyCorner.cs
  63. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/HomographyCorner.cs.meta
  64. 210
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/PinchZoomImage.cs
  65. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/PinchZoomImage.cs.meta
  66. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Prefab.meta
  67. 112
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Prefab/HomographyUICanvas.prefab
  68. 8
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Prefab/HomographyUICanvas.prefab.meta
  69. 475
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Prefab/QuantizedSlider.prefab
  70. 8
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Prefab/QuantizedSlider.prefab.meta
  71. 56
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/QuantizedSlider.cs
  72. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/QuantizedSlider.cs.meta
  73. 101
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/ScreenHomography.cs
  74. 12
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/ScreenHomography.cs.meta
  75. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader.meta
  76. 120
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/ScreenHomography.shader
  77. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/ScreenHomography.shader.meta
  78. 113
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI-Default.shader
  79. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI-Default.shader.meta
  80. 110
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIAdd.shader
  81. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIAdd.shader.meta
  82. 119
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIGamma.shader
  83. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIGamma.shader.meta
  84. 110
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIScreen.shader
  85. 9
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UIScreen.shader.meta
  86. 83
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Add.mat
  87. 10
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Add.mat.meta
  88. 49
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Default.mat
  89. 8
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Default.mat.meta
  90. 83
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Gamma.mat
  91. 10
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/Shader/UI_Gamma.mat.meta
  92. 1427
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/ucGUISkin.guiskin
  93. 8
      Unity-19050-05-BallPool/Assets/UnityUtils/UI/ucGUISkin.guiskin.meta

@ -631,166 +631,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 66098174}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!43 &68844395
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 'Space Ground Mesh: (8x5x3)'
serializedVersion: 9
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 16
localAABB:
m_Center: {x: 0, y: 1.5, z: 0}
m_Extent: {x: 4, y: 1.5, z: 2.5}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_MeshCompression: 0
m_IsReadable: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200040005000600050007000600080009000a0009000b000a000c000d000e000d000f000e00
m_VertexData:
serializedVersion: 2
m_VertexCount: 16
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 24
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 512
_typelessdata: 000080c000000000000020c0000000000000803f00000000e4388e3e00000000000080c00000000000002040000000000000803f00000000e4388e3e0000203f0000804000000000000020c0000000000000803f000000008ee3383f00000000000080400000000000002040000000000000803f000000008ee3383f0000203f000080c000000000000020400000000000000000000080bfe4388e3e0000203f000080c000004040000020400000000000000000000080bfe4388e3e0000803f0000804000000000000020400000000000000000000080bf8ee3383f0000203f0000804000004040000020400000000000000000000080bf8ee3383f0000803f000080c000000000000020c00000803f0000000000000000000000000000203f000080c000004040000020c00000803f0000000000000000000000000000803f000080c000000000000020400000803f0000000000000000e4388e3e0000203f000080c000004040000020400000803f0000000000000000e4388e3e0000803f000080400000000000002040000080bf00000000000000008ee3383f0000203f000080400000404000002040000080bf00000000000000008ee3383f0000803f0000804000000000000020c0000080bf00000000000000000000803f0000203f0000804000004040000020c0000080bf00000000000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 1.5, z: 0}
m_Extent: {x: 4, y: 1.5, z: 2.5}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimized: 0
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &96822205
GameObject:
m_ObjectHideFlags: 0
@ -2783,12 +2623,17 @@ PrefabInstance:
- target: {fileID: 114872970294644716, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: customRoi.width
value: 0
value: 1260
objectReference: {fileID: 0}
- target: {fileID: 114872970294644716, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: customRoi.height
value: 0
value: 800
objectReference: {fileID: 0}
- target: {fileID: 114872970294644716, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: customRoi.x
value: 570
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1f68bf7cec2600e49a46d2f0554453c8, type: 3}
@ -4782,7 +4627,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchoredPosition: {x: 570, y: 0}
m_SizeDelta: {x: 1260, y: 800}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1227078087
@ -5413,7 +5258,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1379541361}
m_Mesh: {fileID: 68844395}
m_Mesh: {fileID: 2019466546}
--- !u!114 &1379541365
MonoBehaviour:
m_ObjectHideFlags: 0
@ -8405,6 +8250,166 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2008324328}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!43 &2019466546
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 'Space Ground Mesh: (8x5x3)'
serializedVersion: 9
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 16
localAABB:
m_Center: {x: 0, y: 1.5, z: 0}
m_Extent: {x: 4, y: 1.5, z: 2.5}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_MeshCompression: 0
m_IsReadable: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200040005000600050007000600080009000a0009000b000a000c000d000e000d000f000e00
m_VertexData:
serializedVersion: 2
m_VertexCount: 16
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 24
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 512
_typelessdata: 000080c000000000000020c0000000000000803f00000000e4388e3e00000000000080c00000000000002040000000000000803f00000000e4388e3e0000203f0000804000000000000020c0000000000000803f000000008ee3383f00000000000080400000000000002040000000000000803f000000008ee3383f0000203f000080c000000000000020400000000000000000000080bfe4388e3e0000203f000080c000004040000020400000000000000000000080bfe4388e3e0000803f0000804000000000000020400000000000000000000080bf8ee3383f0000203f0000804000004040000020400000000000000000000080bf8ee3383f0000803f000080c000000000000020c00000803f0000000000000000000000000000203f000080c000004040000020c00000803f0000000000000000000000000000803f000080c000000000000020400000803f0000000000000000e4388e3e0000203f000080c000004040000020400000803f0000000000000000e4388e3e0000803f000080400000000000002040000080bf00000000000000008ee3383f0000203f000080400000404000002040000080bf00000000000000008ee3383f0000803f0000804000000000000020c0000080bf00000000000000000000803f0000203f0000804000004040000020c0000080bf00000000000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 1.5, z: 0}
m_Extent: {x: 4, y: 1.5, z: 2.5}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimized: 0
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &2024329733
GameObject:
m_ObjectHideFlags: 0
@ -8465,7 +8470,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
persistance: 1
state: 0
state: 1
standbyTime: 10
rate: 0
spaceMaterials: []

@ -106,7 +106,7 @@ namespace UltraCombos.Frozen
if (fakeButton != null)
return;
GameObject obj = new GameObject(gameObject.name);
obj.transform.parent = GameObject.Find("Final Canvas").transform;
obj.transform.parent = GameObject.Find("Final Canvas").transform.Find("RawImage");
fakeButton = obj.AddComponent<RectTransform>();
fakeButton.anchorMin = new Vector2(0, 0);
fakeButton.anchorMax = new Vector2(0, 0);
@ -153,7 +153,7 @@ namespace UltraCombos.Frozen
canvas_group.interactable = true;
canvas_group.blocksRaycasts = true;
}
}
private void OnDisable()
@ -163,9 +163,9 @@ namespace UltraCombos.Frozen
fakeButton.gameObject.SetActive(false);
canvas_group.interactable = false;
canvas_group.blocksRaycasts = false;
}
}
}
public bool Active
{
set
@ -505,6 +505,7 @@ namespace UltraCombos.Frozen
//Vector2 newScreenPos = FrozenScreenToWorldSpace.Instance.GetFinalScreenPos(area, wallRoi);
var roi = FrozenScreenToWorldSpace.Instance.GetWallRoiFromPosition(area, renderers[(int)Status.STANDBY].transform.position);
Vector2 newScreenPos = FrozenScreenToWorldSpace.Instance.GetFinalScreenPos(area, roi);
newScreenPos.x = newScreenPos.x / 1830 * 1260;
fakeButton.anchoredPosition = newScreenPos;
}

@ -1,19 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FrozenCharacterController : MonoBehaviour {
public static FrozenCharacterController Instance { get { return instance; } }
private static FrozenCharacterController instance;
private void Awake()
{
instance = this;
}
}

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 7e9aa98273b5dc84189684d4767d23b4
timeCreated: 1524475879
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: e52c8400fbaa7a849827061bc1854a54
folderAsset: yes
timeCreated: 1524209419
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,16 +0,0 @@
/obj
/bin/*
!/bin/data/*
*.opensdf
*.sdf
*.suo
/Library
/Temp
/Assets/UnityVS.meta
/Assets/UnityVS/Editor
/Assets/UnityVS/Editor.meta
/Assets/UC.meta
/*.CSharp.*
/*.csproj
/*.sln

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 065c0007e5d314a4cb822d52aad7047b
folderAsset: yes
timeCreated: 1479387729
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 8f33eb280aeeebe4790e03ebfc8909a4
folderAsset: yes
timeCreated: 1479386370
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,61 +0,0 @@
using UnityEngine;
namespace UC
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Fade")]
public class ScreenSpaceFade : MonoBehaviour
{
public Color color;
[Range(0.0f, 1.0f)]
public float amount = 0f;
[SerializeField]
private Shader m_Shader;
public Shader shader
{
get
{
if (m_Shader == null)
m_Shader = Shader.Find("Hidden/ScreenSpaceFade");
return m_Shader;
}
}
private Material m_Material;
public Material material
{
get
{
if (m_Material == null)
m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(shader);
return m_Material;
}
}
private void OnEnable()
{
if (!ImageEffectHelper.IsSupported(shader, true, false, this))
enabled = false;
GetComponent<Camera>().depthTextureMode = DepthTextureMode.DepthNormals;
}
private void OnDisable()
{
if (m_Material != null)
DestroyImmediate(m_Material);
m_Material = null;
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
material.SetColor("blend_color", color);
material.SetFloat("amount", amount);
Graphics.Blit(source, destination, material);
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: ccb6bb2de49949247bd1c56b4729043b
timeCreated: 1479386252
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,39 +0,0 @@
Shader "Hidden/ScreenSpaceFade"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
ZTest Always Cull Off ZWrite Off
Fog { Mode off }
CGINCLUDE
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
sampler2D _MainTex;
float3 blend_color;
float amount;
float4 frag(v2f_img i) : SV_Target
{
float4 scene_color = tex2D(_MainTex, i.uv);
float3 col = scene_color * (1-amount) + blend_color * amount;
return float4( col, 1.0 );
}
ENDCG
// (0) VRRenderCloud
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
ENDCG
}
}
FallBack off
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: bc98802603fb77747ae5ea4f301839dd
timeCreated: 1479386252
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,38 +0,0 @@
using UnityEngine;
namespace UC
{
public static class ImageEffectHelper
{
public static bool IsSupported(Shader s, bool needDepth, bool needHdr, MonoBehaviour effect)
{
if (s == null || !s.isSupported)
{
Debug.Log("shader is: " + s);
Debug.LogWarningFormat("Missing shader for image effect {0}", effect);
return false;
}
if (!SystemInfo.supportsImageEffects)
return false;
if (needDepth && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth))
return false;
if (needHdr && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
return false;
return true;
}
public static Material CheckShaderAndCreateMaterial(Shader s)
{
if (s == null || !s.isSupported)
return null;
var material = new Material(s);
material.hideFlags = HideFlags.DontSave;
return material;
}
}
}

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

@ -1,64 +0,0 @@
#pragma multi_compile __ VR
float4x4 _PVMMatrix;
float4x4 _Cam2WorldMatrix;
#if VR
float4x4 _PVMMatrix_L;
float4x4 _PVMMatrix_R;
float4x4 _Cam2WorldMatrix_L;
float4x4 _Cam2WorldMatrix_R;
#endif
float4 toWorldPosition(float4 p_in)
{
return mul(_PVMMatrix, p_in);
}
float toDepth(float4 p_in)
{
#if defined(VR)
return -toWorldPosition(p_in).z;
#else
return toWorldPosition(p_in).z;
#endif
}
float3 getRayDirection(float2 uv)
{
#if VR
if (unity_CameraProjection[0][2] < 0)
{
_Cam2WorldMatrix = _Cam2WorldMatrix_L;
_PVMMatrix = mul(unity_CameraProjection, _PVMMatrix_L);
}
else
{
_Cam2WorldMatrix = _Cam2WorldMatrix_R;
_PVMMatrix = mul(unity_CameraProjection, _PVMMatrix_R);
}
#endif
float4x4 m = unity_CameraProjection;
float near = m[2][3] / (m[2][2] - 1);
float far = m[2][3] / (m[2][2] + 1);
float bottom = near * (m[1][2] - 1) / m[1][1];
float top = near * (m[1][2] + 1) / m[1][1];
float left = near * (m[0][2] - 1) / m[0][0];
float right = near * (m[0][2] + 1) / m[0][0];
float x = uv.x * (right - left) + left;
float y = uv.y * (top - bottom) + bottom;
#if VR
float z = near;
#else
float z = -near;
#endif
float3 rayDirection = float3(x, y, z);
rayDirection = mul(_Cam2WorldMatrix, float4(rayDirection, 0)).xyz;
rayDirection = normalize(rayDirection);
return rayDirection;
}

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

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 7527e552f7ff98e4a9af23da5785fcc9
folderAsset: yes
timeCreated: 1473476733
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,169 +0,0 @@
using UnityEngine;
namespace UC
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Ray Cast/Cloud")]
public class RayCastCloud : MonoBehaviour
{
public Light sun;
[Header("Cloud Color")]
public Color sunGlareColor = new Color(1.0f, 0.4f, 0.2f);
public Color color1 = new Color(0.65f, 0.7f, 0.75f);
public Color color3 = new Color(1.0f, 0.95f, 0.8f);
public Color color4 = new Color(0.25f, 0.3f, 0.35f);
[Range(0.0f, 1.0f)]
public float sssAmount = 0.5f;
[Header("Cloud Shape")]
public bool useMultNoise = true;
[Range(-2.0f, 2.0f)]
public float cloudPosition = 0;
[Range(-2.0f, 4.0f)]
public float cloudThickness = 0;
[Range(-5f, 0.0f)]
public float cloudFreq1 = -1;
[Range(-5f, 0.0f)]
public float cloudFreq2 = -2;
[Range(-5f, 0.0f)]
public float cloudFreq3 = -3;
[Range(-5f, 0.0f)]
public float cloudFreq4 = -4;
[Range(-5f, 0.0f)]
public float cloudFreq5 = -5;
[Range(0f, 50.0f)]
public float near1 = 0;
[Range(0f, 50.0f)]
public float far1 = 50;
[Range(0f, 80.0f)]
public float near2 = 50;
public Vector3 windDirection = new Vector3(0, 0, 0);
[Header("Performance Factor")]
[Range(1, 8)]
public int textureDivideRate = 5;
[Range(60, 400)]
public int rayIteratorCount = 120;
public bool debug = false;
public bool useMipmap = true;
private enum Pass
{
//RenderCloud,
VRRenderCloud,
VRBlendBg
}
[SerializeField]
private Shader m_Shader;
public Shader shader
{
get
{
if (m_Shader == null)
m_Shader = Shader.Find("Hidden/RayCastCloud");
return m_Shader;
}
}
private Material m_Material;
public Material material
{
get
{
if (m_Material == null)
m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(shader);
return m_Material;
}
}
private void OnEnable()
{
if (!ImageEffectHelper.IsSupported(shader, true, false, this))
enabled = false;
GetComponent<Camera>().depthTextureMode = DepthTextureMode.DepthNormals;
}
private void OnDisable()
{
if (m_Material != null)
DestroyImmediate(m_Material);
m_Material = null;
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
float hue, s, v;
Color.RGBToHSV(sunGlareColor, out hue, out s, out v);
Color sunSSSColor = Color.HSVToRGB(hue + 0.025f, s * 0.87f, v);
sunSSSColor.a = sssAmount;
RayCastUtils.SetupMaterial(material);
material.SetColor("_SunGlareColor", sunGlareColor);
material.SetColor("_Color1", color1);
material.SetColor("_SunSSSColor", sunSSSColor);
material.SetColor("_Color3", color3);
material.SetColor("_Color4", color4);
material.SetFloat("cloud_thickness", cloudThickness);
material.SetFloat("cloud_position", cloudPosition);
material.SetFloat("cloud_freq1", Mathf.Pow(2, cloudFreq1));
material.SetFloat("cloud_freq2", Mathf.Pow(2, cloudFreq2));
material.SetFloat("cloud_freq3", Mathf.Pow(2, cloudFreq3));
material.SetFloat("cloud_freq4", Mathf.Pow(2, cloudFreq4));
material.SetFloat("cloud_freq5", Mathf.Pow(2, cloudFreq5));
material.SetFloat("near1", near1);
material.SetFloat("far1", far1);
material.SetFloat("near2", near2);
material.SetInt("rayIteratorCount", rayIteratorCount);
material.SetInt("debug", debug ? 1 : 0);
if (debug)
material.EnableKeyword ("DEBUG");
else
material.DisableKeyword ("DEBUG");
if (useMipmap)
material.EnableKeyword ("MIPMAP");
else
material.DisableKeyword ("MIPMAP");
if (useMultNoise)
material.EnableKeyword("MULTNOISE");
else
material.DisableKeyword("MULTNOISE");
if (sun != null)
{
Vector3 sun_dir = -sun.transform.forward;
material.SetVector("_SunDirection", new Vector4(sun_dir.x, sun_dir.y, sun_dir.z, 1.0f));
}
material.SetVector("winddir", windDirection);
//if(textureDivideRate != 1)
{
int w = source.width / textureDivideRate;
int h = source.height / textureDivideRate;
RenderTexture tmp1 = RenderTexture.GetTemporary(w, h, 0, source.format);
Graphics.Blit(source, tmp1, material, (int)Pass.VRRenderCloud);
material.SetTexture("_CloudTex", tmp1);
Graphics.Blit(source, destination, material, (int)Pass.VRBlendBg);
RenderTexture.ReleaseTemporary(tmp1);
}
//else
// Graphics.Blit(source, destination, material, (int)Pass.VRRenderCloud);
}
}
}

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

@ -1,264 +0,0 @@
Shader "Hidden/RayCastCloud"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
ZTest Always Cull Off ZWrite Off
Fog { Mode off }
CGINCLUDE
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile __ DEBUG
#pragma multi_compile __ MIPMAP
#pragma multi_compile __ MULTNOISE
#include "UnityCG.cginc"
#include "../RayCast.cginc"
#pragma target 3.0
sampler2D _MainTex;
sampler2D _CloudTex;
sampler2D _CameraDepthTexture;
float3 _SunGlareColor;
float3 _Color1;
float4 _SunSSSColor;
float3 _Color3;
float3 _Color4;
float cloud_thickness;
float cloud_position;
float cloud_freq1;
float cloud_freq2;
float cloud_freq3;
float cloud_freq4;
float cloud_freq5;
float near1;
float far1;
float near2;
int rayIteratorCount;
float4 _SunDirection;
static float3 sundir = normalize( _SunDirection.xyz );
float3 winddir;
float hash( float n ) { return frac(sin(n)*43758.5453); }
float noise( in float3 x )
{
float3 p = floor(x);
float3 f = frac(x);
f = f * f * (3.0 - 2.0 * f);
float n = p.x + p.y * 57.0 + 113.0 * p.z;
float rgx = lerp(lerp( hash(n + 0.0), hash(n + 1.0),f.x), lerp( hash(n + 57.0), hash(n + 58.0),f.x), f.y);
float rgy = lerp(lerp( hash(n + 113.0), hash(n + 114.0),f.x), lerp( hash(n + 170.0), hash(n + 171.0),f.x), f.y);
return -1.0 + 2.0 * lerp(rgx, rgy, f.z);
}
#if MULTNOISE
#define FBM_O1 f += cloud_freq1 * noise( q - winddir * _Time.y ); q = q*2.02;
#define FBM_O2 f += f * cloud_freq2 * noise( q - winddir * _Time.y ); q = q*2.03;
#define FBM_O3 f += f * cloud_freq3 * noise( q - winddir * _Time.y ); q = q*2.01;
#define FBM_O4 f += f * cloud_freq4 * noise( q - winddir * _Time.y ); q = q*2.02;
#define FBM_O5 f += f * cloud_freq5 * noise( q - winddir * _Time.y );
#else
#define FBM_O1 f += cloud_freq1 * noise( q - winddir * _Time.y ); q = q*2.02;
#define FBM_O2 f += cloud_freq2 * noise( q - winddir * _Time.y ); q = q*2.03;
#define FBM_O3 f += cloud_freq3 * noise( q - winddir * _Time.y ); q = q*2.01;
#define FBM_O4 f += cloud_freq4 * noise( q - winddir * _Time.y ); q = q*2.02;
#define FBM_O5 f += cloud_freq5 * noise( q - winddir * _Time.y );
#endif
#define FBM5 FBM_O1 FBM_O2 FBM_O3 FBM_O4 FBM_O5
#define FBM4 FBM_O1 FBM_O2 FBM_O3 FBM_O4
#define FBM3 FBM_O1 FBM_O2 FBM_O3
#define FBM2 FBM_O1 FBM_O2
#define FBM(func) \
float3 q = p; \
q.y -= cloud_position; \
float f = 0; \
func \
return clamp( - abs(p.y - cloud_position) + cloud_thickness + 1.75 * f, 0.0, 1.0 );
float map5( in float3 p ) { FBM(FBM5) }
float map4( in float3 p ) { FBM(FBM4) }
float map3( in float3 p ) { FBM(FBM3) }
float map2( in float3 p ) { FBM(FBM2) }
float4 integrate( in float4 sum, in float dif, in float den, in float3 bgcol, in float t )
{
// lighting
float3 lin = _Color1 * 1.4 + _SunSSSColor.rgb * dif * _SunSSSColor.a;
float4 col = float4( lerp( _Color3, _Color4, den ), den );
col.xyz *= lin;
col.xyz = lerp( col.xyz, bgcol, 1.0 - exp(-0.003*t*t) );
// front to back blending
col.a *= 0.4;
col.rgb *= col.a;
return sum + col*(1.0-sum.a);
}
#if DEBUG
#define DEBUG_DEPTH sum.r = 1;
#else
#define DEBUG_DEPTH
#endif
#define MARCH(STEPS, MAPLOD) \
for(int i=0; i<STEPS; i++) { \
float3 pos = ro + t*rd; \
if( sum.a > 0.99 ) break; \
float depth = toDepth(float4(pos, 1)); \
if( depth > bg_depth ) { DEBUG_DEPTH break; } \
float den = MAPLOD( pos ); \
float den2 = MAPLOD( pos + 0.3*sundir ); \
float dif = clamp((den - den2)/0.3, 0.0, 1.0 ); \
if((t>near1 && t<far1) || t>near2) \
sum = integrate( sum, dif, den, bgcol.rgb, t ); \
t += max(0.05, 0.02 * t); \
}
float4 raymarch( in float3 ro, in float3 rd, in float4 bgcol )
{
float4 sum = float4(0.0,0.0,0.0,0.0);
float bg_depth = bgcol.a;
float t = 0.0;
#if MIPMAP
int count = rayIteratorCount / 5;
MARCH(count * 2, map5);
MARCH(count, map4);
MARCH(count, map3);
MARCH(count, map2);
#else
MARCH(rayIteratorCount, map5);
#endif
return clamp( sum, 0.0, 1.0 );
}
float2 castRay( in float3 ro, in float3 rd )
{
float tmin = 1.0;
float tmax = 20.0;
float precis = 0.002;
float t = tmin;
float m = -1.0;
for( int i=0; i<50; i++ )
{
float3 pos = ro + rd*t;
float d = length(pos) - 0.25;
if( d < precis || t > tmax ) break;
t += d;
m = 1;
}
if( t > tmax ) m=-1.0;
return float2( t, m );
}
float3 renderxx( in float3 ro, in float3 rd )
{
float3 col = float3(0.0, 0.0, 0.);
float2 res = castRay(ro,rd);
float m = res.y;
if( m > -0.5 )
{
col = 0.45 + 0.3 * sin( float3(0.05,0.08,0.10)*(m-1.0) );
}
return float3( clamp(col,0.0,1.0) );
}
float4 frag_vr_cloud(v2f_img i) : SV_Target
{
float bgDepth = LinearEyeDepth(tex2D(_CameraDepthTexture, float2(i.uv.x, i.uv.y)).r);
// camera
float3 ro = _WorldSpaceCameraPos;
float3 rd = getRayDirection(i.uv);
float4 scene_color = tex2D(_MainTex, i.uv);
// clouds
float4 res = raymarch( ro, rd, float4(float3(1.0, 1.0, 1.0), bgDepth) );
//float4 res = raymarch(ro, rd, float4(scene_color.rgb, bgDepth));
// sun glare
float sun = clamp( dot(sundir,rd), 0.0, 1.0 );
res.rgb += 0.2 * _SunGlareColor * pow( sun, 3.0 );
//if(abs(ro.x - _WorldSpaceCameraPos.x) < 0.01 && abs(ro.y - _WorldSpaceCameraPos.y) < 0.01 && abs(ro.z - _WorldSpaceCameraPos.z) < 0.01)
//if(coord.x < 0 && coord.y < 0)
// col.r = 1;
#if defined(DEBUG)
res.rgb += renderxx(ro, rd);
#endif
//if (unity_CameraProjection[0][2] < 0)
//if(abs(left) > abs(right))
//res.rgb = float3(1.0,0.0,0.0);
/*
float4x4 m = unity_CameraProjection;
float near = m[2][3] / (m[2][2] - 1);
float far = m[2][3] / (m[2][2] + 1);
if (near <= far)
res.rgb = float4(1,0,0,1);
else
res.rgb = float4(0, 1, 0, 1);
*/
return res;
}
float4 frag_vr_blendbg(v2f_img i) : SV_Target
{
// camera
float4 scene_color = tex2D(_MainTex, i.uv);
//scene_color = float4(0.0,0.0,0.0,1.0);
// background sky
float3 col = scene_color;
//col = float3(0.6,0.71,0.75) - rd.y*0.2*float3(1.0,0.5,1.0) + 0.15*0.5;
//col += 0.2 * float3(1.0,.6,0.1) * pow( sun, 8.0 );
// clouds
float4 res = tex2D(_CloudTex, float2(i.uv.x, i.uv.y));
col = col * (1.0 - res.a) + res.rgb;
//col = res.rgb;
return float4( col, 1.0 );
}
ENDCG
// (0) VRRenderCloud
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag_vr_cloud
ENDCG
}
// (0) VRBlendBg
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag_vr_blendbg
ENDCG
}
}
FallBack off
}

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c68f8f85d85881c4a944af1d9e082132
timeCreated: 1473478078
licenseType: Pro
ShaderImporter:
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTable: {fileID: 2800000, guid: d8299f844728a6749969d137133dd5f3, type: 3}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

@ -1,57 +0,0 @@
fileFormatVersion: 2
guid: d8299f844728a6749969d137133dd5f3
timeCreated: 1473477971
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: ee580588156d7ad4c9d5d282a16ab52e
folderAsset: yes
timeCreated: 1479281655
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,15 +0,0 @@
using UnityEngine;
using System.Collections;
public class RayCastPointLight : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 8ae3424c2d7572346a9ba89fdbde5b0a
timeCreated: 1479285504
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,63 +0,0 @@
using UnityEngine;
#if UC_VR
using Valve.VR;
#endif
namespace UC
{
public static class RayCastUtils
{
public static void SetupMaterial(Material material/*, Camera camera*/)
{
Camera camera = Camera.current;
#if UC_VR
if (SteamVR.enabled)
{
material.EnableKeyword ("VR");
Matrix4x4 ptt_l = GetSteamVRProjectionMatrix(camera, EVREye.Eye_Left);
Matrix4x4 ptt_r = GetSteamVRProjectionMatrix(camera, EVREye.Eye_Right);
Matrix4x4 ttt_l = GetSteamVREyeToHeadTransform(EVREye.Eye_Left);
ttt_l = transform.localToWorldMatrix * ttt_l;
Matrix4x4 ttt_r = GetSteamVREyeToHeadTransform(EVREye.Eye_Right);
ttt_r = transform.localToWorldMatrix * ttt_r;
material.SetMatrix("_Cam2WorldMatrix_L", ttt_l);
material.SetMatrix("_PVMMatrix_L", ttt_l.inverse);
material.SetMatrix("_Cam2WorldMatrix_R", ttt_r);
material.SetMatrix("_PVMMatrix_R", ttt_r.inverse);
}
else
#endif
{
material.DisableKeyword("VR");
material.SetMatrix("_Cam2WorldMatrix", camera.cameraToWorldMatrix);
material.SetMatrix("_PVMMatrix", camera.projectionMatrix * camera.worldToCameraMatrix);
}
}
#if UC_VR
static Matrix4x4 GetSteamVRProjectionMatrix(Camera cam, EVREye eye)
{
HmdMatrix44_t proj = SteamVR.instance.hmd.GetProjectionMatrix(eye, cam.nearClipPlane, cam.farClipPlane, SteamVR.instance.graphicsAPI);
Matrix4x4 m = new Matrix4x4();
m.m00 = proj.m0; m.m01 = proj.m1; m.m02 = proj.m2; m.m03 = proj.m3;
m.m10 = proj.m4; m.m11 = proj.m5; m.m12 = proj.m6; m.m13 = proj.m7;
m.m20 = proj.m8; m.m21 = proj.m9; m.m22 = proj.m10; m.m23 = proj.m11;
m.m30 = proj.m12; m.m31 = proj.m13; m.m32 = proj.m14; m.m33 = proj.m15;
return m;
}
static Matrix4x4 GetSteamVREyeToHeadTransform(EVREye eye)
{
HmdMatrix34_t input = SteamVR.instance.hmd.GetEyeToHeadTransform(eye);
var m = Matrix4x4.identity;
m.m00 = input.m0; m.m01 = input.m1; m.m02 = input.m2; m.m03 = input.m3;
m.m10 = input.m4; m.m11 = input.m5; m.m12 = input.m6; m.m13 = input.m7;
m.m20 = input.m8; m.m21 = input.m9; m.m22 = input.m10; m.m23 = input.m11;
return m;
}
#endif
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 1730b8add97046d4aa7fadfa7a435cec
timeCreated: 1479280718
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 84b552d6955db07428f008457c3c1d07
folderAsset: yes
timeCreated: 1475809471
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,139 +0,0 @@
using UnityEngine;
using System.Linq.Expressions;
using System;
namespace UC
{
public class Math
{
static public float ofMap(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp = false)
{
#if true
if (Mathf.Abs(inputMin - inputMax) < Mathf.Epsilon)
{
return outputMin;
}
else
{
float outVal = ((value - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin);
if (clamp)
{
if (outputMax < outputMin)
{
if (outVal < outputMax) outVal = outputMax;
else if (outVal > outputMin) outVal = outputMin;
}
else
{
if (outVal > outputMax) outVal = outputMax;
else if (outVal < outputMin) outVal = outputMin;
}
}
return outVal;
}
#else
// unity version
return Mathf.Lerp(outputMin, outputMax, Mathf.InverseLerp(inputMin, inputMax, value));
#endif
}
static public float ofMap(float value, Vector2 inputMinMax, Vector2 outputMinMax, bool clamp = false)
{
return ofMap(value, inputMinMax.x, inputMinMax.y, outputMinMax.x, outputMinMax.y, clamp);
}
////////////////////////////////////////////////////////////////////////////////
public static T2 Convert<T1, T2>(T1 x)
{
ParameterExpression pX = Expression.Parameter(typeof(T1), "x");
UnaryExpression body = Expression.Convert(pX, typeof(T2));
return Expression.Lambda<Func<T1, T2>>(body, pX).Compile()(x);
}
public static T Floor<T>(T x)
{
return Convert<int, T>(Convert<T, int>(x));
}
public static T Negate<T>(T x)
{
ParameterExpression pX = Expression.Parameter(typeof(T), "x");
UnaryExpression body = Expression.Negate(pX);
return Expression.Lambda<Func<T,T>>(body, pX).Compile()(x);
}
////////////////////////////////////////////////////////////////////////////////
public delegate BinaryExpression GeneralOpDel(Expression left, Expression right);
public static R GeneralOp<T, R>(T x, T y, GeneralOpDel expr)
{
ParameterExpression pX = Expression.Parameter(typeof(T), "x");
ParameterExpression pY = Expression.Parameter(typeof(T), "y");
BinaryExpression body = expr(pX, pY);
return Expression.Lambda<Func<T, T, R>>(body, pX, pY).Compile()(x, y);
}
public static T GeneralOp<T>(T x, T y, GeneralOpDel expr)
{
return GeneralOp<T, T>(x, y, expr);
}
public static T Add<T>(T x, T y)
{
return GeneralOp<T>(x, y, Expression.Add);
}
public static T Subtract<T>(T x, T y)
{
return GeneralOp<T>(x, y, Expression.Subtract);
}
public static T Multiply<T>(T x, T y)
{
return GeneralOp<T>(x, y, Expression.Multiply);
}
public static T Divide<T>(T x, T y)
{
return GeneralOp<T>(x, y, Expression.Divide);
}
////////////////////////////////////////////////////////////////////////////////
public static bool LessThan<T>(T x, T y)
{
return GeneralOp<T, bool>(x, y, Expression.LessThan);
}
public static bool LessThanOrEqual<T>(T x, T y)
{
return GeneralOp<T, bool>(x, y, Expression.LessThanOrEqual);
}
public static bool GreaterThan<T>(T x, T y)
{
return GeneralOp<T, bool>(x, y, Expression.GreaterThan);
}
public static bool GreaterThanOrEqual<T>(T x, T y)
{
return GeneralOp<T, bool>(x, y, Expression.GreaterThanOrEqual);
}
////////////////////////////////////////////////////////////////////////////////
public static T Modulo<T>(T x, T y, bool cut_cornors = false)
{
T result = GeneralOp<T>(x, y, Expression.Modulo);
//T result = Subtract(x, Multiply(y, Floor(Divide(x, y))));
if (cut_cornors)
{
T half_y = Divide(y, Convert<int, T>(2));
if (LessThan(result, Negate(half_y)))
result = Add(result, y);
else if (GreaterThanOrEqual(result, half_y))
result = Subtract(result, y);
}
return result;
}
public static float Nearest360(float angle, float comparisonTarget)
{
return angle + Mathf.Round((comparisonTarget - angle) / 360) * 360;
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: d4a9533bd9d64a0409414f6b7286586f
timeCreated: 1475746858
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,427 +0,0 @@
// SimplexNoise for C#
// Author: Heikki Törmälä
//This is free and unencumbered software released into the public domain.
//Anyone is free to copy, modify, publish, use, compile, sell, or
//distribute this software, either in source code form or as a compiled
//binary, for any purpose, commercial or non-commercial, and by any
//means.
//In jurisdictions that recognize copyright laws, the author or authors
//of this software dedicate any and all copyright interest in the
//software to the public domain. We make this dedication for the benefit
//of the public at large and to the detriment of our heirs and
//successors. We intend this dedication to be an overt act of
//relinquishment in perpetuity of all present and future rights to this
//software under copyright law.
//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 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.
//For more information, please refer to <http://unlicense.org/>
using UnityEngine;
namespace SimplexNoise
{
/// <summary>
/// Implementation of the Perlin simplex noise, an improved Perlin noise algorithm.
/// Based loosely on SimplexNoise1234 by Stefan Gustavson <http://staffwww.itn.liu.se/~stegu/aqsis/aqsis-newnoise/>
///
/// </summary>
public class Noise
{
/// <summary>
/// 1D simplex noise
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public static float Generate(float x)
{
int i0 = FastFloor(x);
int i1 = i0 + 1;
float x0 = x - i0;
float x1 = x0 - 1.0f;
float n0, n1;
float t0 = 1.0f - x0*x0;
t0 *= t0;
n0 = t0 * t0 * grad(perm[i0 & 0xff], x0);
float t1 = 1.0f - x1*x1;
t1 *= t1;
n1 = t1 * t1 * grad(perm[i1 & 0xff], x1);
// The maximum value of this noise is 8*(3/4)^4 = 2.53125
// A factor of 0.395 scales to fit exactly within [-1,1]
return 0.395f * (n0 + n1);
}
/// <summary>
/// 2D simplex noise
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public static float Generate(float x, float y)
{
const float F2 = 0.366025403f; // F2 = 0.5*(sqrt(3.0)-1.0)
const float G2 = 0.211324865f; // G2 = (3.0-Math.sqrt(3.0))/6.0
float n0, n1, n2; // Noise contributions from the three corners
// Skew the input space to determine which simplex cell we're in
float s = (x+y)*F2; // Hairy factor for 2D
float xs = x + s;
float ys = y + s;
int i = FastFloor(xs);
int j = FastFloor(ys);
float t = (float)(i+j)*G2;
float X0 = i-t; // Unskew the cell origin back to (x,y) space
float Y0 = j-t;
float x0 = x-X0; // The x,y distances from the cell origin
float y0 = y-Y0;
// For the 2D case, the simplex shape is an equilateral triangle.
// Determine which simplex we are in.
int i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords
if(x0>y0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1)
else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1)
// A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and
// a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where
// c = (3-sqrt(3))/6
float x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords
float y1 = y0 - j1 + G2;
float x2 = x0 - 1.0f + 2.0f * G2; // Offsets for last corner in (x,y) unskewed coords
float y2 = y0 - 1.0f + 2.0f * G2;
// Wrap the integer indices at 256, to avoid indexing perm[] out of bounds
int ii = i % 256;
int jj = j % 256;
// Calculate the contribution from the three corners
float t0 = 0.5f - x0*x0-y0*y0;
if(t0 < 0.0f) n0 = 0.0f;
else {
t0 *= t0;
n0 = t0 * t0 * grad(perm[ii+perm[jj]], x0, y0);
}
float t1 = 0.5f - x1*x1-y1*y1;
if(t1 < 0.0f) n1 = 0.0f;
else {
t1 *= t1;
n1 = t1 * t1 * grad(perm[ii+i1+perm[jj+j1]], x1, y1);
}
float t2 = 0.5f - x2*x2-y2*y2;
if(t2 < 0.0f) n2 = 0.0f;
else {
t2 *= t2;
n2 = t2 * t2 * grad(perm[ii+1+perm[jj+1]], x2, y2);
}
// Add contributions from each corner to get the final noise value.
// The result is scaled to return values in the interval [-1,1].
return 40.0f * (n0 + n1 + n2); // TODO: The scale factor is preliminary!
}
public static float Generate(float x, float y, float z)
{
// Simple skewing factors for the 3D case
const float F3 = 0.333333333f;
const float G3 = 0.166666667f;
float n0, n1, n2, n3; // Noise contributions from the four corners
// Skew the input space to determine which simplex cell we're in
float s = (x+y+z)*F3; // Very nice and simple skew factor for 3D
float xs = x+s;
float ys = y+s;
float zs = z+s;
int i = FastFloor(xs);
int j = FastFloor(ys);
int k = FastFloor(zs);
float t = (float)(i+j+k)*G3;
float X0 = i-t; // Unskew the cell origin back to (x,y,z) space
float Y0 = j-t;
float Z0 = k-t;
float x0 = x-X0; // The x,y,z distances from the cell origin
float y0 = y-Y0;
float z0 = z-Z0;
// For the 3D case, the simplex shape is a slightly irregular tetrahedron.
// Determine which simplex we are in.
int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords
int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords
/* This code would benefit from a backport from the GLSL version! */
if(x0>=y0) {
if(y0>=z0)
{ i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order
else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order
else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order
}
else { // x0<y0
if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } // Z Y X order
else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } // Y Z X order
else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } // Y X Z order
}
// A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z),
// a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and
// a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where
// c = 1/6.
float x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords
float y1 = y0 - j1 + G3;
float z1 = z0 - k1 + G3;
float x2 = x0 - i2 + 2.0f*G3; // Offsets for third corner in (x,y,z) coords
float y2 = y0 - j2 + 2.0f*G3;
float z2 = z0 - k2 + 2.0f*G3;
float x3 = x0 - 1.0f + 3.0f*G3; // Offsets for last corner in (x,y,z) coords
float y3 = y0 - 1.0f + 3.0f*G3;
float z3 = z0 - 1.0f + 3.0f*G3;
// Wrap the integer indices at 256, to avoid indexing perm[] out of bounds
int ii = Mod(i, 256);
int jj = Mod(j, 256);
int kk = Mod(k, 256);
// Calculate the contribution from the four corners
float t0 = 0.6f - x0*x0 - y0*y0 - z0*z0;
if(t0 < 0.0f) n0 = 0.0f;
else {
t0 *= t0;
n0 = t0 * t0 * grad(perm[ii+perm[jj+perm[kk]]], x0, y0, z0);
}
float t1 = 0.6f - x1*x1 - y1*y1 - z1*z1;
if(t1 < 0.0f) n1 = 0.0f;
else {
t1 *= t1;
n1 = t1 * t1 * grad(perm[ii+i1+perm[jj+j1+perm[kk+k1]]], x1, y1, z1);
}
float t2 = 0.6f - x2*x2 - y2*y2 - z2*z2;
if(t2 < 0.0f) n2 = 0.0f;
else {
t2 *= t2;
n2 = t2 * t2 * grad(perm[ii+i2+perm[jj+j2+perm[kk+k2]]], x2, y2, z2);
}
float t3 = 0.6f - x3*x3 - y3*y3 - z3*z3;
if(t3<0.0f) n3 = 0.0f;
else {
t3 *= t3;
n3 = t3 * t3 * grad(perm[ii+1+perm[jj+1+perm[kk+1]]], x3, y3, z3);
}
// Add contributions from each corner to get the final noise value.
// The result is scaled to stay just inside [-1,1]
return 32.0f * (n0 + n1 + n2 + n3); // TODO: The scale factor is preliminary!
}
public static byte[] perm = new byte[512] { 151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,
151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180
};
private static int FastFloor(float x)
{
return (x > 0) ? ((int)x) : (((int)x) - 1);
}
private static int Mod(int x, int m)
{
int a = x % m;
return a < 0 ? a + m : a;
}
private static float grad( int hash, float x )
{
int h = hash & 15;
float grad = 1.0f + (h & 7); // Gradient value 1.0, 2.0, ..., 8.0
if ((h & 8) != 0) grad = -grad; // Set a random sign for the gradient
return ( grad * x ); // Multiply the gradient with the distance
}
private static float grad( int hash, float x, float y )
{
int h = hash & 7; // Convert low 3 bits of hash code
float u = h<4 ? x : y; // into 8 simple gradient directions,
float v = h<4 ? y : x; // and compute the dot product with (x,y).
return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -2.0f*v : 2.0f*v);
}
private static float grad( int hash, float x, float y , float z ) {
int h = hash & 15; // Convert low 4 bits of hash code into 12 simple
float u = h<8 ? x : y; // gradient directions, and compute dot product.
float v = h<4 ? y : h==12||h==14 ? x : z; // Fix repeats at h = 12 to 15
return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v);
}
private static float grad( int hash, float x, float y, float z, float t ) {
int h = hash & 31; // Convert low 5 bits of hash code into 32 simple
float u = h<24 ? x : y; // gradient directions, and compute dot product.
float v = h<16 ? y : z;
float w = h<8 ? z : t;
return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v) + ((h&4) != 0 ? -w : w);
}
private static Vector3 floor(Vector3 v)
{
return new Vector3(Mathf.Floor(v.x), Mathf.Floor(v.y), Mathf.Floor(v.z));
}
private static Vector4 floor(Vector4 v)
{
return new Vector4(Mathf.Floor(v.x), Mathf.Floor(v.y), Mathf.Floor(v.z), Mathf.Floor(v.w));
}
private static Vector3 step(Vector3 a, Vector3 b)
{
float x = a.x < b.x ? 0.0f : 1.0f;
float y = a.y < b.y ? 0.0f : 1.0f;
float z = a.z < b.z ? 0.0f : 1.0f;
return new Vector3(x, y, z);
}
private static Vector3 mod289(Vector3 x)
{
return x - floor(x / 289.0f) * 289.0f;
}
private static Vector4 mod289(Vector4 x)
{
return x - floor(x / 289.0f) * 289.0f;
}
private static Vector4 permute(Vector4 x)
{
return mod289(Vector4.Scale(x * 34.0f + Vector4.one, x));
}
private static Vector4 taylorInvSqrt(Vector4 r)
{
return Vector4.one * 1.79284291400159f - r * 0.85373472095314f;
}
private static Vector4 abs(Vector4 v)
{
return new Vector4(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z), Mathf.Abs(v.w));
}
public static Vector3 snoise_grad(Vector3 v)
{
Vector2 C = new Vector2(1.0f / 6.0f, 1.0f / 3.0f);
float vt = 0.0f;
// First corner
vt = Vector3.Dot(v, new Vector3(C.y, C.y, C.y));
Vector3 i = floor(v + new Vector3(vt, vt, vt));
vt = Vector3.Dot(i, new Vector3(C.x, C.x, C.x));
Vector3 x0 = v - i + new Vector3(vt, vt, vt);
// Other corners
Vector3 g = step(new Vector3(x0.y, x0.z, x0.x), new Vector3(x0.x, x0.y, x0.z));
Vector3 l = Vector3.one - g;
Vector3 i1 = Vector3.Min(g, new Vector3(l.z, l.x, l.y));
Vector3 i2 = Vector3.Max(g, new Vector3(l.z, l.x, l.y));
// x1 = x0 - i1 + 1.0 * C.xxx;
// x2 = x0 - i2 + 2.0 * C.xxx;
// x3 = x0 - 1.0 + 3.0 * C.xxx;
Vector3 x1 = x0 - i1 + Vector3.one * C.x;
Vector3 x2 = x0 - i2 + Vector3.one * C.y;
Vector3 x3 = x0 - Vector3.one * 0.5f;
// Permutations
i = mod289(i); // Avoid truncation effects in permutation
Vector4 p =
permute(permute(permute(Vector4.one * i.z + new Vector4(0.0f, i1.z, i2.z, 1.0f))
+ Vector4.one * i.y + new Vector4(0.0f, i1.y, i2.y, 1.0f))
+ Vector4.one * i.x + new Vector4(0.0f, i1.x, i2.x, 1.0f));
// Gradients: 7x7 points over a square, mapped onto an octahedron.
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
Vector4 j = p - 49.0f * floor(p / 49.0f); // mod(p,7*7)
Vector4 x_ = floor(j / 7.0f);
Vector4 y_ = floor(j - 7.0f * x_); // mod(j,N)
Vector4 x = (x_ * 2.0f + Vector4.one * 0.5f) / 7.0f - Vector4.one;
Vector4 y = (y_ * 2.0f + Vector4.one * 0.5f) / 7.0f - Vector4.one;
Vector4 h = Vector4.one - abs(x) - abs(y);
Vector4 b0 = new Vector4(x.x, x.y, y.x, y.y);
Vector4 b1 = new Vector4(x.z, x.w, y.z, y.w);
//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;
//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;
Vector4 s0 = floor(b0) * 2.0f + Vector4.one;
Vector4 s1 = floor(b1) * 2.0f + Vector4.one;
Vector4 sh = -step(h, Vector4.zero);
Vector4 a0 = new Vector4(b0.x, b0.z, b0.y, b0.w) + Vector4.Scale(new Vector4(s0.x, s0.z, s0.y, s0.w), new Vector4(sh.x, sh.x, sh.y, sh.y));
Vector4 a1 = new Vector4(b1.x, b1.z, b1.y, b1.w) + Vector4.Scale(new Vector4(s1.x, s1.z, s1.y, s1.w), new Vector4(sh.z, sh.z, sh.w, sh.w));
Vector3 g0 = new Vector3(a0.x, a0.y, h.x);
Vector3 g1 = new Vector3(a0.z, a0.w, h.y);
Vector3 g2 = new Vector3(a1.x, a1.y, h.z);
Vector3 g3 = new Vector3(a1.z, a1.w, h.w);
// Normalise gradients
Vector4 norm = taylorInvSqrt(new Vector4(Vector3.Dot(g0, g0), Vector3.Dot(g1, g1), Vector3.Dot(g2, g2), Vector3.Dot(g3, g3)));
g0 *= norm.x;
g1 *= norm.y;
g2 *= norm.z;
g3 *= norm.w;
// Compute gradient of noise function at P
Vector4 m = Vector4.Max(Vector4.one * 0.6f - new Vector4(Vector3.Dot(x0, x0), Vector3.Dot(x1, x1), Vector3.Dot(x2, x2), Vector3.Dot(x3, x3)), Vector4.zero);
Vector4 m2 = Vector4.Scale(m, m);
Vector4 m3 = Vector4.Scale(m2, m);
Vector4 m4 = Vector4.Scale(m2, m2);
Vector3 grad =
-6.0f * m3.x * x0 * Vector3.Dot(x0, g0) + m4.x * g0 +
-6.0f * m3.y * x1 * Vector3.Dot(x1, g1) + m4.y * g1 +
-6.0f * m3.z * x2 * Vector3.Dot(x2, g2) + m4.z * g2 +
-6.0f * m3.w * x3 * Vector3.Dot(x3, g3) + m4.w * g3;
return 42.0f * grad;
}
}
}

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

@ -1,90 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace uc.Math
{
public static class Spline
{
public static class Bezier
{
public static Vector3 Position(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
// (1 - t) ^ 3 * A + 3 * (1 - t) ^ 2 * t * B + 3 * (1 - t) * t ^ 2 * C + t ^ 3 * D
float _1mt = 1.0f - t, _1mt2 = _1mt * _1mt, t2 = t * t;
return p1 * _1mt * _1mt2 + p0 * 3 * _1mt2 * t + p3 * 3 * _1mt * t2 + p2 * t2 * t;
}
public static Vector3 Tangent(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
// -3 * (A * (t - 1) ^ 2 + B * (-3 * t ^ 2 + 4 * t - 1) + t * (3 * C * t - 2 * C - D * t))
float _1mt = 1.0f - t, _1mt2 = _1mt * _1mt, t2 = t * t;
return p1 * -3 * _1mt2 + p0 * (-6 * _1mt * t + 3 * _1mt2) + p3 * (6 * _1mt * t - 3 * t2) + p2 * 3 * t2;
}
public static Vector3 Normal(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
// -6 * (A * (t - 1) + B * (2 - 3 * t) + 3 * C * t - C - D * t)
return -6 * (p1 * (1 - t) + p0 * (2 - 3 * t) + 3 * p3 * t - p3 - p2 * t);
}
}
public static class CatmullRom
{
public static Vector3 Position(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t, t3 = t2 * t;
return p1 * (1.5f * t3 - 2.5f * t2 + 1.0f) + p0 * (-0.5f * t3 + t2 - 0.5f * t) + p3 * (0.5f * t3 - 0.5f * t2) + p2 * (-1.5f * t3 + 2.0f * t2 + 0.5f * t);
}
public static Vector3 Tangent(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t;
return p1 * (4.5f * t - 5.0f) * t + p0 * (-1.5f * t2 + 2.0f * t - 0.5f) + p3 * (1.5f * t - 1.0f) * t + p2 * (-4.5f * t2 + 4.0f * t + 0.5f);
}
public static Vector3 Normal(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
return p1 * (9.0f * t - 5.0f) - p0 * (2.0f - 3.0f * t) + 9.0f * p2 * t + 3.0f * p3 * t + 4.0f * p2 - p3;
}
}
public static class Hermite
{
public static Vector3 Position(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t, t3 = t2 * t;
return p1 * (2 * t3 - 3 * t2 + 1) + p0 * (t3 - 2 * t2 + t) + p3 * (t3 - t2) + p2 * (-2 * t3 + 3 * t2);
}
public static Vector3 Tangent(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t;
return p1 * (6 * t2 - 6 * t) + p0 * (3 * t2 - 4 * t + 1) + p3 * (3 * t2 - 2 * t) + p2 * (-6 * t2 + 6 * t);
}
public static Vector3 Normal(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
return p1 * (12 * t - 6) + p0 * (6 * t - 4) + p3 * (6 * t - 2) + p2 * (-12 * t + 6);
}
}
public static class KochanekBartels
{
public static Vector3 Position(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t, t3 = t2 * t;
return p1 * (2 * t3 - 3 * t2 + 1) + p0 * (t3 - 2 * t2 + t) + p3 * (t3 - t2) + p2 * (-2 * t3 + 3 * t2);
}
public static Vector3 Tangent(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
float t2 = t * t;
return p1 * (6 * t2 - 6 * t) + p0 * (3 * t2 - 4 * t + 1) + p3 * (3 * t2 - 2 * t) + p2 * (-6 * t2 + 6 * t);
}
public static Vector3 Normal(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
{
return p1 * (12 * t - 6) + p0 * (6 * t - 4) + p3 * (6 * t - 2) + p2 * (-12 * t + 6);
}
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 4634d26e6f60d07429348662b44db3fc
timeCreated: 1493890688
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: a3b7986d3b93da547905ac2fe0334e54
folderAsset: yes
timeCreated: 1487312187
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,58 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos
{
class Misc
{
static List<string> commandLineArgs = null;
public static bool GetCommandLineArgument(string arg)
{
string input;
return GetCommandLineArgument(arg, out input);
}
public static bool GetCommandLineArgument(string arg, out string input)
{
if (commandLineArgs == null)
{
commandLineArgs = new List<string>();
string[] args = System.Environment.GetCommandLineArgs();
commandLineArgs.AddRange(args);
}
bool res = false;
input = "";
if (commandLineArgs.Contains(arg))
{
res = true;
int index = commandLineArgs.FindIndex(
delegate (string argument)
{
return (argument == arg);
});
if (index > -1)
{
index++;
if (index < commandLineArgs.Count)
input = commandLineArgs[index];
}
}
return res;
}
public static void Verbose(string module, string msg, int level = 0)
{
msg = string.Format("<b>[{0}]</b> {1}", module, msg);
switch (level)
{
case 0: Debug.Log(msg); break;
case 1: Debug.LogWarning(msg); break;
case 2: Debug.LogError(msg); break;
}
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: a24b6052e504e80489ccf3b20b532928
timeCreated: 1490674521
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,30 +0,0 @@
using UnityEngine;
namespace uc
{
public static class RectExtensions
{
public static Rect FitIntoRect(this Rect rect, Rect target)
{
float srcAspect = rect.width/ rect.height;
float dstAspect = target.width / target.height;
Rect rr = target;
if (srcAspect > dstAspect)
{
float h = rr.height;
rr.height = rr.width / srcAspect;
rr.y += h * 0.5f - rr.height * 0.5f;
}
else
{
float w = rr.width;
rr.width = rr.height * srcAspect;
rr.x += w * 0.5f - rr.width * 0.5f;
}
return rr;
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: bf5bb152fc423e64db5090f416b64c6f
timeCreated: 1493782719
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace uc
{
public static class StringExtention
{
static public int[] ConvertToPageRange(this string str)
{
HashSet<int> col = new HashSet<int>();
string[] ranges = str.Split(',');
foreach(var s in ranges)
{
int page;
if(int.TryParse(s, out page))
{
col.Add(page);
}
else
{
string[] pages = s.Split('-');
int start, end;
if(pages.Length == 2 && int.TryParse(pages[0], out start) && int.TryParse(pages[1], out end))
{
for(int i = start; i<= end; i++)
{
col.Add(i);
}
}
}
}
int[] result = new int[col.Count];
col.CopyTo(result);
return result;
}
static public string GetRelativePath(this string targetPath, string refPath)
{
refPath = Path.GetFullPath(refPath + "/foo").Replace(@"\", @"/");
Uri baseUri = new Uri(refPath);
//Debug.Log("Base Path: " + baseUri);
targetPath = Path.GetFullPath(targetPath).Replace(@"\", @"/");
Uri targetUri = new Uri(targetPath );
//Debug.Log("Target Path: " + targetUri);
Uri relUri = baseUri.MakeRelativeUri(targetUri);
return relUri.ToString().Replace(@"/", @"\");
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: cf99b15c75dc4ea43a5fb11a4c3815a5
timeCreated: 1488942158
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,23 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UC
{
public class TextureUtil
{
public static Texture2D Resize(Texture tex, float downScaleRatio)
{
RenderTexture temp = RenderTexture.GetTemporary((int)(tex.width / downScaleRatio), (int)(tex.height / downScaleRatio), 0, RenderTextureFormat.ARGB32);
Graphics.Blit(tex, temp);
RenderTexture current = RenderTexture.active;
RenderTexture.active = temp;
Texture2D newTex = new Texture2D(temp.width, temp.height, TextureFormat.ARGB32, false);
newTex.ReadPixels(new Rect(0, 0, temp.width, temp.height), 0, 0);
newTex.Apply();
RenderTexture.active = current;
RenderTexture.ReleaseTemporary(temp);
return newTex;
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 07ceb96bd48fe4f4dad1924b87cddc68
timeCreated: 1489721765
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,37 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI;
[RequireComponent(typeof(Canvas))]
public class UCGraphicRaycaster : GraphicRaycaster
{
[SerializeField]
private Camera MonitorCamera;
public bool castMouseOnly = false;
public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
{
if (castMouseOnly && eventData.pointerId != -1)
return;
if (MonitorCamera != null && eventCamera != null)
{
//Debug.Log(eventData.position);
Vector2 position = eventData.position;
position.x /= MonitorCamera.pixelRect.width;
position.y /= MonitorCamera.pixelRect.height;
position.x *= eventCamera.pixelRect.width;
position.y *= eventCamera.pixelRect.height;
eventData.position = position;
//Debug.Log("Screen Size: " + MonitorCamera.pixelRect.width + " " + MonitorCamera.pixelRect.height);
//Debug.Log("Target Size: " + eventCamera.pixelRect.width + " " + eventCamera.pixelRect.height);
//Debug.Log(eventData.position);
}
base.Raycast(eventData, resultAppendList);
}
}

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

@ -1,26 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class UCRaycaster : PhysicsRaycaster {
//put this component in monitor camera, point RaycasterCamera to scene camera
public Camera MonitorCamera;
public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
{
//Debug.Log(eventData.position);
if(MonitorCamera != null)
{
Vector2 position = eventData.position;
position.x /= MonitorCamera.pixelRect.width;
position.y /= MonitorCamera.pixelRect.height;
position.x *= eventCamera.pixelRect.width;
position.y *= eventCamera.pixelRect.height;
eventData.position = position;
//Debug.Log("Screen Size: " + Screen.width + " " + Screen.height);
//Debug.Log("Target Size: " + MonitorCamera.pixelRect.width + " " + MonitorCamera.pixelRect.height);
//Debug.Log(eventData.position);
}
base.Raycast(eventData, resultAppendList);
}
}

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

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 8cc5677c74a0896408c1b411bed7adff
folderAsset: yes
timeCreated: 1490768563
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,63 +0,0 @@
Shader "Unlit/AlphaPremultiplied"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
yFlip ("display name", Int) = 0
}
SubShader
{
Tags { "RenderType"="Opeque" }
LOD 100
Blend One Zero
//Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
int yFlip;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
float2 uv = i.uv;
if (yFlip == 1)
uv = i.uv*float2(1.0, -1.0) + float2(0.0, 1.0);
fixed4 col = tex2D(_MainTex, uv);
col.rgb *= col.a;
return col;
}
ENDCG
}
}
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: ca95743014f24fd49897e12abbe931fc
timeCreated: 1490605733
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: c01ac66c0dd5d40419de5c1c07b5601c
folderAsset: yes
timeCreated: 1482136046
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,292 +0,0 @@
//using Luxgen;
//using System;
//using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
//using System.Linq;
using UnityEngine;
using UnityEngine.Audio;
[ExecuteInEditMode]
public class AudioManager : MonoBehaviour
{
public AudioMixer mixer;
public float minimumTriggingPeriod = 0.2f;
[Header("Volume (dB)")]
[Range(-80.0f, 20.0f)]
public float masterVolume = 0.0f;
[Range(-80.0f, 20.0f)]
public float audioVolume = 0.0f;
[Range(-80.0f, 20.0f)]
public float effectVolume = 0.0f;
public static AudioManager Instance
{
get
{
_instance = FindObjectOfType(typeof(AudioManager)) as AudioManager;
if (_instance == null)
{
GameObject singleton = new GameObject();
_instance = singleton.AddComponent<AudioManager>();
singleton.name = "(singleton) " + typeof(AudioManager).ToString();
DontDestroyOnLoad(singleton);
}
return _instance;
}
}
private static AudioManager _instance;
private Dictionary<AudioSource, float> soundStamps = new Dictionary<AudioSource, float>();
private List<GameObject> removal_list = new List<GameObject>();
public Transform audioPool { get { return _audioPool; } }
public Transform effectAudioPool { get { return _effectAudioPool; } }
public Transform effectAudio { get { return _effectAudio; } }
private Transform _audioPool;
private Transform _effectAudioPool;
private Transform _effectAudio;
//private Dictionary<AudioSource, float> audioVolumes = new Dictionary<AudioSource, float>();
private AudioMixerGroup preEffectAudioGroup;
private AudioMixerGroup preAudioGroup;
Dictionary<AudioSource, Coroutine> SoundfadeRountines = new Dictionary<AudioSource, Coroutine>();
public void Trigger(AudioSource sound)
{
if (sound == null || sound.transform.parent != effectAudioPool)
return;
if (soundStamps.ContainsKey(sound) == false)
{
soundStamps.Add(sound, 0);
}
if (Time.time - soundStamps[sound] > minimumTriggingPeriod)
{
GameObject obj = Instantiate(sound.gameObject, _effectAudio);
AudioSource audio = obj.GetComponent<AudioSource>();
audio.loop = false;
audio.Play();
soundStamps[sound] = Time.time;
}
}
public void Trigger(string audioName)
{
try
{
Trigger(_effectAudioPool.Find(audioName).GetComponent<AudioSource>());
}
catch (Exception)
{
Debug.Log("[AudioManager] Trigger: " + audioName);
}
}
public void FadeIn(string audioName)
{
if(_audioPool.Find(audioName).GetComponent<AudioSource>() != null)
FadeIn(_audioPool.Find(audioName).GetComponent<AudioSource>());
}
public void FadeIn(AudioSource sound)
{
if (sound == null)
return;
if (sound.transform.parent == null)
return;
if (sound.transform.parent != audioPool)
return;
if (SoundfadeRountines.ContainsKey(sound))
{
Coroutine routine = SoundfadeRountines[sound];
SoundfadeRountines.Remove(sound);
StopCoroutine(routine);
}
if (sound.volume != 1)
SoundfadeRountines.Add(sound,StartCoroutine(DoFadeIn(sound)));
if(!sound.isPlaying)
sound.Play();
}
public void Play(AudioSource sound)
{
if (sound.transform.parent != audioPool)
return;
if (sound.isPlaying)
return;
sound.Play();
}
public void Play(string audioName)
{
Play(_effectAudioPool.Find(audioName).GetComponent<AudioSource>());
}
public void Stop(AudioSource sound)
{
if (sound.transform.parent != audioPool)
return;
sound.Stop();
}
public void Stop(string audioName)
{
Stop(_effectAudioPool.Find(audioName).GetComponent<AudioSource>());
}
public void Pause(AudioSource sound)
{
if (sound.transform.parent != audioPool)
return;
if (!sound.isPlaying)
return;
sound.Pause();
}
public void Pause(string audioName)
{
Pause(_effectAudioPool.Find(audioName).GetComponent<AudioSource>());
}
public void FadeOut(string audioName)
{
if (_audioPool.Find(audioName).GetComponent<AudioSource>() != null)
FadeOut(_audioPool.Find(audioName).GetComponent<AudioSource>());
}
public void FadeOut(AudioSource sound)
{
if (sound == null)
return;
if (sound.transform.parent == null)
return;
if (sound.transform.parent != audioPool)
return;
if (!sound.isPlaying)
return;
if (SoundfadeRountines.ContainsKey(sound))
{
Coroutine routine = SoundfadeRountines[sound];
SoundfadeRountines.Remove(sound);
StopCoroutine(routine);
}
if(sound.volume != 0)
SoundfadeRountines.Add(sound, StartCoroutine(DoFadeOut(sound)));
else
sound.Stop();
}
IEnumerator DoFadeOut(AudioSource audio)
{
float volume = audio.volume;
while(volume > 0)
{
volume = Mathf.Clamp(volume-Time.deltaTime, 0,1);
audio.volume = volume;
yield return null;
}
audio.Stop();
if (SoundfadeRountines.ContainsKey(audio))
SoundfadeRountines.Remove(audio);
}
IEnumerator DoFadeIn(AudioSource audio)
{
audio.Play();
float volume = audio.volume;
while (volume < 1)
{
volume = Mathf.Clamp(volume + Time.deltaTime, 0, 1);
audio.volume = volume;
yield return null;
}
if (SoundfadeRountines.ContainsKey(audio))
SoundfadeRountines.Remove(audio);
}
// Use this for initialization
void Awake () {
if (_audioPool == null)
_audioPool = GetChild("Audio Pool");
if (_effectAudioPool == null)
_effectAudioPool = GetChild("Effect Audio Pool");
if (_effectAudio == null)
_effectAudio = GetChild("Effect Audio");
}
Transform GetChild(string name)
{
Transform result = transform.Find(name);
if (result == null)
{
GameObject obj = new GameObject(name);
obj.transform.SetParent(gameObject.transform);
result = obj.transform;
}
return result;
}
private AudioMixerGroup GetMixierGroup(string name)
{
AudioMixerGroup[] groups = mixer.FindMatchingGroups("Master/" + name);
if (groups.Length > 0)
return groups[0];
return null;
}
private void ApplyGroup(Transform trans, AudioMixerGroup group)
{
foreach (Transform t in trans)
{
AudioSource audio = t.GetComponent<AudioSource>();
if (audio != null)
audio.outputAudioMixerGroup = group;
}
}
//float volume = 0;
// Update is called once per frame
void Update () {
//AudioSource[] _audios = (AudioSource[])FindObjectsOfType(typeof(AudioSource));
if (_audioPool == null)
_audioPool = GetChild("Audio Pool");
if (_effectAudioPool == null)
_effectAudioPool = GetChild("Effect Audio Pool");
if (_effectAudio == null)
_effectAudio = GetChild("Effect Audio");
foreach (Transform t in _effectAudio)
{
AudioSource audio = t.GetComponent<AudioSource>();
if (audio.isPlaying == false)
removal_list.Add(t.gameObject);
}
foreach(GameObject obj in removal_list)
Destroy(obj);
removal_list.Clear();
if (mixer != null)
{
mixer.SetFloat("Master", masterVolume);
mixer.SetFloat(_effectAudioPool.name, effectVolume);
mixer.SetFloat(_audioPool.name, audioVolume);
AudioMixerGroup audioGroup = GetMixierGroup(_audioPool.name);
if (audioGroup != preAudioGroup)
{
preAudioGroup = audioGroup;
ApplyGroup(_audioPool, audioGroup);
}
AudioMixerGroup effectAudioGroup = GetMixierGroup(_effectAudioPool.name);
if (effectAudioGroup != preEffectAudioGroup)
{
preEffectAudioGroup = effectAudioGroup;
ApplyGroup(_effectAudioPool, effectAudioGroup);
}
}
/*
float targetVol = LuxgenCore.Instance.isVideoPlaying()?0.0f: 1.0f;
volume += (targetVol - volume) * Mathf.Min(1.0f, Time.deltaTime / 0.5f);
volume = Mathf.Clamp01(volume);
backgroundMusic.volume = volume;
*/
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: ac25fa8ef190b4547b804b606e01c7ad
timeCreated: 1482136393
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5c7ff2ca2c13c5047a29c6f93338325e
folderAsset: yes
timeCreated: 1482139657
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,86 +0,0 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
//-----------------------------------------------------------------------------
// Copyright 2012-2016 RenderHeads Ltd. All rights reserved.
//-----------------------------------------------------------------------------
[CustomEditor(typeof(AudioManager))]
public class AudioManagerEditor : Editor
{
private AudioManager _manager;
//private AudioSource[] _audios;
private List<AudioSource> audioPool = new List<AudioSource>();
private List<AudioSource> others = new List<AudioSource>();
private List<AudioSource> effectAudio = new List<AudioSource>();
private void UpdateMovies()
{
AudioSource[] audios = (AudioSource[])FindObjectsOfType(typeof(AudioSource));
audioPool.Clear();
effectAudio.Clear();
others.Clear();
foreach (AudioSource audio in audios)
{
if(audio.transform.parent == AudioManager.Instance.effectAudioPool)
{
}
else if(audio.transform.parent == AudioManager.Instance.audioPool)
{
audioPool.Add(audio);
}
else if (audio.transform.parent == AudioManager.Instance.effectAudio)
{
effectAudio.Add(audio);
}
else
{
others.Add(audio);
}
}
}
public override bool RequiresConstantRepaint()
{
return true;
}
private void DrawUI(List<AudioSource> audios, bool showLoop = true)
{
foreach (AudioSource audio in audios)
{
GUILayout.BeginHorizontal();
{
if (GUILayout.Button(audio.name))
Selection.activeObject = audio;
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
{
if (showLoop)
audio.loop = GUILayout.Toggle(audio.loop, "loop", GUILayout.ExpandWidth(false));
if(audio!=null&& audio.clip!=null)
GUILayout.HorizontalSlider(audio.time, 0f, audio.clip.length, GUILayout.MinWidth(128f), GUILayout.ExpandWidth(true));
}
GUILayout.EndHorizontal();
}
}
public override void OnInspectorGUI()
{
DrawDefaultInspector();
_manager = (this.target) as AudioManager;
UpdateMovies();
GUI.color = Color.white;
DrawUI(audioPool);
GUI.color = Color.red;
DrawUI(others);
GUI.color = Color.grey;
DrawUI(effectAudio);
if (GUI.changed)
{
EditorUtility.SetDirty(_manager);
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 9cdbb44a18cd03b4fa9c93699fe01698
timeCreated: 1482139667
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 56dd475dde3435345b2c1ed39fad021c
folderAsset: yes
timeCreated: 1481883606
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 80b1557f705e27447aba87775f48b826
folderAsset: yes
timeCreated: 1482401794
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,52 +0,0 @@
using UnityEditor;
using UnityEditor.UI;
using UnityEngine;
using UnityEngine.UI;
public class PinchZoomImageEditor : GraphicEditor
{
private static GameObject getCanvas()
{
if (Selection.activeGameObject)
return Selection.activeGameObject;
Canvas[] canvases = FindObjectsOfType<Canvas>();
foreach (Canvas canvas in canvases)
{
if (canvas.gameObject.activeInHierarchy)
return canvas.gameObject;
}
return null;
}
private static GameObject createCanvas()
{
GameObject result = new GameObject("Canvas");
Canvas canvas = result.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
result.AddComponent<CanvasScaler>();
result.AddComponent<GraphicRaycaster>();
return result;
}
[MenuItem("GameObject/UI/Pinch and Zoom Image", false, 0)]
public static void CreateGameObject()
{
GameObject parent = getCanvas();
if(parent == null)
parent = createCanvas();
RectTransform parentCanvasRenderer = parent.GetComponent<RectTransform>();
if (parentCanvasRenderer)
{
GameObject go = new GameObject("Pinch and Zoom Image");
go.transform.SetParent(parent.transform, false);
go.AddComponent<RectTransform>();
go.AddComponent<RawImage>();
go.AddComponent<PinchZoomImage>();
Selection.activeGameObject = go;
}
else
{
EditorUtility.DisplayDialog("Pinch and Zoom Image", "You must make the Pinch and Zoom Image component as a child of a Canvas.", "Ok");
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 80b2cf623b0803944898c56a784a978d
timeCreated: 1482401942
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,34 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class HomographyCorner : MonoBehaviour
, IDragHandler
{
// [AutoUI]
public Vector2 position;
private RectTransform draggingPlane;
public void OnDrag(PointerEventData eventData)
{
if (eventData.pointerEnter != null && eventData.pointerEnter.transform as RectTransform != null)
draggingPlane = eventData.pointerEnter.transform as RectTransform;
var rt = GetComponent<RectTransform>();
Vector3 globalMousePos;
if (RectTransformUtility.ScreenPointToWorldPointInRectangle(draggingPlane, eventData.position, eventData.pressEventCamera, out globalMousePos))
{
rt.position = globalMousePos;
position = globalMousePos;
//rt.rotation = draggingPlane.rotation;
}
}
public void Update()
{
var rt = GetComponent<RectTransform>();
rt.position = position;
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 4973cf96b5acf2e43a467b215b75b4ed
timeCreated: 1484191806
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,210 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof (RawImage))]
[AddComponentMenu("UI/Pinch and Zoom Image")]
public class PinchZoomImage : MonoBehaviour
,IDragHandler, IPointerDownHandler, IPointerUpHandler
{
[Range(0, 0.1f)]
public float posDuration = 0.05f;
[Range(0, 0.1f)]
public float rotDuration = 0.05f;
[Range(0, 0.1f)]
public float scaleDuration = 0.05f;
public bool isRotation = true;
public bool isScale = true;
private bool simulatedByMouse = false;
public void SetPosition(Vector3 position)
{
target_pos = position;
}
public Vector3 GetPosition()
{
return target_pos;
}
//IDragHandler
public void OnDrag(PointerEventData eventData)
{
//Debug.Log("OnDrag"+Time.time);
pointers[eventData.pointerId] = eventData;
}
//IPointerDownHandler
public void OnPointerDown(PointerEventData eventData)
{
//Debug.Log("OnPointerDown" + Time.time);
if (simulatedByMouse && pointers.Count == 0)
{
Vector3 pos = Camera.main.WorldToScreenPoint(transform.position);
PointerEventData p = new PointerEventData(EventSystem.current);
p.position = new Vector2(pos.x, pos.y);
p.pointerId = -2;
pointers.Add(p.pointerId, p);
}
pointers.Add(eventData.pointerId, eventData);
ResetAnchor();
transform.SetSiblingIndex(transform.childCount - 1);
}
//IPointerUpHandler
public void OnPointerUp(PointerEventData eventData)
{
//Debug.Log("OnPointerUp" + Time.time);
pointers.Remove(eventData.pointerId);
if (simulatedByMouse && pointers.Count == 1)
pointers.Remove(-2);
if (pointers.Count > 0)
ResetAnchor();
}
List<Vector2> GetPositionList()
{
List < Vector2 > result = new List<Vector2>();
foreach (int key in pointers.Keys)
result.Add(pointers[key].position);
return result;
}
private static Vector2 Average(List<Vector2> list)
{
Vector2 sum = Vector2.zero;
foreach (Vector2 v in list)
sum += v;
return sum / list.Count;
}
private static List<Vector2> Substract(List<Vector2> list, Vector2 pos)
{
List<Vector2> result = new List<Vector2>();
foreach (Vector2 v in list)
result.Add(v - pos);
return result;
}
private static float AverageMagnitude(List<Vector2> list)
{
float sum = 0.0f;
foreach (Vector2 v in list)
sum += v.magnitude;
return sum / list.Count;
}
Vector2 getAveragePosition()
{
Vector2 sum = Vector2.zero;
foreach (int key in pointers.Keys)
sum += pointers[key].position;
return sum / pointers.Count;
}
float getAverageDistance(Dictionary<int, Vector2> directions)
{
float sum = 0.0f;
foreach (int key in directions.Keys)
sum += directions[key].magnitude;
return sum / pointers.Count;
}
Dictionary<int, Vector2> getDirection(Vector2 pos)
{
Dictionary<int, Vector2> result = new Dictionary<int, Vector2>();
foreach (int key in pointers.Keys)
{
result.Add(key,pointers[key].position - pos);
}
return result;
}
// Use this for initialization
void Start () {
target_pos = transform.localPosition;
target_q = transform.localRotation;
target_scale = transform.localScale.x;
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.Escape))
Application.Quit();
if (Time.deltaTime == 0)
return;
if (pointers.Count > 0)
{
List<Vector2> pos_list = GetPositionList();
Vector2 pos = Average(pos_list);
List<Vector2> diff_list = Substract(pos_list, pos);
float magnitude = AverageMagnitude(diff_list);
{//translation
Vector3 diff_pos = pos - pre_pos;
target_pos += diff_pos;
vel += (diff_pos / Time.deltaTime - vel) * Mathf.Clamp01(Time.deltaTime / 0.2f);
pre_pos = pos;
}
if (pointers.Count > 1)
{
if (isScale)
{//Scale
target_scale = target_scale * magnitude / pre_magnitude;
pre_magnitude = magnitude;
}
if (isRotation)
{//rotation
Quaternion average = new Quaternion(0, 0, 0, 0);
for(int i=0;i<diff_list.Count; ++i)
{
Quaternion q = Quaternion.FromToRotation(pre_diff_list[i].normalized, diff_list[i].normalized);
average = Quaternion.Slerp(average, q, 1.0f / (i+1));
}
target_q = target_q * average;
pre_diff_list = diff_list;
}
}
}else
{
if (posDuration == 0.0f)
vel = Vector3.zero;
target_pos += vel * Time.deltaTime;
vel *= 0.9f;
}
float pos_step = Mathf.Clamp01(Time.deltaTime / posDuration);
float rot_step = Mathf.Clamp01(Time.deltaTime / rotDuration);
float scale_step = Mathf.Clamp01(Time.deltaTime / scaleDuration);
if (Application.isPlaying == false)
pos_step = rot_step = scale_step = 1.0f;
Vector3 new_pos = Vector3.Lerp(transform.localPosition, target_pos, pos_step); ;
transform.localPosition = new_pos;
transform.localRotation = Quaternion.Slerp(transform.localRotation, target_q, rot_step);
float s = Mathf.Lerp(transform.localScale.x, target_scale, scale_step);
transform.localScale = new Vector3(s, s, 1.0f);
}
private void ResetAnchor()
{
vel = Vector3.zero;
List<Vector2> pos_list = GetPositionList();
//target_pos = transform.localPosition;
pre_pos = Average(pos_list);
pre_diff_list = Substract(pos_list, pre_pos);
pre_magnitude = AverageMagnitude(pre_diff_list);
}
private Dictionary<int, PointerEventData> pointers = new Dictionary<int, PointerEventData>();
private Vector3 target_pos;
private Quaternion target_q;
private float target_scale;
private Vector2 pre_pos;
private List<Vector2> pre_diff_list;
private float pre_magnitude;
private Vector3 vel = Vector3.zero;
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: c66ff6def588e2241978284513b43fbf
timeCreated: 1482312685
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: db89048721068484ca7a5fbcf9aaa1e9
folderAsset: yes
timeCreated: 1481883606
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,112 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1220547611407622}
m_IsPrefabParent: 1
--- !u!1 &1220547611407622
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224344512739690750}
- component: {fileID: 223759608021680112}
- component: {fileID: 114519274925448470}
- component: {fileID: 225469320216416124}
- component: {fileID: 114672983905762182}
m_Layer: 5
m_Name: HomographyUICanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!114 &114519274925448470
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1220547611407622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114672983905762182
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1220547611407622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60a3180518fe8fc40882b16299c524c9, type: 3}
m_Name:
m_EditorClassIdentifier:
show: 0
reset: 0
resolution: {x: 1920, y: 1080}
cornerTexture: {fileID: 10912, guid: 0000000000000000f000000000000000, type: 0}
targetCamera: {fileID: 0}
--- !u!223 &223759608021680112
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1220547611407622}
m_Enabled: 1
serializedVersion: 2
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224344512739690750
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1220547611407622}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 120.426}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!225 &225469320216416124
CanvasGroup:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1220547611407622}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 21b63e0e0dbde2b4faf17de7ec8ecafe
timeCreated: 1484278812
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,475 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1988907300946798}
m_IsPrefabParent: 1
--- !u!1 &1375417688498368
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224304404654938718}
- component: {fileID: 222416422471951090}
- component: {fileID: 114497363132654778}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1385776836887608
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224771551838130780}
- component: {fileID: 222379132636330826}
- component: {fileID: 114638408877394022}
m_Layer: 5
m_Name: Handle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1770507486187224
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224716442535490870}
m_Layer: 5
m_Name: Handle Slide Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1786822305037560
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224149623780144052}
- component: {fileID: 114070796728275784}
- component: {fileID: 222145820159045494}
m_Layer: 5
m_Name: ControllingSlider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1832920880223072
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224888190457128752}
m_Layer: 5
m_Name: Fill Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1942975600783958
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224760222269468330}
- component: {fileID: 222557739596762942}
- component: {fileID: 114063066794886906}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1988907300946798
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224881476561811432}
- component: {fileID: 114515992585136448}
- component: {fileID: 114375785639124602}
m_Layer: 5
m_Name: QuantizedSlider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114063066794886906
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1942975600783958}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, 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_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, 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
--- !u!114 &114070796728275784
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1786822305037560}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -113659843, guid: f70555f144d8491a825f0804e09c671c, 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: 0
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.78431374, g: 0.78431374, b: 0.78431374, 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_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 0}
m_HandleRect: {fileID: 0}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114375785639124602
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988907300946798}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56b403d0c2dc89f42a204970e60c5e1f, type: 3}
m_Name:
m_EditorClassIdentifier:
epsilon: 0.01
step: 1
smoothDuration: 0.2
--- !u!114 &114497363132654778
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1375417688498368}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
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
--- !u!114 &114515992585136448
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988907300946798}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -113659843, guid: f70555f144d8491a825f0804e09c671c, 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.78431374, g: 0.78431374, b: 0.78431374, 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_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 114638408877394022}
m_FillRect: {fileID: 224304404654938718}
m_HandleRect: {fileID: 224771551838130780}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114638408877394022
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1385776836887608}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &222145820159045494
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1786822305037560}
--- !u!222 &222379132636330826
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1385776836887608}
--- !u!222 &222416422471951090
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1375417688498368}
--- !u!222 &222557739596762942
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1942975600783958}
--- !u!224 &224149623780144052
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1786822305037560}
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: 224760222269468330}
m_Father: {fileID: 224881476561811432}
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!224 &224304404654938718
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1375417688498368}
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: 224888190457128752}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224716442535490870
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1770507486187224}
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: 224771551838130780}
m_Father: {fileID: 224881476561811432}
m_RootOrder: 2
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: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224760222269468330
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1942975600783958}
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: 224149623780144052}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224771551838130780
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1385776836887608}
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: 224716442535490870}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224881476561811432
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988907300946798}
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: 224149623780144052}
- {fileID: 224888190457128752}
- {fileID: 224716442535490870}
m_Father: {fileID: 0}
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: 0, y: 0}
m_SizeDelta: {x: 160, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224888190457128752
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1832920880223072}
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: 224304404654938718}
m_Father: {fileID: 224881476561811432}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: -5, y: 0}
m_SizeDelta: {x: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ceb78a3d91912e344a414866f690aee6
timeCreated: 1481883613
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,56 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
public class QuantizedSlider : MonoBehaviour {
public float epsilon = 0.01f;
public float step = 1.0f;
public float smoothDuration = 0.2f;
private Slider slider;
private Slider ctrl_slider;
private float smooth;
private float target;
void copyTransform(GameObject dst, GameObject src)
{
RectTransform srcRect = src.transform as RectTransform;
RectTransform dstRect = dst.transform as RectTransform;
dstRect.anchorMin = srcRect.anchorMin;
dstRect.anchorMax = srcRect.anchorMax;
dstRect.sizeDelta = srcRect.sizeDelta;
dstRect.anchoredPosition = srcRect.anchoredPosition;
}
// Use this for initialization
void Start () {
slider = GetComponent<Slider>();
ctrl_slider = transform.Find("ControllingSlider").GetComponent<Slider>();
ctrl_slider.value = smooth = target = slider.value;
ctrl_slider.minValue = slider.minValue;
ctrl_slider.maxValue = slider.maxValue;
ctrl_slider.onValueChanged.AddListener(OnValueChange);
ctrl_slider.transform.hideFlags = HideFlags.NotEditable;
GameObject handle = Instantiate(slider.handleRect.gameObject, slider.handleRect.parent);
copyTransform(handle, slider.handleRect.gameObject);
ctrl_slider.handleRect = handle.transform as RectTransform;
handle.GetComponent<Image>().color = new Color(1.0f, 0.0f, 0.0f, 0.0f);
handle.transform.hideFlags = HideFlags.NotEditable;
}
void OnValueChange(float f)
{
target = Mathf.Round((ctrl_slider.value - slider.minValue) / step)*step;
target = Mathf.Clamp(target, slider.minValue, slider.maxValue);
}
// Update is called once per frame
void Update () {
float diff = target - smooth;
smooth = Mathf.Abs(diff)<epsilon?target: smooth + (diff) * Mathf.Min(1.0f, Time.deltaTime / smoothDuration);
if(smooth != slider.value)
slider.value = smooth;
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: ed9524d22993a444d98390990215eb7a
timeCreated: 1481883609
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,101 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace UC
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Homography")]
public class ScreenHomography : MonoBehaviour
{
public Color color;
[Range(0.0f, 1.0f)]
public float amount = 0f;
[SerializeField]
private Shader m_Shader;
public Shader shader
{
get
{
if (m_Shader == null)
m_Shader = Shader.Find("Hidden/ScreenHomography");
return m_Shader;
}
}
#if false
public Vector2 resolution;
public Texture cornerTexture;
#endif
private Material m_Material;
public Material material
{
get
{
if (m_Material == null)
m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(shader);
return m_Material;
}
}
private void OnEnable()
{
if (!ImageEffectHelper.IsSupported(shader, true, false, this))
enabled = false;
GetComponent<Camera>().depthTextureMode = DepthTextureMode.DepthNormals;
}
private void OnDisable()
{
if (m_Material != null)
DestroyImmediate(m_Material);
m_Material = null;
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
material.SetColor("blend_color", color);
material.SetFloat("amount", amount);
Graphics.Blit(source, destination, material);
}
#if false
GameObject obj = null;
void Awake()
{
if (Application.isPlaying)
{
var camera = GetComponent<Camera>();
obj = new GameObject();
obj.transform.parent = transform;
obj.name = "Homography";
obj.AddComponent<RectTransform>();
var canvas = obj.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
canvas.targetDisplay = camera.targetDisplay;
obj.AddComponent<GraphicRaycaster>();
obj.AddComponent<CanvasGroup>();
var homo = obj.AddComponent<DoHomography>();
homo.homography = this;
homo.resolution = resolution;
homo.cornerTexture = cornerTexture;
homo.reset = true;
}
}
void OnDestroy()
{
if (obj != null)
{
if (Application.isEditor)
Object.DestroyImmediate(obj);
else
Object.Destroy(obj);
}
}
#endif
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 5a07a830728500b469b1a7e6b0767a78
timeCreated: 1484131011
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: d56714f1a0630ad46ae6229b0cac6d50
folderAsset: yes
timeCreated: 1484278879
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,120 +0,0 @@
Shader "Hidden/ScreenHomography"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
ZTest Always Cull Off ZWrite Off
Fog { Mode off }
CGINCLUDE
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
float4x4 matrixHomo;
float4 textureSize;
sampler2D _MainTex;
float3 blend_color;
float amount;
float Triangular(float f)
{
f = f / 2.0;
if (f < 0.0)
{
return (f + 1.0);
}
else
{
return (1.0 - f);
}
return 0.0;
}
float4 getColor(sampler2D textureSampler, float2 TexCoord)
{
float4 homo = mul(matrixHomo, float4(TexCoord, 0.0f, 1.0f));
float2 tex_coord = homo.xy / homo.w;
if (tex_coord.x < 0.0f || tex_coord.x > 1.0f || tex_coord.y < 0.0f || tex_coord.y > 1.0f)
return float4(0, 0, 0, 1);
else
return tex2D(textureSampler, tex_coord);
}
float4 BiCubic(sampler2D textureSampler, float2 TexCoord)
{
float fWidth = textureSize.x;
float fHeight = textureSize.y;
float texelSizeX = 1.0 / fWidth; //size of one texel
float texelSizeY = 1.0 / fHeight; //size of one texel
float4 nSum = float4(0.0, 0.0, 0.0, 0.0);
float4 nDenom = float4(0.0, 0.0, 0.0, 0.0);
float a = frac(TexCoord.x * fWidth); // get the decimal part
float b = frac(TexCoord.y * fHeight); // get the decimal part
for (int m = -1; m <= 2; m++)
{
for (int n = -1; n <= 2; n++)
{
float4 vecData = getColor(textureSampler,
TexCoord + float2(texelSizeX * float(m),
texelSizeY * float(n)));
float f = Triangular(float(m) - a);
float4 vecCooef1 = float4(f, f, f, f);
float f1 = Triangular(-(float(n) - b));
float4 vecCoeef2 = float4(f1, f1, f1, f1);
nSum = nSum + (vecData * vecCoeef2 * vecCooef1);
nDenom = nDenom + ((vecCoeef2 * vecCooef1));
}
}
return nSum / nDenom;
}
float4 BiLinear(sampler2D textureSampler, float2 TexCoord)
{
float fWidth = textureSize.x;
float fHeight = textureSize.y;
float texelSizeX = 1.0 / fWidth; //size of one texel
float texelSizeY = 1.0 / fHeight; //size of one texel
float4 p0q0 = getColor(textureSampler, TexCoord);
float4 p1q0 = getColor(textureSampler, TexCoord + float2(texelSizeX, 0));
float4 p0q1 = getColor(textureSampler, TexCoord + float2(0, texelSizeY));
float4 p1q1 = getColor(textureSampler, TexCoord + float2(texelSizeX, texelSizeY));
float a = frac(TexCoord.x * fWidth); // Get Interpolation factor for X direction.
// Fraction near to valid data.
float4 pInterp_q0 = lerp(p0q0, p1q0, a); // Interpolates top row in X direction.
float4 pInterp_q1 = lerp(p0q1, p1q1, a); // Interpolates bottom row in X direction.
float b = frac(TexCoord.y * fHeight);// Get Interpolation factor for Y direction.
return lerp(pInterp_q0, pInterp_q1, b); // Interpolate in Y direction.
}
float4 frag(v2f_img i) : SV_Target
{
float4 scene_color = getColor(_MainTex, i.uv);
//scene_color = BiLinear(_MainTex, i.uv);
//scene_color = BiCubic(_MainTex, i.uv);
float3 col = scene_color * (1-amount) + blend_color * amount;
return float4(col, 1.0);
}
ENDCG
// (0) VRRenderCloud
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
ENDCG
}
}
FallBack off
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 1bc0e66a10903904f9a395ab00d5928b
timeCreated: 1484131014
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,113 +0,0 @@
Shader "UI/UCDefault"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
//ZWrite Off
//ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_ALPHACLIP
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
if(color.a == 0)
discard;
return color;
}
ENDCG
}
}
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: d558d354467c1324da31c9920577fcfd
timeCreated: 1489391129
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,110 +0,0 @@
Shader "UC/UI/Add"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha One // SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 670de2f621b2f6f4f8298aa40b9c7efe
timeCreated: 1484648736
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,119 +0,0 @@
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "UI/LinearToGamma"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_ALPHACLIP
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
v2f vert(appdata_t v)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = v.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = v.texcoord;
OUT.color = v.color * _Color;
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
#if !defined(UNITY_COLORSPACE_GAMMA)
//color.a = pow(color.a, 2.2);
color.a = pow(color.a + 0.055, 2.4) / 1.13711896582;
#endif
color.rgb = GammaToLinearSpace(color.rgb);
return color;
}
ENDCG
}
}
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 91ce37ee28b99ce42872f13672016cb1
timeCreated: 1507810020
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,110 +0,0 @@
Shader "UC/UI/Screen"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend OneMinusSrcColor One//SrcAlpha One // SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}

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

@ -1,83 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI_Add
m_Shader: {fileID: 4800000, guid: 670de2f621b2f6f4f8298aa40b9c7efe, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 9609476c2d96ab64db4f40b7d0858aee
timeCreated: 1512016283
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -1,49 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI_Default
m_Shader: {fileID: 4800000, guid: d558d354467c1324da31c9920577fcfd, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 22b99f9bf9d972f4fac66d1a02246b53
timeCreated: 1489391195
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -1,83 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI_Gamma
m_Shader: {fileID: 4800000, guid: 91ce37ee28b99ce42872f13672016cb1, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
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
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 04f29ba755f2a124a92772571b22afb0
timeCreated: 1512016267
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a649188d16116fb42b29143a1d756948
timeCreated: 1482132647
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save