Commit 56b0c6e3 authored by Liang JingQiang's avatar Liang JingQiang

增加游戏模式,打泡泡游戏,用手或子弹

parent 790ef2b1
fileFormatVersion: 2
guid: 5e2358e09f938a047991ba555d7a5393
timeCreated: 1460044093
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4b31a7b3ef30f144b809f77416363950
timeCreated: 1504504478
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 22fb1200527041f4b9e92fb74b155f60
timeCreated: 1504504478
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c375d3f8e2d0a30418954420b26df626
timeCreated: 1504505159
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 78c2404ebe2c815479d7baf90829a45c
guid: ae6070aca830c3642a70abb385f21a63
folderAsset: yes
timeCreated: 1486748263
licenseType: Store
timeCreated: 1504491425
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
......
fileFormatVersion: 2
guid: a03cb39bb52ff0c4bbb4d7cd9e6b617a
timeCreated: 1504491439
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1bd5a0b821f43ac488a653c8749d70e8
folderAsset: yes
timeCreated: 1504491425
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 766d4548d4852a949a50554ef2a0d77b
timeCreated: 1504491432
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 95f8ebdecd9043d409d792aa57a3ac77
folderAsset: yes
timeCreated: 1504491425
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7a9676779fc8c244f90dbd14b4e0e44f
timeCreated: 1504491436
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 552a51fe04a7d154c836731f5773233f
timeCreated: 1504511564
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2d63a9d0c7d82e344b0c9c4fbb0ec21c
timeCreated: 1504498952
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0288fa57fee16d644bab95849d798aa5
timeCreated: 1504506317
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 266fc628ad390134b98cc5eebc4ba8ce
timeCreated: 1504506109
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6fd21f19311f1374cb0ab230dc81c882
timeCreated: 1504491232
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9b353a8616ed7ea4eab67600d11e7556
timeCreated: 1504491232
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 713369564ab40bd47b2fa73d3676ab15
timeCreated: 1504491232
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8cf524fa57cc12e4e9abaf3939c6f950
timeCreated: 1504498952
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3c031b468e436734eaa7e91e6b1fcd71
timeCreated: 1504498551
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ea3faff72c0f48b4bad9846a11fbf987
folderAsset: yes
timeCreated: 1504491425
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7598a291a32fd814195a4025ff5201dd
timeCreated: 1504491428
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c5d25ed4c0a904d40a3b02cb2c3e55bd
timeCreated: 1504491443
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f61f05476add5a443bfd950e1e02f51f
timeCreated: 1504506109
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2614c6adf4469094da8e389b661d75e3
timeCreated: 1504505988
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d4941dde5222ed74fb22f72493a2fe54
timeCreated: 1504505981
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 05336d92207c8b447a42d0bdd8516698
timeCreated: 1504499000
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 10c0f246fc208ba4582ffab7e43c5ae9
timeCreated: 1504517876
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides:
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 1
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8eb151f6a88d8604ead54e8fdfcd37e9
timeCreated: 1504507266
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,8 +11,15 @@ AudioImporter:
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
platformSettingOverrides:
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 1
normalize: 1
preloadAudioData: 1
loadInBackground: 0
......
fileFormatVersion: 2
guid: bb7d1b6271380de4a997c54def1fc19c
timeCreated: 1504520656
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 47f879c1c6dfff14f9b359259644076f
timeCreated: 1504520714
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4ee19dccd446d4848ac1cf12a1c26a97
timeCreated: 1504518582
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides:
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 1
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,8 +11,15 @@ AudioImporter:
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
platformSettingOverrides:
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 1
normalize: 1
preloadAudioData: 1
loadInBackground: 0
......
fileFormatVersion: 2
guid: ab23d2da4b16cac419fd4ccfb673f1f9
timeCreated: 1504518300
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides:
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 1
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 48151e4b3b3266242a6016bc025b24f5
timeCreated: 1504507266
licenseType: Pro
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1db726f4f6e9f814fb34370b3685b982
folderAsset: yes
timeCreated: 1504492213
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
......@@ -21,6 +21,7 @@ public class GyroController : MonoBehaviour
#region [Unity events]
protected void Start()
{
Input.gyro.enabled = true;
AttachGyro();
}
protected void Update()
......@@ -30,47 +31,47 @@ public class GyroController : MonoBehaviour
transform.rotation = Quaternion.Slerp(transform.rotation,
cameraBase * (ConvertRotation(referanceRotation * Input.gyro.attitude) * GetRotFix()), lowPassFilterFactor);
}
protected void OnGUI()
{
if (!debug)
return;
GUILayout.Label("Orientation: " + Screen.orientation);
GUILayout.Label("Calibration: " + calibration);
GUILayout.Label("Camera base: " + cameraBase);
GUILayout.Label("input.gyro.attitude: " + Input.gyro.attitude);
GUILayout.Label("transform.rotation: " + transform.rotation);
if (GUILayout.Button("On/off gyro: " + Input.gyro.enabled, GUILayout.Height(100)))
{
Input.gyro.enabled = !Input.gyro.enabled;
}
if (GUILayout.Button("On/off gyro controller: " + gyroEnabled, GUILayout.Height(100)))
{
if (gyroEnabled)
{
DetachGyro();
}
else
{
AttachGyro();
}
}
if (GUILayout.Button("Update gyro calibration (Horizontal only)", GUILayout.Height(80)))
{
UpdateCalibration(true);
}
if (GUILayout.Button("Update camera base rotation (Horizontal only)", GUILayout.Height(80)))
{
UpdateCameraBaseRotation(true);
}
if (GUILayout.Button("Reset base orientation", GUILayout.Height(80)))
{
ResetBaseOrientation();
}
if (GUILayout.Button("Reset camera rotation", GUILayout.Height(80)))
{
transform.rotation = Quaternion.identity;
}
}
//protected void OnGUI()
//{
// if (!debug)
// return;
// GUILayout.Label("Orientation: " + Screen.orientation);
// GUILayout.Label("Calibration: " + calibration);
// GUILayout.Label("Camera base: " + cameraBase);
// GUILayout.Label("input.gyro.attitude: " + Input.gyro.attitude);
// GUILayout.Label("transform.rotation: " + transform.rotation);
// if (GUILayout.Button("On/off gyro: " + Input.gyro.enabled, GUILayout.Height(100)))
// {
// Input.gyro.enabled = !Input.gyro.enabled;
// }
// if (GUILayout.Button("On/off gyro controller: " + gyroEnabled, GUILayout.Height(100)))
// {
// if (gyroEnabled)
// {
// DetachGyro();
// }
// else
// {
// AttachGyro();
// }
// }
// if (GUILayout.Button("Update gyro calibration (Horizontal only)", GUILayout.Height(80)))
// {
// UpdateCalibration(true);
// }
// if (GUILayout.Button("Update camera base rotation (Horizontal only)", GUILayout.Height(80)))
// {
// UpdateCameraBaseRotation(true);
// }
// if (GUILayout.Button("Reset base orientation", GUILayout.Height(80)))
// {
// ResetBaseOrientation();
// }
// if (GUILayout.Button("Reset camera rotation", GUILayout.Height(80)))
// {
// transform.rotation = Quaternion.identity;
// }
//}
#endregion
#region [Public methods]
/// <summary>
......
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.VR;
public class VRInteractionUI : MonoBehaviour
{
[SerializeField]
private GameObject reticle;
[SerializeField]
private Transform reticleSelectionIndicator;
[SerializeField]
private float focusedReticleSize = 2f;
[SerializeField]
private float unfocusedReticleSize = 1f;
[SerializeField]
private float focusingSpeed = 10f;
[SerializeField]
private bool testMode = false;
private Vector3 originalReticleScale;
private GraphicRaycaster graphicRaycaster;
private PointerEventData pointerEventData;
private Button buttonToInteract;
private void Start()
{
if (!VRSettings.isDeviceActive && !testMode)
{
reticle.gameObject.SetActive(false);
Destroy(this);
}
originalReticleScale = reticleSelectionIndicator.localScale;
pointerEventData = new PointerEventData(null);
pointerEventData.position = new Vector2(Screen.width / 2, Screen.height / 2);
GetGraphicsRaycaster();
}
private void Update()
{
if (graphicRaycaster == null)
{
GetGraphicsRaycaster();
return;
}
buttonToInteract = null;
List<RaycastResult> results = new List<RaycastResult>();
graphicRaycaster.Raycast(pointerEventData, results);
if (results.Count > 0)
{
buttonToInteract = results[0].gameObject.GetComponent<Button>();
if (buttonToInteract != null)
{
buttonToInteract.Select();
if (Input.GetMouseButtonDown(0))
{
buttonToInteract.onClick.Invoke();
return;
}
}
}
float size = buttonToInteract != null ? focusedReticleSize : unfocusedReticleSize;
if (reticleSelectionIndicator != null)
reticleSelectionIndicator.localScale = Vector3.Lerp(reticleSelectionIndicator.localScale, originalReticleScale * size, Time.deltaTime * focusingSpeed);
}
private void GetGraphicsRaycaster()
{
graphicRaycaster = FindObjectOfType<GraphicRaycaster>();
}
}
fileFormatVersion: 2
guid: ed39f66afc709424a9a81321d7baf818
timeCreated: 1504491046
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.VR;
public class VRSwitch : MonoBehaviour
{
[SerializeField] private bool enableVR;
private void Start()
{
VRSettings.enabled = enableVR;
}
}
fileFormatVersion: 2
guid: cc20f79a6f1653846b17453424900887
timeCreated: 1504491045
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment