This commit is contained in:
shenjianxing 2025-03-26 14:12:09 +08:00
commit 3dcfe874ff
395 changed files with 25585 additions and 61993 deletions

View File

@ -1,151 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1606901339766124610
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ZMouseCursor
m_Shader: {fileID: 4800000, guid: 0406db5a14f94604a8c57ccfbc9f3b46, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHATEST_ON
- _COLORCOLOR_ON
- _EMISSION
m_InvalidKeywords:
- ETC1_EXTERNAL_ALPHA
- _FLIPBOOKBLENDING_OFF
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- GRABPASS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _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_Ints: []
m_Floats:
- PixelSnap: 0
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ColorMask: 15
- _ColorMode: 4
- _Cull: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EmissionEnabled: 0
- _EnableExternalAlpha: 0
- _FlipbookBlending: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 1
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _Surface: 0
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: deb78dc6bf45226469beb762e95c83e0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,177 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ZStylusBeam
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _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}
- _DetailTex:
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- PixelSnap: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMask: 15
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0.1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EmissionEnabled: 1
- _EnableExternalAlpha: 0
- _EnvironmentReflections: 1
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _InvFade: 1
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 1
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 0.09
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _Strength: 0.2
- _Surface: 0
- _UVSec: 0
- _UseUIAlphaClip: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0}
- _EmissionColor: {r: 0.19800758, g: 0.2594582, b: 0.7100962, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []
--- !u!114 &8780411986509467169
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f5a5dae23fbdd5441859f98c2e85214b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 102b8d56f09b636488d029c21c0cb4a7
folderAsset: yes
timeCreated: 1454691544
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,111 +0,0 @@
fileFormatVersion: 2
guid: 9e62add06c56a1d47aca8ebb7cd7a1d3
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude WebGL: 0
Exclude Win: 0
Exclude Win64: 1
- first:
'': OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: None
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -1,111 +0,0 @@
fileFormatVersion: 2
guid: 8d19c28312d46a54e8d419a2b1c07c16
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude WebGL: 0
Exclude Win: 1
Exclude Win64: 0
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: None
- first:
'': OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -1,363 +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: 1241827237199002}
m_IsPrefabParent: 1
--- !u!1 &1240472787024462
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224717041535614452}
- component: {fileID: 223904860792689590}
- component: {fileID: 114784629252962934}
- component: {fileID: 114063555812110666}
m_Layer: 0
m_Name: ZCanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1241827237199002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4423731972975064}
- component: {fileID: 114533663996865650}
m_Layer: 0
m_Name: ZCameraRig
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1511588161718344
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4668546450119268}
- component: {fileID: 20274956669030512}
m_Layer: 0
m_Name: RightCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1537202479618118
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4056956224095734}
- component: {fileID: 20157938279479636}
- component: {fileID: 81780927811202320}
- component: {fileID: 114223196709495294}
m_Layer: 0
m_Name: ZCamera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1780622745892982
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4204688163907322}
- component: {fileID: 20552003359894790}
m_Layer: 0
m_Name: LeftCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4056956224095734
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1537202479618118}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.59773743}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4204688163907322}
- {fileID: 4668546450119268}
m_Father: {fileID: 4423731972975064}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4204688163907322
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1780622745892982}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4056956224095734}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4423731972975064
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1241827237199002}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 2.1975, z: -2.25}
m_LocalScale: {x: 15, y: 15, z: 15}
m_Children:
- {fileID: 4056956224095734}
- {fileID: 224717041535614452}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4668546450119268
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1511588161718344}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4056956224095734}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &20157938279479636
Camera:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1537202479618118}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.03
far clip plane: 60
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.06
--- !u!20 &20274956669030512
Camera:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1511588161718344}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.03
far clip plane: 60
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 2
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.06
--- !u!20 &20552003359894790
Camera:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1780622745892982}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.03
far clip plane: 60
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 1
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.06
--- !u!81 &81780927811202320
AudioListener:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1537202479618118}
m_Enabled: 1
--- !u!114 &114063555812110666
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240472787024462}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebfbb27e23076ea40973d3f7c13f388d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114223196709495294
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1537202479618118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d868ef3f4aab5a74aa1c0f394895bb33, type: 3}
m_Name:
m_EditorClassIdentifier:
EnableStereo: 1
StereoToMonoDelay: 5
StereoToMonoDuration: 1
StereoRenderMode: 1
_leftCamera: {fileID: 20552003359894790}
_rightCamera: {fileID: 20274956669030512}
--- !u!114 &114533663996865650
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1241827237199002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da65e36522d1e884e8df596e9c90aae5, type: 3}
m_Name:
m_EditorClassIdentifier:
Frame: {fileID: 0}
ViewerScale: 15
--- !u!114 &114784629252962934
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240472787024462}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9881e5cbff7bafb4f98aeddfb99c2cf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!223 &223904860792689590
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240472787024462}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 20157938279479636}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224717041535614452
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240472787024462}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0002713542, y: 0.0002712963, z: 0.0002712963}
m_Children: []
m_Father: {fileID: 4423731972975064}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1920, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 771fb15097bf233438be34de87a54d51
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,96 +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: 1260945026978066}
m_IsPrefabParent: 1
--- !u!1 &1260945026978066
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224939064960161314}
- component: {fileID: 223476893400885874}
- component: {fileID: 114737295439119304}
- component: {fileID: 114387263266815016}
m_Layer: 0
m_Name: ZCanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114387263266815016
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1260945026978066}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebfbb27e23076ea40973d3f7c13f388d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114737295439119304
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1260945026978066}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9881e5cbff7bafb4f98aeddfb99c2cf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!223 &223476893400885874
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1260945026978066}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224939064960161314
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1260945026978066}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0002713542, y: 0.0002712963, z: 0.0002712963}
m_Children: []
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: 1920, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 9d25a7f1cbf3e624d819a1d530f5a7b6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,75 +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: 1257821846236688}
m_IsPrefabParent: 1
--- !u!1 &1257821846236688
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4891547972265758}
- component: {fileID: 114322099233469662}
- component: {fileID: 114199281768559272}
m_Layer: 0
m_Name: ZEventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4891547972265758
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1257821846236688}
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: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114199281768559272
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1257821846236688}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a35d80279c2308a44adc510222f41ffe, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &114322099233469662
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1257821846236688}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7ef5ab800f7b00949a856b846dd2166a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,101 +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: 1939113413139470}
m_IsPrefabParent: 1
--- !u!1 &1116632160792468
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4672684899619346}
- component: {fileID: 114252449844181880}
m_Layer: 0
m_Name: DisplayAligner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1939113413139470
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4305043780963432}
- component: {fileID: 114566111215906162}
m_Layer: 0
m_Name: ZFrame
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4305043780963432
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1939113413139470}
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: 4672684899619346}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4672684899619346
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1116632160792468}
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: 4305043780963432}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114252449844181880
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1116632160792468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52ca74b96d6a7154a8806d62a198c932, type: 3}
m_Name:
m_EditorClassIdentifier:
OverrideAngle: 1
ClampAngle: 0
_angle: 90
MinAngle: 0
MaxAngle: 90
Pivot: 0.5
--- !u!114 &114566111215906162
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1939113413139470}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b20817e9db276aa4182f6e0885aa2ddf, type: 3}
m_Name:
m_EditorClassIdentifier:
ViewerScale: 1

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0aa827687fa31a346aba3909fc52353d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,207 +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: 1887738336402118}
m_IsPrefabParent: 1
--- !u!1 &1281046644252730
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4436908030924874}
- component: {fileID: 114265776425955644}
m_Layer: 0
m_Name: Cursor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1887738336402118
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4598674101387462}
- component: {fileID: 114789069931027486}
m_Layer: 0
m_Name: ZMouse
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1944445212407936
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4588118247177308}
- component: {fileID: 212191648317987634}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4436908030924874
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1281046644252730}
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: 4588118247177308}
m_Father: {fileID: 4598674101387462}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4588118247177308
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1944445212407936}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0002713542, y: 0.0002712963, z: 0.0002712963}
m_Children: []
m_Father: {fileID: 4436908030924874}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4598674101387462
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1887738336402118}
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: 4436908030924874}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114265776425955644
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1281046644252730}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e341d053b31d30643a11f8428803bf2e, type: 3}
m_Name:
m_EditorClassIdentifier:
FlipDuration: 0.1
SnapDuration: 0.05
--- !u!114 &114789069931027486
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1887738336402118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0190ffc646245134f8886a35e7b1a94b, type: 3}
m_Name:
m_EditorClassIdentifier:
EventCamera: {fileID: 0}
Visualization: {fileID: 114265776425955644}
MaxHitDistance: 100
MaxHitRadius: 0
IgnoreMask:
serializedVersion: 2
m_Bits: 0
PriorityMask:
serializedVersion: 2
m_Bits: 0
DefaultCollisionPlane: 1
DefaultDragPolicy: 0
ObjectDragPolicy: 3
UIDragPolicy: 2
ClickTimeThreshold: 0.3
ScrollMetersPerUnit: 0.01
OnObjectEntered:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+CollisionEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnObjectExited:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+CollisionEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnButtonPressed:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+IntEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnButtonReleased:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+IntEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!212 &212191648317987634
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1944445212407936}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_Materials:
- {fileID: 2100000, guid: deb78dc6bf45226469beb762e95c83e0, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 6c9955b02d74366489fa69113ef0f179, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 12, y: 19}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 20ebbb020ae080847917abf80d71991f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,282 +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: 1062594752796354}
m_IsPrefabParent: 1
--- !u!1 &1062594752796354
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4148723506181326}
- component: {fileID: 114919615986479212}
m_Layer: 0
m_Name: ZStylus
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1437910509468862
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4200044430286568}
- component: {fileID: 120121205697902728}
m_Layer: 0
m_Name: Line
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1490941533597796
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4675734179552338}
- component: {fileID: 114653320153453212}
m_Layer: 0
m_Name: Beam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4148723506181326
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1062594752796354}
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: 4675734179552338}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4200044430286568
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1437910509468862}
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: 4675734179552338}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4675734179552338
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1490941533597796}
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: 4200044430286568}
m_Father: {fileID: 4148723506181326}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114653320153453212
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1490941533597796}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54d4133992336d44bb4d832ded1c6309, type: 3}
m_Name:
m_EditorClassIdentifier:
CurveStartPivot: 0.35
EndPointSmoothTime: 0.02
--- !u!114 &114919615986479212
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1062594752796354}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e385489f7775d604c8f29e84df0be6fd, type: 3}
m_Name:
m_EditorClassIdentifier:
EventCamera: {fileID: 0}
Visualization: {fileID: 114653320153453212}
MaxHitDistance: 0.3
MaxHitRadius: 0
IgnoreMask:
serializedVersion: 2
m_Bits: 0
PriorityMask:
serializedVersion: 2
m_Bits: 0
DefaultCollisionPlane: 0
DefaultDragPolicy: 0
ObjectDragPolicy: 1
UIDragPolicy: 2
ClickTimeThreshold: 0.3
ScrollMetersPerUnit: 0.01
OnObjectEntered:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+CollisionEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnObjectExited:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+CollisionEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnButtonPressed:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+IntEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnButtonReleased:
m_PersistentCalls:
m_Calls: []
m_TypeName: GCSeries.Core.Input.ZPointer+IntEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!120 &120121205697902728
LineRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1437910509468862}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RenderingLayerMask: 1
m_Materials:
- {fileID: 2100000, guid: f5a5dae23fbdd5441859f98c2e85214b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 0}
m_Parameters:
serializedVersion: 2
widthMultiplier: 0.001
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 0.0990566, g: 0.47622165, b: 1, a: 1}
key1: {r: 0.09803922, g: 0.4745098, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
generateLightingData: 0
m_UseWorldSpace: 0
m_Loop: 0

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b17d3db327a5f0f41ba7fd54fa984601
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,66 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 02_BasicScene_WithZSpaceSettings
serializedVersion: 6
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_LightmapCompression: 3
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_PVRTiledBaking: 0
m_NumRaysToShootPerTexel: -1
m_RespectSceneVisibilityWhenBakingGI: 0

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 56e815a704bde1746a52f84bf26df880
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 841e2985a52d7aa46933daffd749292e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 02373a160c5ec8c43a5db7e1fe6c9a88
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 24549ecf0845c5e49b7dcab0b738bbd5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9d713209de353ee46a977aaa17b751f7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8a449b10216680f4cb526fdcda0e3195
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,82 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System;
using UnityEngine;
using UnityEngine.UI;
using GCSeries.Core.Sdk;
namespace GCSeries.Core.Samples
{
public class DisplayPropertyPrinter : MonoBehaviour
{
////////////////////////////////////////////////////////////////////////
// Monobehaviour Callbacks
////////////////////////////////////////////////////////////////////////
void Start()
{
this._text = this.gameObject.GetComponent<Text>();
this.UpdateValues();
}
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
public void UpdateValues()
{
this._text.text = "Display Properties\n" +
"\nZProvider" +
"\nDisplayReferenceSize: {0}" +
"\nDisplayReferenceResolution: {1}" +
"\nDisplaySize: {2}" +
"\nDisplayResolution: {3}" +
"\nDisplayMetersPerPixel: {4}" +
"\nDisplayScale: {5}" +
"\nDisplayScaleFactor: {6}" +
"\nWindowSize: {7}" +
"\nWindowSizePixels: {8}" +
"\n\nCurrentDisplay Attributes\n {9}";
this._text.text = string.Format(this._text.text,
ZProvider.DisplayReferenceSize.ToString("N5"),
ZProvider.DisplayReferenceResolution.ToString(),
ZProvider.DisplaySize.ToString("N5"),
ZProvider.DisplayResolution.ToString(),
ZProvider.DisplayMetersPerPixel.ToString("N8"),
ZProvider.DisplayScale.ToString("N5"),
ZProvider.DisplayScaleFactor,
ZProvider.WindowSize.ToString("N8"),
ZProvider.WindowSizePixels.ToString(),
this.DisplayAttributesAsString(ZProvider.CurrentDisplay));
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private string DisplayAttributesAsString(ZDisplay display)
{
string attributeString = "";
foreach (ZDisplayAttribute attribute in
Enum.GetValues(typeof(ZDisplayAttribute)))
{
attributeString += attribute.ToString() + ": " +
display.GetAttribute(attribute) + "\n";
}
return attributeString;
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private ZDisplay _display;
private Text _text;
}
}

View File

@ -1,131 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.EventSystems;
using GCSeries.Core.Input;
namespace GCSeries.Core.Samples
{
public class Draggable :
ZPointerInteractable, IBeginDragHandler, IDragHandler, IEndDragHandler
{
public bool Active = true;
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
public override ZPointer.DragPolicy GetDragPolicy(ZPointer pointer)
{
if (pointer is ZMouse)
{
return ZPointer.DragPolicy.LockToScreenAlignedPlane;
}
if (pointer is ZStylus)
{
return ZPointer.DragPolicy.LockHitPosition;
}
return base.GetDragPolicy(pointer);
}
public virtual void OnBeginDrag(PointerEventData eventData)
{
if (!this.Active) return;
ZPointerEventData pointerEventData = eventData as ZPointerEventData;
if (pointerEventData == null ||
pointerEventData.button != PointerEventData.InputButton.Left)
{
return;
}
Pose pose = pointerEventData.Pointer.EndPointWorldPose;
// Cache the initial grab state.
this._initialGrabOffset =
Quaternion.Inverse(this.transform.rotation) *
(this.transform.position - pose.position);
this._initialGrabRotation =
Quaternion.Inverse(pose.rotation) *
this.transform.rotation;
// If the grabbable object has a rigidbody component,
// mark it as kinematic during the grab.
var rigidbody = this.GetComponent<Rigidbody>();
if (rigidbody != null)
{
this._isKinematic = rigidbody.isKinematic;
rigidbody.isKinematic = true;
}
// Capture pointer events.
pointerEventData.Pointer.CapturePointer(this.gameObject);
}
public virtual void OnDrag(PointerEventData eventData)
{
if (!this.Active) return;
if (_initialGrabOffset == Vector3.zero) return;
ZPointerEventData pointerEventData = eventData as ZPointerEventData;
if (pointerEventData == null ||
pointerEventData.button != PointerEventData.InputButton.Left)
{
return;
}
Pose pose = pointerEventData.Pointer.EndPointWorldPose;
// Update the grab object's rotation.
this.transform.rotation =
pose.rotation * this._initialGrabRotation;
// Update the grab object's position.
this.transform.position =
pose.position +
(this.transform.rotation * this._initialGrabOffset);
}
public virtual void OnEndDrag(PointerEventData eventData)
{
if (!this.Active) return;
ZPointerEventData pointerEventData = eventData as ZPointerEventData;
if (pointerEventData == null ||
pointerEventData.button != PointerEventData.InputButton.Left)
{
return;
}
// Release the pointer.
pointerEventData.Pointer.CapturePointer(null);
// If the grabbable object has a rigidbody component,
// restore its original isKinematic state.
var rigidbody = this.GetComponent<Rigidbody>();
if (rigidbody != null)
{
rigidbody.isKinematic = this._isKinematic;
}
_initialGrabOffset = Vector3.zero;
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private Vector3 _initialGrabOffset = Vector3.zero;
private Quaternion _initialGrabRotation = Quaternion.identity;
private bool _isKinematic = false;
}
}

View File

@ -1,65 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Sdk;
namespace GCSeries.Core.Samples
{
public class MouseEmulatorSample : MonoBehaviour
{
////////////////////////////////////////////////////////////////////////
// Inspector Fields
////////////////////////////////////////////////////////////////////////
public float MaxDistance = 0.1f;
public bool IsEnabled = true;
////////////////////////////////////////////////////////////////////////
// Monobehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void Start()
{
if (ZProvider.IsInitialized)
{
this._mouseEmulator = ZProvider.Context.MouseEmulator;
this.UpdateSettings();
}
else
{
Debug.LogWarning("ZProvider can not initialize.\n" +
"Mouse emulation is unavailable.");
}
}
private void OnValidate()
{
this.UpdateSettings();
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void UpdateSettings()
{
if (this._mouseEmulator != null)
{
this._mouseEmulator.IsEnabled = this.IsEnabled;
this._mouseEmulator.MaxDistance = this.MaxDistance;
}
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
ZMouseEmulator _mouseEmulator;
}
}

View File

@ -1,28 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Samples
{
// Specifying the Script Execution Order is recommended when rotating
// transforms containing a ZFrame or ZCameraRig.
[DefaultExecutionOrder(ZCameraRig.ScriptPriority - 1)]
public class Rotator : MonoBehaviour
{
public Vector3 DegreesPerSecond;
void Update()
{
Vector3 deltaAngles = this.DegreesPerSecond * Time.unscaledDeltaTime;
Vector3 eulerAngles = this.transform.localEulerAngles;
this.transform.localRotation =
Quaternion.Euler(eulerAngles) *
Quaternion.Euler(deltaAngles);
}
}
}

View File

@ -1,109 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.Sdk;
namespace GCSeries.Core.Samples
{
public class StylusVibrationFeedback : MonoBehaviour,
IPointerEnterHandler, IPointerExitHandler
{
////////////////////////////////////////////////////////////////////////
// Inspector Fields
////////////////////////////////////////////////////////////////////////
public VibrationTypeEnum VibrationType;
public float VibrationIntensity;
////////////////////////////////////////////////////////////////////////
// Enumerators
////////////////////////////////////////////////////////////////////////
public enum VibrationTypeEnum
{
Constant,
FastPulse,
MediumPulse,
SlowPulse
}
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void Start()
{
if (ZProvider.IsInitialized)
{
this._stylusTarget = ZProvider.StylusTarget;
this._stylusTarget.IsVibrationEnabled = true;
}
else
{
Debug.LogWarning("ZProvider can not initialize.\n Stylus" +
"vibration and LED light feedback will not be experienced.");
Destroy(this);
}
}
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
public void OnPointerEnter(PointerEventData eventData)
{
this.Vibrate();
}
public void OnPointerExit(PointerEventData eventData)
{
this._stylusTarget.StopVibration();
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void Vibrate()
{
switch (this.VibrationType)
{
case StylusVibrationFeedback.VibrationTypeEnum.Constant:
this._stylusTarget.StartVibration(
1.0f, 0.0f, 100, this.VibrationIntensity);
break;
case StylusVibrationFeedback.VibrationTypeEnum.FastPulse:
this._stylusTarget.StartVibration(
0.1f, 0.1f, 100, this.VibrationIntensity);
break;
case StylusVibrationFeedback.VibrationTypeEnum.MediumPulse:
this._stylusTarget.StartVibration(
0.3f, 0.3f, 100, this.VibrationIntensity);
break;
case StylusVibrationFeedback.VibrationTypeEnum.SlowPulse:
this._stylusTarget.StartVibration(
0.6f, 0.6f, 100, this.VibrationIntensity);
break;
default:
break;
}
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private ZTarget _stylusTarget;
}
}

View File

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

View File

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

View File

@ -1,67 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace GCSeries.Core
{
[CustomEditor(typeof(ZCamera))]
public class ZCameraEditor : Editor
{
////////////////////////////////////////////////////////////////////////
// Editor Callbacks
////////////////////////////////////////////////////////////////////////
public override void OnInspectorGUI()
{
this.InitializeGUIStyles();
this.CheckIsMainCamera();
DrawDefaultInspector();
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void InitializeGUIStyles()
{
if (this._helpBoxStyle == null)
{
this._helpBoxStyle = GUI.skin.GetStyle("HelpBox");
this._helpBoxStyle.richText = true;
}
}
private void CheckIsMainCamera()
{
ZCamera camera = this.target as ZCamera;
// Check whether this is the main camera.
if (!camera.CompareTag("MainCamera"))
{
EditorGUILayout.HelpBox(
"<b>EDITOR:</b> This camera will not render to the " +
"XR Overlay. To enable XR Overlay rendering, please " +
"set this camera's associated tag to <color=#add8e6ff>" +
"MainCamera</color>.",
MessageType.Info);
EditorGUILayout.Space();
}
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private GUIStyle _helpBoxStyle = null;
}
}

View File

@ -1,370 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
using GCSeries.Core.Input;
namespace GCSeries.Core
{
public class ZMenu : MonoBehaviour
{
////////////////////////////////////////////////////////////////////////
// Public Constants
////////////////////////////////////////////////////////////////////////
public const string CreateAllMenuItem =
"GameObject/gcCore/All";
public const string CreateProviderMenuItem =
"GameObject/gcCore/Provider";
public const string CreateFrameMenuItem =
"GameObject/gcCore/Frame";
public const string CreateCameraRigMenuItem =
"GameObject/gcCore/Camera Rig";
public const string CreateStylusMenuItem =
"GameObject/gcCore/Stylus";
public const string CreateMouseMenuItem =
"GameObject/gcCore/Mouse";
public const string CreateCanvasMenuItem =
"GameObject/gcCore/Canvas";
public const string CreateEventSystemMenuItem =
"GameObject/gcCore/Event System";
public const string EnableXROverlayMenuItem =
"GCSeries//Enable XR Overlay";
public const string EnableEyeSwapMenuItem =
"GCSeries//Enable Eye Swap";
////////////////////////////////////////////////////////////////////////
// Menu Item Static Methods
////////////////////////////////////////////////////////////////////////
[MenuItem(CreateAllMenuItem, false, BasePriority)]
static void CreateAll()
{
if (ValidateCreateProvider())
{
CreateProvider();
}
if (FindObjectOfType<ZFrame>() == null)
{
CreateFrame();
}
if (FindObjectOfType<ZCameraRig>() == null)
{
CreateCameraRig();
}
if (ValidateCreateStylus())
{
CreateStylus();
}
if (ValidateCreateMouse())
{
CreateMouse();
}
if (ValidateCreateEventSystem())
{
CreateEventSystem();
}
}
[MenuItem(CreateProviderMenuItem, false, ProviderPriority)]
static void CreateProvider()
{
CreateGameObject<ZProvider>("ZProvider");
}
[MenuItem(CreateProviderMenuItem, true)]
static bool ValidateCreateProvider()
{
return (FindObjectOfType<ZProvider>() == null);
}
[MenuItem(CreateFrameMenuItem, false, ProviderPriority + 1)]
static void CreateFrame()
{
CreateGameObjectFromPrefab<ZFrame>("ZFrame");
}
[MenuItem(CreateCameraRigMenuItem, false, ProviderPriority + 2)]
static void CreateCameraRig()
{
// Create the camera rig.
ZCameraRig cameraRig =
CreateGameObjectFromPrefab<ZCameraRig>("ZCameraRig");
cameraRig.Frame = FindComponent<ZFrame>();
// If a main camera has not been assigned, set the newly
// created camera as the main camera.
if (Camera.main == null)
{
cameraRig.GetComponentInChildren<ZCamera>().tag = "MainCamera";
}
}
[MenuItem(CreateStylusMenuItem, false, InputPriority)]
static void CreateStylus()
{
ZStylus stylus = CreateGameObjectFromPrefab<ZStylus>("ZStylus");
stylus.EventCamera = FindComponent<ZCamera>();
}
[MenuItem(CreateStylusMenuItem, true)]
static bool ValidateCreateStylus()
{
return (FindObjectOfType<ZStylus>() == null);
}
[MenuItem(CreateMouseMenuItem, false, InputPriority + 1)]
static void CreateMouse()
{
ZMouse mouse = CreateGameObjectFromPrefab<ZMouse>("ZMouse");
mouse.EventCamera = FindComponent<ZCamera>();
}
[MenuItem(CreateMouseMenuItem, true)]
static bool ValidateCreateMouse()
{
return (FindObjectOfType<ZMouse>() == null);
}
[MenuItem(CreateCanvasMenuItem, false, UIPriority)]
static void CreateCanvas()
{
// Create the canvas.
Canvas canvas = CreateGameObjectFromPrefab<Canvas>(
"ZCanvas", true, Selection.activeTransform);
canvas.worldCamera = FindComponent<Camera>();
// Create the event system if it doesn't already exist in
// the scene.
if (ValidateCreateEventSystem())
{
CreateGameObjectFromPrefab<EventSystem>("ZEventSystem", false);
}
}
[MenuItem(CreateEventSystemMenuItem, false, EventSystemPriority)]
static void CreateEventSystem()
{
CreateGameObjectFromPrefab<EventSystem>("ZEventSystem");
}
[MenuItem(CreateEventSystemMenuItem, true)]
static bool ValidateCreateEventSystem()
{
return (FindObjectOfType<EventSystem>() == null);
}
[MenuItem(EnableXROverlayMenuItem)]
static void EnableXROverlay()
{
#if UNITY_EDITOR_WIN
bool isEnabled = !EditorPrefs.GetBool(EnableXROverlayMenuItem);
#else
bool isEnabled = false;
#endif
EditorPrefs.SetBool(EnableXROverlayMenuItem, isEnabled);
Menu.SetChecked(EnableXROverlayMenuItem, isEnabled);
#if UNITY_EDITOR_WIN
// Enable/disable the XR Overlay.
if (Application.isPlaying)
{
if (isEnabled)
{
ZOverlay.Enable();
}
else
{
ZOverlay.Disable();
}
}
#endif
}
[MenuItem(EnableXROverlayMenuItem, true)]
static bool ValidateEnableXROverlay()
{
#if UNITY_EDITOR_WIN
bool isValid =
ZProvider.IsInitialized &&
SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11;
// bool isEnabled = EditorPrefs.GetBool(EnableXROverlayMenuItem);
// Menu.SetChecked(EnableXROverlayMenuItem, isValid && isEnabled);
return isValid;
#else
return false;
#endif
}
[MenuItem(EnableEyeSwapMenuItem)]
static void EnableEyeSwap()
{
#if UNITY_EDITOR_WIN
bool isEnabled = !EditorPrefs.GetBool(EnableEyeSwapMenuItem);
#else
bool isEnabled = false;
#endif
EditorPrefs.SetBool(EnableEyeSwapMenuItem, isEnabled);
Menu.SetChecked(EnableEyeSwapMenuItem, isEnabled);
}
[MenuItem(EnableEyeSwapMenuItem, true)]
static bool ValidateEnableEyeSwap()
{
#if UNITY_EDITOR_WIN
bool isValid = ZProvider.IsInitialized;
// bool isEnabled = EditorPrefs.GetBool(EnableEyeSwapMenuItem);
// Menu.SetChecked(EnableEyeSwapMenuItem, isValid && isEnabled);
return isValid;
#else
return false;
#endif
}
////////////////////////////////////////////////////////////////////////
// Private Static Methods
////////////////////////////////////////////////////////////////////////
private static T CreateGameObject<T>(
string name, bool setSelected = true, Transform parent = null)
where T : Component
{
// Create the game object.
GameObject gameObject = new GameObject(name);
gameObject.transform.SetParent(parent);
gameObject.transform.SetAsLastSibling();
// Register this operation with the Unity Editor's undo stack.
Undo.RegisterCreatedObjectUndo(gameObject, $"Create {name}");
// Determine whether to select the newly created Game Object
// in the Unity Inspector window.
if (setSelected)
{
Selection.activeGameObject = gameObject;
}
// Create the specified component.
T component = gameObject.AddComponent<T>();
return component;
}
private static T CreateGameObjectFromPrefab<T>(
string name, bool setSelected = true, Transform parent = null)
where T : Component
{
// Attempt to find a reference to the prefab asset.
GameObject prefab = FindAsset<GameObject>(
$"{name} t:prefab", PrefabAssetRelativePath);
if (prefab == null)
{
Debug.LogError(
$"Failed to create instance of {name}. " +
"Prefab not found.");
return null;
}
// Create an instance of the prefab.
GameObject gameObject = Instantiate(prefab);
gameObject.transform.SetParent(parent);
gameObject.transform.SetAsLastSibling();
gameObject.name = name;
// Register the operation with the Unity Editor's undo stack.
Undo.RegisterCreatedObjectUndo(gameObject, $"Create {name}");
// Determine whether to select the newly created prefab instance
// in the Unity Inspector window.
if (setSelected)
{
Selection.activeGameObject = gameObject;
}
return gameObject.GetComponent<T>();
}
private static T FindComponent<T>() where T : Component
{
T component = null;
// Check the current selection first.
if (Selection.activeGameObject != null)
{
component = Selection.activeGameObject.GetComponent<T>();
}
// Otherwise search the entire scene for the first instance of T.
if (component == null)
{
component = FindObjectOfType<T>();
}
return component;
}
private static T FindAsset<T>(string filter, string relativePath = null)
where T : Object
{
string[] guids = AssetDatabase.FindAssets(filter);
for (int i = 0; i < guids.Length; ++i)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]);
if (string.IsNullOrEmpty(relativePath) ||
assetPath.Contains(relativePath))
{
return (T)AssetDatabase.LoadAssetAtPath(assetPath, typeof(T));
}
}
return null;
}
////////////////////////////////////////////////////////////////////////
// Private Constants
////////////////////////////////////////////////////////////////////////
private const string PrefabAssetRelativePath = "GCSeries/Core/Prefabs";
private const int BasePriority = 10;
private const int ProviderPriority = 100;
private const int InputPriority = 200;
private const int UIPriority = 300;
private const int EventSystemPriority = 400;
}
}

View File

@ -1,193 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEngine;
using GCSeries.Core.Extensions;
using GCSeries.Core.Interop;
namespace GCSeries.Core
{
[InitializeOnLoad]
public static class ZOverlay
{
static ZOverlay()
{
// Register EditorApplication event handlers.
EditorApplication.update -= OnUpdate;
EditorApplication.update += OnUpdate;
EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}
////////////////////////////////////////////////////////////////////////
// Public Static Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Enables the XR Overlay.
/// </summary>
public static void Enable()
{
EditorWindow gameViewWindow =
EditorWindowExtensions.GetGameViewWindow();
// Update the Game View window's title text as an indicator
// that the XR Overlay is enabled.
gameViewWindow.titleContent.text = "Game ";
// Parent the GameView window to the XR Overlay.
// NOTE: A side effect of calling GetWindowHandle() will
// place the associated Editor Window in focus.
ZPlugin.SetXROverlayParentWindowHandle(
gameViewWindow.GetWindowHandle());
// Register XR Overlay callbacks.
ZPlugin.SetXROverlayOnDestroyCallback(
Marshal.GetFunctionPointerForDelegate(s_onDestroyedCallback));
// Initialize the XR Overlay's position and size.
RectInt rect = gameViewWindow.GetClientRect();
ZPlugin.SetXROverlayDimensions(
rect.x, rect.y, rect.width, rect.height);
// Create the XR Overlay.
ZPlugin.CreateXROverlay();
ZPlugin.SetXROverlayEnabled(true);
// Force the application to run in the background while the XR
// Overlay is enabled. This is necessary since upon creation, the
// XR Overlay steals focus from the GameView window and causes
// the application to pause.
Application.runInBackground = true;
}
/// <summary>
/// Disables the XR Overlay.
/// </summary>
public static void Disable()
{
// Restore the Game View window's title text.
EditorWindow gameViewWindow =
EditorWindowExtensions.GetGameViewWindow();
gameViewWindow.titleContent.text = s_gameViewName;
// Restore whether the application was original set to run in
// the background.
Application.runInBackground = s_runInBackground;
// Shut down and destroy the XR Overlay.
ZPlugin.DestroyXROverlay();
}
////////////////////////////////////////////////////////////////////////
// Private Static Methods
////////////////////////////////////////////////////////////////////////
private static void OnUpdate()
{
if (!Application.isPlaying ||
!EditorPrefs.GetBool(ZMenu.EnableXROverlayMenuItem))
{
return;
}
// Check if there is a pending recreate request and if
// so, recreate the XR Overlay.
if (s_recreateRequest)
{
Enable();
s_recreateRequest = false;
}
// If the XR Overlay is active, update it.
if (ZPlugin.IsXROverlayActive())
{
EditorWindow gameViewWindow =
EditorWindowExtensions.GetGameViewWindow();
// Update the XR Overlay's position and size.
RectInt rect = gameViewWindow.GetClientRect();
ZPlugin.SetXROverlayDimensions(
rect.x, rect.y, rect.width, rect.height);
// Update whether the XR Overlay is enabled based on whether
// it is currently overlapped.
bool isGameViewFocused = gameViewWindow.IsFocused();
bool isGameViewOverlapped = gameViewWindow.IsOverlappedBy(
EditorWindow.focusedWindow);
if (isGameViewFocused)
{
ZPlugin.SetXROverlayEnabled(true);
}
else if (isGameViewOverlapped)
{
ZPlugin.SetXROverlayEnabled(false);
}
}
}
private static void OnPlayModeStateChanged(PlayModeStateChange state)
{
// Check if the XR Overlay is enabled.
if (!EditorPrefs.GetBool(ZMenu.EnableXROverlayMenuItem))
{
return;
}
switch (state)
{
case PlayModeStateChange.EnteredPlayMode:
CacheSettings();
Enable();
break;
case PlayModeStateChange.ExitingPlayMode:
Disable();
break;
}
}
private static void CacheSettings()
{
EditorWindow gameViewWindow =
EditorWindowExtensions.GetGameViewWindow();
s_gameViewName = gameViewWindow.titleContent.text;
s_runInBackground = Application.runInBackground;
}
private static void OnDestroyed()
{
// If the XR Overlay was forcibly destroyed (e.g. parent window
// was closed, etc.), queue up a request for the XR Overlay to
// be recreated in the next update.
s_recreateRequest = true;
}
////////////////////////////////////////////////////////////////////////
// Private Static Members
////////////////////////////////////////////////////////////////////////
private delegate void CallbackDelegate();
private static CallbackDelegate s_onDestroyedCallback =
new CallbackDelegate(OnDestroyed);
private static string s_gameViewName = "Game";
private static bool s_recreateRequest = false;
private static bool s_runInBackground = false;
}
}

View File

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

View File

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

View File

@ -1,367 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.Input;
namespace GCSeries.Core.EventSystems
{
[DefaultExecutionOrder(ScriptPriority)]
public class ZInputModule : StandaloneInputModule
{
public const int ScriptPriority = ZProvider.ScriptPriority + 40;
////////////////////////////////////////////////////////////////////////
// BaseInputModule Overrides
////////////////////////////////////////////////////////////////////////
public override bool IsModuleSupported()
{
return true;
}
public override void Process()
{
// Process keyboard events.
bool sentEvent = this.SendUpdateEventToSelectedObject();
if (this.eventSystem.sendNavigationEvents)
{
if (!sentEvent)
{
sentEvent |= this.SendMoveEventToSelectedObject();
}
if (!sentEvent)
{
this.SendSubmitEventToSelectedObject();
}
}
// Fall back to the default logic for processing mouse events if
// no ZMouse pointer is active.
if (!this.IsMousePointerActive())
{
this.ProcessMouseEvent();
}
}
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void Update()
{
// Process events for all currently active pointers.
//
// NOTE: This is being called in Update() instead of Process()
// since we need to ensure that ZCore, ZCamera(s), and
// ZPointer(s) are up-to-date (through an explicitly defined
// script execution order).
this.ProcessPointers();
}
////////////////////////////////////////////////////////////////////////
// Protected Methods
////////////////////////////////////////////////////////////////////////
protected void ProcessPointers()
{
IList<ZPointer> pointers = ZPointer.GetInstances();
for (int i = 0; i < pointers.Count; ++i)
{
this.ProcessPointerEvent(pointers[i]);
}
}
protected void ProcessPointerEvent(ZPointer pointer)
{
for (int i = 0; i < pointer.ButtonCount; ++i)
{
ZPointerEventData eventData = this.GetEventData(pointer, i);
// Process button press/release events.
if (pointer.GetButtonDown(i))
{
this.ProcessButtonPress(eventData);
}
if (pointer.GetButtonUp(i))
{
this.ProcessButtonRelease(eventData);
}
// Process move/scroll events only for the primary button.
if (eventData.button == PointerEventData.InputButton.Left)
{
this.ProcessMove(eventData);
this.ProcessScroll(eventData);
}
// Process drag events.
this.ProcessDrag(eventData);
}
}
protected ZPointerEventData GetEventData(ZPointer pointer, int buttonId)
{
int id = pointer.Id + buttonId;
RaycastResult hitInfo = pointer.HitInfo;
// Attempt to retrieve the pointer event data. If it doesn't exist,
// create it.
ZPointerEventData eventData = null;
if (!this._eventDataCache.TryGetValue(id, out eventData))
{
eventData = new ZPointerEventData(this.eventSystem);
eventData.position = hitInfo.screenPosition;
this._eventDataCache.Add(id, eventData);
}
// Reset the pointer event data before populating it with latest
// information from the pointer.
eventData.Reset();
eventData.Pointer = pointer;
eventData.ButtonId = buttonId;
eventData.IsUIObject =
(hitInfo.gameObject?.GetComponent<RectTransform>() != null);
eventData.Delta3D =
hitInfo.worldPosition -
eventData.pointerCurrentRaycast.worldPosition;
eventData.button = pointer.GetButtonMapping(buttonId);
eventData.delta = hitInfo.screenPosition - eventData.position;
eventData.position = hitInfo.screenPosition;
eventData.scrollDelta = pointer.ScrollDelta;
eventData.pointerCurrentRaycast = hitInfo;
return eventData;
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void ProcessButtonPress(ZPointerEventData eventData)
{
GameObject hitObject = eventData.pointerCurrentRaycast.gameObject;
eventData.eligibleForClick = true;
eventData.delta = Vector2.zero;
eventData.dragging = false;
eventData.useDragThreshold = true;
eventData.pressPosition = eventData.position;
eventData.pointerPressRaycast = eventData.pointerCurrentRaycast;
this.DeselectIfSelectionChanged(hitObject, eventData);
// Attempt to execute pointer down event.
GameObject pressHandler = ExecuteEvents.ExecuteHierarchy(
hitObject, eventData, ExecuteEvents.pointerDownHandler);
// If a pointer down handler could not be found, attempt to
// grab the hit object's pointer click handler as a fallback.
if (pressHandler == null)
{
pressHandler =
ExecuteEvents.GetEventHandler<IPointerClickHandler>(
hitObject);
}
// Determine the click count.
float time = Time.unscaledTime;
if (pressHandler == eventData.lastPress)
{
float timeSincePress = time - eventData.clickTime;
eventData.clickCount =
(timeSincePress < eventData.Pointer.ClickTimeThreshold) ?
eventData.clickCount + 1 : 1;
}
else
{
eventData.clickCount = 1;
}
// Update the event data's press/click information.
eventData.clickTime = time;
eventData.rawPointerPress = hitObject;
eventData.pointerPress = pressHandler;
eventData.pointerDrag =
ExecuteEvents.GetEventHandler<IDragHandler>(hitObject);
if (eventData.pointerDrag != null)
{
ExecuteEvents.Execute(
eventData.pointerDrag,
eventData,
ExecuteEvents.initializePotentialDrag);
}
}
private void ProcessButtonRelease(ZPointerEventData eventData)
{
GameObject hitObject = eventData.pointerCurrentRaycast.gameObject;
float timeSincePress = Time.unscaledTime - eventData.clickTime;
// Execute pointer up event.
ExecuteEvents.Execute(
eventData.pointerPress,
eventData,
ExecuteEvents.pointerUpHandler);
GameObject clickHandler =
ExecuteEvents.GetEventHandler<IPointerClickHandler>(hitObject);
// Execute pointer click and drop events.
if (eventData.eligibleForClick &&
(eventData.pointerPress == clickHandler ||
timeSincePress < eventData.Pointer.ClickTimeThreshold))
{
ExecuteEvents.Execute(
eventData.pointerPress,
eventData,
ExecuteEvents.pointerClickHandler);
}
else if (eventData.pointerDrag != null)
{
ExecuteEvents.ExecuteHierarchy(
hitObject, eventData, ExecuteEvents.dropHandler);
}
// Reset the event data's press/click information.
eventData.eligibleForClick = false;
eventData.pointerPress = null;
eventData.rawPointerPress = null;
// Execute end drag event.
if (eventData.pointerDrag != null && eventData.dragging)
{
ExecuteEvents.Execute(
eventData.pointerDrag,
eventData,
ExecuteEvents.endDragHandler);
}
// Reset the event data's drag information.
eventData.dragging = false;
eventData.pointerDrag = null;
// Redo pointer enter/exit to refresh state.
if (hitObject != eventData.pointerEnter)
{
this.HandlePointerExitAndEnter(eventData, null);
this.HandlePointerExitAndEnter(eventData, hitObject);
}
}
// NOTE: The base ProcessDrag() implementation was originally
// being used until there was a need to determine if the input
// device's 3D position is changing as well as having the ability
// to associate input scrolling with movement (e.g. scrolling
// moves mouse input in the Z direction). So, reimplementing this
// here to account for 3D movement and scrolling.
private void ProcessDrag(ZPointerEventData eventData)
{
bool isPointerActive =
eventData.IsPointerMoving3D() || eventData.IsScrolling();
bool shouldStartDrag =
!eventData.IsUIObject ||
!eventData.useDragThreshold ||
this.ShouldStartDrag(
eventData.pressPosition,
eventData.position,
eventSystem.pixelDragThreshold);
// Execute drag begin event.
if (shouldStartDrag &&
eventData.pointerDrag != null &&
!eventData.dragging)
{
ExecuteEvents.Execute(
eventData.pointerDrag,
eventData,
ExecuteEvents.beginDragHandler);
eventData.dragging = true;
}
// Execute drag event.
if (eventData.dragging &&
isPointerActive &&
eventData.pointerDrag != null)
{
// Before performing a drag, cancel any pointer down state
// and clear the current selection.
if (eventData.pointerPress != eventData.pointerDrag)
{
ExecuteEvents.Execute(
eventData.pointerPress,
eventData,
ExecuteEvents.pointerUpHandler);
eventData.eligibleForClick = false;
eventData.pointerPress = null;
eventData.rawPointerPress = null;
}
ExecuteEvents.Execute(
eventData.pointerDrag,
eventData,
ExecuteEvents.dragHandler);
}
}
private void ProcessScroll(ZPointerEventData eventData)
{
if (!Mathf.Approximately(eventData.scrollDelta.sqrMagnitude, 0))
{
GameObject hitObject =
eventData.pointerCurrentRaycast.gameObject;
GameObject scrollHandler =
ExecuteEvents.GetEventHandler<IScrollHandler>(hitObject);
ExecuteEvents.ExecuteHierarchy(
scrollHandler, eventData, ExecuteEvents.scrollHandler);
}
}
private bool IsMousePointerActive()
{
IList<ZPointer> pointers = ZPointer.GetInstances();
return pointers.Any(p => p is ZMouse);
}
private bool ShouldStartDrag(
Vector2 pressPosition, Vector2 currentPosition, float threshold)
{
Vector2 deltaPosition = (pressPosition - currentPosition);
return deltaPosition.sqrMagnitude >= (threshold * threshold);
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private Dictionary<int, ZPointerEventData> _eventDataCache =
new Dictionary<int, ZPointerEventData>();
}
}

View File

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

View File

@ -1,54 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.Input;
namespace GCSeries.Core.EventSystems
{
public class ZPointerEventData : PointerEventData
{
public ZPointerEventData(EventSystem eventSystem)
: base(eventSystem)
{
}
/// <summary>
/// A reference to the pointer responsible for dispatching
/// the pointer event.
/// </summary>
public ZPointer Pointer { get; set; } = null;
/// <summary>
/// The event's associated pointer button id.
/// </summary>
public int ButtonId { get; set; } = -1;
/// <summary>
/// The pointer's 3D position delta since the last update.
/// </summary>
public Vector3 Delta3D { get; set; } = Vector3.zero;
/// <summary>
/// Is the pointer event in regards to a UI Object
/// </summary>
public bool IsUIObject { get; set; } = false;
/// <summary>
/// Checks whether the pointer is moving based on its 3D position delta.
/// </summary>
///
/// <returns>
/// True if the pointer is moving. False otherwise.
/// </returns>
public bool IsPointerMoving3D()
{
return (this.Delta3D.sqrMagnitude > 0);
}
}
}

View File

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

View File

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

View File

@ -1,135 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class CameraExtensions
{
/// <summary>
/// Makes this camera's settings match the other camera.
/// </summary>
///
/// <remarks>
/// This will copy all camera variables (field of view, clear flags,
/// culling mask, etc.) from the other camera.
///
/// Additionally it will copy the other camera's stereo projection
/// matrix to this camera's mono/stereo projection matrices and set
/// the stereo target eye based on the specified eye.
/// </remarks>
///
/// <param name="other">
/// The camera to copy settings from.
/// </param>
/// <param name="eye">
/// The stereo target eye to copy the projection matrix from.
/// </param>
public static void CopyFrom(
this Camera c, Camera other, Camera.StereoscopicEye eye)
{
c.CopyFrom(other);
c.projectionMatrix = c.GetStereoProjectionMatrix(eye);
switch (eye)
{
case Camera.StereoscopicEye.Left:
c.stereoTargetEye = StereoTargetEyeMask.Left;
break;
case Camera.StereoscopicEye.Right:
c.stereoTargetEye = StereoTargetEyeMask.Right;
break;
}
}
/// <summary>
/// Renders the camera to the specified target texture.
/// </summary>
///
/// <param name="targetTexture">
/// The target texture to render to.
/// </param>
public static void Render(
this Camera c, RenderTexture targetTexture)
{
RenderTexture originalTargetTexture = c.targetTexture;
{
c.targetTexture = targetTexture;
c.Render();
}
c.targetTexture = originalTargetTexture;
}
/// <summary>
/// Renders the camera to the specified target texture.
/// </summary>
///
/// <remarks>
/// The specified target eye will determine which projection matrix
/// to use when rendering. For example, if the eye is set to
/// Camera.StereoscopicEye.Left, the camera will use its left eye
/// stereo projection matrix.
/// </remarks>
///
/// <param name="targetTexture">
/// The target texture to render to.
/// </param>
/// <param name="eye">
/// The target eye to render the perspective from.
/// </param>
public static void Render(
this Camera c,
RenderTexture targetTexture,
Camera.StereoscopicEye eye)
{
Matrix4x4 originalProjectionMatrix = c.projectionMatrix;
{
c.projectionMatrix = c.GetStereoProjectionMatrix(eye);
c.Render(targetTexture);
}
c.projectionMatrix = originalProjectionMatrix;
}
/// <summary>
/// Renders the camera to the specified target texture.
/// </summary>
///
/// <remarks>
/// The specified target eye will determine which projection matrix
/// to use when rendering. For example, if the eye is set to
/// Camera.StereoscopicEye.Left, the camera will use its left eye
/// stereo projection matrix.
///
/// Additionally, the specified pose corresponds to the desired world
/// pose to render the camera perspective from.
/// </remarks>
///
/// <param name="targetTexture">
/// The target texture to render to.
/// </param>
/// <param name="eye">
/// The target eye to render the perspective from.
/// </param>
/// <param name="pose">
/// The world pose to render the perspective from.
/// </param>
public static void Render(
this Camera c,
RenderTexture targetTexture,
Camera.StereoscopicEye eye,
Pose pose)
{
Pose originalPose = c.transform.ToPose();
{
c.transform.SetPose(pose);
c.Render(targetTexture, eye);
}
c.transform.SetPose(originalPose);
}
}
}

View File

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

View File

@ -1,326 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using GCSeries.Core.Interop;
namespace GCSeries.Core.Extensions
{
public static class EditorWindowExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Static Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Checks whether the GameView editor window is open.
/// </summary>
///
/// <returns>
/// True if the GameView editor window is open. False otherwise.
/// </returns>
public static bool IsGameViewWindowOpen()
{
// Lazy initialization of the GameView editor window type.
if (s_gameViewType == null)
{
Assembly assembly = typeof(EditorWindow).Assembly;
s_gameViewType = assembly.GetType("UnityEditor.GameView");
}
EditorWindow[] gameViewWindows =
(EditorWindow[])Resources.FindObjectsOfTypeAll(s_gameViewType);
return (gameViewWindows.Length > 0);
}
/// <summary>
/// Gets the first available instance of the GameView editor window.
/// </summary>
///
/// <remarks>
/// If the GameView editor window is closed, invoking this method
/// will open it.
/// </remarks>
///
/// <returns>
/// A reference to the GameView editor window.
/// </returns>
public static EditorWindow GetGameViewWindow()
{
if (s_gameViewWindow != null)
{
return s_gameViewWindow;
}
// Lazy initialization of the GameView editor window type.
if (s_gameViewType == null)
{
Assembly assembly = typeof(EditorWindow).Assembly;
s_gameViewType = assembly.GetType("UnityEditor.GameView");
}
// Grab the GameView editor window.
s_gameViewWindow = EditorWindow.GetWindow(
s_gameViewType, false, null, false);
return s_gameViewWindow;
}
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Checks whether the editor window is docked.
/// </summary>
///
/// <returns>
/// True if the editor window is docked. False otherwise.
/// </returns>
public static bool IsDocked(this EditorWindow window)
{
// Lazy initialization of EditorWindow docked method info.
if (s_dockedMethodInfo == null)
{
BindingFlags bindingFlags =
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.Static;
PropertyInfo dockedPropertyInfo =
typeof(EditorWindow).GetProperty("docked", bindingFlags);
s_dockedMethodInfo = dockedPropertyInfo.GetGetMethod(true);
}
// Invocation of EditorWindow docked property.
return (bool)s_dockedMethodInfo.Invoke(window, null);
}
/// <summary>
/// Checks whether the editor window has keyboard focus.
/// </summary>
///
/// <returns>
/// True if the editor window has keyboard focus. False otherwise.
/// </returns>
public static bool IsFocused(this EditorWindow window)
{
return (window == EditorWindow.focusedWindow);
}
/// <summary>
/// Checks whether the editor window is overlapped by another
/// editor window.
/// </summary>
///
/// <param name="other">
/// The other editor window to be used in the overlap check.
/// </param>
///
/// <returns>
/// True if the editor window is overlapped. False otherwise.
/// </returns>
public static bool IsOverlappedBy(
this EditorWindow window, EditorWindow other)
{
if (other == null || window == other)
{
return false;
}
if (!window.IsDocked() || window.IsFocused())
{
return false;
}
return other.GetRect().Overlaps(window.GetRect());
}
/// <summary>
/// Gets the editor window's associated native window handle.
/// </summary>
///
/// <remarks>
/// A side effect of the current implementation causes the
/// associated editor window to gain keyboard focus.
/// </remarks>
///
/// <returns>
/// The editor window's associated native window handle.
/// </returns>
public static IntPtr GetWindowHandle(this EditorWindow window)
{
#if UNITY_EDITOR_WIN
// Focus the window.
window.Focus();
// Return the window handle of the focused window.
return Win32.GetFocus();
#else
return IntPtr.Zero;
#endif
}
/// <summary>
/// Gets the editor window's virtual desktop position and size
/// in pixels.
/// </summary>
///
/// <remarks>
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the position and size accordingly.
/// </remarks>
///
/// <returns>
/// The editor window's position and size in pixels.
/// </returns>
public static RectInt GetRect(this EditorWindow window)
{
return new RectInt(window.GetPosition(), window.GetSize());
}
/// <summary>
/// Gets the editor window client area's position and size in pixels.
/// </summary>
///
/// <remarks>
/// The position is relative to the top-left virtual desktop position
/// of its corresponding window.
///
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the position and size accordingly.
/// </remarks>
///
/// <returns>
/// The editor window client area's position and size in pixels.
/// </returns>
public static RectInt GetClientRect(this EditorWindow window)
{
Vector2Int size = window.GetSize();
// HACK: Subtract 1 pixel from the height for more precise
// alignment and sizing (features such as the XR Overlay
// depend on this).
return new RectInt(
window.GetBorderWidth(),
window.GetTabHeight(),
size.x,
size.y - 1);
}
/// <summary>
/// Gets the editor window's virtual desktop position in pixels.
/// </summary>
///
/// <remarks>
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the position accordingly.
/// </remarks>
///
/// <returns>
/// The editor window's virtual desktop position in pixels.
/// </returns>
public static Vector2Int GetPosition(this EditorWindow window)
{
return new Vector2Int(
(int)window.position.x + window.GetBorderWidth(),
(int)window.position.y + window.GetTabHeight());
}
/// <summary>
/// Gets the editor window's size in pixels.
/// </summary>
///
/// <remarks>
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the size accordingly.
/// </remarks>
///
/// <returns>
/// The editor window's size in pixels.
/// </returns>
public static Vector2Int GetSize(this EditorWindow window)
{
return new Vector2Int(
(int)window.position.width,
(int)window.position.height - ExcessHeight);
}
/// <summary>
/// Gets the width of the editor window's side border in pixels.
/// </summary>
///
/// <remarks>
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the border width accordingly.
/// </remarks>
///
/// <returns>
/// The width of the editor window's side border in pixels.
/// </returns>
public static int GetBorderWidth(this EditorWindow window)
{
int borderWidth = window.IsDocked() ?
BorderWidthDocked : BorderWidthUndocked;
return borderWidth;
}
/// <summary>
/// Gets the height of the editor window's top tab in pixels.
/// </summary>
///
/// <remarks>
/// This method accounts for whether the editor window is docked
/// or undocked and adjusts the tab height accordingly.
/// </remarks>
///
/// <returns>
/// The height of the editor window's top tab in pixels.
/// </returns>
public static int GetTabHeight(this EditorWindow window)
{
int tabHeight = window.IsDocked() ?
TabHeightDocked : TabHeightUndocked;
return tabHeight;
}
////////////////////////////////////////////////////////////////
// Private Constants
////////////////////////////////////////////////////////////////
// NOTE: The following constants are subject to change depending on
// the Unity version.
private const int BorderWidthDocked = 2;
private const int BorderWidthUndocked = 0;
private const int TabHeightDocked = 36;
private const int TabHeightUndocked = 40;
private const int ExcessHeight = 17;
////////////////////////////////////////////////////////////////
// Private Static Members
////////////////////////////////////////////////////////////////
private static Type s_gameViewType = null;
private static EditorWindow s_gameViewWindow = null;
private static MethodInfo s_dockedMethodInfo = null;
}
}
#endif // UNITY_EDITOR

View File

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

View File

@ -1,35 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Interop;
namespace GCSeries.Core.Extensions
{
public static class FrustumPlanesExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Converts Unity's FrustumPlanes data structure to the
/// SDK's ZFrustumBounds data structure.
/// </summary>
///
/// <returns>
/// ZFrustumBounds initialized based on the current state of
/// the FrustumPlanes.
/// </returns>
public static ZFrustumBounds ToZFrustumBounds(this FrustumPlanes f)
{
return new ZFrustumBounds(
f.left, f.right, f.bottom, f.top, f.zNear, f.zFar);
}
}
}

View File

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

View File

@ -1,99 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class LineRendererExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Update the positions of the line renderer to comform to
/// a quadratic bezier curve based on the specified control points.
/// </summary>
///
/// <param name="p0">
/// First control point defining the quadratic bezier curve.
/// </param>
/// <param name="p1">
/// Second control point defining the quadratic bezier curve.
/// </param>
/// <param name="p2">
/// Third control point defining the quadratic bezier curve.
/// </param>
public static void SetBezierCurve(
this LineRenderer l, Vector3 p0, Vector3 p1, Vector3 p2)
{
l.SetBezierCurve(0, l.positionCount, p0, p1, p2);
}
/// <summary>
/// Update the positions of the line renderer (defined by the specified
/// start index) to comform to a quadratic bezier curve based on the
/// specified control points.
/// </summary>
///
/// <param name="startIndex">
/// The index of the first position to update.
/// </param>
/// <param name="p0">
/// First control point defining the quadratic bezier curve.
/// </param>
/// <param name="p1">
/// Second control point defining the quadratic bezier curve.
/// </param>
/// <param name="p2">
/// Third control point defining the quadratic bezier curve.
/// </param>
public static void SetBezierCurve(this LineRenderer l,
int startIndex, Vector3 p0, Vector3 p1, Vector3 p2)
{
l.SetBezierCurve(startIndex, l.positionCount - startIndex, p0, p1, p2);
}
/// <summary>
/// Update the positions of the line renderer (defined by the specified
/// start index and length) to comform to a quadratic bezier curve
/// based on the specified control points.
/// </summary>
///
/// <param name="startIndex">
/// The index of the first position to update.
/// </param>
/// <param name="length">
/// The number of positions to update.
/// </param>
/// <param name="p0">
/// First control point defining the quadratic bezier curve.
/// </param>
/// <param name="p1">
/// Second control point defining the quadratic bezier curve.
/// </param>
/// <param name="p2">
/// Third control point defining the quadratic bezier curve.
/// </param>
public static void SetBezierCurve(this LineRenderer l,
int startIndex, int length, Vector3 p0, Vector3 p1, Vector3 p2)
{
float t = 0;
float step = 1 / (float)(length - 1);
for (int i = startIndex; i < startIndex + length; ++i)
{
Vector3 position =
Vector3Extensions.ComputePointOnBezierCurve(p0, p1, p2, t);
l.SetPosition(i, position);
t += step;
}
}
}
}

View File

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

View File

@ -1,157 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Interop;
namespace GCSeries.Core.Extensions
{
public static class Matrix4x4Extensions
{
////////////////////////////////////////////////////////////////////////
// Public Static Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Performs linear interpolation between two Matrix4x4s.
/// </summary>
///
/// <param name="from">
/// The Matrix4x4 start point to interpolate from.
/// </param>
/// <param name="to">
/// The Matrix4x4 end point to interpolate to.
/// </param>
/// <param name="t">
/// Normalized time specified between 0 and 1 (inclusive).
/// </param>
///
/// <returns>
/// The interpolated Matrix4x4 value.
/// </returns>
public static Matrix4x4 Lerp(Matrix4x4 from, Matrix4x4 to, float t)
{
Vector3 position =
Vector3.Lerp(from.GetColumn(3), to.GetColumn(3), t);
Quaternion rotation =
Quaternion.Lerp(from.rotation, to.rotation, t);
return Matrix4x4.TRS(position, rotation, Vector3.one);
}
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Performs linear interpolation between the current
/// and specified Matrix4x4s.
/// </summary>
///
/// <param name="to">
/// The Matrix4x4 end point to interpolate to.
/// </param>
/// <param name="t">
/// Normalized time specified between 0 and 1 (inclusive).
/// </param>
///
/// <returns>
/// The interpolated Matrix4x4 value.
/// </returns>
public static Matrix4x4 LerpTo(this Matrix4x4 from, Matrix4x4 to, float t)
{
return Lerp(from, to, t);
}
/// <summary>
/// Converts Unity's Matrix4x4 data structure to the SDK's
/// ZMatrix4 data structure.
/// </summary>
///
/// <remarks>
/// Unity's Matrix4x4 struct is usually left-handed (minus view
/// matrices, projection matrices, etc.) and the ZMatrix4 struct is
/// right-handed. For convenience, there is a flip handedness
/// parameter that defaults to true in order to facilitate seamless
/// conversions between Unity's and 's 4x4 matrix data
/// structures.
/// </remarks>
///
/// <param name="flipHandedness">
/// Flips the handedness of the resultant ZMatrix4 from left to right
/// (or right to left) depending on the current handedness of the
/// Matrix4x4.
/// </param>
///
/// <returns>
/// ZMatrix4 initialized based on the current state of the Matrix4x4.
/// </returns>
public static ZMatrix4 ToZMatrix4(
this Matrix4x4 m, bool flipHandedness = true)
{
if (flipHandedness)
{
m = m.FlipHandedness();
}
return new ZMatrix4(m);
}
/// <summary>
/// Returns a Unity Matrix4x4 of the opposite handedness (e.g. if
/// current handedness is left-handed, then the resultant Matrix4x4
/// will be right-handed).
/// </summary>
///
/// <returns>
/// Matrix4x4 of the opposite handedness.
/// </returns>
public static Matrix4x4 FlipHandedness(this Matrix4x4 m)
{
return FlipHandednessMatrix * m * FlipHandednessMatrix;
}
/// <summary>
/// Returns a Unity Matrix4x4 with its original position and rotation,
/// but no scale.
/// </summary>
///
/// <remarks>
/// More specifically, in order to remove scale, the scale component is
/// set to (1, 1, 1).
/// </remarks>
///
/// <returns>
/// Matrix4x4 with its original position and rotation, but no scale.
/// </returns>
public static Matrix4x4 ToPoseMatrix(this Matrix4x4 m)
{
return Matrix4x4.TRS(m.GetColumn(3), m.rotation, Vector3.one);
}
/// <summary>
/// Converts the Matrix4x4 to a Unity Pose based on its current
/// position and rotation.
/// </summary>
///
/// <returns>
/// A Unity Pose based on the Matrix4x4's position and rotation.
/// </returns>
public static Pose ToPose(this Matrix4x4 m)
{
return new Pose(m.GetColumn(3), m.rotation);
}
////////////////////////////////////////////////////////////////////////
// Private Static Members
////////////////////////////////////////////////////////////////////////
private static readonly Matrix4x4 FlipHandednessMatrix =
Matrix4x4.Scale(new Vector4(1.0f, 1.0f, -1.0f));
}
}

View File

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

View File

@ -1,120 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Interop;
namespace GCSeries.Core.Extensions
{
public static class PoseExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Static Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Performs linear interpolation between two Poses.
/// </summary>
///
/// <param name="from">
/// The Pose start point to interpolate from.
/// </param>
/// <param name="to">
/// The Pose end point to interpolate to.
/// </param>
/// <param name="t">
/// Normalized time specified between 0 and 1 (inclusive).
/// </param>
///
/// <returns>
/// The interpolated Pose value.
/// </returns>
public static Pose Lerp(Pose from, Pose to, float t)
{
Vector3 position = Vector3.Lerp(from.position, to.position, t);
Quaternion rotation = Quaternion.Lerp(from.rotation, to.rotation, t);
return new Pose(position, rotation);
}
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Performs linear interpolation between the current
/// and specified Poses.
/// </summary>
///
/// <param name="to">
/// The Pose end point to interpolate to.
/// </param>
/// <param name="t">
/// Normalized time specified between 0 and 1 (inclusive).
/// </param>
///
/// <returns>
/// The interpolated Pose value.
/// </returns>
public static Pose LerpTo(this Pose from, Pose to, float t)
{
return Lerp(from, to, t);
}
/// <summary>
/// Returns a new Pose that is the result of transforming
/// the current pose by the specified transformation matrix.
/// </summary>
///
/// <param name="matrix">
/// The Matrix4x4 to transform the current Pose by.
/// </param>
///
/// <returns>
/// Pose equal to the original Pose transformed by the specified
/// transformation matrix.
/// </returns>
public static Pose GetTransformedBy(this Pose pose, Matrix4x4 matrix)
{
return new Pose(
matrix.MultiplyPoint(pose.position),
matrix.rotation * pose.rotation);
}
/// <summary>
/// Converts Unity's Pose data structure to the SDK's
/// ZPose data structure.
/// </summary>
///
/// <remarks>
/// The ZMatrix4 belonging to the ZPose is right-handed.
/// </remarks>
///
/// <returns>
/// ZPose initialized based on the current state of the Pose.
/// </returns>
public static ZPose ToZPose(this Pose p)
{
Matrix4x4 m = p.ToMatrix4x4();
return new ZPose(m.ToZMatrix4(), 0.0f);
}
/// <summary>
/// Converts the Pose to a Matrix4x4 (left-handed).
/// </summary>
///
/// <returns>
/// Matrix4x4 initialized based on the current state of the Pose.
/// </returns>
public static Matrix4x4 ToMatrix4x4(this Pose p)
{
return Matrix4x4.TRS(p.position, p.rotation, Vector3.one);
}
}
}

View File

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

View File

@ -1,31 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class RayExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Converts a Ray to a Pose based on its origin and direction
/// vectors.
/// </summary>
///
/// <returns>
/// Pose initialized based on the origin and direction of the Ray.
/// </returns>
public static Pose ToPose(this Ray ray, Vector3 up)
{
return new Pose(
ray.origin, Quaternion.LookRotation(ray.direction, up));
}
}
}

View File

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

View File

@ -1,36 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class RectIntExtensions
{
/// <summary>
/// Checks whether the other rectangle overlaps this one.
/// </summary>
///
/// <param name="other">
/// The other rectangle to test overlapping with.
/// </param>
///
/// <returns>
/// Returns true if the other rectangle overlaps this one.
/// </returns>
public static bool Overlaps(this RectInt r, RectInt other)
{
if (other.xMax > r.xMin &&
other.xMin < r.xMax &&
other.yMax > r.yMin)
{
return other.yMin < r.yMax;
}
return false;
}
}
}

View File

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

View File

@ -1,120 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class TransformExtensions
{
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Applies a uniform scale to the transform's x, y, and z
/// local scale components.
/// </summary>
///
/// <param name="scale">
/// The uniform scale factor to apply to the transform's local scale.
/// </param>
public static void SetUniformScale(this Transform t, float scale)
{
t.localScale = Vector3.one * scale;
}
/// <summary>
/// Sets the world position and rotation of this transform based
/// on the position and rotation of the specified world space pose.
/// </summary>
///
/// <param name="pose">
/// The world space pose to update the transform's world position
/// and rotation to.
/// </param>
/// <param name="resetScale">
/// Flag specifying whether to reset the transform's scale to (1, 1, 1).
/// </param>
public static void SetPose(
this Transform t, Pose pose, bool resetScale = false)
{
t.position = pose.position;
t.rotation = pose.rotation;
if (resetScale)
{
t.localScale = Vector3.one;
}
}
/// <summary>
/// Sets the local position and rotation of this transform based
/// on the position and rotation of the specified local space pose.
/// </summary>
///
/// <param name="localPose">
/// The local space pose to update the transform's local position
/// and rotation to.
/// </param>
/// <param name="resetScale">
/// Flag specifying whether to reset the transform's scale to (1, 1, 1).
/// </param>
public static void SetLocalPose(
this Transform t, Pose localPose, bool resetScale = false)
{
t.localPosition = localPose.position;
t.localRotation = localPose.rotation;
if (resetScale)
{
t.localScale = Vector3.one;
}
}
/// <summary>
/// Converts the transform to a Unity Pose based on its current
/// world space position and rotation.
/// </summary>
///
/// <returns>
/// A Unity Pose based on the transform's world space
/// position and rotation.
/// </returns>
public static Pose ToPose(this Transform t)
{
return new Pose(t.position, t.rotation);
}
/// <summary>
/// Converts the transform to a Unity Pose based on its current
/// local space position and rotation.
/// </summary>
///
/// <returns>
/// A Unity Pose based on the transform's local space
/// position and rotation.
/// </returns>
public static Pose ToLocalPose(this Transform t)
{
return new Pose(t.localPosition, t.localRotation);
}
/// <summary>
/// Converts the transform to a Unity Ray based on its current
/// position and forward vector.
/// </summary>
///
/// <returns>
/// A Unity Ray based on the transform's position and forward vector.
/// </returns>
public static Ray ToRay(this Transform t)
{
return new Ray(t.position, t.forward);
}
}
}

View File

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

View File

@ -1,86 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Interop;
namespace GCSeries.Core.Extensions
{
public static class Vector3Extensions
{
////////////////////////////////////////////////////////////////////////
// Public Static Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Computes a point on a quadratic bezier curve defined by the
/// specified control points.
/// </summary>
///
/// <param name="p0">
/// First control point defining the quadratic bezier curve.
/// </param>
/// <param name="p1">
/// Second control point defining the quadratic bezier curve.
/// </param>
/// <param name="p2">
/// Third control point defining the quadratic bezier curve.
/// </param>
/// <param name="t">
/// The value between 0 and 1 (inclusive) defining where along the
/// bezier curve to compute the point. A value of 0 corresponds to the
/// beginning of the curve. A value of 1 corresponds to the end of the
/// curve.
/// </param>
///
/// <returns>
/// The point on the bezier curve.
/// </returns>
public static Vector3 ComputePointOnBezierCurve(
Vector3 p0, Vector3 p1, Vector3 p2, float t)
{
Vector3 point =
(p0 * Mathf.Pow(1 - t, 2)) +
(p1 * 2 * (1 - t) * t) +
(p2 * Mathf.Pow(t, 2));
return point;
}
////////////////////////////////////////////////////////////////////////
// Public Extension Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Converts Unity's Vector3 data structure to the SDK's
/// ZVector3 data structure.
/// </summary>
///
/// <remarks>
/// Unity's Vector3 struct is usually left-handed and the ZVector3
/// struct is right-handed. For convenience, there is a flip
/// handedness parameter that defaults to true in order to facilitate
/// seamless conversions between Unity's and 's Vector3 data
/// structures.
/// </remarks>
///
/// <param name="flipHandedness">
/// Flips the handedness of the resultant ZVector3 from left to right
/// (or right to left) depending on the current handedness of the
/// Vector3.
/// </param>
///
/// <returns>
/// ZVector3 initialized based on the current state of the Vector3.
/// </returns>
public static ZVector3 ToZVector3(
this Vector3 v, bool flipHandedness = true)
{
return new ZVector3(v.x, v.y, flipHandedness ? -v.z : v.z);
}
}
}

View File

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

View File

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

View File

@ -1,135 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Extensions;
namespace GCSeries.Core.Input
{
public class ZMouse : ZPointer
{
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
protected override void OnEnable()
{
base.OnEnable();
Cursor.visible = false;
}
protected override void OnDisable()
{
base.OnDisable();
Cursor.visible = true;
}
protected override void Start()
{
base.Start();
Cursor.visible = false;
}
protected override void Update()
{
base.Update();
#if UNITY_EDITOR
Cursor.visible = false;
#endif
}
private void OnApplicationPause(bool isPaused)
{
Cursor.visible = isPaused;
}
////////////////////////////////////////////////////////////////////////
// Public Properties
////////////////////////////////////////////////////////////////////////
/// <summary>
/// The unique id of the mouse pointer.
/// </summary>
public override int Id => 1000;
/// <summary>
/// The current visibility state of the mouse.
/// </summary>
///
/// <remarks>
/// Since the mouse is not a 6-DOF trackable target and is present
/// on all platforms we currently support (e.g. Windows), IsVisible
/// is hard-coded to true.
/// </remarks>
public override bool IsVisible => true;
/// <summary>
/// The number of buttons supported by the mouse.
/// </summary>
public override int ButtonCount => 3;
/// <summary>
/// The current scroll delta for the mouse.
/// </summary>
///
/// <remarks>
/// The scroll delta for the mouse is only stored in Vector2.y
/// (Vector2.x is ignored).
/// </remarks>
public override Vector2 ScrollDelta =>
UnityEngine.Input.mouseScrollDelta;
/// <summary>
/// The pose of the pointer's current end point in world space.
/// </summary>
///
/// <remarks>
/// In this particular case, this will be the the mouse cursor's
/// world pose.
/// </remarks>
public override Pose EndPointWorldPose => new Pose(
this.HitInfo.worldPosition,
this.EventCamera?.ZeroParallaxPose.rotation ??
this.transform.rotation);
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets whether the specified button is pressed.
/// </summary>
///
/// <param name="id">
/// The integer id of the specified button.
/// </param>
///
/// <returns>
/// True if the specified button is pressed. False otherwise.
/// </returns>
public override bool GetButton(int id)
{
return UnityEngine.Input.GetMouseButton(id);
}
////////////////////////////////////////////////////////////////////////
// Protected Methods
////////////////////////////////////////////////////////////////////////
protected override Pose ComputeWorldPose()
{
Ray mouseRay = this.EventCamera.Camera.ScreenPointToRay(
UnityEngine.Input.mousePosition);
return mouseRay.ToPose(this.EventCamera.transform.up);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0190ffc646245134f8886a35e7b1a94b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 93f7e1cf88343dd43bbd9966568ba15d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,181 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Extensions;
namespace GCSeries.Core.Input
{
public class ZMouseCursor : ZPointerVisualization
{
////////////////////////////////////////////////////////////////////////
// Inspector Fields
////////////////////////////////////////////////////////////////////////
/// <summary>
/// The duration in seconds to flip the cursor.
/// </summary>
///
/// <remarks>
/// A value of 0 will cause the flip to occur instantaneously.
/// </remarks>
[Tooltip("The duration in seconds to flip the cursor.")]
public float FlipDuration = 0.1f;
/// <summary>
/// The duration in seconds for the cursor to snap to objects.
/// </summary>
[Tooltip("The duration in seconds for the cursor to snap to objects.")]
public float SnapDuration = 0.05f;
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void Awake()
{
this._spriteRenderer =
this.GetComponentInChildren<SpriteRenderer>();
}
////////////////////////////////////////////////////////////////////////
// Public Properties
////////////////////////////////////////////////////////////////////////
public override void Process(ZPointer pointer, Vector3 worldScale)
{
base.Process(pointer, worldScale);
// Update the mouse cursor's position and rotation.
this.transform.SetPose(this.GetEndPointPose(pointer));
// Update the mouse cursor's scale based on whether
// stereoscopic 3D rendering is currently active. When
// rendering in monoscopic 3D, scale the cursor based on its
// distance from the camera.
float distanceScale = this.GetCameraDistanceScale(
pointer.EventCamera, this.transform.position);
this.transform.localScale = Vector3.Lerp(
Vector3.one * distanceScale,
worldScale,
pointer.EventCamera.StereoWeight);
// Update whether the mouse cursor should be flipped about its
// horizontal and vertical axes based on the hit normal in
// screen space. This will minimize the chance that the mouse
// cursor will be occluded by the object it is intersecting.
if (!pointer.AnyButtonPressed)
{
float flipThreshold = 89;
Vector3 screenNormal =
Quaternion.Inverse(this.transform.rotation) *
pointer.HitInfo.worldNormal;
this._flipHorizontal =
(Vector3.Angle(screenNormal, Vector3.left) < flipThreshold);
this._flipVertical =
(Vector3.Angle(screenNormal, Vector3.up) < flipThreshold);
}
// Update the mouse cursor's corresponding sprite.
this.UpdateSprite();
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private Pose GetEndPointPose(ZPointer pointer)
{
if (pointer.AnyButtonPressed || pointer.MaxHitRadius == 0)
{
this._positionWeight = 1;
}
else if (pointer.HitInfo.gameObject != this._previousHitObject)
{
this._positionWeight = 0;
this._startPosition = this.transform.position;
}
Pose pose = pointer.EndPointWorldPose;
pose.position =
Vector3.Lerp(this._startPosition, pose.position, this._positionWeight) +
(pose.rotation * Vector3.back * 0.0001f);
this._previousHitObject = pointer.HitInfo.gameObject;
this._positionWeight += Time.unscaledDeltaTime / this.SnapDuration;
this._positionWeight = Mathf.Clamp01(this._positionWeight);
return pose;
}
public float GetCameraDistanceScale(ZCamera camera, Vector3 point)
{
Plane monoCameraPlane = new Plane(
-camera.ZeroParallaxPlane.normal,
camera.transform.position);
float distanceToCameraPlane =
monoCameraPlane.GetDistanceToPoint(point);
float distanceFromCameraToZeroParallax =
camera.CameraOffset.magnitude;
return (distanceToCameraPlane / distanceFromCameraToZeroParallax);
}
private void UpdateSprite()
{
if (this._spriteRenderer == null)
{
return;
}
Transform spriteTransform = this._spriteRenderer.transform;
// Update the sprite's local rotation.
Quaternion targetRotation = Quaternion.Euler(
this._flipVertical ? (this._flipHorizontal ? 180 : -180) : 0,
this._flipHorizontal ? -180 : 0,
0);
if (this.FlipDuration == 0)
{
spriteTransform.localRotation = targetRotation;
}
else
{
spriteTransform.localRotation = Quaternion.RotateTowards(
spriteTransform.localRotation,
targetRotation,
180 / this.FlipDuration * Time.unscaledDeltaTime);
}
// Update the sprite's local scale.
Vector3 metersPerPixel = ZProvider.DisplayMetersPerPixel;
spriteTransform.localScale =
Vector3.one * Mathf.Min(metersPerPixel.x, metersPerPixel.y);
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private SpriteRenderer _spriteRenderer = null;
private bool _flipHorizontal = false;
private bool _flipVertical = false;
private GameObject _previousHitObject = null;
private float _positionWeight = 1;
private Vector3 _startPosition = Vector3.zero;
}
}

View File

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

View File

@ -1,175 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.UI;
namespace GCSeries.Core.Input
{
public abstract partial class ZPointer
{
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private RaycastResult Raycast(Ray ray)
{
// Perform a raycast against all high priority objects.
if (this.PriorityMask != 0)
{
RaycastResult highPriorityResult = this.Raycast(
ray, ~this.IgnoreMask & this.PriorityMask);
if (highPriorityResult.gameObject != null)
{
return highPriorityResult;
}
}
// Perform a raycast against all low priority objects.
RaycastResult lowPriorityResult = this.Raycast(
ray, ~this.IgnoreMask & ~this.PriorityMask);
return lowPriorityResult;
}
private RaycastResult Raycast(Ray ray, int layerMask)
{
// Initialize the raycast result.
RaycastResult result = default(RaycastResult);
result.distance = this.DefaultHitDistance;
result.worldNormal = -ray.direction;
result.worldPosition = ray.GetPoint(result.distance);
result.screenPosition = this.EventCamera.Camera.WorldToScreenPoint(
result.worldPosition);
// Perform a physics raycast to determine if any physics objects
// are hit.
RaycastHit physicsResult;
if (Physics.Raycast(
ray, out physicsResult, result.distance, layerMask))
{
result.distance = physicsResult.distance;
result.worldPosition = physicsResult.point;
result.worldNormal = physicsResult.normal;
result.gameObject = physicsResult.collider.gameObject;
result.screenPosition =
this.EventCamera.Camera.WorldToScreenPoint(
physicsResult.point);
}
// Perform a graphics raycast to determine if any UI objects
// are hit.
RaycastResult graphicResult;
if (ZGraphicRaycaster.Raycast(
ray, out graphicResult, result.distance, layerMask))
{
result = graphicResult;
}
// Perform a physics spherecast if the hit radius is greater
// than zero to determine if any physics objects are within the
// hit radius.
float radius = this.DefaultHitRadius;
if (radius > 0)
{
// Increase the hit radius by 10% when an object is intersected
// to eliminate instability issues in collision detection results
// when the pointer is straddling intersection boundaries.
if (this.HitInfo.gameObject != null)
{
radius *= 1.1f;
}
if (this.SphereCast(
ray, radius, out physicsResult, result.distance, layerMask))
{
if (result.gameObject == null ||
result.gameObject == physicsResult.collider.gameObject)
{
result.distance = physicsResult.distance;
result.worldPosition = physicsResult.point;
result.worldNormal = physicsResult.normal;
result.gameObject = physicsResult.collider.gameObject;
result.screenPosition =
this.EventCamera.Camera.WorldToScreenPoint(
physicsResult.point);
}
}
}
// If neither the physics nor graphics raycast succeeded,
// perform a raycast against the default collision plane.
if (result.gameObject == null &&
this.DefaultCollisionPlane == CollisionPlane.Screen)
{
result = this.Raycast(
ray, this.EventCamera.ZeroParallaxPlane, false);
}
return result;
}
private RaycastResult Raycast(Ray ray, Plane plane, bool lockToPlane)
{
RaycastResult result = default(RaycastResult);
float distance = 0.0f;
if (plane.Raycast(ray, out distance))
{
distance = lockToPlane ?
distance : Mathf.Min(distance, this.DefaultHitDistance);
result.worldNormal = plane.normal;
}
else
{
distance = lockToPlane ?
this._hitInfo.distance : this.DefaultHitDistance;
result.worldNormal = -ray.direction.normalized;
}
result.distance = distance;
result.worldPosition = ray.origin + (ray.direction * distance);
result.screenPosition =
this.EventCamera.Camera.WorldToScreenPoint(
result.worldPosition);
return result;
}
private bool SphereCast(
Ray ray, float radius, out RaycastHit hitInfo, float maxDistance, int layerMask)
{
hitInfo = default(RaycastHit);
RaycastHit[] hitInfos = Physics.SphereCastAll(
ray, radius, maxDistance, layerMask);
bool success = false;
float distance = float.MaxValue;
// Prioritize spherecast results based on their distance from the
// ray's line as opposed to the ray's origin.
for (int i = 0; i < hitInfos.Length; ++i)
{
float distanceFromRay = Vector3.Cross(
ray.direction, hitInfos[i].point - ray.origin).magnitude;
if (distanceFromRay < distance)
{
hitInfo = hitInfos[i];
distance = distanceFromRay;
success = true;
}
}
return success;
}
}
}

View File

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

View File

@ -1,110 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace GCSeries.Core.Input
{
public abstract partial class ZPointer
{
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void OnDrawGizmos()
{
// Update the hit info.
if (!Application.isPlaying)
{
this._hitInfo.distance = this.DefaultHitDistance;
this._hitInfo.worldPosition =
this.transform.position +
(this.transform.forward * this.DefaultHitDistance);
this._hitInfo.worldNormal = -this.transform.forward;
}
}
private void OnDrawGizmosSelected()
{
if (this.EventCamera != null)
{
Vector3 startPoint = this.transform.position;
Vector3 hitPoint = this.HitInfo.worldPosition;
Vector3 hitNormal = this.HitInfo.worldNormal;
// Draw the hit distance.
Handles.color = Color.white;
Handles.DrawDottedLine(startPoint, hitPoint, 5);
Handles.Label(
(startPoint + hitPoint) / 2,
string.Format("{0:0.000} m", this.HitInfo.distance));
// Draw the hit normal.
Handles.color = new Color32(0, 191, 255, 155);
this.DrawNormal(hitPoint, hitNormal, this.transform.up);
// Draw the hit radius information.
float hitRadius = this.DefaultHitRadius;
if (hitRadius > 0)
{
Vector3 direction = this.transform.forward;
Vector3 projectedHitPoint =
Vector3.Project(hitPoint - startPoint, direction) +
startPoint;
Handles.color = Color.white;
this.DrawDiscs(startPoint, projectedHitPoint, hitRadius, 5);
Handles.DrawLine(startPoint, projectedHitPoint);
Handles.DrawDottedLine(hitPoint, projectedHitPoint, 5);
}
}
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void DrawNormal(Vector3 position, Vector3 normal, Vector3 up)
{
Quaternion rotation = Quaternion.LookRotation(normal, up);
float size = HandleUtility.GetHandleSize(position) * 0.75f;
Handles.ArrowHandleCap(
0, position, rotation, size, EventType.Repaint);
}
private void DrawDiscs(Vector3 a, Vector3 b, float radius, int count)
{
float t = 0;
float step = 1 / (float)(count - 1);
Color originalColor = Handles.color;
Color startColor = Handles.color;
startColor.a = 0.2f;
Color endColor = Handles.color;
endColor.a = 0.8f;
for (int i = 0; i < count; ++i)
{
Handles.color = Color.Lerp(endColor, startColor, t);
Handles.DrawWireDisc(Vector3.Lerp(b, a, t), b - a, radius);
t += step;
}
Handles.color = originalColor;
}
}
}
#endif // UNITY_EDITOR

View File

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

View File

@ -1,802 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using GCSeries.Core.Extensions;
namespace GCSeries.Core.Input
{
[DefaultExecutionOrder(ScriptPriority)]
public abstract partial class ZPointer : MonoBehaviour
{
public const int ScriptPriority = ZProvider.ScriptPriority + 30;
////////////////////////////////////////////////////////////////////////
// Public Types
////////////////////////////////////////////////////////////////////////
public enum CollisionPlane
{
None = 0,
Screen = 1,
}
public enum DragPolicy
{
None = 0,
LockHitPosition = 1,
LockToSurfaceAlignedPlane = 2,
LockToScreenAlignedPlane = 3,
LockToCustomPlane = 4,
}
[Serializable]
public class CollisionEvent : UnityEvent<ZPointer, GameObject>
{
}
[Serializable]
public class IntEvent : UnityEvent<ZPointer, int>
{
}
////////////////////////////////////////////////////////////////////////
// Inspector Fields
////////////////////////////////////////////////////////////////////////
/// <summary>
/// The camera that will be used when calculating the pointer's
/// world space pose as well as to process pointer events.
/// </summary>
[Tooltip(
"The camera that will be used when calculating the pointer's " +
"world space pose as well as to process pointer events.")]
public ZCamera EventCamera = null;
/// <summary>
/// The visualization to be processed by the pointer.
/// </summary>
[Tooltip("The visualization to be processed by the pointer.")]
public ZPointerVisualization Visualization = null;
[Header("Collision")]
/// <summary>
/// The maximum hit distance in meters.
/// </summary>
[Tooltip("The maximum hit distance in meters.")]
public float MaxHitDistance = 1.0f;
/// <summary>
/// The maximum hit radius in meters.
/// </summary>
[Tooltip("The maximum hit radius in meters.")]
[Range(0, 0.1f)]
public float MaxHitRadius = 0.0f;
/// <summary>
/// The mask controlling which layers the pointer will ignore. All
/// objects on the specified ignore layers will not receive any
/// pointer events.
/// </summary>
[Tooltip(
"The mask controlling which layers the pointer will ignore. " +
"All objects on the specified ignore layers will not receive " +
"any pointer events.")]
public LayerMask IgnoreMask = 0;
/// <summary>
/// A mask specifying which objects take priority when snapping.
/// </summary>
[Tooltip("A mask specifying which objects take priority when snapping.")]
public LayerMask PriorityMask = 0;
/// <summary>
/// Enable whether the pointer will attempt to intersect with a
/// collision plane (e.g. screen plane) if it is not intersecting
/// with UI or in-scene objects.
/// </summary>
///
/// <remarks>
/// This feature is useful for pointers such as the mouse in order
/// ensure the mouse cursor is bound to the screen plane by default
/// when it is not intersecting with UI or in-scene objects.
/// </remarks>
[Tooltip(
"Enable whether the pointer will attempt to intersect with a " +
"collision plane (e.g. screen plane) if it is not intersecting " +
"with UI or in-scene objects.")]
public CollisionPlane DefaultCollisionPlane = CollisionPlane.None;
[Header("Drag")]
/// <summary>
/// The drag policy to be used when no object is intersected.
/// </summary>
[Tooltip("The drag policy to be used when no object is intersected.")]
public DragPolicy DefaultDragPolicy = DragPolicy.None;
/// <summary>
/// The drag policy to be used by default for non-UI objects.
/// </summary>
[Tooltip("The drag policy to be used by default for non-UI objects.")]
public DragPolicy ObjectDragPolicy = DragPolicy.LockHitPosition;
/// <summary>
/// The drag policy to be used by default for UI objects.
/// </summary>
[Tooltip("The drag policy to be used by default for UI objects.")]
public DragPolicy UIDragPolicy = DragPolicy.LockToSurfaceAlignedPlane;
/// <summary>
/// The time threshold in seconds to differentiate between a click
/// and drag. If the elapsed time between button press and release
/// is less than the threshold, the action is interpreted as a
/// click. Otherwise it is interpreted as a drag.
/// </summary>
[Tooltip(
"The time threshold in seconds to differentiate between a click " +
"and drag. If the elapsed time between button press and release " +
"is less than the threshold, the action is interpreted as a " +
"click. Otherwise it is interpreted as a drag.")]
public float ClickTimeThreshold = 0.3f;
/// <summary>
/// The conversion factor to convert scroll units to meters.
/// </summary>
[Tooltip("The conversion factor to convert scroll units to meters.")]
public float ScrollMetersPerUnit = 0.01f;
[Header("Events")]
/// <summary>
/// Event dispatched when the pointer enters an object.
/// </summary>
[Tooltip("Event dispatched when the pointer enters an object.")]
public CollisionEvent OnObjectEntered = new CollisionEvent();
/// <summary>
/// Event dispatched when the pointer exits an object.
/// </summary>
[Tooltip("Event dispatched when the pointer exits an object.")]
public CollisionEvent OnObjectExited = new CollisionEvent();
/// <summary>
/// Event dispatched when a pointer button becomes pressed.
/// </summary>
[Tooltip("Event dispatched when a pointer button becomes pressed.")]
public IntEvent OnButtonPressed = new IntEvent();
/// <summary>
/// Event dispatched when a pointer button becomes released.
/// </summary>
[Tooltip("Event dispatched when a pointer button becomes released.")]
public IntEvent OnButtonReleased = new IntEvent();
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
protected virtual void Awake()
{
// Initialize hit info.
this._hitInfo.distance = this.DefaultHitDistance;
this._hitInfo.worldPosition =
this.transform.position +
(this.transform.forward * this.DefaultHitDistance);
this._hitInfo.worldNormal = -this.transform.forward;
}
protected virtual void Start()
{
if (this.EventCamera == null)
{
Debug.LogWarningFormat(
this,
"The <color=cyan>{0}</color> pointer will not be " +
"processed since no event camera is attached. " +
"Please make sure you have attached a valid event camera " +
"to enable pointer processing.",
this.name);
}
this._buttonState = new ButtonState[this.ButtonCount];
}
protected virtual void OnEnable()
{
if (!s_instances.Contains(this))
{
s_instances.Add(this);
}
}
protected virtual void OnDisable()
{
if (s_instances.Contains(this))
{
s_instances.Remove(this);
}
}
protected virtual void Update()
{
this.Process();
}
////////////////////////////////////////////////////////////////////////
// Public Properties
////////////////////////////////////////////////////////////////////////
/// <summary>
/// The unique id of the pointer.
/// </summary>
public abstract int Id { get; }
/// <summary>
/// The number of buttons supported by the pointer.
/// </summary>
public abstract int ButtonCount { get; }
/// <summary>
/// The current scroll delta of the pointer.
/// </summary>
public abstract Vector2 ScrollDelta { get; }
/// <summary>
/// The current visibility state of the pointer.
/// </summary>
public abstract bool IsVisible { get; }
/// <summary>
/// The pose of the pointer's current end point in world space.
/// </summary>
public virtual Pose EndPointWorldPose => new Pose(
this.HitInfo.worldPosition, this.transform.rotation);
/// <summary>
/// The current hit information of the pointer.
/// </summary>
public RaycastResult HitInfo => this._hitInfo;
/// <summary>
/// The hit information corresponding to when any button is pressed
/// to initiate a drag.
/// </summary>
public RaycastResult PressHitInfo => this._pressHitInfo;
/// <summary>
/// The world ray based on the pointer's current position and rotation.
/// </summary>
public Ray PointerRay => this.transform.ToRay();
/// <summary>
/// Checks whether any pointer button is currently pressed.
/// </summary>
public bool AnyButtonPressed => (this._dragButtonId != -1);
/// <summary>
/// A callback to override the default drag plane.
/// </summary>
public Func<ZPointer, Plane> DefaultCustomDragPlane { get; set; }
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets all active pointer instances in the current scene.
/// </summary>
///
/// <remarks>
/// This is a convenience method for any logic that needs to
/// quickly iterate through all active pointers in the scene
/// (e.g. ZInputModule).
/// </remarks>
public static IList<ZPointer> GetInstances()
{
return s_instances;
}
/// <summary>
/// Gets whether the specified button is currently in a pressed state.
/// </summary>
///
/// <param name="id">
/// The id of the button.
/// </param>
///
/// <returns>
/// True if the specified button is pressed. False otherwise.
/// </returns>
public abstract bool GetButton(int id);
/// <summary>
/// Gets whether the specified button became pressed this frame.
/// </summary>
///
/// <param name="id">
/// The id of the button.
/// </param>
///
/// <returns>
/// True if the specified button became pressed. False otherwise.
/// </returns>
public bool GetButtonDown(int id)
{
return this._buttonState[id].BecamePressed;
}
/// <summary>
/// Gets whether the specified button became released this frame.
/// </summary>
///
/// <param name="id">
/// The id of the button.
/// </param>
///
/// <returns>
/// True if the specified button became released. False otherwise.
/// </returns>
public bool GetButtonUp(int id)
{
return this._buttonState[id].BecameReleased;
}
/// <summary>
/// Returns the appropriate Unity PointerEventData.InputButton based
/// on a specified integer button id.
/// </summary>
///
/// <param name="id">
/// The integer button id to retrieve the InputButton for.
/// </param>
///
/// <returns>
/// The InputButton associated with the specified integer button id.
/// </returns>
public PointerEventData.InputButton GetButtonMapping(int id)
{
switch (id)
{
case 1:
return PointerEventData.InputButton.Right;
case 2:
return PointerEventData.InputButton.Middle;
case 0:
default:
return PointerEventData.InputButton.Left;
}
}
/// <summary>
/// Allows a specified object to capture pointer events.
/// </summary>
///
/// <remarks>
/// To disable pointer event capture, call this method and pass
/// in null for the capture object.
/// </remarks>
///
/// <param name="captureObject">
/// A reference to the GameObject responsible for capturing pointer
/// events.
/// </param>
public void CapturePointer(GameObject captureObject)
{
this._captureObject = captureObject;
}
////////////////////////////////////////////////////////////////////////
// Protected Methods
////////////////////////////////////////////////////////////////////////
protected abstract Pose ComputeWorldPose();
////////////////////////////////////////////////////////////////////////
// Private Properties
////////////////////////////////////////////////////////////////////////
private Matrix4x4 ScreenWorldPoseMatrix =>
this.EventCamera.ZeroParallaxLocalToWorldMatrix.ToPoseMatrix();
private Matrix4x4 DeltaScreenWorldPoseMatrix =>
this.ScreenWorldPoseMatrix *
this._pressScreenWorldPoseMatrix.inverse;
private float WorldScale => this.EventCamera?.WorldScale.z ?? 1;
private float DefaultHitDistance =>
this.MaxHitDistance * this.WorldScale;
private float DefaultHitRadius =>
this.MaxHitRadius * this.WorldScale;
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void Process()
{
if (this.EventCamera == null)
{
return;
}
// Process the pointer.
if (this.IsVisible)
{
this.ProcessMove();
this.ProcessButtonState();
this.ProcessScroll();
this.ProcessCollisions();
this.SendEvents();
}
// Process the pointer's associated visualization.
if (this.Visualization != null)
{
this.Visualization.Process(this, this.EventCamera.WorldScale);
}
}
private void ProcessMove()
{
Pose worldPose = this.ComputeWorldPose();
this.transform.SetPose(worldPose);
}
private void ProcessButtonState()
{
int buttonCount = this.ButtonCount;
for (int i = 0; i < buttonCount; ++i)
{
bool isPressed = this.GetButton(i);
bool wasPressed = this._buttonState[i].IsPressed;
this._buttonState[i].BecamePressed = (isPressed && !wasPressed);
this._buttonState[i].BecameReleased = (!isPressed && wasPressed);
this._buttonState[i].IsPressed = isPressed;
if (this._buttonState[i].BecamePressed)
{
this.ProcessButtonPress(i);
}
if (this._buttonState[i].BecameReleased)
{
this.ProcessButtonRelease(i);
}
}
}
private void ProcessButtonPress(int buttonId)
{
if (this._dragButtonId == -1)
{
this._dragButtonId = buttonId;
this._dragScrollDistance = 0.0f;
this._pressHitInfo = this.Raycast(this.PointerRay);
this._pressObject = this._pressHitInfo.gameObject;
this._pressInteractable =
this._pressObject?.GetComponent<ZPointerInteractable>();
this._pressScreenWorldPoseMatrix = this.ScreenWorldPoseMatrix;
this._pressScreenWorldNormal = Vector3.Normalize(
this._pressScreenWorldPoseMatrix.MultiplyVector(
Vector3.back));
this._pressLocalHitPosition =
this.transform.worldToLocalMatrix.MultiplyPoint(
this._pressHitInfo.worldPosition);
this._pressLocalHitNormal = Vector3.Normalize(
this.transform.worldToLocalMatrix.MultiplyVector(
this._pressHitInfo.worldNormal));
this._pressLocalHitDirection = Vector3.Normalize(
this.transform.worldToLocalMatrix.MultiplyVector(
this._pressHitInfo.worldPosition -
this.transform.position));
this._pressDragPolicy = this.GetDragPolicy(this._pressObject);
}
}
private void ProcessButtonRelease(int buttonId)
{
if (this._dragButtonId == buttonId)
{
this._dragButtonId = -1;
}
}
private void ProcessScroll()
{
if (this.AnyButtonPressed)
{
float scrollDelta = this.ScrollDelta.y;
this._dragScrollDistance +=
scrollDelta * this.ScrollMetersPerUnit * this.WorldScale;
if (this._dragScrollDistance != 0)
{
// Clamp the scroll distance based the pointer's distance
// from the hit plane captured on button press.
Plane hitPlane = new Plane(
this._pressScreenWorldNormal,
this._pressHitInfo.worldPosition);
hitPlane = this.DeltaScreenWorldPoseMatrix.TransformPlane(
hitPlane);
float minScrollDistance = -hitPlane.GetDistanceToPoint(
this.transform.position);
this._dragScrollDistance = Mathf.Max(
minScrollDistance + 0.01f, this._dragScrollDistance);
}
}
}
private void ProcessCollisions()
{
// Perform a physics and graphics raycast to determine if
// the pointer is intersecting anything.
RaycastResult hitInfo = this.Raycast(this.PointerRay);
// If any key is currently being pressed, update the
// resultant hit info in case the hit position is being
// constrained based on the current drag mode policy.
if (this.AnyButtonPressed)
{
this.ProcessDrag(ref hitInfo);
}
// Check if the pointer was captured by an object. If so,
// make sure all events are forwarded to the capture object.
if (this._captureObject != null)
{
hitInfo.gameObject = this._captureObject;
}
// Update the cached entered object.
this._enteredObject = null;
if (hitInfo.gameObject != null &&
hitInfo.gameObject != this._hitInfo.gameObject)
{
this._enteredObject = hitInfo.gameObject;
}
// Update the cached exited object.
this._exitedObject = null;
if (this._hitInfo.gameObject != null &&
this._hitInfo.gameObject != hitInfo.gameObject)
{
this._exitedObject = this._hitInfo.gameObject;
}
this._hitInfo = hitInfo;
}
private void ProcessDrag(ref RaycastResult hitInfo)
{
// If the current hit info's object is not equal to
// the current drag object, clear it so that objects
// other than the current drag object won't receive
// events.
if (hitInfo.gameObject != this._pressHitInfo.gameObject)
{
hitInfo.gameObject = null;
}
// Update the hit info based on the current drag policy.
switch (this._pressDragPolicy)
{
case DragPolicy.LockHitPosition:
this.ProcessDragLockHitPosition(ref hitInfo);
break;
case DragPolicy.LockToSurfaceAlignedPlane:
this.ProcessDragLockToSurfacePlane(ref hitInfo);
break;
case DragPolicy.LockToScreenAlignedPlane:
this.ProcessDragLockToScreenPlane(ref hitInfo);
break;
case DragPolicy.LockToCustomPlane:
this.ProcessDragLockToCustomPlane(ref hitInfo);
break;
}
}
private void ProcessDragLockHitPosition(ref RaycastResult hitInfo)
{
hitInfo.distance = this._pressHitInfo.distance;
hitInfo.worldPosition =
this.transform.localToWorldMatrix.MultiplyPoint(
this._pressLocalHitPosition);
hitInfo.worldNormal = Vector3.Normalize(
this.transform.localToWorldMatrix.MultiplyVector(
this._pressLocalHitNormal));
hitInfo.screenPosition =
this.EventCamera.Camera.WorldToScreenPoint(
hitInfo.worldPosition);
}
private void ProcessDragLockToSurfacePlane(ref RaycastResult hitInfo)
{
Vector3 normal = this._pressHitInfo.worldNormal;
Vector3 position = this._pressHitInfo.worldPosition;
Plane dragPlane = this.DeltaScreenWorldPoseMatrix.TransformPlane(
new Plane(normal, position));
this.ProcessDragLockToPlane(dragPlane, ref hitInfo);
}
private void ProcessDragLockToScreenPlane(ref RaycastResult hitInfo)
{
Vector3 normal = this._pressScreenWorldNormal;
Vector3 scrollOffset = (-normal * this._dragScrollDistance);
Vector3 position = this._pressHitInfo.worldPosition + scrollOffset;
Plane dragPlane = this.DeltaScreenWorldPoseMatrix.TransformPlane(
new Plane(normal, position));
this.ProcessDragLockToPlane(dragPlane, ref hitInfo);
}
private void ProcessDragLockToCustomPlane(ref RaycastResult hitInfo)
{
Plane dragPlane = default(Plane);
if (this._pressInteractable != null)
{
dragPlane = this._pressInteractable.GetDragPlane(this);
}
else if (this.DefaultCustomDragPlane != null)
{
dragPlane = this.DefaultCustomDragPlane(this);
}
this.ProcessDragLockToPlane(dragPlane, ref hitInfo);
}
private void ProcessDragLockToPlane(
Plane plane, ref RaycastResult hitInfo)
{
// Compute the ray.
Vector3 direction = this.transform.localToWorldMatrix.MultiplyVector(
this._pressLocalHitDirection);
Ray ray = new Ray(this.transform.position, direction);
// Perform a raycast against the drag plane.
RaycastResult result = this.Raycast(ray, plane, true);
// Update the hit info.
hitInfo.distance = result.distance;
hitInfo.worldPosition = result.worldPosition;
hitInfo.worldNormal = result.worldNormal;
hitInfo.screenPosition = result.screenPosition;
}
private void SendEvents()
{
// Send collision events.
if (this._exitedObject != null)
{
this.OnObjectExited.Invoke(this, this._exitedObject);
}
if (this._enteredObject != null)
{
this.OnObjectEntered.Invoke(this, this._enteredObject);
}
// Send button events.
int buttonCount = this.ButtonCount;
for (int i = 0; i < buttonCount; ++i)
{
if (this._buttonState[i].BecamePressed)
{
this.OnButtonPressed.Invoke(this, i);
}
if (this._buttonState[i].BecameReleased)
{
this.OnButtonReleased.Invoke(this, i);
}
}
}
private DragPolicy GetDragPolicy(GameObject gameObject)
{
if (gameObject == null)
{
return this.DefaultDragPolicy;
}
ZPointerInteractable interactable =
gameObject.GetComponent<ZPointerInteractable>();
if (interactable != null)
{
return interactable.GetDragPolicy(this);
}
else if (gameObject.GetComponent<RectTransform>() != null)
{
return this.UIDragPolicy;
}
else
{
return this.ObjectDragPolicy;
}
}
////////////////////////////////////////////////////////////////////////
// Private Types
////////////////////////////////////////////////////////////////////////
private struct ButtonState
{
public bool IsPressed;
public bool BecamePressed;
public bool BecameReleased;
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private const int MaxButtonCount = 10;
private static readonly List<ZPointer> s_instances =
new List<ZPointer>();
private ButtonState[] _buttonState = new ButtonState[MaxButtonCount];
private RaycastResult _hitInfo;
private GameObject _captureObject = null;
private GameObject _enteredObject = null;
private GameObject _exitedObject = null;
private int _dragButtonId = -1;
private float _dragScrollDistance = 0.0f;
private RaycastResult _pressHitInfo;
private GameObject _pressObject = null;
private ZPointerInteractable _pressInteractable = null;
private Matrix4x4 _pressScreenWorldPoseMatrix;
private Vector3 _pressScreenWorldNormal;
private Vector3 _pressLocalHitPosition;
private Vector3 _pressLocalHitNormal;
private Vector3 _pressLocalHitDirection;
private DragPolicy _pressDragPolicy = DragPolicy.None;
}
}

View File

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

View File

@ -1,56 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Input
{
public class ZPointerInteractable : MonoBehaviour
{
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Overrides the pointer's current drag policy for this interactable.
/// </summary>
///
/// <param name="pointer">
/// A reference to the pointer currently interacting with this
/// interactable.
/// </param>
///
/// <returns>
/// The interactable's drag policy.
/// </returns>
public virtual ZPointer.DragPolicy GetDragPolicy(ZPointer pointer)
{
if (this.GetComponent<RectTransform>() != null)
{
return pointer.UIDragPolicy;
}
else
{
return pointer.ObjectDragPolicy;
}
}
/// <summary>
/// Get the interactable's specified drag plane.
/// </summary>
/// <param name="pointer"></param>
/// <returns></returns>
public virtual Plane GetDragPlane(ZPointer pointer)
{
if (pointer.DefaultCustomDragPlane != null)
{
return pointer.DefaultCustomDragPlane(pointer);
}
return default(Plane);
}
}
}

View File

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

View File

@ -1,17 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Input
{
public class ZPointerVisualization : MonoBehaviour
{
public virtual void Process(ZPointer pointer, Vector3 worldScale)
{
}
}
}

View File

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

View File

@ -1,114 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Extensions;
using GCSeries.Core.Sdk;
namespace GCSeries.Core.Input
{
public class ZStylus : ZPointer
{
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
protected override void Awake()
{
base.Awake();
if (ZProvider.IsInitialized)
{
this._target = ZProvider.StylusTarget;
this._viewport = ZProvider.Viewport;
}
}
////////////////////////////////////////////////////////////////////////
// Public Properties
////////////////////////////////////////////////////////////////////////
/// <summary>
/// The unique id of the stylus pointer.
/// </summary>
public override int Id => 0;
/// <summary>
/// The current visibility state of the stylus.
/// </summary>
public override bool IsVisible => this._target?.IsVisible ?? false;
/// <summary>
/// The number of buttons supported by the stylus.
/// </summary>
public override int ButtonCount => this._target?.ButtonCount ?? 0;
/// <summary>
/// The current scroll delta of the stylus.
/// </summary>
///
/// <remarks>
/// Since the stylus has not scroll support, the current implementation
/// is hard-coded to the zero vector.
/// </remarks>
public override Vector2 ScrollDelta => Vector2.zero;
/// <summary>
/// The pose of the stylus in tracker space.
/// </summary>
public Pose TrackerPose => this._target?.Pose ?? default(Pose);
////////////////////////////////////////////////////////////////////////
// Public Methods
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets whether the specified button is pressed.
/// </summary>
///
/// <param name="id">
/// The integer id of the specified button.
/// </param>
///
/// <returns>
/// True if the specified button is pressed. False otherwise.
/// </returns>
public override bool GetButton(int id)
{
return this._target?.IsButtonPressed(id) ?? false;
}
////////////////////////////////////////////////////////////////////////
// Protected Methods
////////////////////////////////////////////////////////////////////////
protected override Pose ComputeWorldPose()
{
if (this._target == null || this._viewport == null)
{
return this.transform.ToPose();
}
Pose trackerPose = this._target.Pose;
Matrix4x4 trackerToWorldMatrix =
this.EventCamera.CameraToWorldMatrix *
this._viewport.GetCoordinateSpaceTransform(
ZCoordinateSpace.Tracker,
ZCoordinateSpace.Camera);
return trackerPose.GetTransformedBy(trackerToWorldMatrix);
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private ZTarget _target = null;
private ZViewport _viewport = null;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e385489f7775d604c8f29e84df0be6fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: ec50496b8d7e1a141a406c68300e4678, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,71 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace GCSeries.Core.Input
{
public partial class ZStylusBeam
{
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void OnDrawGizmosSelected()
{
if (this.gameObject != Selection.activeGameObject)
{
return;
}
if (this._pointer == null)
{
this._pointer = this.GetComponentInParent<ZPointer>();
}
if (this._pointer != null)
{
Vector3 p0 = this._pointer.transform.position;
Vector3 p2 = this._pointer.HitInfo.worldPosition;
Vector3 p1 =
p0 + Vector3.Project(p2 - p0, this._pointer.transform.forward);
Handles.color = Color.white;
Handles.DrawDottedLine(p0, p1, 5);
Handles.DrawDottedLine(p1, p2, 5);
this.DrawPoint(Vector3.Lerp(p0, p1, this.CurveStartPivot), "p0");
this.DrawPoint(p1, "p1");
this.DrawPoint(p2, "p2");
}
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void DrawPoint(Vector3 position, string labelText)
{
Quaternion rotation = Quaternion.identity;
float size = HandleUtility.GetHandleSize(position) * 0.1f;
Handles.SphereHandleCap(0, position, rotation, size, EventType.Repaint);
Handles.Label(position, labelText);
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private ZPointer _pointer = null;
}
}
#endif // UNITY_EDITOR

View File

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

View File

@ -1,112 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using GCSeries.Core.Extensions;
namespace GCSeries.Core.Input
{
public partial class ZStylusBeam : ZPointerVisualization
{
////////////////////////////////////////////////////////////////////////
// Inspector Fields
////////////////////////////////////////////////////////////////////////
/// <summary>
/// A ratio indciating how much of the beam will arc to its end point.
/// </summary>
[Tooltip("A ratio indciating how much of the beam will arc to its end point.")]
[Range(0, 1)]
public float CurveStartPivot = 0.35f;
/// <summary>
/// How quickly the beam will snap to its target end point.
/// </summary>
[Tooltip("How quickly the beam will snap to its target end point.")]
[Range(0, 0.1f)]
public float EndPointSmoothTime = 0.02f;
////////////////////////////////////////////////////////////////////////
// MonoBehaviour Callbacks
////////////////////////////////////////////////////////////////////////
private void Awake()
{
this._lineRenderer = this.GetComponentInChildren<LineRenderer>();
this._originalWidthMultiplier = this._lineRenderer.widthMultiplier;
this._endPoint = this.transform.position;
}
////////////////////////////////////////////////////////////////////////
// Public Properties
////////////////////////////////////////////////////////////////////////
public override void Process(ZPointer pointer, Vector3 worldScale)
{
base.Process(pointer, worldScale);
this._lineRenderer.gameObject.SetActive(pointer.IsVisible);
this._lineRenderer.widthMultiplier =
this._originalWidthMultiplier *
Mathf.Min(worldScale.x, worldScale.y);
this.UpdateLineRendererPositions(pointer);
}
////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////
private void UpdateLineRendererPositions(ZPointer pointer)
{
// Update the end point.
Vector3 hitPosition = pointer.HitInfo.worldPosition;
if (pointer.AnyButtonPressed)
{
this._endPoint = hitPosition;
}
else
{
this._endPoint = Vector3.SmoothDamp(
this._endPoint, hitPosition, ref this._velocity, this.EndPointSmoothTime);
}
// Compute the control points for the line renderer's quadratic
// bezier curve. Additionally, transform the control points to be
// in the local space of the pointer since the current assumption
// is that the line renderer is a child of the pointer.
Vector3 p0 = pointer.transform.position;
Vector3 p2 = this._endPoint;
Vector3 p1 = p0 + Vector3.Project(p2 - p0, pointer.transform.forward);
Matrix4x4 worldToLocalMatrix = this.transform.worldToLocalMatrix;
p0 = worldToLocalMatrix.MultiplyPoint(p0);
p1 = worldToLocalMatrix.MultiplyPoint(p1);
p2 = worldToLocalMatrix.MultiplyPoint(p2);
this._lineRenderer.SetPosition(0, p0);
this._lineRenderer.SetBezierCurve(
1, Vector3.Lerp(p0, p1, this.CurveStartPivot), p1, p2);
}
////////////////////////////////////////////////////////////////////////
// Private Members
////////////////////////////////////////////////////////////////////////
private LineRenderer _lineRenderer = null;
private float _originalWidthMultiplier = 1.0f;
private Vector3 _endPoint = Vector3.zero;
private Vector3 _velocity = Vector3.zero;
}
}

View File

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

View File

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

View File

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

View File

@ -1,20 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using System.Runtime.InteropServices;
namespace GCSeries.Core.Interop
{
[StructLayout(LayoutKind.Explicit, Pack = 8)]
public struct ZBoundingBox
{
[FieldOffset(0)]
public ZVector3 lower;
[FieldOffset(12)]
public ZVector3 upper;
}
}

View File

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

Some files were not shown because too many files have changed in this diff Show More