diff --git a/.gitignore b/.gitignore index 88fbf77e8..7edb99f59 100644 --- a/.gitignore +++ b/.gitignore @@ -4,80 +4,8 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates -*.userprefs -*.pidb .vs - -# Build results -*_i.c -*_p.c -*.ilk -*.obj -*.pch -*.pdb -*.mdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others -[Bb]in -[Oo]bj -sql -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML +TouchScript.userprefs +TouchScript.v12.suo TouchScript.unitypackage \ No newline at end of file diff --git a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll index 5b7458218..052cf908e 100644 Binary files a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll and b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll differ diff --git a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta index 919f28fc7..c3b7c6a02 100644 --- a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta +++ b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta @@ -1,14 +1,34 @@ fileFormatVersion: 2 -guid: 11188de2b6632fa4486c470af4b55fa0 +guid: 46975cd389724d0499db55591d961a35 +timeCreated: 1499691956 +licenseType: Store PluginImporter: - serializedVersion: 1 + serializedVersion: 2 iconMap: {} executionOrder: {} isPreloaded: 0 + isOverridable: 0 platformData: - Any: - enabled: 1 - settings: {} + data: + first: + Any: + second: + enabled: 0 + settings: {} + data: + first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + data: + first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU userData: assetBundleName: assetBundleVariant: diff --git a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll index a28d4889e..2b1615cca 100644 Binary files a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll and b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll differ diff --git a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll.meta b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll.meta index 589111dfd..845630373 100644 --- a/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll.meta +++ b/AssetStore/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll.meta @@ -1,14 +1,34 @@ fileFormatVersion: 2 -guid: e35231d99115e9e4c8cb29414445831f +guid: a4f7ad432f1fed24caa2acbe1ceeef39 +timeCreated: 1499692003 +licenseType: Store PluginImporter: - serializedVersion: 1 + serializedVersion: 2 iconMap: {} executionOrder: {} isPreloaded: 0 + isOverridable: 0 platformData: - Any: - enabled: 1 - settings: {} + data: + first: + Any: + second: + enabled: 0 + settings: {} + data: + first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + data: + first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU userData: assetBundleName: assetBundleVariant: diff --git a/AssetStore/Assets/AssetStoreTools/Editor/DroidSansMono.ttf.meta b/AssetStore/Assets/AssetStoreTools/Editor/DroidSansMono.ttf.meta index 6716cafd2..8347e6789 100644 --- a/AssetStore/Assets/AssetStoreTools/Editor/DroidSansMono.ttf.meta +++ b/AssetStore/Assets/AssetStoreTools/Editor/DroidSansMono.ttf.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 35021dda9bd03434195c7dcd6ad7618f +guid: d54231d61af8b414486b80e17598cce1 +timeCreated: 1499692004 +licenseType: Store TrueTypeFontImporter: serializedVersion: 2 fontSize: 16 diff --git a/AssetStore/Assets/AssetStoreTools/Editor/icon.png.meta b/AssetStore/Assets/AssetStoreTools/Editor/icon.png.meta index 2bf7c577b..642a0457b 100644 --- a/AssetStore/Assets/AssetStoreTools/Editor/icon.png.meta +++ b/AssetStore/Assets/AssetStoreTools/Editor/icon.png.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 41844c716792706449720732c95b2747 +guid: 7d783a70b51365a49a04d3f369611b99 +timeCreated: 1499692003 +licenseType: Store TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 @@ -25,7 +27,7 @@ TextureImporter: cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 - maxTextureSize: 1024 + maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 diff --git a/AssetStore/Assets/screens/2.jpg b/AssetStore/Assets/screens/2.jpg index 277936392..59c8aed18 100644 Binary files a/AssetStore/Assets/screens/2.jpg and b/AssetStore/Assets/screens/2.jpg differ diff --git a/AssetStore/Assets/screens/3.jpg b/AssetStore/Assets/screens/3.jpg index db2e293d1..382ba5746 100644 Binary files a/AssetStore/Assets/screens/3.jpg and b/AssetStore/Assets/screens/3.jpg differ diff --git a/AssetStore/Assets/screens/7.jpg b/AssetStore/Assets/screens/7.jpg new file mode 100644 index 000000000..9b7e097d9 Binary files /dev/null and b/AssetStore/Assets/screens/7.jpg differ diff --git a/AssetStore/Assets/screens/7.jpg.meta b/AssetStore/Assets/screens/7.jpg.meta new file mode 100644 index 000000000..f7ee8add9 --- /dev/null +++ b/AssetStore/Assets/screens/7.jpg.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: 7dc890e3840c24372af2aac85173f8b3 +timeCreated: 1501437402 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -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: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/AssetStore/ProjectSettings/ClusterInputManager.asset b/AssetStore/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 000000000..e7886b266 --- /dev/null +++ b/AssetStore/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/AssetStore/ProjectSettings/GraphicsSettings.asset b/AssetStore/ProjectSettings/GraphicsSettings.asset index 151b43f77..5a96ca8a8 100644 --- a/AssetStore/ProjectSettings/GraphicsSettings.asset +++ b/AssetStore/ProjectSettings/GraphicsSettings.asset @@ -3,7 +3,7 @@ --- !u!30 &1 GraphicsSettings: m_ObjectHideFlags: 0 - serializedVersion: 4 + serializedVersion: 5 m_Deferred: m_Mode: 1 m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} @@ -21,14 +21,17 @@ GraphicsSettings: - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] + m_ShaderSettings: + useScreenSpaceShadows: 1 + m_BuildTargetShaderSettings: [] m_LightmapStripping: 0 + m_FogStripping: 0 m_LightmapKeepPlain: 1 m_LightmapKeepDirCombined: 1 m_LightmapKeepDirSeparate: 1 m_LightmapKeepDynamicPlain: 1 m_LightmapKeepDynamicDirCombined: 1 m_LightmapKeepDynamicDirSeparate: 1 - m_FogStripping: 0 m_FogKeepLinear: 1 m_FogKeepExp: 1 m_FogKeepExp2: 1 diff --git a/AssetStore/ProjectSettings/ProjectSettings.asset b/AssetStore/ProjectSettings/ProjectSettings.asset index f14d972e5..03403af75 100644 --- a/AssetStore/ProjectSettings/ProjectSettings.asset +++ b/AssetStore/ProjectSettings/ProjectSettings.asset @@ -3,30 +3,57 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 11 + productGUID: d1fbc6bd3a3f2df418cc5c74efc952d3 AndroidProfiler: 0 defaultScreenOrientation: 0 targetDevice: 2 - targetResolution: 0 useOnDemandResources: 0 accelerometerFrequency: 60 companyName: Valentin Simonov productName: TouchScript Asset Store defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1} m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_SplashScreenBackgroundLandscape: {fileID: 0} + m_SplashScreenBackgroundPortrait: {fileID: 0} + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} defaultScreenWidth: 1024 defaultScreenHeight: 768 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 - m_RenderingPath: 1 - m_MobileRenderingPath: 1 + m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 m_MobileMTRendering: 0 - m_Stereoscopic3D: 0 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 + tizenShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 iosAllowHTTPDownload: 1 @@ -41,7 +68,7 @@ PlayerSettings: defaultIsNativeResolution: 1 runInBackground: 1 captureSingleScreen: 0 - Override IPod Music: 0 + muteOtherAudioSources: 0 Prepare IOS For Recording: 0 submitAnalytics: 1 usePlayerLog: 1 @@ -49,24 +76,31 @@ PlayerSettings: forceSingleInstance: 0 resizableWindow: 0 useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games gpuSkinning: 0 + graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 xboxEnableKinectAutoTracking: 0 xboxEnableFitness: 0 visibleInBackground: 0 + allowFullscreenSwitch: 1 + graphicsJobMode: 0 macFullscreenMode: 2 d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 n3dsDisableStereoscopicView: 0 n3dsEnableSharedListOpt: 1 n3dsEnableVSync: 0 + ignoreAlphaClear: 0 xboxOneResolution: 0 - ps3SplashScreen: {fileID: 0} + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -85,36 +119,56 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleIdentifier: com.Company.ProductName bundleVersion: 1.0 preloadedAssets: [] - metroEnableIndependentInputSource: 0 - metroEnableLowLatencyPresentationAPI: 0 + metroInputSource: 0 + m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 - virtualRealitySupported: 0 - productGUID: d1fbc6bd3a3f2df418cc5c74efc952d3 + xboxOneEnable7thCore: 0 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + hololens: + depthFormat: 1 + protectGraphicsMemory: 0 + useHDRDisplay: 0 + applicationIdentifier: + Android: com.Company.ProductName + Standalone: unity.Valentin Simonov.TouchScript Asset Store + Tizen: com.Company.ProductName + iOS: com.Company.ProductName + tvOS: com.Company.ProductName + buildNumber: + iOS: 0 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 9 + AndroidMinSdkVersion: 16 + AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: - apiCompatibilityLevel: 2 stripEngineCode: 1 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 0 - iPhoneBuildNumber: 0 ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 APKExpansionFiles: 0 - preloadShaders: 0 + keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 0 VertexChannelCompressionMask: serializedVersion: 2 m_Bits: 238 iPhoneSdkVersion: 988 - iPhoneTargetOSVersion: 22 + iOSTargetOSVersionString: 6.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 @@ -128,6 +182,11 @@ PlayerSettings: iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} + appleTVSplashScreen: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSLargeIconLayers: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -146,6 +205,16 @@ PlayerSettings: iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 0 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 1 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + appleEnableAutomaticSigning: 0 AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -175,6 +244,9 @@ PlayerSettings: - m_BuildTarget: AndroidPlayer m_APIs: 08000000 m_Automatic: 0 + m_BuildTargetVRSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 webPlayerTemplate: APPLICATION:Default m_TemplateCustomTags: {} wiiUTitleID: 0005000011000000 @@ -193,40 +265,126 @@ PlayerSettings: wiiUSystemHeapSize: 128 wiiUTVStartupScreen: {fileID: 0} wiiUGamePadStartupScreen: {fileID: 0} + wiiUDrcBufferDisabled: 0 wiiUProfilerLibPath: + playModeTestRunnerEnabled: 0 actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 + cameraUsageDescription: locationUsageDescription: - XboxTitleId: - XboxImageXexPath: - XboxSpaPath: - XboxGenerateSpa: 0 - XboxDeployKinectResources: 0 - XboxSplashScreen: {fileID: 0} - xboxEnableSpeech: 0 - xboxAdditionalTitleMemorySize: 0 - xboxDeployKinectHeadOrientation: 0 - xboxDeployKinectHeadPosition: 0 - ps3TitleConfigPath: - ps3DLCConfigPath: - ps3ThumbnailPath: - ps3BackgroundPath: - ps3SoundPath: - ps3NPAgeRating: 12 - ps3TrophyCommId: - ps3NpCommunicationPassphrase: - ps3TrophyPackagePath: - ps3BootCheckMaxSaveGameSizeKB: 128 - ps3TrophyCommSig: - ps3SaveGameSlots: 1 - ps3TrialMode: 0 - ps3VideoMemoryForAudio: 0 - ps3EnableVerboseMemoryStats: 0 - ps3UseSPUForUmbra: 0 - ps3EnableMoveSupport: 1 - ps3DisableDolbyEncoding: 0 + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchDataLossConfirmation: 0 + switchSupportedNpadStyles: 3 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -238,7 +396,9 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -252,6 +412,7 @@ PlayerSettings: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 ps4EnterButtonAssignment: 1 ps4ApplicationParam1: 0 ps4ApplicationParam2: 0 @@ -259,19 +420,35 @@ PlayerSettings: ps4ApplicationParam4: 0 ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 ps4Passcode: 5xr84P2R391UXaLHbavJvFZGfO47XWS2 + ps4UseDebugIl2cppLibs: 0 ps4pnSessions: 1 ps4pnPresence: 1 ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 3 ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 ps4attribUserManagement: 0 ps4attribMoveSupport: 0 ps4attrib3DSupport: 0 ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] monoEnv: psp2Splashimage: {fileID: 0} @@ -320,14 +497,38 @@ PlayerSettings: psp2UseLibLocation: 0 psp2InfoBarOnStartup: 0 psp2InfoBarColor: 0 + psp2UseDebugIl2cppLibs: 0 psmSplashimage: {fileID: 0} + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLUseWasm: 0 + webGLCompressionFormat: 1 scriptingDefineSymbols: {} + platformArchitecture: + iOS: 2 + scriptingBackend: + Android: 0 + Standalone: 0 + WebGL: 1 + iOS: 1 + incrementalIl2cppBuild: + iOS: 0 + additionalIl2CppArgs: + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 metroPackageName: _Packages - metroPackageLogo: - metroPackageLogo140: - metroPackageLogo180: - metroPackageLogo240: metroPackageVersion: metroCertificatePath: metroCertificatePassword: @@ -335,44 +536,7 @@ PlayerSettings: metroCertificateIssuer: metroCertificateNotAfter: 0000000000000000 metroApplicationDescription: _Packages - metroStoreTileLogo80: - metroStoreTileLogo: - metroStoreTileLogo140: - metroStoreTileLogo180: - metroStoreTileWideLogo80: - metroStoreTileWideLogo: - metroStoreTileWideLogo140: - metroStoreTileWideLogo180: - metroStoreTileSmallLogo80: - metroStoreTileSmallLogo: - metroStoreTileSmallLogo140: - metroStoreTileSmallLogo180: - metroStoreSmallTile80: - metroStoreSmallTile: - metroStoreSmallTile140: - metroStoreSmallTile180: - metroStoreLargeTile80: - metroStoreLargeTile: - metroStoreLargeTile140: - metroStoreLargeTile180: - metroStoreSplashScreenImage: - metroStoreSplashScreenImage140: - metroStoreSplashScreenImage180: - metroPhoneAppIcon: - metroPhoneAppIcon140: - metroPhoneAppIcon240: - metroPhoneSmallTile: - metroPhoneSmallTile140: - metroPhoneSmallTile240: - metroPhoneMediumTile: - metroPhoneMediumTile140: - metroPhoneMediumTile240: - metroPhoneWideTile: - metroPhoneWideTile140: - metroPhoneWideTile240: - metroPhoneSplashScreenImage: - metroPhoneSplashScreenImage140: - metroPhoneSplashScreenImage240: + wsaImages: {} metroTileShortName: metroCommandLineArgsFile: metroTileShowName: 1 @@ -389,29 +553,14 @@ PlayerSettings: metroFTAFileTypes: [] metroProtocolName: metroCompilationOverrides: 1 - blackberryDeviceAddress: - blackberryDevicePassword: - blackberryTokenPath: - blackberryTokenExires: - blackberryTokenAuthor: - blackberryTokenAuthorId: - blackberryCskPassword: - blackberrySaveLogPath: - blackberrySharedPermissions: 0 - blackberryCameraPermissions: 0 - blackberryGPSPermissions: 0 - blackberryDeviceIDPermissions: 0 - blackberryMicrophonePermissions: 0 - blackberryGamepadSupport: 0 - blackberryBuildId: 0 - blackberryLandscapeSplashScreen: {fileID: 0} - blackberryPortraitSplashScreen: {fileID: 0} - blackberrySquareSplashScreen: {fileID: 0} tizenProductDescription: tizenProductURL: tizenSigningProfileName: tizenGPSPermissions: 0 tizenMicrophonePermissions: 0 + tizenDeploymentTarget: + tizenDeploymentTargetType: -1 + tizenMinOSVersion: 1 n3dsUseExtSaveData: 0 n3dsCompressStaticMem: 1 n3dsExtSaveDataNumber: 0x12345 @@ -441,47 +590,26 @@ PlayerSettings: XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} XboxOneIsContentPackage: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 - intPropertyNames: - - Android::ScriptingBackend - - Standalone::ScriptingBackend - - WebGL::ScriptingBackend - - WebGL::audioCompressionFormat - - WebGL::exceptionSupport - - WebGL::memorySize - - iOS::Architecture - - iOS::EnableIncrementalBuildSupportForIl2cpp - - iOS::ScriptingBackend - Android::ScriptingBackend: 0 - Standalone::ScriptingBackend: 0 - WebGL::ScriptingBackend: 1 - WebGL::audioCompressionFormat: 4 - WebGL::exceptionSupport: 1 - WebGL::memorySize: 256 - iOS::Architecture: 2 - iOS::EnableIncrementalBuildSupportForIl2cpp: 0 - iOS::ScriptingBackend: 1 - boolPropertyNames: - - WebGL::analyzeBuildSize - - WebGL::dataCaching - - WebGL::useEmbeddedResources - WebGL::analyzeBuildSize: 0 - WebGL::dataCaching: 0 - WebGL::useEmbeddedResources: 0 - stringPropertyNames: - - WebGL::emscriptenArgs - - WebGL::template - - additionalIl2CppArgs::additionalIl2CppArgs - WebGL::emscriptenArgs: - WebGL::template: APPLICATION:Default - additionalIl2CppArgs::additionalIl2CppArgs: - firstStreamedSceneWithResources: 0 + xboxOneScriptCompiler: 0 + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: {} + facebookSdkVersion: 7.9.1 + apiCompatibilityLevel: 2 cloudProjectId: projectName: organizationId: cloudEnabled: 0 + enableNewInputSystem: 0 diff --git a/AssetStore/ProjectSettings/ProjectVersion.txt b/AssetStore/ProjectSettings/ProjectVersion.txt index b11ab9b5b..cbfba31f0 100644 --- a/AssetStore/ProjectSettings/ProjectVersion.txt +++ b/AssetStore/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.2.2f1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.2p4 diff --git a/AssetStore/ProjectSettings/UnityAdsSettings.asset b/AssetStore/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 224050ce8..000000000 --- a/AssetStore/ProjectSettings/UnityAdsSettings.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!292 &1 -UnityAdsSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: diff --git a/AssetStore/ProjectSettings/UnityAnalyticsManager.asset b/AssetStore/ProjectSettings/UnityAnalyticsManager.asset deleted file mode 100644 index 4a7b66883..000000000 --- a/AssetStore/ProjectSettings/UnityAnalyticsManager.asset +++ /dev/null @@ -1,10 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!303 &1 -UnityAnalyticsManager: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: diff --git a/AssetStore/ProjectSettings/UnityConnectSettings.asset b/AssetStore/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 000000000..1cb99bba0 Binary files /dev/null and b/AssetStore/ProjectSettings/UnityConnectSettings.asset differ diff --git a/Build/package.sh b/Build/package.sh index 2f5fc80a9..2f339deb8 100755 --- a/Build/package.sh +++ b/Build/package.sh @@ -19,12 +19,14 @@ rm -f "$ASSETSTORE/Assets/TouchScript.meta" cp -r "$SOURCE/Assets/TouchScript" "$ASSETSTORE/Assets/" cp "$SOURCE/Assets/TouchScript.meta" "$ASSETSTORE/Assets/" -for i in $(ls -d "$MODULES/"*/); do - FILE="${i%%/}/Build/package.sh" - if [ -f $FILE ]; then - "$FILE" "$ASSETSTORE/Assets/TouchScript/Modules" - fi -done +if [ -d "$MODULES" ]; then + for i in $(ls -d "$MODULES/"*/); do + FILE="${i%%/}/Build/package.sh" + if [ -f $FILE ]; then + "$FILE" "$ASSETSTORE/Assets/TouchScript/Modules" + fi + done +fi printf "\n\e[1;36mPackaging TouchScript.unitypackage.\e[0;39m\n" diff --git a/Build/sync_modules.sh b/Build/sync_modules.sh index 15cf7f770..d1a1b1215 100755 --- a/Build/sync_modules.sh +++ b/Build/sync_modules.sh @@ -3,7 +3,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MODULES=$(cd "$DIR/../Modules/" && pwd) -for i in $(ls -d "$MODULES/"*/); do - FOLDER="${i%%/}" - "$DIR/utils/sync_module.sh" "$FOLDER" -done \ No newline at end of file +if [ -d "$MODULES" ]; then + for i in $(ls -d "$MODULES/"*/); do + FOLDER="${i%%/}" + "$DIR/utils/sync_module.sh" "$FOLDER" + done +fi \ No newline at end of file diff --git a/Build/utils/build_solution.sh b/Build/utils/build_solution.sh index 0dfdcd4d8..4c67fe4c8 100755 --- a/Build/utils/build_solution.sh +++ b/Build/utils/build_solution.sh @@ -3,12 +3,12 @@ # Builds a solution on OSX and Windows. # Assumes that Unity is located either in /Applications/Unity/ or c:\Program Files\Unity\. -if [[ $# -eq 0 ]] ; then - printf "\e[31mUsage: build_solution.sh \e[39m\n" +if [[ $# -ne 2 ]] ; then + printf "\e[31mUsage: build_solution.sh \e[39m\n" exit 0 fi -printf "\e[1;33mBuilding ${1}.\e[0;39m\n" +printf "\e[1;33mBuilding ${1} (${2}).\e[0;39m\n" # Mac if [ "$(uname)" == "Darwin" ]; then @@ -21,5 +21,5 @@ if [ "$(uname)" == "Darwin" ]; then # Windows elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then - /c/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe ${1} -p:Configuration=Release -clp:ErrorsOnly + /c/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe "${1}" -p:Platform="${2}" -p:Configuration=Release -clp:ErrorsOnly -p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140" fi \ No newline at end of file diff --git a/Docs/docs.shfbproj b/Docs/docs.shfbproj index a53cb069b..7832740c9 100644 --- a/Docs/docs.shfbproj +++ b/Docs/docs.shfbproj @@ -23,8 +23,8 @@ TouchScript ..\..\..\..\Program Files (x86)\Sandcastle\ - - + + Website C# @@ -45,13 +45,13 @@ 2 False Blank - VS2010 + VS2013 False TouchScript — multitouch library for Unity AboveNamespaces - Attributes, ExplicitInterfaceImplementations, Protected + ExplicitInterfaceImplementations, InheritedMembers, Protected AutoDocumentCtors, AutoDocumentDispose - TouchScript is a multitouch library for Unity. Inspired by iOS, TouchScript makes handling complex gesture interactions on any touch surface much easier. Please refer to: https://github.com/TouchScript/TouchScript + TouchScript is a multitouch library for Unity. Inspired by iOS, TouchScript makes handling complex gesture interactions on any touch surface much easier. Please refer to: &lt%3ba href=&quot%3bhttps://github.com/TouchScript/TouchScript&quot%3b&gt%3bhttps://github.com/TouchScript/TouchScript&lt%3b/a&gt%3b. TouchScript. @@ -70,17 +70,44 @@ TouchScript.Gestures. - + TouchScript.Gestures.Clustered. TouchScript.Gestures.UI. TouchScript.Hit. TouchScript.InputSources. TouchScript.InputSources.InputHandlers TouchScript.Layers. - TouchScript.Utils. - - + TouchScript.Utils. + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/howto.txt b/Docs/howto.txt new file mode 100644 index 000000000..36c7f548d --- /dev/null +++ b/Docs/howto.txt @@ -0,0 +1,28 @@ +## How to build Documentation. + +The docs are built using Sandcastle Help File Builder +https://github.com/EWSoftware/SHFB/releases + +First, you need to generate the docs XML file and build the DLL from Visual Studio. + +Right now it is only possible to do on Windows: +1. Open Source.sln in Visual Studio. +2. Open Source.CSharp Properties. + If unable, need to configure VS Tools for Unity so it would allow chaning project properties. + You need to enable the "Access to project properties" option in the "Tools > Options > Tools for Unity > General" section and restart Visual Studio. +3. Enable "XML Documentation File" option in "Build" tab. +4. Save the project and build it from Visual Studio. + +This will generate two files needed by the docs build process: +1. Source/Temp/UnityVS_bin/Debug/Assembly-CSharp.DLL +2. Source/Temp/UnityVS_bin/Debug/Assembly-CSharp.XML + +To build the docs you need to: +1. Download the latest release of SHFB. +2. Run SandcastleBuilderGUI.exe from the folder where you installed SHFB. +3. Delete Docs/Help folder if it exists. +4. Open docs.shfbproj file. +5. Go to Project "Properties > Visibility > Edit API Filter" and uncheck all Examples namespaces and non-TouchScript namespaces which might have gotten there if you have any other code in the Unity project. +6. Save and press "Build the Help File" button. + +Documentation will be saved to Docs/Help folder. \ No newline at end of file diff --git a/External/TUIO/Build/build.sh b/External/TUIO/Build/build.sh index db4ff1623..08d1c87df 100755 --- a/External/TUIO/Build/build.sh +++ b/External/TUIO/Build/build.sh @@ -7,6 +7,6 @@ PROJECT=$(cd "$DIR/../TUIOsharp" && pwd) LIBS=$(cd "$DIR/../../../Source/Assets/TouchScript/Modules/TUIO/Libraries/" && pwd) SLN="$PROJECT/TUIOsharp.sln" -"$DIR/../../../Build/utils/build_solution.sh" $SLN +"$DIR/../../../Build/utils/build_solution.sh" $SLN "Any CPU" cp "$PROJECT/TUIOsharp/bin/Release/TUIOsharp.dll" "$LIBS" cp "$PROJECT/TUIOsharp/bin/Release/OSCsharp.dll" "$LIBS" \ No newline at end of file diff --git a/External/WindowsTouch/.gitignore b/External/WindowsTouch/.gitignore new file mode 100644 index 000000000..ca07639e2 --- /dev/null +++ b/External/WindowsTouch/.gitignore @@ -0,0 +1,250 @@ +#OS junk files +[Tt]humbs.db +*.DS_Store + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +*.VC.db \ No newline at end of file diff --git a/External/WindowsTouch/Build/build.sh b/External/WindowsTouch/Build/build.sh new file mode 100755 index 000000000..84795c22d --- /dev/null +++ b/External/WindowsTouch/Build/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +printf "\n\e[1;36mBuilding External/WindowsTouch.\e[0;39m\n" + +UNAME=$(uname -s) +if [ "${UNAME:0:10}" != "MINGW32_NT" ] && [ "${UNAME:0:10}" != "MINGW64_NT" ]; then + printf "\e[31mNeed to build WindowsTouch.dll on Windows!\e[39m\n" + exit 0 +fi + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT=$(cd "$DIR/../" && pwd) +SLN="$PROJECT/WindowsTouch.sln" + +"$DIR/../../../Build/utils/build_solution.sh" $SLN x86 +"$DIR/../../../Build/utils/build_solution.sh" $SLN x64 \ No newline at end of file diff --git a/External/WindowsTouch/WindowsTouch.cpp b/External/WindowsTouch/WindowsTouch.cpp new file mode 100644 index 000000000..9bc7fc95f --- /dev/null +++ b/External/WindowsTouch/WindowsTouch.cpp @@ -0,0 +1,190 @@ +/* +* @author Valentin Simonov / http://va.lent.in/ +*/ + +#include "WindowsTouch.h" + +extern "C" +{ + + void __stdcall Init(TOUCH_API api, LogFuncPtr logFunc, PointerDelegatePtr delegate) + { + _log = logFunc; + _delegate = delegate; + _api = api; + + _currentWindow = FindWindowA("UnityWndClass", NULL); + if (api == WIN8) + { + HINSTANCE h = LoadLibrary(TEXT("user32.dll")); + GetPointerInfo = (GET_POINTER_INFO) GetProcAddress(h, "GetPointerInfo"); + GetPointerTouchInfo = (GET_POINTER_TOUCH_INFO) GetProcAddress(h, "GetPointerTouchInfo"); + GetPointerPenInfo = (GET_POINTER_PEN_INFO)GetProcAddress(h, "GetPointerPenInfo"); + + _oldWindowProc = SetWindowLongPtr(_currentWindow, GWLP_WNDPROC, (LONG_PTR)wndProc8); + log(L"Initialized WIN8 input."); + } + else + { + RegisterTouchWindow(_currentWindow, 0); + _oldWindowProc = SetWindowLongPtr(_currentWindow, GWLP_WNDPROC, (LONG_PTR)wndProc7); + log(L"Initialized WIN7 input."); + } + } + + void __stdcall Dispose() + { + if (_oldWindowProc) + { + SetWindowLongPtr(_currentWindow, GWLP_WNDPROC, (LONG_PTR)_oldWindowProc); + _oldWindowProc = 0; + if (_api == WIN7) + { + UnregisterTouchWindow(_currentWindow); + } + } + } + + void __stdcall SetScreenParams(int width, int height, float offsetX, float offsetY, float scaleX, float scaleY) + { + _screenWidth = width; + _screenHeight = height; + _offsetX = offsetX; + _offsetY = offsetY; + _scaleX = scaleX; + _scaleY = scaleY; + } + +} + +LRESULT CALLBACK wndProc8(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_TOUCH: + CloseTouchInputHandle((HTOUCHINPUT)lParam); + break; + case WM_POINTERENTER: + case WM_POINTERLEAVE: + case WM_POINTERDOWN: + case WM_POINTERUP: + case WM_POINTERUPDATE: + case WM_POINTERCAPTURECHANGED: + decodeWin8Touches(msg, wParam, lParam); + break; + default: + return CallWindowProc((WNDPROC)_oldWindowProc, hwnd, msg, wParam, lParam); + } + return 0; +} + +LRESULT CALLBACK wndProc7(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_TOUCH: + decodeWin7Touches(msg, wParam, lParam); + break; + default: + return CallWindowProc((WNDPROC)_oldWindowProc, hwnd, msg, wParam, lParam); + } + return 0; +} + +void decodeWin8Touches(UINT msg, WPARAM wParam, LPARAM lParam) +{ + int pointerId = GET_POINTERID_WPARAM(wParam); + + POINTER_INFO pointerInfo; + if (!GetPointerInfo(pointerId, &pointerInfo)) return; + + POINT p; + p.x = pointerInfo.ptPixelLocation.x; + p.y = pointerInfo.ptPixelLocation.y; + ScreenToClient(_currentWindow, &p); + + Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); + PointerData data {}; + data.pointerFlags = pointerInfo.pointerFlags; + data.changedButtons = pointerInfo.ButtonChangeType; + + if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELED) != 0 + || msg == WM_POINTERCAPTURECHANGED) msg = POINTER_CANCELLED; + + switch (pointerInfo.pointerType) + { + case PT_MOUSE: + break; + case PT_TOUCH: + POINTER_TOUCH_INFO touchInfo; + GetPointerTouchInfo(pointerId, &touchInfo); + data.flags = touchInfo.touchFlags; + data.mask = touchInfo.touchMask; + data.rotation = touchInfo.orientation; + data.pressure = touchInfo.pressure; + break; + case PT_PEN: + POINTER_PEN_INFO penInfo; + GetPointerPenInfo(pointerId, &penInfo); + data.flags = penInfo.penFlags; + data.mask = penInfo.penMask; + data.rotation = penInfo.rotation; + data.pressure = penInfo.pressure; + data.tiltX = penInfo.tiltX; + data.tiltY = penInfo.tiltY; + break; + } + + _delegate(pointerId, msg, pointerInfo.pointerType, position, data); +} + +void decodeWin7Touches(UINT msg, WPARAM wParam, LPARAM lParam) +{ + UINT cInputs = LOWORD(wParam); + PTOUCHINPUT pInputs = new TOUCHINPUT[cInputs]; + + if (!pInputs) return; + if (!GetTouchInputInfo((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))) return; + + for (UINT i = 0; i < cInputs; i++) + { + TOUCHINPUT touch = pInputs[i]; + + POINT p; + p.x = touch.x / 100; + p.y = touch.y / 100; + ScreenToClient(_currentWindow, &p); + + Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); + PointerData data {}; + + if ((touch.dwFlags & TOUCHEVENTF_DOWN) != 0) + { + msg = WM_POINTERDOWN; + data.changedButtons = POINTER_CHANGE_FIRSTBUTTON_DOWN; + } + else if ((touch.dwFlags & TOUCHEVENTF_UP) != 0) + { + msg = WM_POINTERLEAVE; + data.changedButtons = POINTER_CHANGE_FIRSTBUTTON_UP; + } + else if ((touch.dwFlags & TOUCHEVENTF_MOVE) != 0) + { + msg = WM_POINTERUPDATE; + } + + _delegate(touch.dwID, msg, PT_TOUCH, position, data); + } + + CloseTouchInputHandle((HTOUCHINPUT)lParam); + delete[] pInputs; +} + +void log(const wchar_t* str) +{ +#if _DEBUG + BSTR bstr = SysAllocString(str); + _log(bstr); + SysFreeString(bstr); +#endif +} \ No newline at end of file diff --git a/External/WindowsTouch/WindowsTouch.h b/External/WindowsTouch/WindowsTouch.h new file mode 100644 index 000000000..1a6d15976 --- /dev/null +++ b/External/WindowsTouch/WindowsTouch.h @@ -0,0 +1,198 @@ +/* +* @author Valentin Simonov / http://va.lent.in/ +*/ + +#define WINVER _WIN32_WINNT_WIN7 +#define _WIN32_WINNT _WIN32_WINNT_WIN7 + +#include + +#define EXPORT_API __declspec(dllexport) + +typedef enum +{ + WIN7, + WIN8 +} TOUCH_API; + +// + +#define WM_POINTERENTER 0x0249 +#define WM_POINTERLEAVE 0x024A +#define WM_POINTERUPDATE 0x0245 +#define WM_POINTERDOWN 0x0246 +#define WM_POINTERUP 0x0247 +#define WM_POINTERCAPTURECHANGED 0x024C +#define POINTER_CANCELLED 0x1000 + +#define GET_POINTERID_WPARAM(wParam) (LOWORD(wParam)) + +typedef enum { + PT_POINTER = 0x00000001, + PT_TOUCH = 0x00000002, + PT_PEN = 0x00000003, + PT_MOUSE = 0x00000004, + PT_TOUCHPAD = 0x00000005 +} POINTER_INPUT_TYPE; + +typedef enum { + POINTER_FLAG_NONE = 0x00000000, + POINTER_FLAG_NEW = 0x00000001, + POINTER_FLAG_INRANGE = 0x00000002, + POINTER_FLAG_INCONTACT = 0x00000004, + POINTER_FLAG_FIRSTBUTTON = 0x00000010, + POINTER_FLAG_SECONDBUTTON = 0x00000020, + POINTER_FLAG_THIRDBUTTON = 0x00000040, + POINTER_FLAG_FOURTHBUTTON = 0x00000080, + POINTER_FLAG_FIFTHBUTTON = 0x00000100, + POINTER_FLAG_PRIMARY = 0x00002000, + POINTER_FLAG_CONFIDENCE = 0x00004000, + POINTER_FLAG_CANCELED = 0x00008000, + POINTER_FLAG_DOWN = 0x00010000, + POINTER_FLAG_UPDATE = 0x00020000, + POINTER_FLAG_UP = 0x00040000, + POINTER_FLAG_WHEEL = 0x00080000, + POINTER_FLAG_HWHEEL = 0x00100000, + POINTER_FLAG_CAPTURECHANGED = 0x00200000, + POINTER_FLAG_HASTRANSFORM = 0x00400000 +} POINTER_FLAGS; + +typedef enum { + POINTER_CHANGE_NONE, + POINTER_CHANGE_FIRSTBUTTON_DOWN, + POINTER_CHANGE_FIRSTBUTTON_UP, + POINTER_CHANGE_SECONDBUTTON_DOWN, + POINTER_CHANGE_SECONDBUTTON_UP, + POINTER_CHANGE_THIRDBUTTON_DOWN, + POINTER_CHANGE_THIRDBUTTON_UP, + POINTER_CHANGE_FOURTHBUTTON_DOWN, + POINTER_CHANGE_FOURTHBUTTON_UP, + POINTER_CHANGE_FIFTHBUTTON_DOWN, + POINTER_CHANGE_FIFTHBUTTON_UP, +} POINTER_BUTTON_CHANGE_TYPE; + +typedef enum { + TOUCH_FLAG_NONE = 0x00000000 +} TOUCH_FLAGS; + +typedef enum { + TOUCH_MASK_NONE = 0x00000000, + TOUCH_MASK_CONTACTAREA = 0x00000001, + TOUCH_MASK_ORIENTATION = 0x00000002, + TOUCH_MASK_PRESSURE = 0x00000004 +} TOUCH_MASK; + +typedef enum { + PEN_FLAG_NONE = 0x00000000, + PEN_FLAG_BARREL = 0x00000001, + PEN_FLAG_INVERTED = 0x00000002, + PEN_FLAG_ERASER = 0x00000004 +} PEN_FLAGS; + +typedef enum { + PEN_MASK_NONE = 0x00000000, + PEN_MASK_PRESSURE = 0x00000001, + PEN_MASK_ROTATION = 0x00000002, + PEN_MASK_TILT_X = 0x00000004, + PEN_MASK_TILT_Y = 0x00000008 +} PEN_MASK; + +typedef struct { + POINTER_INPUT_TYPE pointerType; + UINT32 pointerId; + UINT32 frameId; + POINTER_FLAGS pointerFlags; + HANDLE sourceDevice; + HWND hwndTarget; + POINT ptPixelLocation; + POINT ptHimetricLocation; + POINT ptPixelLocationRaw; + POINT ptHimetricLocationRaw; + DWORD dwTime; + UINT32 historyCount; + INT32 InputData; + DWORD dwKeyStates; + UINT64 PerformanceCount; + POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; +} POINTER_INFO; + +typedef struct { + POINTER_INFO pointerInfo; + TOUCH_FLAGS touchFlags; + TOUCH_MASK touchMask; + RECT rcContact; + RECT rcContactRaw; + UINT32 orientation; + UINT32 pressure; +} POINTER_TOUCH_INFO; + +typedef struct { + POINTER_INFO pointerInfo; + PEN_FLAGS penFlags; + PEN_MASK penMask; + UINT32 pressure; + UINT32 rotation; + INT32 tiltX; + INT32 tiltY; +} POINTER_PEN_INFO; + +typedef BOOL (WINAPI *GET_POINTER_INFO)(UINT32 pointerId, POINTER_INFO *pointerInfo); +typedef BOOL (WINAPI *GET_POINTER_TOUCH_INFO)(UINT32 pointerId, POINTER_TOUCH_INFO *pointerInfo); +typedef BOOL (WINAPI *GET_POINTER_PEN_INFO)(UINT32 pointerId, POINTER_PEN_INFO *pointerInfo); + +GET_POINTER_INFO GetPointerInfo; +GET_POINTER_TOUCH_INFO GetPointerTouchInfo; +GET_POINTER_PEN_INFO GetPointerPenInfo; + +// + +struct Vector2 +{ + float x, y; + + Vector2(float x, float y) + { + this->x = x; + this->y = y; + } +}; + +struct PointerData +{ + POINTER_FLAGS pointerFlags; + UINT32 flags; + UINT32 mask; + POINTER_BUTTON_CHANGE_TYPE changedButtons; + UINT32 rotation; + UINT32 pressure; + INT32 tiltX; + INT32 tiltY; +}; + +typedef void(__stdcall * PointerDelegatePtr)(int id, UINT32 event, POINTER_INPUT_TYPE type, Vector2 position, PointerData data); +typedef void(__stdcall * LogFuncPtr)(BSTR log); + +PointerDelegatePtr _delegate; +LogFuncPtr _log; +HWND _currentWindow; +int _screenWidth; +int _screenHeight; +float _offsetX = 0; +float _offsetY = 0; +float _scaleX = 1; +float _scaleY = 1; +TOUCH_API _api; +LONG_PTR _oldWindowProc; + +extern "C" +{ + EXPORT_API void __stdcall Init(TOUCH_API api, LogFuncPtr logFunc, PointerDelegatePtr delegate); + EXPORT_API void __stdcall SetScreenParams(int width, int height, float offsetX, float offsetY, float scaleX, float scaleY); + EXPORT_API void __stdcall Dispose(); +} + +void log(const wchar_t* str); +LRESULT CALLBACK wndProc8(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK wndProc7(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +void decodeWin8Touches(UINT msg, WPARAM wParam, LPARAM lParam); +void decodeWin7Touches(UINT msg, WPARAM wParam, LPARAM lParam); \ No newline at end of file diff --git a/External/WindowsTouch/WindowsTouch.sln b/External/WindowsTouch/WindowsTouch.sln new file mode 100644 index 000000000..845b40d24 --- /dev/null +++ b/External/WindowsTouch/WindowsTouch.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsTouch", "WindowsTouch.vcxproj", "{6E671F43-5721-4EE9-9FCD-FD53202B4B43}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Debug|x64.ActiveCfg = Debug|x64 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Debug|x64.Build.0 = Debug|x64 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Debug|x86.ActiveCfg = Debug|Win32 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Debug|x86.Build.0 = Debug|Win32 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Release|x64.ActiveCfg = Release|x64 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Release|x64.Build.0 = Release|x64 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Release|x86.ActiveCfg = Release|Win32 + {6E671F43-5721-4EE9-9FCD-FD53202B4B43}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/External/WindowsTouch/WindowsTouch.vcxproj b/External/WindowsTouch/WindowsTouch.vcxproj new file mode 100644 index 000000000..42ac710b2 --- /dev/null +++ b/External/WindowsTouch/WindowsTouch.vcxproj @@ -0,0 +1,183 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6E671F43-5721-4EE9-9FCD-FD53202B4B43} + Win32Proj + WindowsTouch + 8.1 + WindowsTouch + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\Source\Assets\TouchScript\Plugins\WindowsTouch\$(Platform)\ + $(ProjectName) + + + $(ProjectName) + true + ..\..\Source\Assets\TouchScript\Plugins\WindowsTouch\ + + + false + ..\..\Source\Assets\TouchScript\Plugins\WindowsTouch\$(Platform)\ + $(ProjectName) + $(Configuration)\ + false + + + $(ProjectName) + false + ..\..\Source\Assets\TouchScript\Plugins\WindowsTouch\ + + + + + + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;WINDOWSTOUCH_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;WINDOWSTOUCH_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;WINDOWSTOUCH_EXPORTS;%(PreprocessorDefinitions) + true + None + MultiThreaded + + + Windows + true + true + false + UseLinkTimeCodeGeneration + $(Configuration)\$(TargetName).lib + + + + + + + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;WINDOWSTOUCH_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + false + $(Configuration)\$(TargetName).lib + UseLinkTimeCodeGeneration + + + + + + + + + + + + \ No newline at end of file diff --git a/External/WindowsTouch/WindowsTouch.vcxproj.filters b/External/WindowsTouch/WindowsTouch.vcxproj.filters new file mode 100644 index 000000000..776ab0ebb --- /dev/null +++ b/External/WindowsTouch/WindowsTouch.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Modules/.gitignore b/Modules/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/Modules/Playmaker b/Modules/Playmaker deleted file mode 160000 index f41ce76a6..000000000 --- a/Modules/Playmaker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f41ce76a6801bf17294adc0eb76f4394c83d0a15 diff --git a/README.md b/README.md index e9f70637f..5a13dc27b 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,63 @@ ![](https://raw.github.com/wiki/TouchScript/TouchScript/images/dvfu.jpg) -## TouchScript — multitouch library for Unity - -**TouchScript** is a multitouch library for Unity. Inspired by iOS, **TouchScript** makes handling complex gesture interactions on any touch surface much easier. - -> Warning! [Please read before upgrading](https://github.com/TouchScript/TouchScript/wiki/Upgrading). -> Please ask all questions on [the Forum](http://touchprefab.com/index.php). - -## Features -- **Supports many touch input methods starting from smartphones to giant touch surfaces: Windows 7/8 touch, mobile (iOS, Android, Windows Store/Windows Phone), TUIO, mouse.** -- **Abstracts touch and gesture logic from input methods and platforms. Your touch-related code will be the same everywhere.** -- **Manages simultaneous gesture recognition within scene hierarchy.** -- **Is infinitely extensible. You can add custom input methods, gestures and hit test logic in a matter of minutes.** -- Comes with many commonly used gestures. -- Supports all available platforms. -- Doesn't require Unity Pro. -- Highly efficient and optimized. -- Has very easy and intuitive API. -- Uses events in C# and SendMessage in UnityScript. -- Has PlayMaker actions. -- Takes into account DPI differences between a large touch surface and an iPad. -- Comes with many examples, is heavily documented with step-by-step tutorials. -- Groups touch points into clusters on big touch surfaces. -- Easy to test multitouch gestures without actual multitouch device using built-in second touch simulator (activated with ALT+CLICK), [TUIOPad on iOS](https://itunes.apple.com/us/app/tuiopad/id412446962) or [TUIODroid on Android](https://play.google.com/store/apps/details?id=tuioDroid.impl&hl=en"). [Read more](Testing-multitouch-on-a-PC). -- **It's free and open-source. Licensed under MIT license.** - -Developed by Valentin Simonov at [Interactive Lab](http://interactivelab.ru). - -## Documentation -Please refer to [Wiki](https://github.com/TouchScript/TouchScript/wiki) for up-to-date documentation and tutorials. -If you have questions please read the [FAQ](https://github.com/TouchScript/TouchScript/wiki/FAQ) first. After that search [the Forum](http://touchprefab.com/index.php). -If you are sure that you found a bug post an [issue](https://github.com/TouchScript/TouchScript/issues). -API documentation is available [here](http://TouchScript.github.io/docs/Index.html). - -## Consulting and contract work -If you require custom functionality for your project or consulting services please contact me at **v@lent.in**. +## TouchScript — multi-touch library for Unity + +When working on a project for mobile devices or PCs with touch input you will soon require basic gestures like tap, pan, pinch and zoom — they are not hard to implement manually using Unity API or using a package from Asset Store. The hard part is to make these gestures work together, e.g. to have a button with a tap gesture placed on a zoomable window. This is where you will need **TouchScript** — it makes handling complex gesture interactions on any touch surface an effortless job. + +## Why TouchScript? +- TouchScript abstracts touch and gesture logic from input methods and platforms. Your touch-related code will be the same everywhere. +- TouchScript supports many touch input methods starting from smartphones to giant touch surfaces: mouse, Windows 7/8 touch, mobile (iOS, Android, Windows Store/Windows Phone), TUIO. +- TouchScript includes common gesture implementations: press, release, tap, long press, flick, pinch/scale/rotate. +- TouchScript allows you to write your own gestures and custom pointer input logic. +- TouchScript manages gestures in transform hierarchy and makes sure that the most relevant gesture will receive touch input. +- TouchScript comes with many examples and is extensively documented. +- TouchScript makes it easy to test multi-touch gestures without an actual multi-touch device using built-in second touch simulator (activated with Alt + click), [TUIOPad on iOS](https://itunes.apple.com/us/app/tuiopad/id412446962) or [TUIODroid on Android](https://play.google.com/store/apps/details?id=tuioDroid.impl&hl=en"). [Read more](Testing-multitouch-on-a-PC). +- It's free and open-source. Licensed under MIT license. + +Developed by Valentin Simonov. + +## Getting started +### Downloading the package +To use **TouchScript** in your project you either need to +* download the [latest release from Github](https://github.com/TouchScript/TouchScript/releases), +* or get it from [Asset Store](https://www.assetstore.unity3d.com/en/#!/content/7394), +* or clone the [repository](https://github.com/TouchScript/TouchScript) and use the source ([more info on how to do it](https://github.com/TouchScript/TouchScript/wiki/How-to-Contribute)). + +### Your first TouchScript project +To test how TouchScript works, create an empty scene and drag two prefabs from `TouchScript/Prefabs` folder to the scene: `TouchManager` and `Cursors`. Press Play and click or touch (if your PC supports touch input) the Game View — you will see colored circles, pointer cursors. + +> Note: to simulate a second pointer you can hold Alt and click anywhere within the Game View. + +You can make any GameObject react to touch input — just attach one of the scripts called Gestures to it. TouchScript ships with a few built-in Gestures which you can find in `Component/TouchScript/Gestures` menu. It is also possible to write your own gestures. + +To test how built-in Gestures work, create an empty cube in the scene and attach a `TransformGesture` to it either from `Component` menu or `Add Component` button. Make the cube large enough to be able to touch it with two fingers. Attach another component called `Transformer` to the cube — this component listens to events from `TransformGesture` and applies translation, rotation and scaling to the GameObject. + +Press Play. Note how you can drag the object with one touch and scale or rotate it with two touches. Don't forget that you can use Alt + click to simulate a second pointer ([read more more about testing multi-touch gestures](https://github.com/TouchScript/TouchScript/wiki/Testing-multitouch-on-a-PC)). + +### Examples +TouchScript comes with many examples in `TouchScript/Examples` folder. Open `Examples.unity` scene and read description for every example to find out what it is about. + +[All examples are explaned here.](https://github.com/TouchScript/TouchScript/wiki/Examples) + +### What to read next +- [How to receive a pointer.](https://github.com/TouchScript/TouchScript/wiki/Pointer-Input) +- [What is a Gesture and how to work with it.](https://github.com/TouchScript/TouchScript/wiki/Gestures) +- [What is an Input Source and why it is needed.](https://github.com/TouchScript/TouchScript/wiki/Input-Sources) +- [What is a Layer and why it is needed.](https://github.com/TouchScript/TouchScript/wiki/Layers) +- [Some info on how TouchScript works internally.](https://github.com/TouchScript/TouchScript/wiki/Main-Ideas-Behind-TouchScript) +- [How to affect which objects can be touched.](https://github.com/TouchScript/TouchScript/wiki/Modifying-Hits) +- [How to change touch coordinates from an input device.](https://github.com/TouchScript/TouchScript/wiki/Remapping-Coordinates-From-an-Input-Source) +- [How to write a custom Gesture.](https://github.com/TouchScript/TouchScript/wiki/Tutorial.-Writing-a-Custom-Gesture.) +- [How you can help.](https://github.com/TouchScript/TouchScript/wiki/How-to-Contribute) + +## Need help? +> If you have a problem using TouchScript or running examples please check the [FAQ](FAQ) before submitting issues. + + - [FAQ](FAQ) +_Some of the questions have been already asked multiple times. Check if yours is in the list._ + - [Documentation](http://touchscript.github.io/docs/) +_Complete up-to-date generated docs with all public API annotated._ + - [Official Forum](http://touchprefab.com/index.php) +_Want to ask a question about TouchScript? Use the official Forum._ + - [Issues](https://github.com/TouchScript/TouchScript/issues) +_Found a bug? Got a feature request? Feel free to post it in Issues._ diff --git a/Resources/Icons/Axes/Axes.xfl b/Resources/Icons/Axes/Axes.xfl new file mode 100644 index 000000000..860a820ec --- /dev/null +++ b/Resources/Icons/Axes/Axes.xfl @@ -0,0 +1 @@ +PROXY-CS5 \ No newline at end of file diff --git a/Resources/Icons/Axes/DOMDocument.xml b/Resources/Icons/Axes/DOMDocument.xml new file mode 100644 index 000000000..4c20f7dd3 --- /dev/null +++ b/Resources/Icons/Axes/DOMDocument.xml @@ -0,0 +1,656 @@ + + + + + + + + + + + + + + + + + + + + X + + + + + + Z + + + + + + + + + + + + + + + + + X + + + + + + Z + + + + + + + + + + + + + + + + + Y + + + + + + Z + + + + + + + + + + + + + + + + + X + + + + + + Y + + + + + + + + + + + + + + + + + + + + + + + ?? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Icons/Axes/LIBRARY/Arrow.xml b/Resources/Icons/Axes/LIBRARY/Arrow.xml new file mode 100644 index 000000000..8b36b0679 --- /dev/null +++ b/Resources/Icons/Axes/LIBRARY/Arrow.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Icons/Axes/LIBRARY/Line.xml b/Resources/Icons/Axes/LIBRARY/Line.xml new file mode 100644 index 000000000..a4a6db0ad --- /dev/null +++ b/Resources/Icons/Axes/LIBRARY/Line.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Icons/Axes/META-INF/metadata.xml b/Resources/Icons/Axes/META-INF/metadata.xml new file mode 100644 index 000000000..e69de29bb diff --git a/Resources/Icons/Axes/MobileSettings.xml b/Resources/Icons/Axes/MobileSettings.xml new file mode 100644 index 000000000..e69de29bb diff --git a/Resources/Icons/Axes/PublishSettings.xml b/Resources/Icons/Axes/PublishSettings.xml new file mode 100644 index 000000000..8258315df --- /dev/null +++ b/Resources/Icons/Axes/PublishSettings.xml @@ -0,0 +1,175 @@ + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + axes.swf + axes.exe + axes.app + axes.html + axes.gif + axes.jpg + axes.png + axes.swc + axes.oam + 0 + 0 + 0 + 0 + + + 0 + 25,0,0,0;23,0,0,0;21,0,0,0;20,0,0,0;19,0,0,0;18,0,0,0;17,0,0,0;16,0,0,0;14,0,0,0;13,0,0,0;12,0,0,0;11,9,0,0;11,8,0,0;11,7,0,0;11,6,0,0;11,5,0,0;11,4,0,0;11,3,0,0;11,2,0,0;11,1,0,0;10,3,0,0;10,2,153,0;10,1,52,0;9,0,124,0;8,0,24,0;7,0,14,0;6,0,79,0;5,0,58,0;4,0,32,0;3,0,8,0;2,0,1,12;1,0,0,1; + 1 + 1 + axes_content.html + axes_alternate.html + 0 + + 550 + 400 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 4 + 0 + 0 + 1 + 0 + /Users/valyard/Library/Application Support/Adobe/Animate CC 2017/en_US/Configuration/HTML/Default.html + 1 + + + + + 0 + 0 + 0 + 80 + 0 + 0 + 7 + 0 + 7 + 0 + 36 + FlashPlayer25.0 + 3 + 1 + + . + CONFIG::FLASH_AUTHORING="true"; + 0 + + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + 2 + 4 + 4096 + AS3 + 1 + 1 + 0 + 15 + 1 + 0 + 4102 + rsl + wrap + $(AppConfig)/ActionScript 3.0/rsls/loader_animation.swf + + + $(AppConfig)/ActionScript 3.0/libs + merge + + + + + 0 + + + + 550 + 400 + 0 + 4718592 + 0 + 80 + 1 + + + 550 + 400 + 0 + 1 + 1 + + 1 + 255 + + + 550 + 400 + 1 + 1 + 24-bit with Alpha + 255 + + + 550 + 400 + 1 + 0 + + 0 + + + true + axes.zip + + + true + true + false + Untitled-1.svg + images + true + 0.1 + + + true + Untitled-1.app + + + true + Untitled-1.exe + + + \ No newline at end of file diff --git a/Resources/Icons/Axes/bin/SymDepend.cache b/Resources/Icons/Axes/bin/SymDepend.cache new file mode 100644 index 000000000..cf9bc671e Binary files /dev/null and b/Resources/Icons/Axes/bin/SymDepend.cache differ diff --git a/Resources/SettingsWindow/Header.psd b/Resources/SettingsWindow/Header.psd new file mode 100644 index 000000000..3c6f8dc1c Binary files /dev/null and b/Resources/SettingsWindow/Header.psd differ diff --git a/Source/.gitignore b/Source/.gitignore index 1e63af9f8..69a627838 100644 --- a/Source/.gitignore +++ b/Source/.gitignore @@ -29,4 +29,6 @@ _ReSharper* *.pdb* *.mdb* -pdb2mdb.bat* \ No newline at end of file +pdb2mdb.bat* + +/Assets/Tests* \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/Debug.meta b/Source/Assets/Test.meta similarity index 67% rename from Source/Assets/TouchScript/Scripts/Utils/Debug.meta rename to Source/Assets/Test.meta index 23a1c9fcf..ed78c8085 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/Debug.meta +++ b/Source/Assets/Test.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 130e732941aee45338415c75c7c1c62a +guid: 7e1fcc64fde35914b886872755292f44 folderAsset: yes -timeCreated: 1447582128 +timeCreated: 1490462516 licenseType: Pro DefaultImporter: userData: diff --git a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset index 501628013..cc53ace5a 100644 --- a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset +++ b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset @@ -8,8 +8,10 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 927472823, guid: 20c2a163775f09b4cafa29b19d0c9204, type: 3} + m_Script: {fileID: 11500000, guid: 3bb766ec5aebe4332b86a7b9b50eb01d, type: 3} m_Name: FullHD TV 42 m_EditorClassIdentifier: name: FullHD TV 42 dpi: 52 + nativeDPI: 52 + nativeResolution: {x: 1920, y: 1080} diff --git a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset.meta b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset.meta index 24e043f37..b006cddf5 100644 --- a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset.meta +++ b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 42.asset.meta @@ -1,4 +1,9 @@ fileFormatVersion: 2 -guid: 2bc291805b9384c48a7b1776bff51829 +guid: cce7a04b5eb9d024899e39e60d27db64 +timeCreated: 1500668483 +licenseType: Pro NativeFormatImporter: + mainObjectFileID: 11400000 userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset index fe22896ed..9ec9303da 100644 --- a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset +++ b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset @@ -8,8 +8,10 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 927472823, guid: 20c2a163775f09b4cafa29b19d0c9204, type: 3} + m_Script: {fileID: 11500000, guid: 3bb766ec5aebe4332b86a7b9b50eb01d, type: 3} m_Name: FullHD TV 50 m_EditorClassIdentifier: name: FullHD TV 50 dpi: 44 + nativeDPI: 44 + nativeResolution: {x: 1920, y: 1080} diff --git a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset.meta b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset.meta index 02556d447..fd9eaaf68 100644 --- a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset.meta +++ b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 50.asset.meta @@ -1,4 +1,9 @@ fileFormatVersion: 2 -guid: 04c17a8fa37b750408c1aaa5a0fb31af +guid: ee9d224e766697b43a3bbc68ff230c15 +timeCreated: 1500668483 +licenseType: Pro NativeFormatImporter: + mainObjectFileID: 11400000 userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 55.asset b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 55.asset index 2a71f411e..bc9b0012f 100644 --- a/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 55.asset +++ b/Source/Assets/TouchScript/Devices/Display/TVs/FullHD TV 55.asset @@ -8,8 +8,10 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 927472823, guid: 20c2a163775f09b4cafa29b19d0c9204, type: 3} + m_Script: {fileID: 11500000, guid: 3bb766ec5aebe4332b86a7b9b50eb01d, type: 3} m_Name: FullHD TV 55 m_EditorClassIdentifier: name: FullHD TV 55 dpi: 40 + nativeDPI: 40 + nativeResolution: {x: 1920, y: 1080} diff --git a/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset b/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset index 9e67fcbae..0dc3fff25 100644 --- a/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset +++ b/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset @@ -8,8 +8,10 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 927472823, guid: 20c2a163775f09b4cafa29b19d0c9204, type: 3} + m_Script: {fileID: 11500000, guid: 3bb766ec5aebe4332b86a7b9b50eb01d, type: 3} m_Name: Unknown Device m_EditorClassIdentifier: name: Unknown Device dpi: 96 + nativeDPI: 96 + nativeResolution: {x: 1920, y: 1080} diff --git a/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset.meta b/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset.meta index 0a5e73264..899c0af80 100644 --- a/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset.meta +++ b/Source/Assets/TouchScript/Devices/Display/Unknown Device.asset.meta @@ -1,4 +1,9 @@ fileFormatVersion: 2 -guid: e47dcd113beb42843965ea5aa86272dc +guid: 1d1252c9bfc58b44293c994720c07f5e +timeCreated: 1500668483 +licenseType: Pro NativeFormatImporter: + mainObjectFileID: 11400000 userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Behaviors/Visualizer.meta b/Source/Assets/TouchScript/Editor/Behaviors/Cursors.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Behaviors/Visualizer.meta rename to Source/Assets/TouchScript/Editor/Behaviors/Cursors.meta diff --git a/Source/Assets/TouchScript/Editor/Behaviors/Cursors/CursorManagerEditor.cs b/Source/Assets/TouchScript/Editor/Behaviors/Cursors/CursorManagerEditor.cs new file mode 100644 index 000000000..9e1a4a1e0 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Behaviors/Cursors/CursorManagerEditor.cs @@ -0,0 +1,68 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Behaviors.Cursors; +using UnityEditor; +using UnityEngine; +using TouchScript.Editor.EditorUI; + +namespace TouchScript.Editor.Behaviors.Visualizer +{ + [CustomEditor(typeof(CursorManager))] + internal sealed class CursorManagerEditor : UnityEditor.Editor + { + public static readonly GUIContent TEXT_DPI_HEADER = new GUIContent("Use DPI", "Scale touch pointer based on DPI."); + public static readonly GUIContent TEXT_CURSORS_HEADER = new GUIContent("Cursors", "Cursor prefabs used for different pointer types."); + public static readonly GUIContent TEXT_POINTER_SIZE = new GUIContent("Pointer size (cm)", "Pointer size in cm based on current DPI."); + public static readonly GUIContent TEXT_POINTER_PIXEL_SIZE = new GUIContent("Pointer size (px)", "Pointer size in pixels."); + + private SerializedProperty mousePointerProxy, touchPointerProxy, penPointerProxy, objectPointerProxy; + private SerializedProperty useDPI, cursorSize, cursorPixelSize; + private SerializedProperty cursorsProps; + + private void OnEnable() + { + mousePointerProxy = serializedObject.FindProperty("mouseCursor"); + touchPointerProxy = serializedObject.FindProperty("touchCursor"); + penPointerProxy = serializedObject.FindProperty("penCursor"); + objectPointerProxy = serializedObject.FindProperty("objectCursor"); + + useDPI = serializedObject.FindProperty("useDPI"); + cursorSize = serializedObject.FindProperty("cursorSize"); + cursorPixelSize = serializedObject.FindProperty("cursorPixelSize"); + + cursorsProps = serializedObject.FindProperty("cursorsProps"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + GUILayout.Space(5); + + EditorGUILayout.PropertyField(useDPI, TEXT_DPI_HEADER); + if (useDPI.boolValue) + { + EditorGUILayout.PropertyField(cursorSize, TEXT_POINTER_SIZE); + } + else + { + EditorGUILayout.PropertyField(cursorPixelSize, TEXT_POINTER_PIXEL_SIZE); + } + + var display = GUIElements.Header(TEXT_CURSORS_HEADER, cursorsProps); + if (display) + { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(mousePointerProxy, new GUIContent("Mouse Pointer Proxy")); + EditorGUILayout.PropertyField(touchPointerProxy, new GUIContent("Touch Pointer Proxy")); + EditorGUILayout.PropertyField(penPointerProxy, new GUIContent("Pen Pointer Proxy")); + EditorGUILayout.PropertyField(objectPointerProxy, new GUIContent("Object Pointer Proxy")); + EditorGUI.indentLevel--; + } + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs.meta b/Source/Assets/TouchScript/Editor/Behaviors/Cursors/CursorManagerEditor.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Behaviors/Cursors/CursorManagerEditor.cs.meta diff --git a/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs b/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs new file mode 100644 index 000000000..9ab5068d0 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs @@ -0,0 +1,72 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Behaviors; +using UnityEditor; +using UnityEngine; +using System.Reflection; +using TouchScript.Editor.EditorUI; + +namespace TouchScript.Editor.Behaviors +{ + [CustomEditor(typeof(Transformer), true)] + internal class TransformerEditor : UnityEditor.Editor + { + public static readonly GUIContent TEXT_SMOOTHING_HEADER = new GUIContent("Smoothing", "Applies smoothing to transform actions. This allows to reduce jagged movements but adds some visual lag."); + public static readonly GUIContent TEXT_SMOOTHING_FACTOR = new GUIContent("Factor", "Indicates how much smoothing to apply. 0 - no smoothing, 100000 - maximum."); + public static readonly GUIContent TEXT_POSITION_THRESHOLD = new GUIContent("Position Threshold", "Minimum distance between target position and smoothed position when to stop automatic movement."); + public static readonly GUIContent TEXT_ROTATION_THRESHOLD = new GUIContent("Rotation Threshold", "Minimum angle between target rotation and smoothed rotation when to stop automatic movement."); + public static readonly GUIContent TEXT_SCALE_THRESHOLD = new GUIContent("Scale Threshold", "Minimum difference between target scale and smoothed scale when to stop automatic movement."); + public static readonly GUIContent TEXT_ALLOW_CHANGING = new GUIContent("Allow Changing From Outside", "Indicates if this transform can be changed from another script."); + public static readonly GUIContent TEXT_SMOOTHING_FACTOR_DESC = new GUIContent("Indicates how much smoothing to apply. \n0 - no smoothing, 100000 - maximum."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component receives transform data from Transform Gestures and applies changes to the GameObject."); + + private Transformer instance; + + private SerializedProperty enableSmoothing, allowChangingFromOutside; + private PropertyInfo enableSmoothing_prop; + + protected virtual void OnEnable() + { + enableSmoothing = serializedObject.FindProperty("enableSmoothing"); + allowChangingFromOutside = serializedObject.FindProperty("allowChangingFromOutside"); + + instance = target as Transformer; + + var type = instance.GetType(); + enableSmoothing_prop = type.GetProperty("EnableSmoothing", BindingFlags.Instance | BindingFlags.Public); + } + + public override void OnInspectorGUI() + { +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif + + GUILayout.Space(5); + + var display = GUIElements.Header(TEXT_SMOOTHING_HEADER, enableSmoothing, enableSmoothing, enableSmoothing_prop); + if (display) + { + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(!enableSmoothing.boolValue)) + { + instance.SmoothingFactor = EditorGUILayout.FloatField(TEXT_SMOOTHING_FACTOR, instance.SmoothingFactor); + EditorGUILayout.LabelField(TEXT_SMOOTHING_FACTOR_DESC, GUIElements.HelpBox); + instance.PositionThreshold = EditorGUILayout.FloatField(TEXT_POSITION_THRESHOLD, instance.PositionThreshold); + instance.RotationThreshold = EditorGUILayout.FloatField(TEXT_ROTATION_THRESHOLD, instance.RotationThreshold); + instance.ScaleThreshold = EditorGUILayout.FloatField(TEXT_SCALE_THRESHOLD, instance.ScaleThreshold); + EditorGUILayout.PropertyField(allowChangingFromOutside, TEXT_ALLOW_CHANGING); + } + EditorGUI.indentLevel--; + } + EditorGUILayout.LabelField(TEXT_HELP, GUIElements.HelpBox); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs.meta b/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs.meta similarity index 75% rename from Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs.meta index db386297d..d59c686ae 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs.meta +++ b/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 9c7f8fc728f794dc691b2a87036a14fe -timeCreated: 1447582130 +guid: 2b3b3cedc8dd446d991e87f97e19fdbc +timeCreated: 1477969520 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs b/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs deleted file mode 100644 index 1c591e758..000000000 --- a/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs +++ /dev/null @@ -1,43 +0,0 @@ - -using TouchScript.Behaviors.Visualizer; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Behaviors.Visualizer -{ - - [CustomEditor(typeof(TouchVisualizer))] - internal sealed class TouchVisualizerEditor : UnityEditor.Editor - { - - private SerializedProperty touchProxy, useDPI, touchSize, showTouchId, showTags; - - private void OnEnable() - { - showTouchId = serializedObject.FindProperty("showTouchId"); - showTags = serializedObject.FindProperty("showTags"); - touchProxy = serializedObject.FindProperty("touchProxy"); - useDPI = serializedObject.FindProperty("useDPI"); - touchSize = serializedObject.FindProperty("touchSize"); - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(touchProxy, new GUIContent("Touch Proxy")); - EditorGUILayout.PropertyField(showTouchId, new GUIContent("Show Touch Id")); - EditorGUILayout.PropertyField(showTags, new GUIContent("Show Tags")); - - EditorGUILayout.PropertyField(useDPI, new GUIContent("Use DPI")); - if (useDPI.boolValue) - { - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(touchSize, new GUIContent("Touch Size (cm)")); - } - - serializedObject.ApplyModifiedProperties(); - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Debugging.meta b/Source/Assets/TouchScript/Editor/Debugging.meta new file mode 100644 index 000000000..8c2b9493d --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Debugging.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 81e4112b0ec1b439595cbb4384be9b70 +folderAsset: yes +timeCreated: 1500410739 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs new file mode 100644 index 000000000..a35b1a8c3 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs @@ -0,0 +1,709 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using TouchScript.Debugging; +using TouchScript.Debugging.Filters; +using TouchScript.Debugging.GL; +using TouchScript.Debugging.Loggers; +using TouchScript.Editor.EditorUI; +using TouchScript.Utils; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Debugging +{ + public class PointerDebuggerWindow : EditorWindow + { + private class Styles : IDisposable + { + public Texture2D BG; + + public int Padding = 5; + public int GlobalPadding = 10; + + public int TabHeight = 20; + public int TabWidth = 80; + public int TabPadding = 10; + + public int TopWindowHeight = 240; + public int RefreshHeight = 30; + + public int PointerItemHeight = 22; + public Color PointerItemSelected = new Color(.86f, .86f, .86f, 1f); + public Color PointerItemEmpty = new Color(.7f, .7f, .7f, .2f); + + public GUIStyle PointerItemStyle; + public GUIStyle EnterPlayModeText; + public GUIStyle SmallText; + public GUIStyle SmallButton; + public GUIStyle FilterToggle; + + public Styles() + { + BG = CreateColorTexture(new Color(0, 0, 0, 0.05f)); + + PointerItemStyle = new GUIStyle("ShurikenModuleTitle") + { + font = (new GUIStyle("Label")).font, + border = new RectOffset(15, 7, 4, 4), + fixedHeight = 22, + contentOffset = new Vector2(20f, -2f), + }; + + EnterPlayModeText = new GUIStyle("miniLabel") + { + alignment = TextAnchor.MiddleCenter, + }; + + SmallText = new GUIStyle("miniLabel") + { + alignment = TextAnchor.UpperLeft, + }; + + SmallButton = new GUIStyle("Button") + { + fontSize = SmallText.fontSize, + fontStyle = SmallText.fontStyle, + font = SmallText.font, + }; + + FilterToggle = new GUIStyle("ShurikenToggle") + { + fontSize = SmallText.fontSize, + fontStyle = SmallText.fontStyle, + font = SmallText.font, + }; + FilterToggle.normal.textColor = SmallText.normal.textColor; + FilterToggle.onNormal.textColor = SmallText.normal.textColor; + } + + public void Dispose() + { + DestroyImmediate(BG); + } + + public static Texture2D CreateColorTexture(Color color) + { + var texture = new Texture2D(1, 1); + texture.hideFlags = HideFlags.HideAndDontSave; + texture.name = "Color " + color; + texture.SetPixel(0, 0, color); + texture.Apply(); + return texture; + } + } + + public enum LogType + { + Editor, + File + } + + // sec + private const float UPDATE_INTERVAL = 1f; + + private enum Tab + { + Pointers, + Event, + Filters + } + + [MenuItem("Window/TouchScript/Debug", false, 0)] + static void createWindow() + { + EditorWindow window = GetWindow(false, "TSDebugger", true); + window.minSize = new Vector2(300, 600); + + window.Show(); + } + + private Styles styles; + + private LogType logType; + private IPointerLogger pLogger; + private PointerVisualizer pointerVisualizer; + private PagedList pointerList; + private PagedList eventList; + + [NonSerialized] + private Tab activeTab; + + [NonSerialized] + private int pointerDataCount = 0; + + [NonSerialized] + private List pointerData = new List(); + + [NonSerialized] + private List pointerStrings = new List(); + + [NonSerialized] + private List pointerEvents = new List(); + + [NonSerialized] + private PointerLog selectedEvent; + + [NonSerialized] + private int selectedEventId = -1; + + [NonSerialized] + private Dictionary pointerEventStrings = new Dictionary(); + + [NonSerialized] + private PointerLogFilter logFilter; + + private FilterState filterState; + //private Vector2 filterScroll; + + private bool autoRefresh = true; + + [NonSerialized] + private float refreshTime; + + private void OnEnable() + { + setupLogging(); + if (EditorApplication.isPlayingOrWillChangePlaymode) + setupPlaymodeLogging(); + + if (filterState == null) + { + filterState = new FilterState(); + filterState.Load(); + } + + EditorApplication.update += updateHandler; + } + + private void OnDisable() + { + if (styles != null) styles.Dispose(); + + EditorApplication.update -= updateHandler; + } + + private void updateHandler() + { + if (pLogger == null) return; + + if (pLogger.PointerCount != pointerDataCount) + { + updatePointers(); + } + if (autoRefresh) + { + var time = Time.unscaledTime; + if (time > refreshTime) + { + refreshTime = time + UPDATE_INTERVAL; + updateEventList(); + } + } + } + + #region Init + + private void setupPlaymodeLogging() + { + TouchScriptDebugger.Instance.PointerLogger = pLogger = new PointerLogger(); + } + + private void setupLogging() + { + pointerVisualizer = new PointerVisualizer(); + pointerList = new PagedList(22, drawPointerItem, pointerSelectionChangeHandler); + eventList = new PagedList(22, drawEventItem, eventSelectionChangeHandler); + logFilter = new PointerLogFilter(); + } + + private void loadLogFile() + { + var path = EditorUtility.OpenFilePanel("Load log data", Application.dataPath, "bin"); + if (string.IsNullOrEmpty(path)) return; + pLogger = new FileReaderLogger(path); + updatePointers(); + } + + private void updateLogType(LogType type) + { + logType = type; + + if (type == LogType.Editor) + { + if (pLogger != null) pLogger.Dispose(); + if (EditorApplication.isPlayingOrWillChangePlaymode) setupPlaymodeLogging(); + } + else + { + TouchScriptDebugger.Instance.ClearPointerLogger(); + } + } + + #endregion + + #region Update + + private void updatePointers() + { + pointerData = pLogger.GetFilteredPointerData(); + pointerList.Count = pointerData.Count; + pointerDataCount = pointerData.Count; + + pointerStrings.Clear(); + foreach (var data in pointerData) + { + pointerStrings.Add(string.Format("{0} (id: {1})", data.Type, data.Id)); + } + + Repaint(); + } + + private void updateEventList() + { + if (pointerList.SelectedId == -1) + { + pointerEvents.Clear(); + eventList.Count = 0; + } + else + { + var id = pointerData[pointerList.SelectedId].Id; + syncFilter(); + pointerEvents = pLogger.GetFilteredLogsForPointer(id, logFilter); + eventList.Count = pointerEvents.Count; + } + + Repaint(); + } + + private void selectPointer() + { + updateEventList(); + pointerVisualizer.Hide(); + } + + private void selectEvent() + { + if (eventList.SelectedId == -1) + { + pointerVisualizer.Hide(); + selectedEventId = -1; + return; + } + + selectedEventId = eventList.SelectedId; + selectedEvent = pointerEvents[selectedEventId]; + pointerVisualizer.Show(selectedEvent.State.Position); + switchTab(Tab.Event); + } + + private void syncFilter() + { + logFilter.EventMask = filterState.PointerEventMask; + } + + private string getEventString(int id) + { + var evt = pointerEvents[id]; + string str = null; + if (!pointerEventStrings.TryGetValue(evt.Id, out str)) + { + DateTime time = new DateTime(evt.Tick); + str = string.Format("{0} > {1}", time.ToString("HH:mm:ss.ffffff"), evt.Event); + pointerEventStrings.Add(evt.Id, str); + } + return str; + } + + #endregion + + #region Misc + + private void switchTab(Tab newTab) + { + activeTab = newTab; + + //if (activeTab == Tab.Filters) + //{ + // filterScroll = Vector2.zero; + //} + + Repaint(); + } + + #endregion + + #region Drawing + + private void OnGUI() + { + if (styles == null) styles = new Styles(); + + int height = styles.TopWindowHeight; + //int height = pointerList.FitHeight(10); + + var rect = GUIUtils.GetPaddedRect(height + styles.GlobalPadding * 2, styles.Padding); + + GUI.DrawTexture(rect, styles.BG); + GUIUtils.ContractRect(ref rect, styles.GlobalPadding); + + switch (activeTab) + { + case Tab.Pointers: + if (pointerData.Count == 0) + drawNoData(rect); + else + pointerList.Draw(rect); + break; + case Tab.Event: + if (selectedEventId == -1) + drawNoData(rect); + else + drawSelectedEvent(rect); + break; + case Tab.Filters: + drawFilters(rect); + break; + } + + drawTabs(); + drawRefresh(); + + //eventList.Count = 100; + rect = GUIUtils.GetPaddedRect(0, styles.Padding, true); + + GUI.DrawTexture(rect, styles.BG); + GUIUtils.ContractRect(ref rect, styles.GlobalPadding); + + if (pointerEvents.Count == 0) + drawNoData(rect); + else + eventList.Draw(rect); + } + + private void drawFilters(Rect rect) + { + //GUI.Toggle(rect, true, " Test", styles.FilterToggle); + + GUI.Label(rect, "Show pointer events:"); + + rect.y += 20; + rect.height -= 20; + var scrollRect = new Rect(rect); + scrollRect.height *= 2; + scrollRect.width -= 40; + //scrollRect.x = 0; + //scrollRect.y = 0; + + //using (var scope = new GUI.ScrollViewScope(rect, filterScroll, scrollRect)) + //{ + scrollRect.height = 14; + var names = Enum.GetNames(typeof (PointerEvent)); + using (var changeScope = new EditorGUI.ChangeCheckScope()) + { + for (var i = 1; i < names.Length; i++) + { + var evt = (PointerEvent) i; + filterState.SetEventValue(evt, + GUI.Toggle(scrollRect, filterState.IsEventEnabled(evt), " " + names[i], styles.FilterToggle)); + scrollRect.y += scrollRect.height; + } + if (changeScope.changed) filterState.Save(); + } + // filterScroll = scope.scrollPosition; + //} + + scrollRect.y += 4; + scrollRect.height = 20; + using (var scope = new EditorGUI.DisabledScope(pointerList.SelectedId == -1)) + { + if (GUI.Button(scrollRect, "Apply filter")) + { + updateEventList(); + } + } + } + + private void drawTabs() + { + var rect = GUILayoutUtility.GetRect(0, styles.TabHeight, GUILayout.ExpandWidth(true)); + rect.x += styles.Padding; + rect.y -= styles.Padding; + + rect.width = styles.TabWidth; + if (drawTab(rect, "Pointers", activeTab == Tab.Pointers)) + activeTab = Tab.Pointers; + rect.x += rect.width; + if (drawTab(rect, "Event", activeTab == Tab.Event)) + activeTab = Tab.Event; + rect.x += rect.width; + if (drawTab(rect, "Filters", activeTab == Tab.Filters)) + activeTab = Tab.Filters; + } + + private void drawRefresh() + { + var rect = GUILayoutUtility.GetRect(0, styles.RefreshHeight, GUILayout.ExpandWidth(true)); + GUIUtils.ContractRect(ref rect, styles.Padding); + + var sourceRect = new Rect(rect); + sourceRect.width = 50; + GUI.Label(sourceRect, " Source", styles.SmallText); + sourceRect.x += sourceRect.width; + using (var scope = new EditorGUI.ChangeCheckScope()) + { + logType = (LogType) EditorGUI.EnumPopup(sourceRect, "", logType); + if (scope.changed) updateLogType(logType); + } + + if (logType == LogType.File) + { + sourceRect.x += sourceRect.width + 2; + sourceRect.width = 40; + sourceRect.height = 15; + if (GUI.Button(sourceRect, "Load", styles.SmallButton)) + { + loadLogFile(); + } + } + + var refreshRect = new Rect(rect); + refreshRect.x = refreshRect.width - 50 - 60; + refreshRect.width = 50; + autoRefresh = GUI.Toggle(refreshRect, autoRefresh, " Auto", styles.FilterToggle); + + using (var scope = new EditorGUI.DisabledScope(autoRefresh)) + { + rect.x = rect.width - 60; + rect.width = 60; + rect.height = 15; + rect.y -= 1; + if (GUI.Button(rect, "Refresh", styles.SmallButton)) + { + updateEventList(); + } + } + } + + private void drawSelectedEvent(Rect rect) + { + if (selectedEvent.Id == -1) + { + GUI.Label(rect, "No event selected.", styles.EnterPlayModeText); + return; + } + + var transform = selectedEvent.State.Target; + var path = selectedEvent.State.TargetPath; + + GUI.Label(rect, string.Format("{0}\nPosition: {1}\nPrevious: {2}\nFlags: {3}, Buttons: {4}", + getEventString(selectedEventId), selectedEvent.State.Position, + selectedEvent.State.PreviousPosition, selectedEvent.State.Flags, + PointerUtils.ButtonsToString(selectedEvent.State.Buttons))); + rect.y += 64; + rect.height = 20; + GUI.Label(rect, "Target: "); + using (var scope = new EditorGUI.DisabledScope(true)) + { + var fieldRect = new Rect(rect); + fieldRect.x += 50; + fieldRect.width -= 50; + EditorGUI.ObjectField(fieldRect, transform, typeof (Transform), true); + } + + if (path != null) + { + rect.y += 20; + rect.height = 16; + GUI.Label(rect, path, styles.SmallText); + } + } + + private bool drawTab(Rect rect, string content, bool selected) + { + switch (Event.current.type) + { + case EventType.MouseDown: + if (rect.Contains(Event.current.mousePosition)) + { + Event.current.Use(); + return true; + } + break; + case EventType.Layout: + case EventType.Repaint: + if (selected) GUI.DrawTexture(rect, styles.BG); + rect.x += styles.TabPadding; + GUI.Label(rect, content); + break; + } + + return false; + } + + private void drawNoData(Rect rect) + { + GUI.Label(rect, "No data available.", styles.EnterPlayModeText); + } + + private void drawPlaymodeText(Rect rect) + { + GUI.Label(rect, "Data is only available in Play Mode.", styles.EnterPlayModeText); + } + + private void drawPointerItem(int id, Rect rect, bool selected) + { + var bg = GUI.backgroundColor; + if (id == -1) + { + GUI.backgroundColor = styles.PointerItemEmpty; + GUI.Box(rect, "", styles.PointerItemStyle); + GUI.backgroundColor = bg; + return; + } + + if (selected) + { + GUI.backgroundColor = styles.PointerItemSelected; + } + + GUI.Box(rect, pointerStrings[id], styles.PointerItemStyle); + GUI.backgroundColor = bg; + } + + private void drawEventItem(int id, Rect rect, bool selected) + { + var bg = GUI.backgroundColor; + if (id == -1) + { + GUI.backgroundColor = styles.PointerItemEmpty; + GUI.Box(rect, "", styles.PointerItemStyle); + GUI.backgroundColor = bg; + return; + } + + if (selected) + { + GUI.backgroundColor = styles.PointerItemSelected; + } + + GUI.Box(rect, getEventString(id), styles.PointerItemStyle); + GUI.backgroundColor = bg; + } + + #endregion + + #region List handlers + + private void pointerSelectionChangeHandler(int id) + { + selectPointer(); + } + + private void eventSelectionChangeHandler(int id) + { + selectEvent(); + } + + #endregion + + private class PointerVisualizer + { + private int currentDebugId = -1; + + public PointerVisualizer() {} + + public void Show(Vector2 position) + { + if (!Application.isPlaying) return; + + if (currentDebugId != -1) Hide(); + currentDebugId = GLDebug.DrawSquareScreenSpace(position, 0, Vector2.one * 20, GLDebug.MULTIPLY, float.MaxValue); + } + + public void Hide() + { + if (!Application.isPlaying) return; + + GLDebug.RemoveFigure(currentDebugId); + currentDebugId = -1; + } + } + + [Serializable] + private class FilterState : ISerializationCallbackReceiver + { + private const string KEY = "TouchScript:Debugger:FilterState"; + + [SerializeField] + private List pointerEvents; + + public uint PointerEventMask + { + get { return BinaryUtils.ToBinaryMask(pointerEvents); } + } + + public FilterState() + { + var eventsCount = Enum.GetValues(typeof (PointerEvent)).Length; + pointerEvents = new List(eventsCount); + syncPointerEvents(eventsCount); + } + + public bool IsEventEnabled(PointerEvent evt) + { + var id = (int) evt; + if (id >= pointerEvents.Count) return false; + return pointerEvents[id]; + } + + public void SetEventValue(PointerEvent evt, bool value) + { + pointerEvents[(int) evt] = value; + } + + public void Save() + { + var json = JsonUtility.ToJson(this); + EditorPrefs.SetString(KEY, json); + } + + public void Load() + { + if (!EditorPrefs.HasKey(KEY)) return; + var json = EditorPrefs.GetString(KEY); + JsonUtility.FromJsonOverwrite(json, this); + } + + private void syncPointerEvents(int count) + { + for (var i = pointerEvents.Count; i < count; i++) pointerEvents.Add(true); + } + + public void OnBeforeSerialize() {} + + public void OnAfterDeserialize() + { + var eventsCount = Enum.GetValues(typeof (PointerEvent)).Length; + if (pointerEvents.Count != eventsCount) + { + Debug.Log("FilterState serialization error!"); + if (pointerEvents.Count > eventsCount) + { + pointerEvents = new List(eventsCount); + } + syncPointerEvents(eventsCount); + } + } + } + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs.meta b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs.meta similarity index 75% rename from Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs.meta index c7c046401..f147fa5be 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs.meta +++ b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 8fa81a2cd8d004ae49a1960cd7fa1862 -timeCreated: 1447582130 +guid: 1684ac3d3422e4b458a73b6955a0cae3 +timeCreated: 1500410762 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Source/Assets/TouchScript/Editor/EditorResources.cs b/Source/Assets/TouchScript/Editor/EditorResources.cs new file mode 100644 index 000000000..41f15a5a0 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources.cs @@ -0,0 +1,64 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + * Adapted from https://github.com/Unity-Technologies/PostProcessing + */ + +using System; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace TouchScript.Editor +{ + static class EditorResources + { + static string editorResourcesPath = string.Empty; + + internal static string EditorResourcesPath + { + get + { + if (string.IsNullOrEmpty(editorResourcesPath)) + { + string path; + + if (searchForEditorResourcesPath(out path)) + editorResourcesPath = path; + else + Debug.LogError("Unable to locate editor resources. Make sure the TouchScript package has been installed correctly."); + } + + return editorResourcesPath; + } + } + + internal static T Load(string name) + where T : Object + { + return AssetDatabase.LoadAssetAtPath(EditorResourcesPath + name); + } + + static bool searchForEditorResourcesPath(out string path) + { + path = string.Empty; + + string searchStr = "/TouchScript/Editor/EditorResources/"; + string str = null; + + foreach (var assetPath in AssetDatabase.GetAllAssetPaths()) + { + if (assetPath.Contains(searchStr)) + { + str = assetPath; + break; + } + } + + if (str == null) + return false; + + path = str.Substring(0, str.LastIndexOf(searchStr, StringComparison.Ordinal) + searchStr.Length); + return true; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs.meta b/Source/Assets/TouchScript/Editor/EditorResources.cs.meta similarity index 75% rename from Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs.meta rename to Source/Assets/TouchScript/Editor/EditorResources.cs.meta index f831d438d..9999498ee 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs.meta +++ b/Source/Assets/TouchScript/Editor/EditorResources.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 2675434635a8a4b3dbdd6aef444c8ebe -timeCreated: 1447582130 +guid: c529b7b5fb8104246a705de628148fcc +timeCreated: 1478409234 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Source/Assets/TouchScript/Editor/EditorResources.meta b/Source/Assets/TouchScript/Editor/EditorResources.meta new file mode 100644 index 000000000..290e2b4a0 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d6a9095b435fc49be88fbe81cebedfa0 +folderAsset: yes +timeCreated: 1478315757 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons.meta new file mode 100644 index 000000000..acc16807b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 375fcf571e23249898d00c0d11ffbf93 +folderAsset: yes +timeCreated: 1500984768 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png b/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png new file mode 100644 index 000000000..3eb285fa8 Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png.meta new file mode 100644 index 000000000..5f8eac14d --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons/selector.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: e0afdfca204fe4cd3a260d4df23e6a6a +timeCreated: 1500986715 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + 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: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png b/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png new file mode 100644 index 000000000..7d9ded74d Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png.meta new file mode 100644 index 000000000..cc814c2da --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons/unknown.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 29c2d4978005b4ea68d2f3ecbd258ffd +timeCreated: 1500987331 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + 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: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png new file mode 100644 index 000000000..e0ee77109 Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png.meta new file mode 100644 index 000000000..ee0057901 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xy.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 88423ab2c1d7b4ad18b422f1405bf312 +timeCreated: 1500984768 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + 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: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png new file mode 100644 index 000000000..55c91abdc Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png.meta new file mode 100644 index 000000000..747e5b64b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons/xz.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: a8bb65c0cb8d14e93baa4c3403e83181 +timeCreated: 1500984768 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + 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: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png b/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png new file mode 100644 index 000000000..b38c8a412 Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png.meta new file mode 100644 index 000000000..3ea117e2c --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/Icons/yz.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 5b7a913101fce4f3589a24ca1780a607 +timeCreated: 1500984768 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + 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: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow.meta b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow.meta new file mode 100644 index 000000000..e69e637c0 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7a59b8419df174664a1744ef6715d004 +folderAsset: yes +timeCreated: 1478315757 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png new file mode 100644 index 000000000..6deee1470 Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png.meta b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png.meta new file mode 100644 index 000000000..7177b7bb7 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/SettingsWindow/Header.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: d72972e5e15a842c4a98ee0025f9d9aa +timeCreated: 1478315757 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 5 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds b/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds new file mode 100644 index 000000000..82ead2ebe Binary files /dev/null and b/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds differ diff --git a/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds.meta b/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds.meta new file mode 100644 index 000000000..8dafd3a9b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorResources/TouchScript Component Icon.dds.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e1e5ef31262d242ce8efe2020a27425e +timeCreated: 1501325322 +licenseType: Pro +IHVImageFormatImporter: + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + isReadable: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorUI.meta b/Source/Assets/TouchScript/Editor/EditorUI.meta new file mode 100644 index 000000000..f8c1b5255 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3b24d098c65af4192a812e7d9e2862ef +folderAsset: yes +timeCreated: 1500501530 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorUI/GUIElements.cs b/Source/Assets/TouchScript/Editor/EditorUI/GUIElements.cs new file mode 100644 index 000000000..0fdeaab5b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI/GUIElements.cs @@ -0,0 +1,137 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; +using UnityEditor; +using System.Reflection; + +namespace TouchScript.Editor.EditorUI +{ + internal static class GUIElements + { + public static GUIStyle Box; + public static GUIStyle BoxLabel; + + public static GUIStyle HelpBox; + public static GUIStyle HeaderBox; + public static GUIStyle HeaderCheckbox; + public static GUIStyle HeaderFoldout; + public static GUIStyle SmallText; + public static GUIStyle SmallTextRight; + public static GUIStyle SmallButton; + + public static Texture2D PaneOptionsIcon; + + static GUIElements() + { + Box = new GUIStyle(GUI.skin.box) + { + margin = new RectOffset(0, 0, 1, 0), + padding = new RectOffset(0, 0, 0, 0), + contentOffset = new Vector2(0, 0), + alignment = TextAnchor.MiddleCenter, + }; + Box.normal.textColor = GUI.skin.label.normal.textColor; + + BoxLabel = new GUIStyle(GUI.skin.label) + { + fontSize = 9, + padding = new RectOffset(0, 0, 5, 0), + }; + + HelpBox = new GUIStyle("HelpBox") + { + wordWrap = true, + }; + + HeaderBox = new GUIStyle("ShurikenModuleTitle") + { + font = (new GUIStyle("Label")).font, + border = new RectOffset(15, 7, 4, 4), + fixedHeight = 22, + contentOffset = new Vector2(20f, -2f), + }; + + HeaderCheckbox = new GUIStyle("ShurikenCheckMark"); + HeaderFoldout = new GUIStyle("Foldout"); + + SmallText = new GUIStyle("miniLabel") + { + alignment = TextAnchor.UpperLeft, + }; + + SmallTextRight = new GUIStyle("miniLabel") + { + alignment = TextAnchor.UpperRight, + }; + + SmallButton = new GUIStyle("Button") + { + fontSize = SmallText.fontSize, + fontStyle = SmallText.fontStyle, + font = SmallText.font, + }; + + if (EditorGUIUtility.isProSkin) + PaneOptionsIcon = (Texture2D) EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/pane options.png"); + else + PaneOptionsIcon = (Texture2D) EditorGUIUtility.LoadRequired("Builtin Skins/LightSkin/Images/pane options.png"); + } + + public static bool Header(GUIContent title, SerializedProperty expanded, SerializedProperty enabled = null, PropertyInfo enabledProp = null) + { + var rect = GUILayoutUtility.GetRect(16f, 22f, HeaderBox); + GUI.Box(rect, title, HeaderBox); + + var display = expanded == null || expanded.isExpanded; + + var foldoutRect = new Rect(rect.x + 4f, rect.y + 3f, 13f, 13f); + var e = Event.current; + + if (e.type == EventType.Repaint) + { + if (enabled == null) HeaderFoldout.Draw(foldoutRect, false, false, display, false); + else HeaderCheckbox.Draw(foldoutRect, false, false, enabled.boolValue, false); + } + + if (e.type == EventType.MouseDown) + { + if (enabled != null) + { + const float kOffset = 2f; + foldoutRect.x -= kOffset; + foldoutRect.y -= kOffset; + foldoutRect.width += kOffset * 2f; + foldoutRect.height += kOffset * 2f; + + if (foldoutRect.Contains(e.mousePosition)) + { + enabled.boolValue = !enabled.boolValue; + if (enabledProp != null) enabledProp.SetValue(enabled.serializedObject.targetObject, enabled.boolValue, null); + e.Use(); + return display; + } + } + if (rect.Contains(e.mousePosition)) + { + display = !display; + expanded.isExpanded = !expanded.isExpanded; + e.Use(); + } + } + + return display; + } + + public static bool BasicHelpBox(GUIContent text) + { + EditorGUILayout.LabelField(text, HelpBox); + var rect = GUILayoutUtility.GetRect(10, 22, GUILayout.ExpandWidth(true)); + rect.x = rect.width - 86; + rect.width = 100; + rect.height = 14; + return GUI.Button(rect, "Switch to Advanced", SmallButton); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs.meta b/Source/Assets/TouchScript/Editor/EditorUI/GUIElements.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Utils/GUIElements.cs.meta rename to Source/Assets/TouchScript/Editor/EditorUI/GUIElements.cs.meta diff --git a/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs new file mode 100644 index 000000000..db12ed199 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs @@ -0,0 +1,30 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; + +namespace TouchScript.Editor.EditorUI +{ + public static class GUIUtils + { + public static Rect GetPaddedRect(int minHeight, int padding, bool expandHeight = false) + { + Rect rect; + if (expandHeight) + rect = GUILayoutUtility.GetRect(padding * 2, minHeight + padding * 2, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + else + rect = GUILayoutUtility.GetRect(padding * 2, minHeight + padding * 2, GUILayout.ExpandWidth(true)); + ContractRect(ref rect, padding); + return rect; + } + + public static void ContractRect(ref Rect rect, int delta) + { + rect.x += delta; + rect.y += delta; + rect.width -= delta * 2; + rect.height -= delta * 2; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs.meta b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs.meta similarity index 75% rename from Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs.meta rename to Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs.meta index 3f82b9ec1..79a3041ab 100644 --- a/Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs.meta +++ b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 63c78cda8eb1f4f188460aa97fc7e207 -timeCreated: 1447582130 +guid: e4af8ab947e1c4b959f59dba2bce9dc3 +timeCreated: 1500502342 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs b/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs new file mode 100644 index 000000000..5ebd45c7b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs @@ -0,0 +1,190 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.EditorUI +{ + public class PagedList + { + private class Styles + { + public int HeaderHeight = 0; + public int FooterHeight = 20; + + public int FooterButtonWidth = 60; + public int FooterButtonHeight = 20; + public int FooterButtonSpace = 10; + public int FooterTextWidth = 8; + + public GUIContent TextPrev = new GUIContent("< Prev"); + public GUIContent TextNext = new GUIContent("Next >"); + + public int GetIntFieldSize(int value) + { + if (value < 10) return FooterTextWidth + 8; + if (value < 100) return 2 * FooterTextWidth + 8; + if (value < 1000) return 3 * FooterTextWidth + 8; + return 4; + } + } + + public int ItemHeight { get; set; } + + public int Count + { + get { return count; } + set + { + if (count == value) return; + count = value; + reset(); + } + } + + public int PagesTotal + { + get { return pagesTotal; } + } + + public int SelectedId + { + get { return selectedId; } + } + + private static Styles styles; + + private Action onSelectionChange; + private Action drawItem; + + private int count = 0; + // Starts from 1 + private int page = 1; + private int pagesTotal = 1; + private int itemsPerPage = 1; + + private int selectedId = -1; + private int oldSelectedId = -1; + + public PagedList(int itemHeight, Action drawItem, Action onSelectionChange) + { + if (styles == null) styles = new Styles(); + + ItemHeight = itemHeight; + this.onSelectionChange = onSelectionChange; + this.drawItem = drawItem; + } + + public int FitHeight(int numberOfItems) + { + return ItemHeight * numberOfItems + styles.FooterHeight + styles.HeaderHeight; + } + + public void Draw(Rect rect) + { + var h = rect.height; + h -= styles.HeaderHeight + styles.FooterHeight; + if (h < 0) return; + rect.y += styles.HeaderHeight; + rect.height = ItemHeight; + + itemsPerPage = Mathf.FloorToInt(h / 22f); + pagesTotal = Mathf.CeilToInt((float) count / itemsPerPage); + + int start = (Count - 1) - (page - 1) * itemsPerPage; + if (start < 0) return; + + var i = start; + var t = 0; + while (t < itemsPerPage) + { + if (i < 0) draw(-1, rect); + else draw(i, rect); + rect.y += ItemHeight; + i--; + t++; + } + + rect.height = styles.FooterHeight; + drawFooter(rect); + + if (oldSelectedId != selectedId) + { + oldSelectedId = selectedId; + onSelectionChange(selectedId); + } + } + + private void drawFooter(Rect parentRect) + { + parentRect.y += 5; + parentRect.height -= 5; + + var rect = new Rect(parentRect.x, parentRect.y, styles.FooterButtonWidth, styles.FooterButtonHeight); + if (GUI.Button(rect, styles.TextPrev)) + { + setPage(page - 1); + } + + rect.x += rect.width + styles.FooterButtonSpace; + rect.width = styles.GetIntFieldSize(page); + var newPage = EditorGUI.DelayedIntField(rect, page); + if (page != newPage) setPage(newPage); + + rect.x += rect.width + styles.FooterButtonSpace; + rect.width = 16; + GUI.Label(rect, "of"); + + rect.x += rect.width + styles.FooterButtonSpace; + rect.width = styles.GetIntFieldSize(page); + + using (var scope = new EditorGUI.DisabledScope(true)) + { + EditorGUI.IntField(rect, PagesTotal); + } + + rect.x += rect.width + styles.FooterButtonSpace; + rect.width = styles.FooterButtonWidth; + if (GUI.Button(rect, styles.TextNext)) + { + setPage(page + 1); + } + } + + private void draw(int id, Rect rect) + { + switch (Event.current.type) + { + case EventType.Repaint: + case EventType.Layout: + drawItem(id, rect, selectedId == id); + break; + case EventType.MouseDown: + if (rect.Contains(Event.current.mousePosition)) + { + selectedId = id; + Event.current.Use(); + //GUI.changed = true; + } + break; + } + } + + private void setPage(int newPage) + { + if (newPage < 1) newPage = 1; + else if (newPage > PagesTotal) newPage = PagesTotal; + page = newPage; + } + + private void reset() + { + page = 1; + selectedId = -1; + oldSelectedId = -1; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs.meta b/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs.meta new file mode 100644 index 000000000..5d52de706 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI/PagedList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 52832a1748b2b4dfaae6bcec7cf1721e +timeCreated: 1500501497 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs deleted file mode 100644 index 6c9ab7b54..000000000 --- a/Source/Assets/TouchScript/Editor/Gestures/Base/PinnedTransformGestureBaseEditor.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Gestures; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Gestures.Base -{ - internal class PinnedTransformGestureBaseEditor : GestureEditor - { - public static readonly GUIContent TYPE = new GUIContent("Transform Type", "Specifies what gestures should be detected: Rotation, Scaling."); - public static readonly GUIContent TYPE_ROTATION = new GUIContent("Rotation", "Rotating with two or more fingers."); - public static readonly GUIContent TYPE_SCALING = new GUIContent("Scaling", "Scaling with two or more fingers."); - public static readonly GUIContent SCREEN_TRANSFORM_THRESHOLD = new GUIContent("Movement Threshold (cm)", "Minimum distance in cm touch points must move for the gesture to begin."); - - protected SerializedProperty type; - protected SerializedProperty screenTransformThreshold; - - protected override void OnEnable() - { - base.OnEnable(); - - type = serializedObject.FindProperty("type"); - screenTransformThreshold = serializedObject.FindProperty("screenTransformThreshold"); - } - - public override void OnInspectorGUI() - { - serializedObject.UpdateIfDirtyOrScript(); - - var typeValue = type.intValue; - int newType = 0; - EditorGUILayout.LabelField(TYPE); - EditorGUI.indentLevel++; - EditorGUILayout.BeginHorizontal(); - if (EditorGUILayout.ToggleLeft(TYPE_ROTATION, - (typeValue & (int)TransformGesture.TransformType.Rotation) != 0, GUILayout.Width(80))) - newType |= (int)TransformGesture.TransformType.Rotation; - EditorGUI.indentLevel--; - if (EditorGUILayout.ToggleLeft(TYPE_SCALING, - (typeValue & (int)TransformGesture.TransformType.Scaling) != 0, GUILayout.Width(70))) - newType |= (int)TransformGesture.TransformType.Scaling; - type.intValue = newType; - EditorGUILayout.EndHorizontal(); - - doInspectorGUI(); - - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); - } - - protected virtual void doInspectorGUI() { } - - protected override void drawAdvanced() - { - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.PropertyField(screenTransformThreshold, SCREEN_TRANSFORM_THRESHOLD); - - base.drawAdvanced(); - } - - } -} diff --git a/Source/Assets/TouchScript/Editor/Gestures/Base/TransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/Base/TransformGestureBaseEditor.cs deleted file mode 100644 index c5fc0ad99..000000000 --- a/Source/Assets/TouchScript/Editor/Gestures/Base/TransformGestureBaseEditor.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Gestures; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Gestures.Base -{ - internal class TransformGestureBaseEditor : GestureEditor - { - public static readonly GUIContent TYPE = new GUIContent("Transform Type", "Specifies what gestures should be detected: Translation, Rotation, Scaling."); - public static readonly GUIContent TYPE_TRANSLATION = new GUIContent("Translation", "Dragging with one ore more fingers."); - public static readonly GUIContent TYPE_ROTATION = new GUIContent("Rotation", "Rotating with two or more fingers."); - public static readonly GUIContent TYPE_SCALING = new GUIContent("Scaling", "Scaling with two or more fingers."); - public static readonly GUIContent MIN_SCREEN_POINTS_DISTANCE = new GUIContent("Min Points Distance (cm)", "Minimum distance between two points (clusters) in cm to consider this gesture started. Used to prevent fake touch points spawned near real ones on cheap multitouch hardware to mess everything up."); - public static readonly GUIContent SCREEN_TRANSFORM_THRESHOLD = new GUIContent("Movement Threshold (cm)", "Minimum distance in cm touch points must move for the gesture to begin."); - - protected SerializedProperty type; - protected SerializedProperty minScreenPointsDistance; - protected SerializedProperty screenTransformThreshold; - - protected override void OnEnable() - { - base.OnEnable(); - - type = serializedObject.FindProperty("type"); - minScreenPointsDistance = serializedObject.FindProperty("minScreenPointsDistance"); - screenTransformThreshold = serializedObject.FindProperty("screenTransformThreshold"); - } - - public override void OnInspectorGUI() - { - serializedObject.UpdateIfDirtyOrScript(); - - var typeValue = type.intValue; - int newType = 0; - EditorGUILayout.LabelField(TYPE); - EditorGUI.indentLevel++; - EditorGUILayout.BeginHorizontal(); - if (EditorGUILayout.ToggleLeft(TYPE_TRANSLATION, - (typeValue & (int)TransformGesture.TransformType.Translation) != 0, GUILayout.Width(100))) - newType |= (int)TransformGesture.TransformType.Translation; - EditorGUI.indentLevel--; - if (EditorGUILayout.ToggleLeft(TYPE_ROTATION, - (typeValue & (int)TransformGesture.TransformType.Rotation) != 0, GUILayout.Width(70))) - newType |= (int)TransformGesture.TransformType.Rotation; - if (EditorGUILayout.ToggleLeft(TYPE_SCALING, - (typeValue & (int)TransformGesture.TransformType.Scaling) != 0, GUILayout.Width(70))) - newType |= (int)TransformGesture.TransformType.Scaling; - type.intValue = newType; - EditorGUILayout.EndHorizontal(); - - doInspectorGUI(); - - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); - } - - protected virtual void doInspectorGUI() {} - - protected override void drawAdvanced() - { - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.PropertyField(minScreenPointsDistance, MIN_SCREEN_POINTS_DISTANCE); - EditorGUILayout.PropertyField(screenTransformThreshold, SCREEN_TRANSFORM_THRESHOLD); - - base.drawAdvanced(); - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Gestures/FlickGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/FlickGestureEditor.cs index 9753477bb..971c6ba11 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/FlickGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/FlickGestureEditor.cs @@ -11,10 +11,12 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(FlickGesture), true)] internal sealed class FlickGestureEditor : GestureEditor { - private static readonly GUIContent DIRECTION = new GUIContent("Direction", "Flick direction."); - private static readonly GUIContent MOVEMENT_THRESHOLD = new GUIContent("Movement Threshold (cm)", "Minimum distance in cm touch points must move for the gesture to begin."); - private static readonly GUIContent FLICK_TIME = new GUIContent("Flick Time (sec)", "Time interval in seconds during which touch points must move by for the gesture to be recognized."); - private static readonly GUIContent MIN_DISTANCE = new GUIContent("Minimum Distance (cm)", "Minimum distance in cm touch points must move in seconds for the gesture to be recognized."); + public static readonly GUIContent DIRECTION = new GUIContent("Direction", "Flick direction."); + public static readonly GUIContent MOVEMENT_THRESHOLD = new GUIContent("Movement Threshold (cm)", "Minimum distance in cm pointers must move for the gesture to begin."); + public static readonly GUIContent FLICK_TIME = new GUIContent("Flick Time (sec)", "Time interval in seconds during which pointers must move by for the gesture to be recognized."); + public static readonly GUIContent MIN_DISTANCE = new GUIContent("Minimum Distance (cm)", "Minimum distance in cm pointers must move in seconds for the gesture to be recognized."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component a fast flick gesture started over the GameObject."); private SerializedProperty direction; private SerializedProperty flickTime; @@ -31,18 +33,23 @@ protected override void OnEnable() direction = serializedObject.FindProperty("direction"); } - public override void OnInspectorGUI() + protected override void drawBasic() { - serializedObject.UpdateIfDirtyOrScript(); + EditorGUILayout.PropertyField(direction, DIRECTION); + } + protected override void drawGeneral() + { EditorGUIUtility.labelWidth = 180; EditorGUILayout.PropertyField(direction, DIRECTION); EditorGUILayout.PropertyField(movementThreshold, MOVEMENT_THRESHOLD); EditorGUILayout.PropertyField(flickTime, FLICK_TIME); EditorGUILayout.PropertyField(minDistance, MIN_DISTANCE); + } - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); + protected override GUIContent getHelpText() + { + return TEXT_HELP; } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs index 4c5d0220c..1232e8a97 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs @@ -3,11 +3,12 @@ */ using System; -using TouchScript.Editor.Utils; +using TouchScript.Editor.EditorUI; using TouchScript.Gestures; using UnityEditor; using UnityEditorInternal; using UnityEngine; +using System.Reflection; namespace TouchScript.Editor.Gestures { @@ -15,53 +16,73 @@ namespace TouchScript.Editor.Gestures internal class GestureEditor : UnityEditor.Editor { private const string FRIENDLY_GESTURES_PROP = "friendlyGestures"; - private const string TEXT_FRIENDLY_HEADER = "List of gestures which can work together with this gesture."; - - private static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced properties."); - private static readonly GUIContent DEBUG_MODE = new GUIContent("Debug", "Turns on gesture debug mode."); - private static readonly GUIContent USE_SEND_MESSAGE = new GUIContent("Use SendMessage", "If you use UnityScript or prefer using Unity Messages you can turn them on with this option."); - private static readonly GUIContent SEND_STATE_CHANGE_MESSAGES = new GUIContent("Send State Change Messages", "If checked, the gesture will send a message for every state change. Gestures usually have their own more specific messages, so you should keep this toggle unchecked unless you really want state change messages."); - private static readonly GUIContent SEND_MESSAGE_TARGET = new GUIContent("Target", "The GameObject target of Unity Messages. If null, host GameObject is used."); - private static readonly GUIContent COMBINE_TOUCH_POINTS = new GUIContent("Combine Touch Points", "When several fingers are used to perform a tap, touch points released not earlier than seconds ago are used to calculate gesture's final screen position."); - private static readonly GUIContent COMBINE_TOUCH_POINTS_INTERVAL = new GUIContent("Combine Interval (sec)", COMBINE_TOUCH_POINTS.tooltip); - private static readonly GUIContent REQUIRE_GESTURE_TO_FAIL = new GUIContent("Require Other Gesture to Fail", "Gesture which must fail for this gesture to start."); - private static readonly GUIContent LIMIT_TOUCHES = new GUIContent("Limit Touches", ""); - - protected bool shouldDrawCombineTouches = false; - - private SerializedProperty advanced; - private SerializedProperty debugMode; - private SerializedProperty friendlyGestures; - private SerializedProperty requireGestureToFail; - private SerializedProperty minTouches, maxTouches; - private SerializedProperty combineTouches, combineTouchesInterval; - private SerializedProperty useSendMessage, sendMessageTarget, sendStateChangeMessages; + + public static readonly GUIContent TEXT_GENERAL_HEADER = new GUIContent("General settings", "General settings."); + public static readonly GUIContent TEXT_LIMITS_HEADER = new GUIContent("Limits", "Properties that limit the gesture."); + public static readonly GUIContent TEXT_GESTURES_HEADER = new GUIContent("Interaction with other Gestures", "Settings which allow this gesture to interact with other gestures."); + public static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced properties."); + public static readonly GUIContent TEXT_USE_SEND_MESSAGE_HEADER = new GUIContent("Use SendMessage", "Enables sending events through SendMessage. Warnning: this method is slow!"); + public static readonly GUIContent TEXT_USE_UNITY_EVENTS_HEADER = new GUIContent("Use Unity Events", "Enables sending events through Unity Events."); + + public static readonly GUIContent TEXT_FRIENDLY = new GUIContent("Friendly Gestures", "List of gestures which can work together with this gesture."); + public static readonly GUIContent TEXT_DEBUG_MODE = new GUIContent("Debug", "Turns on gesture debug mode."); + public static readonly GUIContent TEXT_SEND_STATE_CHANGE_MESSAGES = new GUIContent("Send State Change Messages", "If checked, the gesture will send a message for every state change. Gestures usually have their own more specific messages, so you should keep this toggle unchecked unless you really want state change messages."); + public static readonly GUIContent TEXT_SEND_MESSAGE_TARGET = new GUIContent("Target", "The GameObject target of Unity Messages. If null, host GameObject is used."); + public static readonly GUIContent TEXT_SEND_STATE_CHANGE_EVENTS = new GUIContent("Send State Change Events", "If checked, the gesture will send a events for every state change. Gestures usually have their own more specific messages, so you should keep this toggle unchecked unless you really want state change events."); + public static readonly GUIContent TEXT_REQUIRE_GESTURE_TO_FAIL = new GUIContent("Require Other Gesture to Fail", "Another gesture must fail for this gesture to start."); + public static readonly GUIContent TEXT_LIMIT_POINTERS = new GUIContent(" Limit Pointers", ""); + + protected bool shouldDrawAdvanced = false; + protected bool shouldDrawGeneral = true; + + private Gesture instance; + + private SerializedProperty basicEditor; + + private SerializedProperty debugMode, friendlyGestures, requireGestureToFail, + minPointers, maxPointers, + useSendMessage, sendMessageTarget, sendStateChangeMessages, + useUnityEvents, sendStateChangeEvents; + + private SerializedProperty OnStateChange; + private SerializedProperty advancedProps, limitsProps, generalProps; + private PropertyInfo useUnityEvents_prop, useSendMessage_prop; private ReorderableList friendlyGesturesList; private int indexToRemove = -1; - private float minTouchesFloat, maxTouchesFloat; + private float minPointersFloat, maxPointersFloat; protected virtual void OnEnable() { - hideFlags = HideFlags.HideAndDontSave; + instance = target as Gesture; + + advancedProps = serializedObject.FindProperty("advancedProps"); + limitsProps = serializedObject.FindProperty("limitsProps"); + generalProps = serializedObject.FindProperty("generalProps"); + basicEditor = serializedObject.FindProperty("basicEditor"); - advanced = serializedObject.FindProperty("advancedProps"); debugMode = serializedObject.FindProperty("debugMode"); friendlyGestures = serializedObject.FindProperty("friendlyGestures"); requireGestureToFail = serializedObject.FindProperty("requireGestureToFail"); - combineTouches = serializedObject.FindProperty("combineTouches"); - combineTouchesInterval = serializedObject.FindProperty("combineTouchesInterval"); useSendMessage = serializedObject.FindProperty("useSendMessage"); sendMessageTarget = serializedObject.FindProperty("sendMessageTarget"); sendStateChangeMessages = serializedObject.FindProperty("sendStateChangeMessages"); - minTouches = serializedObject.FindProperty("minTouches"); - maxTouches = serializedObject.FindProperty("maxTouches"); + useUnityEvents = serializedObject.FindProperty("useUnityEvents"); + sendStateChangeEvents = serializedObject.FindProperty("sendStateChangeEvents"); + minPointers = serializedObject.FindProperty("minPointers"); + maxPointers = serializedObject.FindProperty("maxPointers"); + + OnStateChange = serializedObject.FindProperty("OnStateChange"); + + var type = instance.GetType(); + useUnityEvents_prop = type.GetProperty("UseUnityEvents", BindingFlags.Instance | BindingFlags.Public); + useSendMessage_prop = type.GetProperty("UseSendMessage", BindingFlags.Instance | BindingFlags.Public); - minTouchesFloat = minTouches.intValue; - maxTouchesFloat = maxTouches.intValue; + minPointersFloat = minPointers.intValue; + maxPointersFloat = maxPointers.intValue; - friendlyGesturesList = new ReorderableList(serializedObject, friendlyGestures, false, false, false, true); - friendlyGesturesList.headerHeight = 0; + friendlyGesturesList = new ReorderableList(serializedObject, friendlyGestures, false, true, false, true); + friendlyGesturesList.drawHeaderCallback += (rect) => GUI.Label(rect, TEXT_FRIENDLY); friendlyGesturesList.drawElementCallback += (rect, index, active, focused) => { rect.height = 16; @@ -73,132 +94,179 @@ protected virtual void OnEnable() EditorGUI.LabelField(rect, GUIContent.none); return; } - EditorGUI.LabelField(rect, string.Format("{0} @ {1}", gesture.GetType().Name, gesture.name), GUIElements.BoxLabelStyle); + EditorGUI.LabelField(rect, string.Format("{0} @ {1}", gesture.GetType().Name, gesture.name), GUIElements.BoxLabel); }; friendlyGesturesList.onRemoveCallback += list => { indexToRemove = list.index; }; } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif - EditorGUI.BeginChangeCheck(); - var expanded = GUIElements.BeginFoldout(advanced.isExpanded, TEXT_ADVANCED_HEADER); - if (EditorGUI.EndChangeCheck()) + GUILayout.Space(5); + bool display; + + if (basicEditor.boolValue) { - advanced.isExpanded = expanded; + drawBasic(); + if (GUIElements.BasicHelpBox(getHelpText())) + { + basicEditor.boolValue = false; + Repaint(); + } } - if (expanded) + else { - GUILayout.BeginVertical(GUIElements.FoldoutStyle); - drawAdvanced(); - GUILayout.EndVertical(); + if (shouldDrawGeneral) + { + display = GUIElements.Header(TEXT_GENERAL_HEADER, generalProps); + if (display) + { + EditorGUI.indentLevel++; + drawGeneral(); + EditorGUI.indentLevel--; + } + } + + drawOtherGUI(); + + display = GUIElements.Header(TEXT_LIMITS_HEADER, limitsProps); + if (display) + { + EditorGUI.indentLevel++; + drawLimits(); + EditorGUI.indentLevel--; + } + + display = GUIElements.Header(TEXT_GESTURES_HEADER, friendlyGestures); + if (display) + { + EditorGUI.indentLevel++; + drawFriendlyGestures(); + drawRequireToFail(); + GUILayout.Space(5); + EditorGUI.indentLevel--; + } + + display = GUIElements.Header(TEXT_USE_UNITY_EVENTS_HEADER, useUnityEvents, useUnityEvents, useUnityEvents_prop); + if (display) + { + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(!useUnityEvents.boolValue)) + { + drawUnityEvents(); + } + EditorGUI.indentLevel--; + } + + display = GUIElements.Header(TEXT_USE_SEND_MESSAGE_HEADER, useSendMessage, useSendMessage, useSendMessage_prop); + if (display) + { + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(!useSendMessage.boolValue)) + { + drawSendMessage(); + } + EditorGUI.indentLevel--; + } + + if (shouldDrawAdvanced) + { + display = GUIElements.Header(TEXT_ADVANCED_HEADER, advancedProps); + if (display) + { + EditorGUI.indentLevel++; + drawAdvanced(); + EditorGUI.indentLevel--; + } + } + + drawDebug(); } - GUIElements.EndFoldout(); serializedObject.ApplyModifiedProperties(); } - protected virtual void drawDebug() - { - if (debugMode == null) return; - EditorGUILayout.PropertyField(debugMode, DEBUG_MODE); - } + protected virtual void drawBasic() {} - protected virtual void drawSendMessage() + protected virtual GUIContent getHelpText() { - EditorGUILayout.PropertyField(useSendMessage, USE_SEND_MESSAGE); - if (useSendMessage.boolValue) - { - EditorGUIUtility.labelWidth = 70; - - EditorGUILayout.BeginHorizontal(); - GUILayout.Label(GUIContent.none, GUILayout.Width(10)); - EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true)); - EditorGUILayout.PropertyField(sendMessageTarget, SEND_MESSAGE_TARGET); - EditorGUILayout.PropertyField(sendStateChangeMessages, SEND_STATE_CHANGE_MESSAGES); - EditorGUILayout.EndVertical(); - EditorGUILayout.EndHorizontal(); - } + return new GUIContent(""); } - protected virtual void drawCombineTouches() + protected virtual void drawOtherGUI() {} + + protected virtual void drawGeneral() {} + + protected virtual void drawLimits() { - if (shouldDrawCombineTouches) + var limitPointers = (minPointers.intValue > 0) || (maxPointers.intValue > 0); + var newLimitPointers = EditorGUILayout.ToggleLeft(TEXT_LIMIT_POINTERS, limitPointers); + if (newLimitPointers) { - EditorGUILayout.PropertyField(combineTouches, COMBINE_TOUCH_POINTS); - if (combineTouches.boolValue) + if (!limitPointers) { - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.BeginHorizontal(); - GUILayout.Label(GUIContent.none, GUILayout.Width(10)); - EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true)); - EditorGUILayout.PropertyField(combineTouchesInterval, COMBINE_TOUCH_POINTS_INTERVAL); - EditorGUILayout.EndVertical(); - EditorGUILayout.EndHorizontal(); + minPointersFloat = 0; + maxPointersFloat = 10; } - } - } - - protected virtual void drawLimitTouches() - { - var limitTouches = (minTouches.intValue > 0) || (maxTouches.intValue > 0); - var newLimitTouches = EditorGUILayout.ToggleLeft(LIMIT_TOUCHES, limitTouches); - if (newLimitTouches) - { - if (!limitTouches) + else { - minTouchesFloat = 0; - maxTouchesFloat = 10; + minPointersFloat = (float) minPointers.intValue; + maxPointersFloat = (float) maxPointers.intValue; } + //or this values doesn't change from script properly EditorGUI.indentLevel++; - EditorGUILayout.LabelField("Min: " + (int)minTouchesFloat + ", Max: " + (int)maxTouchesFloat); - EditorGUILayout.MinMaxSlider(ref minTouchesFloat, ref maxTouchesFloat, 0, 10); + EditorGUILayout.LabelField("Min: " + (int) minPointersFloat + ", Max: " + (int) maxPointersFloat); + EditorGUILayout.MinMaxSlider(ref minPointersFloat, ref maxPointersFloat, 0, 10, GUILayout.MaxWidth(150)); EditorGUI.indentLevel--; } else { - if (limitTouches) + if (limitPointers) { - minTouchesFloat = 0; - maxTouchesFloat = 0; + minPointersFloat = 0; + maxPointersFloat = 0; } } - minTouches.intValue = (int)minTouchesFloat; - maxTouches.intValue = (int)maxTouchesFloat; + minPointers.intValue = (int) minPointersFloat; + maxPointers.intValue = (int) maxPointersFloat; } - protected virtual void drawRequireToFail() + protected virtual void drawFriendlyGestures() { - EditorGUILayout.PropertyField(requireGestureToFail, REQUIRE_GESTURE_TO_FAIL); + GUILayout.Space(5); + drawGestureList(friendlyGestures, addFriendlyGesture); + GUILayout.Space(5); } - protected virtual void drawAdvanced() + protected virtual void drawUnityEvents() { - drawLimitTouches(); - drawCombineTouches(); - drawSendMessage(); - drawRequireToFail(); - drawDebug(); - drawFriendlyGestures(); + EditorGUILayout.PropertyField(OnStateChange); + EditorGUILayout.PropertyField(sendStateChangeEvents, TEXT_SEND_STATE_CHANGE_EVENTS); } - protected virtual void drawFriendlyGestures() + protected virtual void drawSendMessage() { - EditorGUI.BeginChangeCheck(); - var expanded = GUIElements.BeginFoldout(friendlyGestures.isExpanded, new GUIContent(string.Format("Friendly gestures ({0})", friendlyGestures.arraySize), TEXT_FRIENDLY_HEADER)); - if (EditorGUI.EndChangeCheck()) - { - friendlyGestures.isExpanded = expanded; - } - if (expanded) - { - GUILayout.BeginVertical(GUIElements.FoldoutStyle); - drawGestureList(friendlyGestures, addFriendlyGesture); - GUILayout.EndVertical(); - } - GUIElements.EndFoldout(); + EditorGUILayout.PropertyField(sendMessageTarget, TEXT_SEND_MESSAGE_TARGET); + EditorGUILayout.PropertyField(sendStateChangeMessages, TEXT_SEND_STATE_CHANGE_MESSAGES); + } + + protected virtual void drawAdvanced() {} + + protected virtual void drawDebug() + { + if (debugMode == null) return; + EditorGUILayout.PropertyField(debugMode, TEXT_DEBUG_MODE); + } + + protected virtual void drawRequireToFail() + { + EditorGUILayout.PropertyField(requireGestureToFail, TEXT_REQUIRE_GESTURE_TO_FAIL); } #region Gesture List @@ -206,13 +274,15 @@ protected virtual void drawFriendlyGestures() private void drawGestureList(SerializedProperty prop, Action addGesture) { indexToRemove = -1; + +// Rect listRect = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(0.0f, (prop.arraySize == 0 ? 0 : prop.arraySize - 1) * 16 + 60, GUILayout.ExpandWidth(true))); +// friendlyGesturesList.DoList(listRect); friendlyGesturesList.DoLayoutList(); GUILayout.Space(9); - Rect dropArea = GUILayoutUtility.GetRect(0.0f, 50.0f, GUIElements.BoxStyle, - GUILayout.ExpandWidth(true)); - GUI.Box(dropArea, "Drag a Gesture Here", GUIElements.BoxStyle); + Rect dropArea = GUILayoutUtility.GetRect(0.0f, 50.0f, GUIElements.Box, GUILayout.ExpandWidth(true)); + GUI.Box(dropArea, "Drag a Gesture Here", GUIElements.Box); switch (Event.current.type) { case EventType.DragUpdated: @@ -338,4 +408,4 @@ private void removeFromArray(SerializedProperty array, int index) #endregion } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/LongPressGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/LongPressGestureEditor.cs index 74ac0e849..dc2f49fe3 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/LongPressGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/LongPressGestureEditor.cs @@ -11,35 +11,52 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(LongPressGesture), true)] internal sealed class LongPressGestureEditor : GestureEditor { - private static readonly GUIContent TIME_TO_PRESS = new GUIContent("Time to Press (sec)", "Limit maximum number of simultaneous touch points."); - private static readonly GUIContent DISTANCE_LIMIT = new GUIContent("Limit Movement (cm)", "Gesture fails if fingers move more than cm."); + public static readonly GUIContent TEXT_TIME_TO_PRESS = new GUIContent("Time to Press (sec)", "Limit maximum number of simultaneous pointers."); + public static readonly GUIContent TEXT_DISTANCE_LIMIT = new GUIContent("Limit Movement (cm)", "Gesture fails if fingers move more than cm."); - private SerializedProperty distanceLimit; - private SerializedProperty timeToPress; + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a gesture when this GameObject is being pressed for seconds."); + + private SerializedProperty distanceLimit, timeToPress; + private SerializedProperty OnLongPress; protected override void OnEnable() { - base.OnEnable(); - timeToPress = serializedObject.FindProperty("timeToPress"); distanceLimit = serializedObject.FindProperty("distanceLimit"); + OnLongPress = serializedObject.FindProperty("OnLongPress"); + + base.OnEnable(); + } + + protected override void drawBasic() + { + EditorGUILayout.PropertyField(timeToPress, TEXT_TIME_TO_PRESS); + } + + protected override GUIContent getHelpText() + { + return TEXT_HELP; } - public override void OnInspectorGUI() + protected override void drawGeneral() { - serializedObject.UpdateIfDirtyOrScript(); + EditorGUILayout.PropertyField(timeToPress, TEXT_TIME_TO_PRESS); - EditorGUILayout.PropertyField(timeToPress, TIME_TO_PRESS); + base.drawGeneral(); + } + + protected override void drawLimits() + { + EditorGUILayout.PropertyField(distanceLimit, TEXT_DISTANCE_LIMIT); - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); + base.drawLimits(); } - protected override void drawAdvanced() + protected override void drawUnityEvents() { - EditorGUILayout.PropertyField(distanceLimit, DISTANCE_LIMIT); + EditorGUILayout.PropertyField(OnLongPress); - base.drawAdvanced(); + base.drawUnityEvents(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs new file mode 100644 index 000000000..1d50c7784 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs @@ -0,0 +1,28 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Gestures; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Gestures +{ + [CustomEditor(typeof(MetaGesture), true)] + internal sealed class MetaGestureEditor : GestureEditor + { + public static readonly GUIContent TEXT_HELP = new GUIContent("This component serves as a proxy from TouchScript gesture recognition logic to C# events. It catches pointers like a normal event and dispatches events for every event of caught pointers."); + + protected override void OnEnable() + { + base.OnEnable(); + + shouldDrawGeneral = false; + } + + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs.meta new file mode 100644 index 000000000..e0ebd396d --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/MetaGestureEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1526de045810e4fd49854b9fda413e2a +timeCreated: 1500968297 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Gestures/PinnedTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/PinnedTransformGestureEditor.cs deleted file mode 100644 index 3830971c6..000000000 --- a/Source/Assets/TouchScript/Editor/Gestures/PinnedTransformGestureEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Editor.Gestures.Base; -using TouchScript.Gestures; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Gestures -{ - [CustomEditor(typeof(PinnedTransformGesture), true)] - internal class PinnedTransformGestureEditor : PinnedTransformGestureBaseEditor - { - private static readonly GUIContent PROJECTION = new GUIContent("Projection Type", "Method used to project 2d screen positions of touch points into 3d space."); - private static readonly GUIContent PROJECTION_NORMAL = new GUIContent("Projection Normal", "Normal of the plane in 3d space where touch points' positions are projected."); - - private SerializedProperty projection; - private SerializedProperty projectionPlaneNormal; - - protected override void OnEnable() - { - base.OnEnable(); - - projection = serializedObject.FindProperty("projection"); - projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); - } - - protected override void doInspectorGUI() - { - EditorGUILayout.PropertyField(projection, PROJECTION); - if (projection.enumValueIndex != (int)TransformGesture.ProjectionType.Layer) - { - EditorGUILayout.PropertyField(projectionPlaneNormal, PROJECTION_NORMAL); - } - } - - } -} diff --git a/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs index 1293e37c1..5c00da861 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs @@ -11,22 +11,38 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(PressGesture), true)] internal sealed class PressGestureEditor : GestureEditor { - private static readonly GUIContent IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores touch points from children."); + public static readonly GUIContent TEXT_IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores pointers from children."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a gesture when at least one pointer is pressed over this GameObject."); private SerializedProperty ignoreChildren; + private SerializedProperty OnPress; protected override void OnEnable() { + ignoreChildren = serializedObject.FindProperty("ignoreChildren"); + OnPress = serializedObject.FindProperty("OnPress"); + base.OnEnable(); + } - ignoreChildren = serializedObject.FindProperty("ignoreChildren"); + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + + protected override void drawGeneral() + { + EditorGUILayout.PropertyField(ignoreChildren, TEXT_IGNORE_CHILDREN); + + base.drawGeneral(); } - protected override void drawAdvanced() + protected override void drawUnityEvents() { - EditorGUILayout.PropertyField(ignoreChildren, IGNORE_CHILDREN); + EditorGUILayout.PropertyField(OnPress); - base.drawAdvanced(); + base.drawUnityEvents(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs index 28b711f13..ff2b1ec22 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs @@ -11,22 +11,38 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(ReleaseGesture), true)] internal sealed class ReleaseGestureEditor : GestureEditor { - private static readonly GUIContent IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores touch points from children."); + public static readonly GUIContent TEXT_IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores pointers from children."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a gesture when all pointers are lifted off from this GameObject."); private SerializedProperty ignoreChildren; + private SerializedProperty OnRelease; protected override void OnEnable() { + ignoreChildren = serializedObject.FindProperty("ignoreChildren"); + OnRelease = serializedObject.FindProperty("OnRelease"); + base.OnEnable(); + } - ignoreChildren = serializedObject.FindProperty("ignoreChildren"); + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + + protected override void drawGeneral() + { + EditorGUILayout.PropertyField(ignoreChildren, TEXT_IGNORE_CHILDREN); + + base.drawGeneral(); } - protected override void drawAdvanced() + protected override void drawUnityEvents() { - EditorGUILayout.PropertyField(ignoreChildren, IGNORE_CHILDREN); + EditorGUILayout.PropertyField(OnRelease); - base.drawAdvanced(); + base.drawUnityEvents(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/ScreenTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/ScreenTransformGestureEditor.cs deleted file mode 100644 index a00e1c8f0..000000000 --- a/Source/Assets/TouchScript/Editor/Gestures/ScreenTransformGestureEditor.cs +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Editor.Gestures.Base; -using TouchScript.Gestures; -using UnityEditor; - -namespace TouchScript.Editor.Gestures -{ - [CustomEditor(typeof(ScreenTransformGesture), true)] - internal class ScreenTransformGestureEditor : TransformGestureBaseEditor - { - } -} diff --git a/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs index 3cf54b49e..eacfcc60b 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs @@ -11,43 +11,72 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(TapGesture), true)] internal sealed class TapGestureEditor : GestureEditor { - private static readonly GUIContent TIME_LIMIT = new GUIContent("Limit Time (sec)", "Gesture fails if in seconds user didn't do the required number of taps."); - private static readonly GUIContent DISTANCE_LIMIT = new GUIContent("Limit Movement (cm)", "Gesture fails if taps are made more than cm away from the first touch position."); - private static readonly GUIContent NUMBER_OF_TAPS_REQUIRED = new GUIContent("Number of Taps Required", "Number of taps required for this gesture to be recognized."); + public static readonly GUIContent TEXT_TIME_LIMIT = new GUIContent("Limit Time (sec)", "Gesture fails if in seconds user didn't do the required number of taps."); + public static readonly GUIContent TEXT_DISTANCE_LIMIT = new GUIContent("Limit Movement (cm)", "Gesture fails if taps are made more than cm away from the first pointer position."); + public static readonly GUIContent TEXT_NUMBER_OF_TAPS_REQUIRED = new GUIContent("Number of Taps Required", "Number of taps required for this gesture to be recognized."); + public static readonly GUIContent TEXT_COMBINE_POINTERS = new GUIContent("Combine Pointers", "When several fingers are used to perform a tap, pointers released not earlier than seconds ago are used to calculate gesture's final screen position."); + public static readonly GUIContent TEXT_COMBINE_TOUCH_POINTERS = new GUIContent("Combine Interval (sec)", TEXT_COMBINE_POINTERS.tooltip); - private SerializedProperty numberOfTapsRequired; - private SerializedProperty distanceLimit; - private SerializedProperty timeLimit; + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a gesture when this GameObject is tapped."); + + private SerializedProperty numberOfTapsRequired, distanceLimit, timeLimit, combinePointers, combinePointersInterval; + private SerializedProperty OnTap; protected override void OnEnable() { - base.OnEnable(); - numberOfTapsRequired = serializedObject.FindProperty("numberOfTapsRequired"); timeLimit = serializedObject.FindProperty("timeLimit"); distanceLimit = serializedObject.FindProperty("distanceLimit"); + combinePointers = serializedObject.FindProperty("combinePointers"); + combinePointersInterval = serializedObject.FindProperty("combinePointersInterval"); + + OnTap = serializedObject.FindProperty("OnTap"); + + base.OnEnable(); + } - shouldDrawCombineTouches = true; + protected override void drawBasic() + { + EditorGUIUtility.labelWidth = 180; + EditorGUILayout.IntPopup(numberOfTapsRequired, new[] {new GUIContent("One"), new GUIContent("Two"), new GUIContent("Three")}, new[] {1, 2, 3}, TEXT_NUMBER_OF_TAPS_REQUIRED, GUILayout.ExpandWidth(true)); } - public override void OnInspectorGUI() + protected override GUIContent getHelpText() { - serializedObject.UpdateIfDirtyOrScript(); + return TEXT_HELP; + } + protected override void drawGeneral() + { EditorGUIUtility.labelWidth = 180; - EditorGUILayout.IntPopup(numberOfTapsRequired, new[] {new GUIContent("One"), new GUIContent("Two"), new GUIContent("Three")}, new[] {1, 2, 3}, NUMBER_OF_TAPS_REQUIRED, GUILayout.ExpandWidth(true)); + EditorGUILayout.IntPopup(numberOfTapsRequired, new[] {new GUIContent("One"), new GUIContent("Two"), new GUIContent("Three")}, new[] {1, 2, 3}, TEXT_NUMBER_OF_TAPS_REQUIRED, GUILayout.ExpandWidth(true)); + EditorGUILayout.PropertyField(combinePointers, TEXT_COMBINE_POINTERS); + if (combinePointers.boolValue) + { + EditorGUIUtility.labelWidth = 160; + EditorGUILayout.BeginHorizontal(); + GUILayout.Label(GUIContent.none, GUILayout.Width(10)); + EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true)); + EditorGUILayout.PropertyField(combinePointersInterval, TEXT_COMBINE_TOUCH_POINTERS); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + } + base.drawGeneral(); + } + + protected override void drawLimits() + { + EditorGUILayout.PropertyField(timeLimit, TEXT_TIME_LIMIT); + EditorGUILayout.PropertyField(distanceLimit, TEXT_DISTANCE_LIMIT); - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); + base.drawLimits(); } - protected override void drawAdvanced() + protected override void drawUnityEvents() { - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.PropertyField(timeLimit, TIME_LIMIT); - EditorGUILayout.PropertyField(distanceLimit, DISTANCE_LIMIT); + EditorGUILayout.PropertyField(OnTap); - base.drawAdvanced(); + base.drawUnityEvents(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestureEditor.cs deleted file mode 100644 index 2df7a88d5..000000000 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestureEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Editor.Gestures.Base; -using TouchScript.Gestures; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Gestures -{ - [CustomEditor(typeof(TransformGesture), true)] - internal class TransformGestureEditor : TransformGestureBaseEditor - { - private static readonly GUIContent PROJECTION = new GUIContent("Projection Type", "Method used to project 2d screen positions of touch points into 3d space."); - private static readonly GUIContent PROJECTION_NORMAL = new GUIContent("Projection Normal", "Normal of the plane in 3d space where touch points' positions are projected."); - - private SerializedProperty projection; - private SerializedProperty projectionPlaneNormal; - - protected override void OnEnable() - { - base.OnEnable(); - - projection = serializedObject.FindProperty("projection"); - projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); - } - - protected override void doInspectorGUI() - { - EditorGUILayout.PropertyField(projection, PROJECTION); - if (projection.enumValueIndex != (int)TransformGesture.ProjectionType.Layer) - { - EditorGUILayout.PropertyField(projectionPlaneNormal, PROJECTION_NORMAL); - } - } - - } -} diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures.meta new file mode 100644 index 000000000..32d8f6cfa --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5a173685f455645ce85f70ce30426f30 +folderAsset: yes +timeCreated: 1477923463 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Gestures/Base.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Gestures/Base.meta rename to Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base.meta diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs new file mode 100644 index 000000000..b2016ecfd --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs @@ -0,0 +1,58 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Gestures.TransformGestures.Base +{ + internal class OnePointTransformGestureBaseEditor : TransformGestureBaseEditor + { + protected override void drawBasic() + { + var typeValue = type.intValue; + int newType = 0; + EditorGUILayout.LabelField(TEXT_TYPE); + + var rect = GUILayoutUtility.GetRect(0, 20, GUILayout.ExpandWidth(true)); + rect.x += 10; + rect.width = 70; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_ROTATION, + (typeValue & (int) TransformGesture.TransformType.Rotation) != 0)) + newType |= (int) TransformGesture.TransformType.Rotation; + rect.x += rect.width; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_SCALING, + (typeValue & (int) TransformGesture.TransformType.Scaling) != 0)) + newType |= (int) TransformGesture.TransformType.Scaling; + type.intValue = newType; + } + + protected override void drawGeneral() + { + var typeValue = type.intValue; + int newType = 0; + EditorGUILayout.LabelField(TEXT_TYPE); + + EditorGUI.indentLevel--; + var rect = GUILayoutUtility.GetRect(0, 20, GUILayout.ExpandWidth(true)); + rect.x += 26; + rect.width = 70; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_ROTATION, + (typeValue & (int) TransformGesture.TransformType.Rotation) != 0)) + newType |= (int) TransformGesture.TransformType.Rotation; + rect.x += rect.width; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_SCALING, + (typeValue & (int) TransformGesture.TransformType.Scaling) != 0)) + newType |= (int) TransformGesture.TransformType.Scaling; + type.intValue = newType; + EditorGUI.indentLevel++; + + EditorGUIUtility.labelWidth = 160; + EditorGUILayout.PropertyField(screenTransformThreshold, TEXT_SCREEN_TRANSFORM_THRESHOLD); + + base.drawGeneral(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs.meta new file mode 100644 index 000000000..9ae64c84c --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 02b15da66d6e24de79d6f41a4323f422 +timeCreated: 1478434727 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs new file mode 100644 index 000000000..fec57b9a4 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs @@ -0,0 +1,148 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Editor.EditorUI; +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Gestures.TransformGestures.Base +{ + internal class TransformGestureBaseEditor : GestureEditor + { + public static readonly GUIContent TEXT_PROJECTION_HEADER = new GUIContent("Projection", "Screen to 3D object projection parameters."); + + public static readonly GUIContent TEXT_TYPE = new GUIContent("Transform Type", "Specifies what gestures should be detected: Translation, Rotation, Scaling."); + public static readonly GUIContent TEXT_TYPE_TRANSLATION = new GUIContent("Translation", "Dragging with one ore more fingers."); + public static readonly GUIContent TEXT_TYPE_ROTATION = new GUIContent("Rotation", "Rotating with two or more fingers."); + public static readonly GUIContent TEXT_TYPE_SCALING = new GUIContent("Scaling", "Scaling with two or more fingers."); + public static readonly GUIContent TEXT_MIN_SCREEN_POINTS_DISTANCE = new GUIContent("Min Points Distance (cm)", "Minimum distance between two pointers (clusters) in cm to consider this gesture started. Used to prevent fake pointers spawned near real ones on cheap multitouch hardware to mess everything up."); + public static readonly GUIContent TEXT_SCREEN_TRANSFORM_THRESHOLD = new GUIContent("Movement Threshold (cm)", "Minimum distance in cm pointers must move for the gesture to begin."); + + public static readonly GUIContent TEXT_PROJECTION = new GUIContent("Projection Type", "Method used to project 2d screen positions of pointers into 3d space."); + public static readonly GUIContent TEXT_PROJECTION_LAYER = new GUIContent("Transform plane is parallel to the camera."); + public static readonly GUIContent TEXT_PROJECTION_OBJECT = new GUIContent("Transform plane is relative to the object."); + public static readonly GUIContent TEXT_PROJECTION_GLOBAL = new GUIContent("Transform plane is relative to the world."); + public static readonly GUIContent TEXT_PROJECTION_NORMAL = new GUIContent("Projection Normal", "Normal of the plane in 3d space where pointers' positions are projected."); + + + protected SerializedProperty type, minScreenPointsDistance, screenTransformThreshold; + protected SerializedProperty OnTransformStart, OnTransform, OnTransformComplete; + + public SerializedProperty projection, projectionPlaneNormal; + public SerializedProperty projectionProps; + + private Texture2D xy, xz, yz, unknown, selector; + private Color selectorColor = new Color(1, 1, 1, .05f); + private Color selectorColorSelected = new Color(1, 1, 1, .9f); + protected bool customProjection = false; + + protected override void OnEnable() + { + type = serializedObject.FindProperty("type"); + minScreenPointsDistance = serializedObject.FindProperty("minScreenPointsDistance"); + screenTransformThreshold = serializedObject.FindProperty("screenTransformThreshold"); + OnTransformStart = serializedObject.FindProperty("OnTransformStart"); + OnTransform = serializedObject.FindProperty("OnTransform"); + OnTransformComplete = serializedObject.FindProperty("OnTransformComplete"); + + projection = serializedObject.FindProperty("projection"); + projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); + projectionProps = serializedObject.FindProperty("projectionProps"); + + xy = EditorResources.Load("Icons/xy.png"); + xz = EditorResources.Load("Icons/xz.png"); + yz = EditorResources.Load("Icons/yz.png"); + unknown = EditorResources.Load("Icons/unknown.png"); + selector = EditorResources.Load("Icons/selector.png"); + + base.OnEnable(); + } + + protected override void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnTransformStart); + EditorGUILayout.PropertyField(OnTransform); + EditorGUILayout.PropertyField(OnTransformComplete); + + base.drawUnityEvents(); + } + + protected void initCustomProjection() + { + var v = projectionPlaneNormal.vector3Value; + customProjection = !(v == Vector3.up || v == Vector3.right || v == Vector3.forward); + } + + protected bool drawProjection(bool custom) + { + EditorGUILayout.PropertyField(projection, TEXT_PROJECTION); + switch (projection.enumValueIndex) + { + case (int) TransformGesture.ProjectionType.Layer: + EditorGUILayout.LabelField(TEXT_PROJECTION_LAYER, GUIElements.HelpBox); + break; + case (int) TransformGesture.ProjectionType.Object: + EditorGUILayout.LabelField(TEXT_PROJECTION_OBJECT, GUIElements.HelpBox); + break; + case (int) TransformGesture.ProjectionType.Global: + EditorGUILayout.LabelField(TEXT_PROJECTION_GLOBAL, GUIElements.HelpBox); + break; + } + + if (projection.enumValueIndex != (int) TransformGesture.ProjectionType.Layer) + { + var v = projectionPlaneNormal.vector3Value; + var rect = GUILayoutUtility.GetRect(0, 35, GUILayout.ExpandWidth(true)); + + rect.width = 44; + rect.x += 10; + GUI.DrawTexture(rect, yz); + if (drawSelector(rect, !custom && v == Vector3.right)) + { + projectionPlaneNormal.vector3Value = Vector3.right; + custom = false; + } + + rect.x += rect.width + 5; + GUI.DrawTexture(rect, xz); + if (drawSelector(rect, !custom && v == Vector3.up)) + { + projectionPlaneNormal.vector3Value = Vector3.up; + custom = false; + } + + rect.x += rect.width + 5; + GUI.DrawTexture(rect, xy); + if (drawSelector(rect, !custom && v == Vector3.forward)) + { + projectionPlaneNormal.vector3Value = Vector3.forward; + custom = false; + } + + rect.x += rect.width + 10; + GUI.DrawTexture(rect, unknown); + if (drawSelector(rect, custom)) custom = true; + + if (custom) EditorGUILayout.PropertyField(projectionPlaneNormal, TEXT_PROJECTION_NORMAL); + } + + return custom; + } + + protected bool drawSelector(Rect rect, bool selected) + { + GUI.color = selected ? selectorColorSelected : selectorColor; + GUI.DrawTexture(rect, selector); + GUI.color = Color.white; + + if (Event.current.type == EventType.MouseUp && rect.Contains(Event.current.mousePosition)) + { + Event.current.Use(); + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/Base/TransformGestureBaseEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Gestures/Base/TransformGestureBaseEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs.meta diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs new file mode 100644 index 000000000..4cb6492f4 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs @@ -0,0 +1,70 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Gestures.TransformGestures.Base +{ + internal class TwoPointTransformGestureBaseEditor : TransformGestureBaseEditor + { + protected override void drawBasic() + { + var typeValue = type.intValue; + int newType = 0; + EditorGUILayout.LabelField(TEXT_TYPE); + + var rect = GUILayoutUtility.GetRect(0, 20, GUILayout.ExpandWidth(true)); + rect.x += 10; + rect.width = 90; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_TRANSLATION, + (typeValue & (int) TransformGesture.TransformType.Translation) != 0)) + newType |= (int) TransformGesture.TransformType.Translation; + rect.x += rect.width; + rect.width = 70; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_ROTATION, + (typeValue & (int) TransformGesture.TransformType.Rotation) != 0)) + newType |= (int) TransformGesture.TransformType.Rotation; + rect.x += rect.width; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_SCALING, + (typeValue & (int) TransformGesture.TransformType.Scaling) != 0)) + newType |= (int) TransformGesture.TransformType.Scaling; + type.intValue = newType; + } + + protected override void drawGeneral() + { + var typeValue = type.intValue; + int newType = 0; + EditorGUILayout.LabelField(TEXT_TYPE); + EditorGUI.indentLevel--; + + var rect = GUILayoutUtility.GetRect(0, 20, GUILayout.ExpandWidth(true)); + rect.x += 26; + rect.width = 90; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_TRANSLATION, + (typeValue & (int) TransformGesture.TransformType.Translation) != 0)) + newType |= (int) TransformGesture.TransformType.Translation; + rect.x += rect.width; + rect.width = 70; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_ROTATION, + (typeValue & (int) TransformGesture.TransformType.Rotation) != 0)) + newType |= (int) TransformGesture.TransformType.Rotation; + rect.x += rect.width; + if (EditorGUI.ToggleLeft(rect, TEXT_TYPE_SCALING, + (typeValue & (int) TransformGesture.TransformType.Scaling) != 0)) + newType |= (int) TransformGesture.TransformType.Scaling; + type.intValue = newType; + + EditorGUI.indentLevel++; + + EditorGUIUtility.labelWidth = 160; + EditorGUILayout.PropertyField(minScreenPointsDistance, TEXT_MIN_SCREEN_POINTS_DISTANCE); + EditorGUILayout.PropertyField(screenTransformThreshold, TEXT_SCREEN_TRANSFORM_THRESHOLD); + + base.drawGeneral(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs.meta new file mode 100644 index 000000000..ff8dcc5d9 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a65e2d10701184d48aa913a8ee9ff7e7 +timeCreated: 1478434727 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs new file mode 100644 index 000000000..42a21a75a --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs @@ -0,0 +1,49 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Editor.Gestures.TransformGestures.Base; +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using UnityEngine; +using TouchScript.Editor.EditorUI; + +namespace TouchScript.Editor.Gestures.TransformGestures +{ + [CustomEditor(typeof(PinnedTransformGesture), true)] + internal class PinnedTransformGestureEditor : OnePointTransformGestureBaseEditor + { + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a combination of rotation and scaling gestures on the GameObject if it was pinned to the world position."); + + protected override void OnEnable() + { + base.OnEnable(); + + initCustomProjection(); + } + + protected override void drawBasic() + { + base.drawBasic(); + + customProjection = drawProjection(customProjection); + } + + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + + protected override void drawOtherGUI() + { + var display = GUIElements.Header(TEXT_PROJECTION_HEADER, projectionProps); + if (display) + { + EditorGUI.indentLevel++; + customProjection = drawProjection(customProjection); + EditorGUILayout.Space(); + EditorGUI.indentLevel--; + } + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/PinnedTransformGestureEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Gestures/PinnedTransformGestureEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs.meta diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs new file mode 100644 index 000000000..c30fa37f3 --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs @@ -0,0 +1,22 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Editor.Gestures.TransformGestures.Base; +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Gestures.TransformGestures +{ + [CustomEditor(typeof(ScreenTransformGesture), true)] + internal class ScreenTransformGestureEditor : TwoPointTransformGestureBaseEditor + { + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a combination of translation, rotation and scaling gestures on the GameObject in screen space."); + + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/ScreenTransformGestureEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Gestures/ScreenTransformGestureEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs.meta diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs new file mode 100644 index 000000000..d205e6f0e --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs @@ -0,0 +1,50 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Editor.Gestures.TransformGestures.Base; +using TouchScript.Gestures.TransformGestures; +using UnityEditor; +using TouchScript.Editor.EditorUI; +using UnityEngine; + +namespace TouchScript.Editor.Gestures.TransformGestures +{ + [CustomEditor(typeof(TransformGesture), true)] + internal class TransformGestureEditor : TwoPointTransformGestureBaseEditor + { + public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a combination of translation, rotation and scaling gestures on the GameObject."); + + + protected override void OnEnable() + { + base.OnEnable(); + + initCustomProjection(); + } + + protected override void drawBasic() + { + base.drawBasic(); + + customProjection = drawProjection(customProjection); + } + + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } + + protected override void drawOtherGUI() + { + var display = GUIElements.Header(TEXT_PROJECTION_HEADER, projectionProps); + if (display) + { + EditorGUI.indentLevel++; + customProjection = drawProjection(customProjection); + EditorGUILayout.Space(); + EditorGUI.indentLevel--; + } + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestureEditor.cs.meta b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Editor/Gestures/TransformGestureEditor.cs.meta rename to Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs.meta diff --git a/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs index d358b2173..030363f56 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs +++ b/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs @@ -1,3 +1,7 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + using TouchScript.Editor.Utils; using UnityEditor; using UnityEngine; @@ -6,36 +10,10 @@ namespace TouchScript.Editor.InputSources { public class InputSourceEditor : UnityEditor.Editor { - private const string TEXT_ADVANCED_HEADER = "Advanced properties."; - - private SerializedProperty advanced; - - protected virtual void OnEnable() - { - advanced = serializedObject.FindProperty("advancedProps"); - } - - public override void OnInspectorGUI() - { - serializedObject.UpdateIfDirtyOrScript(); - - EditorGUI.BeginChangeCheck(); - var expanded = GUIElements.BeginFoldout(advanced.isExpanded, new GUIContent("Advanced", TEXT_ADVANCED_HEADER)); - if (EditorGUI.EndChangeCheck()) - { - advanced.isExpanded = expanded; - } - if (expanded) - { - GUILayout.BeginVertical(GUIElements.FoldoutStyle); - drawAdvanced(); - GUILayout.EndVertical(); - } - GUIElements.EndFoldout(); + protected virtual void OnEnable() {} - serializedObject.ApplyModifiedProperties(); - } + public override void OnInspectorGUI() {} protected virtual void drawAdvanced() {} } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs deleted file mode 100644 index dca00d9a8..000000000 --- a/Source/Assets/TouchScript/Editor/InputSources/MobileInputEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -using TouchScript.InputSources; -using UnityEditor; - -namespace TouchScript.Editor.InputSources -{ -#pragma warning disable 0618 - [CustomEditor(typeof (MobileInput), true)] -#pragma warning restore 0618 - internal sealed class MobileInputEditor : InputSourceEditor - { - private SerializedProperty tags; - private SerializedProperty disableOnNonTouchPlatforms; - - protected override void OnEnable() - { - base.OnEnable(); - - tags = serializedObject.FindProperty("Tags"); - disableOnNonTouchPlatforms = serializedObject.FindProperty("DisableOnNonTouchPlatforms"); - } - - public override void OnInspectorGUI() - { - serializedObject.UpdateIfDirtyOrScript(); - - EditorGUILayout.PropertyField(disableOnNonTouchPlatforms); - - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); - } - - protected override void drawAdvanced() - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(tags); - EditorGUI.indentLevel--; - } - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs deleted file mode 100644 index 062e9a202..000000000 --- a/Source/Assets/TouchScript/Editor/InputSources/MouseInputEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -using TouchScript.InputSources; -using UnityEditor; - -namespace TouchScript.Editor.InputSources -{ -#pragma warning disable 0618 - [CustomEditor(typeof(MouseInput), true)] -#pragma warning restore 0618 - internal sealed class MouseInputEditor : InputSourceEditor - { - private SerializedProperty tags; - private SerializedProperty disableOnMobilePlatforms; - - protected override void OnEnable() - { - base.OnEnable(); - - tags = serializedObject.FindProperty("Tags"); - disableOnMobilePlatforms = serializedObject.FindProperty("DisableOnMobilePlatforms"); - } - - public override void OnInspectorGUI() - { - serializedObject.UpdateIfDirtyOrScript(); - - EditorGUILayout.PropertyField(disableOnMobilePlatforms); - - serializedObject.ApplyModifiedProperties(); - base.OnInspectorGUI(); - } - - protected override void drawAdvanced() - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(tags); - EditorGUI.indentLevel--; - } - } -} diff --git a/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs index 9daf62c5d..b6cc02970 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs +++ b/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs @@ -1,58 +1,137 @@ -using TouchScript.InputSources; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; using UnityEditor; +using UnityEngine; +using TouchScript.Editor.EditorUI; namespace TouchScript.Editor.InputSources { - [CustomEditor(typeof (StandardInput), true)] + [CustomEditor(typeof(StandardInput), true)] internal sealed class StandardInputEditor : InputSourceEditor { - private SerializedProperty touchTags, mouseTags, penTags; + public static readonly GUIContent TEXT_GENERAL_HEADER = new GUIContent("General", "General settings."); + public static readonly GUIContent TEXT_WINDOWS_HEADER = new GUIContent("Windows", "Windows specific settings."); + public static readonly GUIContent TEXT_WEBGL_HEADER = new GUIContent("WebGL", "WebGL specific settings."); + + public static readonly GUIContent TEXT_EMULATE_MOUSE = new GUIContent("Emulate Second Mouse Pointer", "If selected, you can press ALT to make a stationary mouse pointer. This is used to simulate multi-touch."); + + public static readonly GUIContent TEXT_WINDOWS_API = new GUIContent("Select which touch API to use:\n - Windows 8 — new WM_POINTER API,\n - Windows 7 — old WM_TOUCH API,\n - Unity — Unity's WM_TOUCH implementation,\n - None — no touch."); + public static readonly GUIContent TEXT_WINDOWS8 = new GUIContent("Windows 8+ API"); + public static readonly GUIContent TEXT_WINDOWS7 = new GUIContent("Windows 7 API"); + public static readonly GUIContent TEXT_WINDOWS8_MOUSE = new GUIContent("Enable Mouse on Windows 8+"); + public static readonly GUIContent TEXT_WINDOWS7_MOUSE = new GUIContent("Enable Mouse on Windows 7"); + public static readonly GUIContent TEXT_UWP_MOUSE = new GUIContent("Enable Mouse on UWP"); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component gathers input data from various devices like touch, mouse and pen on all platforms."); + + private SerializedProperty basicEditor; - private SerializedProperty windows8Touch, - windows7Touch, - webPlayerTouch, - webGLTouch, - windows8Mouse, - windows7Mouse, - universalWindowsMouse; + private SerializedProperty windows8Touch, windows7Touch, webGLTouch, windows8Mouse, + windows7Mouse, universalWindowsMouse, emulateSecondMousePointer; + + private SerializedProperty generalProps, windowsProps, webglProps; + + private StandardInput instance; protected override void OnEnable() { base.OnEnable(); - touchTags = serializedObject.FindProperty("TouchTags"); - mouseTags = serializedObject.FindProperty("MouseTags"); - penTags = serializedObject.FindProperty("PenTags"); - windows8Touch = serializedObject.FindProperty("Windows8Touch"); - windows7Touch = serializedObject.FindProperty("Windows7Touch"); - webPlayerTouch = serializedObject.FindProperty("WebPlayerTouch"); - webGLTouch = serializedObject.FindProperty("WebGLTouch"); - windows8Mouse = serializedObject.FindProperty("Windows8Mouse"); - windows7Mouse = serializedObject.FindProperty("Windows7Mouse"); - universalWindowsMouse = serializedObject.FindProperty("UniversalWindowsMouse"); + instance = target as StandardInput; + basicEditor = serializedObject.FindProperty("basicEditor"); + windows8Touch = serializedObject.FindProperty("windows8API"); + windows7Touch = serializedObject.FindProperty("windows7API"); + webGLTouch = serializedObject.FindProperty("webGLTouch"); + windows8Mouse = serializedObject.FindProperty("windows8Mouse"); + windows7Mouse = serializedObject.FindProperty("windows7Mouse"); + universalWindowsMouse = serializedObject.FindProperty("universalWindowsMouse"); + emulateSecondMousePointer = serializedObject.FindProperty("emulateSecondMousePointer"); + + generalProps = serializedObject.FindProperty("generalProps"); + windowsProps = serializedObject.FindProperty("windowsProps"); + webglProps = serializedObject.FindProperty("webglProps"); } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); - EditorGUILayout.PropertyField(windows8Touch); - EditorGUILayout.PropertyField(windows7Touch); - EditorGUILayout.PropertyField(webPlayerTouch); - EditorGUILayout.PropertyField(webGLTouch); - EditorGUILayout.PropertyField(windows8Mouse); - EditorGUILayout.PropertyField(windows7Mouse); - EditorGUILayout.PropertyField(universalWindowsMouse); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif + + GUILayout.Space(5); + + if (basicEditor.boolValue) + { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(emulateSecondMousePointer, TEXT_EMULATE_MOUSE); + if (EditorGUI.EndChangeCheck()) + { + instance.EmulateSecondMousePointer = emulateSecondMousePointer.boolValue; + } + + if (GUIElements.BasicHelpBox(TEXT_HELP)) + { + basicEditor.boolValue = false; + Repaint(); + } + } + else + { + drawGeneral(); + drawWindows(); + drawWebGL(); + } + serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); } - protected override void drawAdvanced() + private void drawGeneral() + { + var display = GUIElements.Header(TEXT_GENERAL_HEADER, generalProps); + if (display) + { + EditorGUI.indentLevel++; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(emulateSecondMousePointer, TEXT_EMULATE_MOUSE); + if (EditorGUI.EndChangeCheck()) + { + instance.EmulateSecondMousePointer = emulateSecondMousePointer.boolValue; + } + EditorGUI.indentLevel--; + } + } + + private void drawWindows() + { + var display = GUIElements.Header(TEXT_WINDOWS_HEADER, windowsProps); + if (display) + { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(windows8Touch, TEXT_WINDOWS8); + EditorGUILayout.PropertyField(windows7Touch, TEXT_WINDOWS7); + EditorGUILayout.LabelField(TEXT_WINDOWS_API, GUIElements.HelpBox); + EditorGUILayout.PropertyField(windows8Mouse, TEXT_WINDOWS8_MOUSE); + EditorGUILayout.PropertyField(windows7Mouse, TEXT_WINDOWS7_MOUSE); + EditorGUILayout.PropertyField(universalWindowsMouse, TEXT_UWP_MOUSE); + EditorGUI.indentLevel--; + } + } + + private void drawWebGL() { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(touchTags); - EditorGUILayout.PropertyField(mouseTags); - EditorGUILayout.PropertyField(penTags); - EditorGUI.indentLevel--; + var display = GUIElements.Header(TEXT_WEBGL_HEADER, webglProps); + if (display) + { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(webGLTouch); + EditorGUI.indentLevel--; + } } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs b/Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs deleted file mode 100644 index 455248e2a..000000000 --- a/Source/Assets/TouchScript/Editor/Layers/CameraLayer2DEditor.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Reflection; -using TouchScript.Layers; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Layers -{ - [CustomEditor(typeof(CameraLayer2D))] - internal sealed class CameraLayer2DEditor : UnityEditor.Editor - { - public const string TEXT_REBUILD = "Unity doesn't expose actual 2d layers sorting, so if you change 2d layers you must manually rebuild layers by pressing this button."; - - private SerializedProperty layerIds; - - private void OnEnable() - { - layerIds = serializedObject.FindProperty("layerIds"); - if (layerIds.arraySize == 0) rebuildSortingLayers(); - } - - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - - GUILayout.Space(10); - if (GUILayout.Button(new GUIContent("Update Sorting Layers", TEXT_REBUILD))) - { - rebuildSortingLayers(); - } - } - - private void rebuildSortingLayers() - { - var data = getSortingLayerIdsToSortOrder(); - layerIds.arraySize = data.Length; - for (var i = 0; i < data.Length; i++) - { - layerIds.GetArrayElementAtIndex(i).intValue = data[i]; - } - serializedObject.ApplyModifiedProperties(); - - Debug.Log("CameraLayer2D: sorting layer order was rebuilt."); - } - - // https://github.com/TouchScript/TouchScript/issues/60 - // Based on https://gist.github.com/stuartcarnie/8511903 - private static int[] getSortingLayerIdsToSortOrder() - { - var type = typeof(UnityEditorInternal.InternalEditorUtility); - - var getSortingLayerCount = type.GetMethod("GetSortingLayerCount", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); - MethodInfo getSortingLayerUserID; - if (Application.unityVersion.StartsWith("4")) - { - getSortingLayerUserID = type.GetMethod("GetSortingLayerUserID", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); - } - else - { - // was renamed in 5.0 - getSortingLayerUserID = type.GetMethod("GetSortingLayerUniqueID", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); - } - - int count = (int)getSortingLayerCount.Invoke(null, null); - var layerIds = new int[count]; - for (int i = 0; i < count; i++) - { - layerIds[i] = (int)getSortingLayerUserID.Invoke(null, new object[] { i }); - } - - return layerIds; - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Layers/FullscreenLayerEditor.cs b/Source/Assets/TouchScript/Editor/Layers/FullscreenLayerEditor.cs index 1986c8492..ed516d04f 100644 --- a/Source/Assets/TouchScript/Editor/Layers/FullscreenLayerEditor.cs +++ b/Source/Assets/TouchScript/Editor/Layers/FullscreenLayerEditor.cs @@ -2,6 +2,7 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Editor.EditorUI; using TouchScript.Layers; using UnityEditor; using UnityEngine; @@ -11,6 +12,8 @@ namespace TouchScript.Editor.Layers [CustomEditor(typeof(FullscreenLayer))] internal sealed class FullscreenLayerEditor : UnityEditor.Editor { + public static readonly GUIContent TEXT_HELP = new GUIContent("This component receives all pointers which were not caught by other layers. It sets poitners' Target property to itself, so all fullscreen gestures must be attached to the same GameObject as FullscreenGesture."); + private SerializedProperty type, camera; private FullscreenLayer instance; @@ -30,10 +33,10 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(type); if (EditorGUI.EndChangeCheck()) { - instance.Type = (FullscreenLayer.LayerType)type.enumValueIndex; + instance.Type = (FullscreenLayer.LayerType) type.enumValueIndex; } - if (type.enumValueIndex == (int)FullscreenLayer.LayerType.Camera) + if (type.enumValueIndex == (int) FullscreenLayer.LayerType.Camera) { EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(camera); @@ -42,6 +45,8 @@ public override void OnInspectorGUI() instance.Camera = camera.objectReferenceValue as Camera; } } + + EditorGUILayout.LabelField(TEXT_HELP, GUIElements.HelpBox); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs b/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs new file mode 100644 index 000000000..37406e88e --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs @@ -0,0 +1,116 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Editor.EditorUI; +using TouchScript.Layers; +using UnityEditor; +using UnityEngine; + +namespace TouchScript.Editor.Layers +{ + [CustomEditor(typeof(StandardLayer), true)] + internal class StandardLayerEditor : UnityEditor.Editor + { + public static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced properties."); + public static readonly GUIContent TEXT_HIT_HEADER = new GUIContent("Hit test options", "Options which control what types of objects this layer should search under pointers."); + + public static readonly GUIContent TEXT_3D_OBJECTS = new GUIContent("Hit 3D Objects", "Layer should raycast 3D objects."); + public static readonly GUIContent TEXT_2D_OBJECTS = new GUIContent("Hit 2D Objects", "Layer should raycast 2D objects."); + public static readonly GUIContent TEXT_WORLD_UI = new GUIContent("Hit World UI", "Layer should raycast World Space UI."); + public static readonly GUIContent TEXT_SS_UI = new GUIContent("Hit Screen Space UI", "Layer should raycast Screen Space UI."); + public static readonly GUIContent TEXT_LAYER_MASK = new GUIContent("Layer Mask", "Layer mask."); + public static readonly GUIContent TEXT_HIT_FILTERS = new GUIContent("Use Hit FIlters", "Layer should test for individual HitTest objects."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component assigns target GameObjects in the scene for pressed pointers."); + + private SerializedProperty advancedProps, hitProps; + private SerializedProperty basicEditor; + private SerializedProperty hit3DObjects; + private SerializedProperty hit2DObjects; + private SerializedProperty hitWorldSpaceUI; + private SerializedProperty hitScreenSpaceUI; + private SerializedProperty layerMask; + private SerializedProperty useHitFilters; + + protected virtual void OnEnable() + { + hideFlags = HideFlags.HideAndDontSave; + + advancedProps = serializedObject.FindProperty("advancedProps"); + hitProps = serializedObject.FindProperty("hitProps"); + basicEditor = serializedObject.FindProperty("basicEditor"); + hit3DObjects = serializedObject.FindProperty("hit3DObjects"); + hit2DObjects = serializedObject.FindProperty("hit2DObjects"); + hitWorldSpaceUI = serializedObject.FindProperty("hitWorldSpaceUI"); + hitScreenSpaceUI = serializedObject.FindProperty("hitScreenSpaceUI"); + layerMask = serializedObject.FindProperty("layerMask"); + useHitFilters = serializedObject.FindProperty("useHitFilters"); + } + + public override void OnInspectorGUI() + { +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif + + GUILayout.Space(5); + + if (basicEditor.boolValue) + { + drawHit(); + + if (GUIElements.BasicHelpBox(TEXT_HELP)) + { + basicEditor.boolValue = false; + Repaint(); + } + } + else + { + drawHit(); + drawAdvanced(); + } + + serializedObject.ApplyModifiedProperties(); + } + + private void drawHit() + { + var display = GUIElements.Header(TEXT_HIT_HEADER, hitProps); + if (display) + { + EditorGUI.indentLevel++; + doDrawHit(); + EditorGUI.indentLevel--; + } + } + + protected virtual void doDrawHit() + { + EditorGUILayout.PropertyField(hitScreenSpaceUI, TEXT_SS_UI); + EditorGUILayout.PropertyField(hit3DObjects, TEXT_3D_OBJECTS); + EditorGUILayout.PropertyField(hit2DObjects, TEXT_2D_OBJECTS); + EditorGUILayout.PropertyField(hitWorldSpaceUI, TEXT_WORLD_UI); + EditorGUILayout.PropertyField(layerMask, TEXT_LAYER_MASK); + } + + private void drawAdvanced() + { + var display = GUIElements.Header(TEXT_ADVANCED_HEADER, advancedProps); + if (display) + { + EditorGUI.indentLevel++; + doDrawAdvanced(); + EditorGUI.indentLevel--; + } + } + + protected virtual void doDrawAdvanced() + { + EditorGUILayout.PropertyField(useHitFilters, TEXT_HIT_FILTERS); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs.meta b/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs.meta new file mode 100644 index 000000000..2ac07e3ac --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6dddf8a020fa54bcba36b9d67bd59978 +timeCreated: 1477791911 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs b/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs deleted file mode 100644 index 300e32b23..000000000 --- a/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Layers; -using UnityEditor; -using UnityEngine; - -namespace TouchScript.Editor.Layers -{ - [CustomEditor(typeof (UILayer))] - internal sealed class UILayerEditor : UnityEditor.Editor - { - private void OnEnable() {} - - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - } - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs.meta b/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs.meta deleted file mode 100644 index b32e72109..000000000 --- a/Source/Assets/TouchScript/Editor/Layers/UILayerEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7c765df6b51e243c189e129d8edc4a7b -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs b/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs index 32d023582..b5486f592 100644 --- a/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs +++ b/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs @@ -5,44 +5,81 @@ using System.Collections.Generic; using System.Linq; using TouchScript.Devices.Display; +using TouchScript.Editor.EditorUI; using TouchScript.Layers; using UnityEditor; using UnityEditorInternal; using UnityEngine; using Object = UnityEngine.Object; +using System.Reflection; namespace TouchScript.Editor { [CustomEditor(typeof(TouchManager))] internal sealed class TouchManagerEditor : UnityEditor.Editor { - private static readonly GUIContent DISPLAY_DEVICE = new GUIContent("Display Device", "Display device properties where such parameters as target DPI are stored."); - private static readonly GUIContent CREATE_CAMERA_LAYER = new GUIContent("Create Camera Layer", "Indicates if TouchScript should create a CameraLayer for you if no layers present in a scene. This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get touch input from some device."); - private static readonly GUIContent CREATE_STANDARD_INPUT = new GUIContent("Create Standard Input", ""); - private static readonly GUIContent USE_SEND_MESSAGE = new GUIContent("Use SendMessage", "If you use UnityScript or prefer using Unity Messages you can turn them on with this option."); - private static readonly GUIContent SEND_MESSAGE_TARGET = new GUIContent("SendMessage Target", "The GameObject target of Unity Messages. If null, host GameObject is used."); - private static readonly GUIContent SEND_MESSAGE_EVENTS = new GUIContent("SendMessage Events", "Which events should be sent as Unity Messages."); - private static readonly GUIContent LAYERS_HEADER = new GUIContent("Touch Layers", "Sorted array of Touch Layers in the scene."); + public static readonly GUIContent TEXT_LAYERS_HELP = new GUIContent("Layers at the top get to process pointer input first."); + public static readonly GUIContent TEXT_LAYERS_HEADER = new GUIContent("Pointer Layers", "Sorted array of Pointer Layers in the scene."); + public static readonly GUIContent TEXT_USE_SEND_MESSAGE_HEADER = new GUIContent("Use SendMessage", "Enables sending events through SendMessage. Warnning: this method is slow!"); + public static readonly GUIContent TEXT_USE_UNITY_EVENTS_HEADER = new GUIContent("Use Unity Events", "Enables sending events through Unity Events."); + public static readonly GUIContent TEXT_DEFAULTS_HEADER = new GUIContent("Defaults", "Default actions when some of TouchScript components are not present in the scene."); + + public static readonly GUIContent TEXT_DEBUG_MODE = new GUIContent("Debug", "Turns on debug mode."); + public static readonly GUIContent TEXT_DISPLAY_DEVICE = new GUIContent("Display Device", "Display device properties where such parameters as target DPI are stored."); + public static readonly GUIContent TEXT_CREATE_CAMERA_LAYER = new GUIContent("Create Camera Layer", "Indicates if TouchScript should create a CameraLayer for you if no layers present in a scene. This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get input from some device."); + public static readonly GUIContent TEXT_CREATE_STANDARD_INPUT = new GUIContent("Create Standard Input", ""); + public static readonly GUIContent TEXT_SEND_MESSAGE_TARGET = new GUIContent("Target", "The GameObject target of Unity Messages. If null, host GameObject is used."); + public static readonly GUIContent TEXT_SEND_MESSAGE_EVENTS = new GUIContent("Events", "Which events should be sent as Unity Messages."); + + public static readonly GUIContent TEXT_HELP = new GUIContent("This component holds TouchScript configuration options for a scene."); private TouchManager instance; private ReorderableList layersList; - private SerializedProperty layers, displayDevice, shouldCreateCameraLayer, shouldCreateStandardInput, useSendMessage, sendMessageTarget, sendMessageEvents; + private SerializedProperty basicEditor; + private SerializedProperty debugMode; + + private SerializedProperty layers, displayDevice, shouldCreateCameraLayer, shouldCreateStandardInput, + useSendMessage, sendMessageTarget, sendMessageEvents; + + private SerializedProperty OnFrameStart, OnFrameFinish, OnPointersAdd, OnPointersUpdate, OnPointersPress, + OnPointersRelease, OnPointersRemove, OnPointersCancel, useUnityEvents; + + private PropertyInfo useUnityEvents_prop, useSendMessage_prop; private void OnEnable() { instance = target as TouchManager; + + basicEditor = serializedObject.FindProperty("basicEditor"); + debugMode = serializedObject.FindProperty("debugMode"); layers = serializedObject.FindProperty("layers"); displayDevice = serializedObject.FindProperty("displayDevice"); shouldCreateCameraLayer = serializedObject.FindProperty("shouldCreateCameraLayer"); shouldCreateStandardInput = serializedObject.FindProperty("shouldCreateStandardInput"); + useSendMessage = serializedObject.FindProperty("useSendMessage"); sendMessageTarget = serializedObject.FindProperty("sendMessageTarget"); sendMessageEvents = serializedObject.FindProperty("sendMessageEvents"); + useUnityEvents = serializedObject.FindProperty("useUnityEvents"); + OnFrameStart = serializedObject.FindProperty("OnFrameStart"); + OnFrameFinish = serializedObject.FindProperty("OnFrameFinish"); + OnPointersAdd = serializedObject.FindProperty("OnPointersAdd"); + OnPointersUpdate = serializedObject.FindProperty("OnPointersUpdate"); + OnPointersPress = serializedObject.FindProperty("OnPointersPress"); + OnPointersRelease = serializedObject.FindProperty("OnPointersRelease"); + OnPointersRemove = serializedObject.FindProperty("OnPointersRemove"); + OnPointersCancel = serializedObject.FindProperty("OnPointersCancel"); + + var type = instance.GetType(); + useUnityEvents_prop = type.GetProperty("UseUnityEvents", BindingFlags.Instance | BindingFlags.Public); + useSendMessage_prop = type.GetProperty("UseSendMessage", BindingFlags.Instance | BindingFlags.Public); + refresh(); - layersList = new ReorderableList(serializedObject, layers, true, true, false, false); - layersList.drawHeaderCallback += rect => GUI.Label(rect, LAYERS_HEADER); + layersList = new ReorderableList(serializedObject, layers, true, false, false, false); + layersList.headerHeight = 0; + layersList.footerHeight = 0; layersList.drawElementCallback += (rect, index, active, focused) => { rect.height = 16; @@ -60,77 +97,174 @@ private void OnEnable() public override void OnInspectorGUI() { - serializedObject.Update(); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif - var r = EditorGUILayout.GetControlRect(true, 16f, EditorStyles.objectField); - var label = EditorGUI.BeginProperty(r, DISPLAY_DEVICE, displayDevice); - EditorGUI.BeginChangeCheck(); - r = EditorGUI.PrefixLabel(r, label); - var newDevice = EditorGUI.ObjectField(r, instance.DisplayDevice as Object, typeof(IDisplayDevice), true) as IDisplayDevice; - if (EditorGUI.EndChangeCheck()) + GUILayout.Space(5); + + if (basicEditor.boolValue) { - instance.DisplayDevice = newDevice; - EditorUtility.SetDirty(instance); + drawLayers(); + + if (GUIElements.BasicHelpBox(TEXT_HELP)) + { + basicEditor.boolValue = false; + Repaint(); + } } - EditorGUI.EndProperty(); + else + { + drawDefaults(); + drawLayers(); + drawUnityEvents(); + drawSendMessage(); + drawDebug(); + } + + GUILayout.Label("v. " + TouchManager.VERSION + (string.IsNullOrEmpty(TouchManager.VERSION_SUFFIX) ? "" : " " + TouchManager.VERSION_SUFFIX), GUIElements.SmallTextRight); - if (Application.isPlaying) GUI.enabled = false; - EditorGUILayout.PropertyField(shouldCreateCameraLayer, CREATE_CAMERA_LAYER); - EditorGUILayout.PropertyField(shouldCreateStandardInput, CREATE_STANDARD_INPUT); - GUI.enabled = true; + serializedObject.ApplyModifiedProperties(); + } - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.PropertyField(useSendMessage, USE_SEND_MESSAGE); - if (useSendMessage.boolValue) + private void drawDefaults() + { + var display = GUIElements.Header(TEXT_DEFAULTS_HEADER, shouldCreateCameraLayer); + if (display) { - EditorGUILayout.PropertyField(sendMessageTarget, SEND_MESSAGE_TARGET); + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(Application.isPlaying)) + { + EditorGUILayout.PropertyField(shouldCreateCameraLayer, TEXT_CREATE_CAMERA_LAYER); + EditorGUILayout.PropertyField(shouldCreateStandardInput, TEXT_CREATE_STANDARD_INPUT); + } - r = EditorGUILayout.GetControlRect(true, 16f, EditorStyles.layerMaskField); - label = EditorGUI.BeginProperty(r, SEND_MESSAGE_EVENTS, sendMessageEvents); + var r = EditorGUILayout.GetControlRect(true, 16f, EditorStyles.objectField); + var label = EditorGUI.BeginProperty(r, TEXT_DISPLAY_DEVICE, displayDevice); EditorGUI.BeginChangeCheck(); r = EditorGUI.PrefixLabel(r, label); - var sMask = (TouchManager.MessageType)EditorGUI.EnumMaskField(r, instance.SendMessageEvents); + var newDevice = EditorGUI.ObjectField(r, instance.DisplayDevice as Object, typeof(IDisplayDevice), true) as IDisplayDevice; if (EditorGUI.EndChangeCheck()) { - instance.SendMessageEvents = sMask; + instance.DisplayDevice = newDevice; EditorUtility.SetDirty(instance); } EditorGUI.EndProperty(); - } - - if (Application.isPlaying) GUI.enabled = false; - layersList.DoLayoutList(); + EditorGUI.indentLevel--; + } + } - GUI.enabled = true; - serializedObject.ApplyModifiedProperties(); + private void drawLayers() + { + var display = GUIElements.Header(TEXT_LAYERS_HEADER, layers); + if (display) + { + EditorGUILayout.LabelField(TEXT_LAYERS_HELP, GUIElements.HelpBox); + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(Application.isPlaying)) + { + layersList.DoLayoutList(); + } + EditorGUI.indentLevel--; + } } - private void refresh() + private void drawUnityEvents() { - var allLayers = FindObjectsOfType(typeof(TouchLayer)).Cast().ToList(); - var toRemove = new List(); - for (var i = 0; i < layers.arraySize; i++) + var display = GUIElements.Header(TEXT_USE_UNITY_EVENTS_HEADER, useUnityEvents, useUnityEvents, useUnityEvents_prop); + if (display) { - var layer = layers.GetArrayElementAtIndex(i).objectReferenceValue as TouchLayer; - if (layer == null || allLayers.IndexOf(layer) == -1) toRemove.Add(i); - else allLayers.Remove(layer); + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(!useUnityEvents.boolValue)) + { + EditorGUILayout.PropertyField(OnFrameStart); + EditorGUILayout.PropertyField(OnFrameFinish); + EditorGUILayout.PropertyField(OnPointersAdd); + EditorGUILayout.PropertyField(OnPointersUpdate); + EditorGUILayout.PropertyField(OnPointersPress); + EditorGUILayout.PropertyField(OnPointersRelease); + EditorGUILayout.PropertyField(OnPointersRemove); + EditorGUILayout.PropertyField(OnPointersCancel); + } + EditorGUI.indentLevel--; } + } - for (var i = toRemove.Count - 1; i >= 0; i--) + private void drawSendMessage() + { + var display = GUIElements.Header(TEXT_USE_SEND_MESSAGE_HEADER, useSendMessage, useSendMessage, useSendMessage_prop); + if (display) { - var index = toRemove[i]; - layers.GetArrayElementAtIndex(index).objectReferenceValue = null; - layers.DeleteArrayElementAtIndex(index); + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(!useSendMessage.boolValue)) + { + EditorGUILayout.PropertyField(sendMessageTarget, TEXT_SEND_MESSAGE_TARGET); + + var r = EditorGUILayout.GetControlRect(true, 16f, EditorStyles.layerMaskField); + var label = EditorGUI.BeginProperty(r, TEXT_SEND_MESSAGE_EVENTS, sendMessageEvents); + EditorGUI.BeginChangeCheck(); + r = EditorGUI.PrefixLabel(r, label); + var sMask = (TouchManager.MessageType) EditorGUI.EnumMaskField(r, instance.SendMessageEvents); + if (EditorGUI.EndChangeCheck()) + { + instance.SendMessageEvents = sMask; + EditorUtility.SetDirty(instance); + } + EditorGUI.EndProperty(); + } + EditorGUI.indentLevel--; } + } + + private void drawDebug() + { + if (debugMode == null) return; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(debugMode, TEXT_DEBUG_MODE); + if (EditorGUI.EndChangeCheck()) instance.DebugMode = debugMode.boolValue; + } - for (var i = 0; i < allLayers.Count; i++) + private void refresh() + { + if (Application.isPlaying) { - layers.arraySize++; - layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = allLayers[i]; + layers.arraySize = 0; + LayerManager.Instance.ForEach((l) => + { + layers.arraySize++; + layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = l; + return true; + }); + } + else + { + var allLayers = FindObjectsOfType(typeof(TouchLayer)).Cast().ToList(); + var toRemove = new List(); + for (var i = 0; i < layers.arraySize; i++) + { + var layer = layers.GetArrayElementAtIndex(i).objectReferenceValue as TouchLayer; + if (layer == null || allLayers.IndexOf(layer) == -1) toRemove.Add(i); + else allLayers.Remove(layer); + } + + for (var i = toRemove.Count - 1; i >= 0; i--) + { + var index = toRemove[i]; + layers.GetArrayElementAtIndex(index).objectReferenceValue = null; + layers.DeleteArrayElementAtIndex(index); + } + + for (var i = 0; i < allLayers.Count; i++) + { + layers.arraySize++; + layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = allLayers[i]; + } } serializedObject.ApplyModifiedProperties(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs new file mode 100644 index 000000000..8645a087b --- /dev/null +++ b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs @@ -0,0 +1,188 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace TouchScript.Editor +{ + [InitializeOnLoad] + class TouchScriptSettingsWindow : EditorWindow + { + private const string SHOW_AT_STARTUP = "TouchScript.ShowSettingsOnStartup"; + + private const string DEFINE_DEBUG = "TOUCHSCRIPT_DEBUG"; + private const string DEFINE_TUIO = "TOUCHSCRIPT_TUIO"; + + private static bool showAtStartup = true; + private static TouchScriptSettingsWindowSO so; + + private static bool initialized; + private static int width = 500; + private static int height = 500; + private static GUIStyle header; + private static GUIStyle bold; + + private static Dictionary enabledDefines = new Dictionary() + { + {DEFINE_DEBUG, false}, + {DEFINE_TUIO, false}, + }; + + [MenuItem("Window/TouchScript/Settings", false, 0)] + static void createWindow() + { + EditorWindow window = GetWindow(true, "TouchScript Settings", true); + window.maxSize = new Vector2(width, height); + window.minSize = new Vector2(width, height); + + window.Show(); + } + + static TouchScriptSettingsWindow() + { + EditorApplication.update += doShow; + } + + private static void doShow() + { + EditorApplication.update -= doShow; + showAtStartup = EditorPrefs.GetBool(SHOW_AT_STARTUP, true); + + if (so == null) + { + var sos = Resources.FindObjectsOfTypeAll(); + if (sos.Length > 0) so = sos[0]; + } + if (so == null) + { + so = ScriptableObject.CreateInstance(); + if (showAtStartup) createWindow(); + } + } + + private void OnEnable() + { + updateEnabledDefines(); + } + + private void OnDisable() {} + + private void OnGUI() + { + init(); + + var headerRect = GUILayoutUtility.GetRect(width, 165); + GUI.Box(headerRect, "v. " + TouchManager.VERSION + + (string.IsNullOrEmpty(TouchManager.VERSION_SUFFIX) ? "" : " " + TouchManager.VERSION_SUFFIX), header); + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(10); + EditorGUILayout.BeginVertical(); + GUILayout.Space(10); + + EditorGUILayout.LabelField("Thank you for choosing TouchScript!", bold); + + EditorGUI.indentLevel++; + drawListElement("FAQ", "Some of the questions have been already asked multiple times. \nCheck if yours is in the list.", + "https://github.com/TouchScript/TouchScript/wiki/FAQ"); + drawListElement("Documentation", "Complete up-to-date generated docs with all public API annotated.", + "http://touchscript.github.io/docs/"); + drawListElement("Official Forum", "Want to ask a question about TouchScript? Use the official Forum.", + "http://touchprefab.com/index.php"); + drawListElement("Issues", "Found a bug? Feel free to post it in Github Issues.", + "https://github.com/TouchScript/TouchScript/issues"); + EditorGUI.indentLevel--; + + EditorGUILayout.LabelField("Options", bold); + + EditorGUI.indentLevel++; + setDefine(DEFINE_DEBUG, EditorGUILayout.ToggleLeft("Enable Debug Mode", enabledDefines[DEFINE_DEBUG])); + EditorGUILayout.LabelField("Enables " + DEFINE_DEBUG + " define to turn on some TouchScript debug features.", EditorStyles.miniLabel); + setDefine(DEFINE_TUIO, EditorGUILayout.ToggleLeft("Enable TUIO", enabledDefines[DEFINE_TUIO])); + EditorGUILayout.LabelField("Enables " + DEFINE_TUIO + " define, this adds TUIO protocol support.", EditorStyles.miniLabel); + + EditorGUILayout.EndVertical(); + GUILayout.Space(10); + EditorGUILayout.EndHorizontal(); + + drawShowAtStartup(); + } + + private void init() + { + if (initialized) return; + initialized = true; + + header = new GUIStyle(); + header.normal.background = EditorResources.Load("SettingsWindow/Header.png"); + header.normal.textColor = Color.white; + header.padding = new RectOffset(0, 70, 102, 0); + header.alignment = TextAnchor.UpperRight; + + bold = new GUIStyle(EditorStyles.largeLabel); + bold.fontStyle = FontStyle.Bold; + bold.fontSize = 18; + bold.wordWrap = true; + } + + private void drawListElement(string header, string content, string url) + { + GUILayout.BeginVertical(); + EditorGUILayout.LabelField("> " + header, EditorStyles.boldLabel); + EditorGUILayout.LabelField(content, EditorStyles.wordWrappedLabel); + GUILayout.EndVertical(); + + if (!string.IsNullOrEmpty(url)) + { + var rect = GUILayoutUtility.GetLastRect(); + EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link); + if (Event.current.type == EventType.mouseDown && rect.Contains(Event.current.mousePosition)) + Application.OpenURL(url); + } + } + + private void drawShowAtStartup() + { + bool show = GUI.Toggle(new Rect(10, height - 24, 120, 30), showAtStartup, "Show at startup"); + if (show != showAtStartup) + { + showAtStartup = show; + EditorPrefs.SetBool(SHOW_AT_STARTUP, showAtStartup); + } + } + + private void updateEnabledDefines() + { + var defines = new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup).Split(';')); + var keys = new List(enabledDefines.Keys); + foreach (var define in keys) + { + if (defines.Contains(define)) enabledDefines[define] = true; + else enabledDefines[define] = false; + } + } + + private void setDefine(string name, bool value) + { + if (!enabledDefines.ContainsKey(name)) return; + if (enabledDefines[name] == value) return; + + enabledDefines[name] = value; + var defines = new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup).Split(';')); + if (value) defines.Add(name); + else defines.Remove(name); + PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, string.Join(";", defines.ToArray())); + } + } + + public class TouchScriptSettingsWindowSO : ScriptableObject + { + private void Awake() + { + hideFlags = HideFlags.HideAndDontSave; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs.meta b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs.meta new file mode 100644 index 000000000..aaad65d1c --- /dev/null +++ b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7aae6ded351f04cd38bfb5b64a426541 +timeCreated: 1478312527 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs b/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs deleted file mode 100644 index 1e680ed6a..000000000 --- a/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using UnityEngine; - -namespace TouchScript.Editor.Utils -{ - internal static class GUIElements - { - public static GUIStyle BoxStyle - { - get { return boxStyle; } - } - - public static GUIStyle BoxLabelStyle - { - get { return boxLabelStyle; } - } - - public static GUIStyle FoldoutStyle - { - get { return foldoutStyle; } - } - - public static GUIStyle HeaderStyle - { - get { return foldoutStyle; } - } - - private static GUIStyle boxStyle, boxLabelStyle; - private static GUIStyle foldoutStyle, headerStyle; - - static GUIElements() - { - boxStyle = new GUIStyle(GUI.skin.box); - boxStyle.margin = new RectOffset(0, 0, 1, 0); - boxStyle.padding = new RectOffset(0, 0, 0, 0); - boxStyle.contentOffset = new Vector2(0, 0); - boxStyle.normal.textColor = GUI.skin.label.normal.textColor; - boxStyle.alignment = TextAnchor.MiddleCenter; - - boxLabelStyle = new GUIStyle(GUI.skin.label); - boxLabelStyle.fontSize = 9; - boxLabelStyle.padding = new RectOffset(0, 0, 5, 0); - - foldoutStyle = new GUIStyle(GUI.skin.FindStyle("ShurikenModuleBg")); - foldoutStyle.padding = new RectOffset(10, 10, 10, 10); - - headerStyle = new GUIStyle(GUI.skin.FindStyle("ShurikenModuleTitle")); - headerStyle.contentOffset = new Vector2(3, -2); - } - - public static bool BeginFoldout(bool open, GUIContent header) - { - GUILayout.BeginVertical("ShurikenEffectBg", GUILayout.MinHeight(16f)); - - return GUI.Toggle(GUILayoutUtility.GetRect(0, 16), open, header, headerStyle); - } - - public static void EndFoldout() - { - GUILayout.EndVertical(); - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs index e5ac4f26a..3920f081c 100644 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs +++ b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs @@ -1,3 +1,7 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + using TouchScript.Utils.Attributes; using UnityEditor; using UnityEngine; @@ -28,21 +32,21 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten switch (property.propertyType) { case SerializedPropertyType.ObjectReference: - property.objectReferenceValue = (Object)getNullValue(property); + property.objectReferenceValue = (Object) getNullValue(property); break; case SerializedPropertyType.Integer: - property.intValue = (int)getNullValue(property); + property.intValue = (int) getNullValue(property); break; case SerializedPropertyType.Float: - property.floatValue = (float)getNullValue(property); + property.floatValue = (float) getNullValue(property); break; } } else { EditorGUI.BeginChangeCheck(); - EditorGUI.LabelField(new Rect(position.x + 14, position.y + 18, 40, 16), new GUIContent("Value", label.tooltip)); - position = new Rect(position.x + 54, position.y + 18, position.width - 54, 16); + EditorGUI.LabelField(new Rect(position.x + 14, position.y + 18, 50, 16), new GUIContent("Value", label.tooltip)); + position = new Rect(position.x + 54, position.y + 18, Mathf.Min(position.width - 54, 100), 16); switch (property.propertyType) { case SerializedPropertyType.ObjectReference: @@ -133,7 +137,9 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten private void Begin(Rect position, SerializedProperty property, GUIContent label) { label = EditorGUI.BeginProperty(position, label, property); + label.text = " " + label.text; position.height = 16; + EditorGUIUtility.labelWidth = 180; expanded = EditorGUI.ToggleLeft(position, label, expanded == true); } @@ -155,9 +161,9 @@ private bool isNull(SerializedProperty property) case SerializedPropertyType.ObjectReference: return ReferenceEquals(property.objectReferenceValue, getNullValue(property)); case SerializedPropertyType.Integer: - return property.intValue == (int)getNullValue(property); + return property.intValue == (int) getNullValue(property); case SerializedPropertyType.Float: - return property.floatValue == (float)getNullValue(property); + return property.floatValue == (float) getNullValue(property); } return false; } @@ -177,4 +183,4 @@ private object getNullValue(SerializedProperty property) return null; } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs deleted file mode 100644 index 592b077e7..000000000 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs +++ /dev/null @@ -1,39 +0,0 @@ -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; - -namespace TouchScript.Editor.Utils.PropertyDrawers -{ - [CustomPropertyDrawer(typeof(Tags))] - internal sealed class TagsDrawer : PropertyDrawer - { - private ReorderableList list; - - public override float GetPropertyHeight(SerializedProperty property, GUIContent label) - { - if (list == null) initList(property, label); - - return list.GetHeight(); - } - - public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) - { - if (list == null) initList(property, label); - - list.serializedProperty = property.FindPropertyRelative("tagList"); - list.DoList(position); - } - - private void initList(SerializedProperty property, GUIContent label) - { - list = new ReorderableList(property.serializedObject, property.FindPropertyRelative("tagList"), false, true, true, true); - list.drawHeaderCallback += rect => GUI.Label(rect, label); - list.drawElementCallback += (rect, index, active, focused) => - { - rect.height = 16; - rect.y += 2; - EditorGUI.PropertyField(rect, list.serializedProperty.GetArrayElementAtIndex(index), GUIContent.none); - }; - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs.meta b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs.meta deleted file mode 100644 index 513e13c05..000000000 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/TagsDrawer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e373603907e744048b209e3b7bc5e268 -timeCreated: 1447582131 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs index 18f86b140..c0c456bc4 100644 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs +++ b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs @@ -1,3 +1,7 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + using TouchScript.Utils.Attributes; using UnityEditor; using UnityEngine; @@ -10,6 +14,7 @@ internal sealed class ToggleLeftDrawer : PropertyDrawer public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { label = EditorGUI.BeginProperty(position, label, property); + label.text = " " + label.text; EditorGUI.BeginChangeCheck(); var boolValue = EditorGUI.ToggleLeft(position, label, property.boolValue); if (EditorGUI.EndChangeCheck()) @@ -19,4 +24,4 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten EditorGUI.EndProperty(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Camera/Camera.unity b/Source/Assets/TouchScript/Examples/Camera/Camera.unity index 2a3e264c3..6ced9e1d4 100644 --- a/Source/Assets/TouchScript/Examples/Camera/Camera.unity +++ b/Source/Assets/TouchScript/Examples/Camera/Camera.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,50 +54,72 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -111,11 +134,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -11.6400003} + m_LocalPosition: {x: 0, y: 0, z: -11.64} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1462230477} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -153,7 +177,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 30 orthographic: 0 @@ -167,19 +191,21 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!1 &139543607 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 139543608} - - 114: {fileID: 139543609} + - component: {fileID: 139543608} + - component: {fileID: 139543609} m_Layer: 5 m_Name: Rotate m_TagString: Untagged @@ -201,11 +227,12 @@ RectTransform: - {fileID: 567050690} m_Father: {fileID: 250857271} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &139543609 MonoBehaviour: m_ObjectHideFlags: 0 @@ -229,11 +256,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 242343086} - - 222: {fileID: 242343088} - - 114: {fileID: 242343087} + - component: {fileID: 242343086} + - component: {fileID: 242343088} + - component: {fileID: 242343087} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -253,11 +280,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &242343087 MonoBehaviour: m_ObjectHideFlags: 0 @@ -296,10 +324,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -327,6 +355,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -343,22 +373,23 @@ RectTransform: - {fileID: 139543608} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &567050689 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 567050690} - - 222: {fileID: 567050692} - - 114: {fileID: 567050691} - - 114: {fileID: 567050693} + - component: {fileID: 567050690} + - component: {fileID: 567050692} + - component: {fileID: 567050691} + - component: {fileID: 567050693} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -378,11 +409,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 139543608} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &567050691 MonoBehaviour: m_ObjectHideFlags: 0 @@ -410,6 +442,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -480,7 +513,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: m_RootOrder - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] @@ -494,10 +527,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 624081475} - - 114: {fileID: 624081476} + - component: {fileID: 624081475} + - component: {fileID: 624081476} m_Layer: 5 m_Name: Drag m_TagString: Untagged @@ -519,11 +552,12 @@ RectTransform: - {fileID: 1713463340} m_Father: {fileID: 250857271} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &624081476 MonoBehaviour: m_ObjectHideFlags: 0 @@ -547,11 +581,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -573,6 +607,7 @@ RectTransform: - {fileID: 1552723601} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -606,7 +641,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 740851131} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -614,18 +649,21 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &746517018 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 746517019} - - 222: {fileID: 746517021} - - 114: {fileID: 746517020} + - component: {fileID: 746517019} + - component: {fileID: 746517021} + - component: {fileID: 746517020} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -645,11 +683,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 139543608} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &746517020 MonoBehaviour: m_ObjectHideFlags: 0 @@ -688,14 +727,14 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} - - 54: {fileID: 930800603} - - 114: {fileID: 930800604} - - 114: {fileID: 930800602} - - 114: {fileID: 930800606} - - 114: {fileID: 930800605} + - component: {fileID: 930800601} + - component: {fileID: 930800603} + - component: {fileID: 930800604} + - component: {fileID: 930800602} + - component: {fileID: 930800606} + - component: {fileID: 930800605} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -718,6 +757,7 @@ Transform: - {fileID: 2072767614} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &930800602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -729,19 +769,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74ae431eff8434b0897d3f7f1cff4311, type: 3} m_Name: m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 0 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 1 - maxTouches: 1 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 1 + maxPointers: 1 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .0500000007 + screenTransformThreshold: 0.05 + minScreenPointsDistance: 0.5 --- !u!54 &930800603 Rigidbody: m_ObjectHideFlags: 0 @@ -751,7 +815,7 @@ Rigidbody: serializedVersion: 2 m_Mass: 1 m_Drag: 0 - m_AngularDrag: .0500000007 + m_AngularDrag: 0.05 m_UseGravity: 0 m_IsKinematic: 1 m_Interpolate: 0 @@ -770,7 +834,7 @@ MonoBehaviour: m_EditorClassIdentifier: TwoFingerMoveGesture: {fileID: 930800602} ManipulationGesture: {fileID: 930800606} - PanSpeed: .00999999978 + PanSpeed: 0.01 RotationSpeed: 200 ZoomSpeed: 10 --- !u!114 &930800605 @@ -798,29 +862,53 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74ae431eff8434b0897d3f7f1cff4311, type: 3} m_Name: m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 0 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 2 - maxTouches: 10 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 2 + maxPointers: 10 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .200000003 + screenTransformThreshold: 0.2 + minScreenPointsDistance: 0.5 --- !u!1 &1138005899 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -840,11 +928,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -883,12 +972,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1399100004} - - 222: {fileID: 1399100006} - - 114: {fileID: 1399100005} - - 114: {fileID: 1399100007} + - component: {fileID: 1399100004} + - component: {fileID: 1399100006} + - component: {fileID: 1399100005} + - component: {fileID: 1399100007} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -908,11 +997,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1399100005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -940,6 +1030,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -970,12 +1061,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -995,11 +1086,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1027,6 +1119,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1059,9 +1152,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1462230477} + - component: {fileID: 1462230477} m_Layer: 0 m_Name: Pivot m_TagString: Untagged @@ -1082,16 +1175,17 @@ Transform: - {fileID: 62216952} m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1541924793 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1541924794} - - 222: {fileID: 1541924796} - - 114: {fileID: 1541924795} + - component: {fileID: 1541924794} + - component: {fileID: 1541924796} + - component: {fileID: 1541924795} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1111,11 +1205,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 624081475} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1541924795 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1154,12 +1249,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1179,11 +1274,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 156, y: 78} m_SizeDelta: {x: 276, y: 128} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1211,6 +1307,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1248,10 +1345,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Drag m_TagString: Untagged @@ -1273,11 +1370,12 @@ RectTransform: - {fileID: 1408280581} m_Father: {fileID: 250857271} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1301,12 +1399,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1713463340} - - 222: {fileID: 1713463343} - - 114: {fileID: 1713463342} - - 114: {fileID: 1713463341} + - component: {fileID: 1713463340} + - component: {fileID: 1713463343} + - component: {fileID: 1713463342} + - component: {fileID: 1713463341} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1326,11 +1424,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 624081475} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1713463341 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1372,6 +1471,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1388,10 +1488,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -1425,6 +1525,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1867657389 Prefab: m_ObjectHideFlags: 0 @@ -1464,6 +1565,10 @@ Prefab: propertyPath: m_RootOrder value: 0 objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} m_IsPrefabParent: 0 @@ -1472,10 +1577,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1962593004} - - 114: {fileID: 1962593005} + - component: {fileID: 1962593004} + - component: {fileID: 1962593005} m_Layer: 5 m_Name: Zoom m_TagString: Untagged @@ -1497,11 +1602,12 @@ RectTransform: - {fileID: 1399100004} m_Father: {fileID: 250857271} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1962593005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1525,9 +1631,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -1548,22 +1654,23 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2072767610 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2072767614} - - 33: {fileID: 2072767613} - - 135: {fileID: 2072767612} - - 23: {fileID: 2072767611} + - component: {fileID: 2072767614} + - component: {fileID: 2072767613} + - component: {fileID: 2072767612} + - component: {fileID: 2072767611} m_Layer: 0 m_Name: Earth m_TagString: Untagged @@ -1580,20 +1687,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: 6e379d1ec9f5fd949891068175de34fe, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!135 &2072767612 SphereCollider: @@ -1605,7 +1720,7 @@ SphereCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Radius: .5 + m_Radius: 0.5 m_Center: {x: 0, y: 0, z: 0} --- !u!33 &2072767613 MeshFilter: @@ -1620,21 +1735,22 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2072767610} - m_LocalRotation: {x: -.0799503922, y: .910241425, z: -.208807573, w: .348522633} + m_LocalRotation: {x: -0.07995039, y: 0.9102414, z: -0.20880757, w: 0.34852263} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 4.29649591, y: 4.29649305, z: 4.29649305} + m_LocalScale: {x: 4.296496, y: 4.296493, z: 4.296493} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -1648,12 +1764,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .329245895, y: -.19317472, z: .128770933, w: .915258884} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.3292459, y: -0.19317472, z: 0.12877093, w: 0.9152589} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -1661,19 +1778,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 1 m_Resolution: 3 - m_Strength: .185000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.185 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1682,7 +1801,9 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} diff --git a/Source/Assets/TouchScript/Examples/Camera/Camera.unity.meta b/Source/Assets/TouchScript/Examples/Camera/Camera.unity.meta index 4f208254b..5c8bc3030 100644 --- a/Source/Assets/TouchScript/Examples/Camera/Camera.unity.meta +++ b/Source/Assets/TouchScript/Examples/Camera/Camera.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 9bc4a96ba8ead427ab54f883160abc15 DefaultImporter: - userData: + userData: "3" diff --git a/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs b/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs index 2e4b91aea..72874fd94 100644 --- a/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs +++ b/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs @@ -3,10 +3,11 @@ */ using UnityEngine; -using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; namespace TouchScript.Examples.CameraControl { + /// public class CameraController : MonoBehaviour { public ScreenTransformGesture TwoFingerMoveGesture; @@ -38,16 +39,16 @@ private void OnDisable() private void manipulationTransformedHandler(object sender, System.EventArgs e) { - var rotation = Quaternion.Euler(ManipulationGesture.DeltaPosition.y/Screen.height*RotationSpeed, - -ManipulationGesture.DeltaPosition.x/Screen.width*RotationSpeed, + var rotation = Quaternion.Euler(ManipulationGesture.DeltaPosition.y / Screen.height * RotationSpeed, + -ManipulationGesture.DeltaPosition.x / Screen.width * RotationSpeed, ManipulationGesture.DeltaRotation); pivot.localRotation *= rotation; - cam.transform.localPosition += Vector3.forward*(ManipulationGesture.DeltaScale - 1f)*ZoomSpeed; + cam.transform.localPosition += Vector3.forward * (ManipulationGesture.DeltaScale - 1f) * ZoomSpeed; } private void twoFingerTransformHandler(object sender, System.EventArgs e) { - pivot.localPosition += pivot.rotation*TwoFingerMoveGesture.DeltaPosition*PanSpeed; + pivot.localPosition += pivot.rotation * TwoFingerMoveGesture.DeltaPosition * PanSpeed; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity b/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity index 5cdd294c2..a74b7ad80 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity +++ b/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,51 +54,127 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &12619638 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 1766364327} +--- !u!114 &12619639 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 12619638} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &12619640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 12619638} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} +--- !u!1 &42889166 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 1404673428} +--- !u!114 &42889167 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42889166} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &42889168 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42889166} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -111,12 +188,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: .269457936, y: 0, z: 0, w: .963012159} - m_LocalPosition: {x: -1.11000001, y: 7.78999996, z: -14.4399996} + m_LocalRotation: {x: 0.26945794, y: 0, z: 0, w: 0.96301216} + m_LocalPosition: {x: -1.11, y: 7.79, z: -14.44} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 31.264, y: 0, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -125,13 +203,21 @@ MonoBehaviour: m_GameObject: {fileID: 62216951} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -169,7 +255,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 40 field of view: 30 orthographic: 0 @@ -183,9 +269,11 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!4 &235575575 stripped Transform: @@ -196,11 +284,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 242343086} - - 222: {fileID: 242343088} - - 114: {fileID: 242343087} + - component: {fileID: 242343086} + - component: {fileID: 242343088} + - component: {fileID: 242343087} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -220,11 +308,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &242343087 MonoBehaviour: m_ObjectHideFlags: 0 @@ -263,10 +352,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -294,6 +383,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -309,11 +400,66 @@ RectTransform: - {fileID: 841877613} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &292077922 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 1492764721} +--- !u!114 &292077923 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 292077922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &292077924 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 292077922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} +--- !u!1 &362054473 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 746500663} +--- !u!114 &362054474 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 362054473} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &362054475 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 362054473} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!114 &496670577 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11490626, guid: b4fd857376bb94265b47bcf5b50f67fa, @@ -337,7 +483,7 @@ Prefab: m_Modifications: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.size - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: m_LocalPosition.x @@ -370,42 +516,10 @@ Prefab: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: - objectReference: {fileID: 0} + objectReference: {fileID: 62216953} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &543251037 stripped -GameObject: - m_PrefabParentObject: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - m_PrefabInternal: {fileID: 543251036} ---- !u!114 &543251038 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 543251037} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - TouchTags: - tagList: - - Touch - MouseTags: - tagList: - - Mouse - PenTags: - tagList: - - Pen - Windows8Touch: 0 - Windows7Touch: 0 - WebPlayerTouch: 1 - WebGLTouch: 1 - Windows8Mouse: 1 - Windows7Mouse: 1 - UniversalWindowsMouse: 1 --- !u!1001 &556842199 Prefab: m_ObjectHideFlags: 0 @@ -448,10 +562,64 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} m_IsPrefabParent: 0 +--- !u!1 &575047064 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 1065738468} +--- !u!114 &575047065 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 575047064} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &575047066 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 575047064} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!4 &584553677 stripped Transform: m_PrefabParentObject: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} m_PrefabInternal: {fileID: 599866430} +--- !u!1 &588072016 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 1973376682} +--- !u!114 &588072017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 588072016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &588072018 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 588072016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1001 &599866430 Prefab: m_ObjectHideFlags: 0 @@ -507,6 +675,60 @@ Prefab: - {fileID: 9500000, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} m_ParentPrefab: {fileID: 100100000, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} m_IsPrefabParent: 0 +--- !u!1 &644314094 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 1726854358} +--- !u!114 &644314095 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 644314094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &644314096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 644314094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} +--- !u!1 &653642804 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 912356309} +--- !u!114 &653642805 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 653642804} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &653642806 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 653642804} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1001 &690687408 Prefab: m_ObjectHideFlags: 0 @@ -549,6 +771,33 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} m_IsPrefabParent: 0 +--- !u!1 &718956936 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 2071229255} +--- !u!114 &718956937 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 718956936} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &718956938 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 718956936} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1 &721853795 stripped GameObject: m_PrefabParentObject: {fileID: 100006, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} @@ -564,18 +813,20 @@ MeshCollider: m_Enabled: 1 serializedVersion: 2 m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 4300006, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} --- !u!1 &724610588 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 724610589} - - 222: {fileID: 724610592} - - 114: {fileID: 724610591} - - 114: {fileID: 724610590} + - component: {fileID: 724610589} + - component: {fileID: 724610592} + - component: {fileID: 724610591} + - component: {fileID: 724610590} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -595,11 +846,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 841877613} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &724610590 MonoBehaviour: m_ObjectHideFlags: 0 @@ -641,6 +893,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -661,11 +914,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -687,6 +940,7 @@ RectTransform: - {fileID: 1552723601} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -720,7 +974,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 740851131} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -728,8 +982,11 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1001 &746500663 Prefab: m_ObjectHideFlags: 0 @@ -823,10 +1080,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 841877613} - - 114: {fileID: 841877614} + - component: {fileID: 841877613} + - component: {fileID: 841877614} m_Layer: 5 m_Name: Space m_TagString: Untagged @@ -848,11 +1105,12 @@ RectTransform: - {fileID: 724610589} m_Father: {fileID: 250857271} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &841877614 MonoBehaviour: m_ObjectHideFlags: 0 @@ -880,11 +1138,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 900258188} - - 222: {fileID: 900258190} - - 114: {fileID: 900258189} + - component: {fileID: 900258188} + - component: {fileID: 900258190} + - component: {fileID: 900258189} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -904,11 +1162,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 841877613} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 36.7700005, y: 0} + m_AnchoredPosition: {x: 36.77, y: 0} m_SizeDelta: {x: 28, y: -28} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &900258189 MonoBehaviour: m_ObjectHideFlags: 0 @@ -946,6 +1205,33 @@ CanvasRenderer: Transform: m_PrefabParentObject: {fileID: 437898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} m_PrefabInternal: {fileID: 997919739} +--- !u!1 &909805779 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 1975095845} +--- !u!114 &909805780 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 909805779} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &909805781 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 909805779} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1001 &912356309 Prefab: m_ObjectHideFlags: 0 @@ -993,10 +1279,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} - - 114: {fileID: 930800602} + - component: {fileID: 930800601} + - component: {fileID: 930800602} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -1020,6 +1306,7 @@ Transform: - {fileID: 584553677} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &930800602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1032,7 +1319,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Target: {fileID: 496670577} - Color: {r: .944827557, g: 1, b: 0, a: 1} + Color: {r: 0.94482756, g: 1, b: 0, a: 1} --- !u!1001 &997919739 Prefab: m_ObjectHideFlags: 0 @@ -1117,16 +1404,43 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} m_IsPrefabParent: 0 +--- !u!1 &1100161185 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 1242757937} +--- !u!114 &1100161186 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1100161185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1100161187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1100161185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1 &1138005899 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1146,11 +1460,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1249,18 +1564,20 @@ MeshCollider: m_Enabled: 1 serializedVersion: 2 m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 4300004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} --- !u!1 &1399100003 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1399100004} - - 222: {fileID: 1399100006} - - 114: {fileID: 1399100005} - - 114: {fileID: 1399100007} + - component: {fileID: 1399100004} + - component: {fileID: 1399100006} + - component: {fileID: 1399100005} + - component: {fileID: 1399100007} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1280,11 +1597,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1399100005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1312,6 +1630,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1386,12 +1705,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1411,11 +1730,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1443,6 +1763,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1476,6 +1797,33 @@ Transform: Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} m_PrefabInternal: {fileID: 1404673428} +--- !u!1 &1484313264 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 690687408} +--- !u!114 &1484313265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1484313264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1484313266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1484313264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1001 &1492764721 Prefab: m_ObjectHideFlags: 0 @@ -1569,12 +1917,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1594,11 +1942,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 178, y: 78} m_SizeDelta: {x: 320, y: 128} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1626,6 +1975,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1652,6 +2002,33 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 1} m_EffectDistance: {x: 1, y: -1} m_UseGraphicAlpha: 1 +--- !u!1 &1556569441 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 997919739} +--- !u!114 &1556569442 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1556569441} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1556569443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1556569441} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!1001 &1590395755 Prefab: m_ObjectHideFlags: 0 @@ -1739,10 +2116,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Drag m_TagString: Untagged @@ -1764,11 +2141,12 @@ RectTransform: - {fileID: 1408280581} m_Father: {fileID: 250857271} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1838,10 +2216,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -1875,6 +2253,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1766364327 Prefab: m_ObjectHideFlags: 0 @@ -1917,6 +2296,87 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} m_IsPrefabParent: 0 +--- !u!1 &1841925474 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 556842199} +--- !u!114 &1841925475 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1841925474} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1841925476 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1841925474} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} +--- !u!1 &1890351926 stripped +GameObject: + m_PrefabParentObject: {fileID: 137898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} + m_PrefabInternal: {fileID: 1525929576} +--- !u!114 &1890351927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1890351926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1890351928 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1890351926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} +--- !u!1 &1908498623 stripped +GameObject: + m_PrefabParentObject: {fileID: 191238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} + m_PrefabInternal: {fileID: 813591731} +--- !u!114 &1908498624 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1908498623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f406de0e0ca42828041209d7c5f611, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1908498625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1908498623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f91ca003806bd40f7938a006eee71921, type: 3} + m_Name: + m_EditorClassIdentifier: + OverColor: {r: 1, g: 0, b: 0, a: 1} --- !u!4 &1953507434 stripped Transform: m_PrefabParentObject: {fileID: 437898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} @@ -1926,10 +2386,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1962593004} - - 114: {fileID: 1962593005} + - component: {fileID: 1962593004} + - component: {fileID: 1962593005} m_Layer: 5 m_Name: Rotate m_TagString: Untagged @@ -1951,11 +2411,12 @@ RectTransform: - {fileID: 1399100004} m_Father: {fileID: 250857271} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1962593005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2067,9 +2528,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -2090,11 +2551,12 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!4 &1983636052 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -2104,13 +2566,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 119514, guid: 4af91eff6c67b4995be4765a62f7eb5d, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2027571738} - - 33: {fileID: 2027571741} - - 23: {fileID: 2027571740} - - 114: {fileID: 2027571737} - - 114: {fileID: 2027571735} + - component: {fileID: 2027571738} + - component: {fileID: 2027571741} + - component: {fileID: 2027571740} + - component: {fileID: 2027571737} + - component: {fileID: 2027571735} m_Layer: 0 m_Name: Board m_TagString: Untagged @@ -2130,18 +2592,42 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 2 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &2027571737 @@ -2170,6 +2656,7 @@ Transform: - {fileID: 2130344072} m_Father: {fileID: 930800601} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &2027571740 MeshRenderer: m_ObjectHideFlags: 0 @@ -2180,20 +2667,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: c39504b52f7f64f26b5762f1bb63f09c, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &2027571741 MeshFilter: @@ -2208,13 +2703,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 119512, guid: 4af91eff6c67b4995be4765a62f7eb5d, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2041409367} - - 33: {fileID: 2041409372} - - 23: {fileID: 2041409369} - - 65: {fileID: 2041409368} - - 54: {fileID: 2041409371} + - component: {fileID: 2041409367} + - component: {fileID: 2041409372} + - component: {fileID: 2041409369} + - component: {fileID: 2041409368} + - component: {fileID: 2041409371} m_Layer: 0 m_Name: Body m_TagString: Untagged @@ -2229,11 +2724,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2041409366} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -.101000004, z: 0} - m_LocalScale: {x: 10, y: .200000003, z: 10} + m_LocalPosition: {x: 0, y: -0.101, z: 0} + m_LocalScale: {x: 10, y: 0.2, z: 10} m_Children: [] m_Father: {fileID: 2027571738} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &2041409368 BoxCollider: m_ObjectHideFlags: 0 @@ -2246,7 +2742,7 @@ BoxCollider: m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: .00999999978, z: 0} + m_Center: {x: 0, y: 0.01, z: 0} --- !u!23 &2041409369 MeshRenderer: m_ObjectHideFlags: 0 @@ -2257,20 +2753,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: bade3b3ccc3024624b44815e95a6af4e, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!54 &2041409371 Rigidbody: @@ -2281,7 +2785,7 @@ Rigidbody: serializedVersion: 2 m_Mass: 1 m_Drag: 0 - m_AngularDrag: .0500000007 + m_AngularDrag: 0.05 m_UseGravity: 0 m_IsKinematic: 1 m_Interpolate: 0 @@ -2346,9 +2850,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2130344072} + - component: {fileID: 2130344072} m_Layer: 0 m_Name: Container m_TagString: Untagged @@ -2384,15 +2888,16 @@ Transform: - {fileID: 1140064800} m_Father: {fileID: 2027571738} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -2406,12 +2911,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .241942912, y: -.49854365, z: .221075788, w: .802523136} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.24194291, y: -0.49854365, z: 0.22107579, w: 0.80252314} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -2419,19 +2925,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 2 m_Resolution: 3 - m_Strength: .560000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -2440,10 +2948,12 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} --- !u!4 &2137966724 stripped Transform: m_PrefabParentObject: {fileID: 437898, guid: b4fd857376bb94265b47bcf5b50f67fa, type: 2} diff --git a/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity.meta b/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity.meta index 99adb06c4..21cb61b30 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity.meta +++ b/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 6ba58961df0a14cad91763f92bda13b9 DefaultImporter: - userData: + userData: "5" diff --git a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs index 04b34996f..8355c9702 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs +++ b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs @@ -3,10 +3,11 @@ */ using UnityEngine; -using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; namespace TouchScript.Examples.Checkers { + /// public class Board : MonoBehaviour { private PinnedTransformGesture gesture; diff --git a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs index c9ebafa42..559eb97dc 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs +++ b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs @@ -3,39 +3,42 @@ */ using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Examples.Checkers { + /// public class Exclusive : MonoBehaviour, IGestureDelegate { public TransformGesture Target; public Color Color = Color.red; private bool exclusive = false; - private Renderer renderer; + private Renderer cachedRenderer; private float shininess; private void Awake() { GestureManager.Instance.GlobalGestureDelegate = this; - renderer = Target.GetComponent(); - shininess = renderer.sharedMaterial.GetFloat("_Shininess"); + cachedRenderer = Target.GetComponent(); + shininess = cachedRenderer.sharedMaterial.GetFloat("_Shininess"); } private void Update() { - if (UnityEngine.Input.GetKey(KeyCode.Space)) + if (Input.GetKey(KeyCode.Space)) { exclusive = true; - renderer.material.SetColor("_SpecColor", Color); - renderer.material.SetFloat("_Shininess", 0); + cachedRenderer.material.SetColor("_SpecColor", Color); + cachedRenderer.material.SetFloat("_Shininess", 0); } else { exclusive = false; - renderer.material.SetColor("_SpecColor", Color.white); - renderer.material.SetFloat("_Shininess", shininess); + cachedRenderer.material.SetColor("_SpecColor", Color.white); + cachedRenderer.material.SetFloat("_Shininess", shininess); } } @@ -45,7 +48,7 @@ public bool ShouldBegin(Gesture gesture) return true; } - public bool ShouldReceiveTouch(Gesture gesture, TouchPoint touch) + public bool ShouldReceivePointer(Gesture gesture, Pointer pointer) { if (exclusive) return gesture == Target; return true; diff --git a/Source/Assets/TouchScript/Examples/Colors/Colors.unity b/Source/Assets/TouchScript/Examples/Colors/Colors.unity index 7508c3c40..cd5edaf6a 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Colors.unity +++ b/Source/Assets/TouchScript/Examples/Colors/Colors.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,51 +54,73 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -117,6 +140,7 @@ Transform: m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -125,14 +149,21 @@ MonoBehaviour: m_GameObject: {fileID: 62216951} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2c791a2415314ea3b9f44592097a9d1, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 0 + hit2DObjects: 1 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 - layerIds: 00000000 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -170,7 +201,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 40 field of view: 30 orthographic: 1 @@ -184,18 +215,20 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!1 &68250096 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 68250097} + - component: {fileID: 68250097} m_Layer: 0 m_Name: Container m_TagString: Untagged @@ -215,15 +248,16 @@ Transform: m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &250857269 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -251,6 +285,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -265,11 +301,12 @@ RectTransform: - {fileID: 602940323} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &543251036 Prefab: m_ObjectHideFlags: 0 @@ -309,62 +346,26 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: objectReference: {fileID: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[1] - value: - objectReference: {fileID: 0} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[2] - value: - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &543251037 stripped -GameObject: - m_PrefabParentObject: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - m_PrefabInternal: {fileID: 543251036} ---- !u!114 &543251038 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 543251037} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - TouchTags: - tagList: - - Touch - MouseTags: - tagList: - - Mouse - PenTags: - tagList: - - Pen - Windows8Touch: 0 - Windows7Touch: 0 - WebPlayerTouch: 1 - WebGLTouch: 1 - Windows8Mouse: 1 - Windows7Mouse: 1 - UniversalWindowsMouse: 1 --- !u!1 &602940322 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 602940323} - - 114: {fileID: 602940324} + - component: {fileID: 602940323} + - component: {fileID: 602940324} m_Layer: 5 m_Name: Scale m_TagString: Untagged @@ -386,11 +387,12 @@ RectTransform: - {fileID: 1122129733} m_Father: {fileID: 250857271} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &602940324 MonoBehaviour: m_ObjectHideFlags: 0 @@ -414,11 +416,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -440,6 +442,7 @@ RectTransform: - {fileID: 1552723601} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -473,7 +476,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 740851131} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -481,17 +484,20 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &930800600 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} - - 114: {fileID: 930800602} + - component: {fileID: 930800601} + - component: {fileID: 930800602} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -513,6 +519,7 @@ Transform: - {fileID: 68250097} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &930800602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -531,12 +538,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1122129733} - - 222: {fileID: 1122129736} - - 114: {fileID: 1122129735} - - 114: {fileID: 1122129734} + - component: {fileID: 1122129733} + - component: {fileID: 1122129736} + - component: {fileID: 1122129735} + - component: {fileID: 1122129734} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -556,11 +563,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 602940323} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 196, y: 0} m_SizeDelta: {x: 242, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1122129734 MonoBehaviour: m_ObjectHideFlags: 0 @@ -602,6 +610,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -618,11 +627,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -642,11 +651,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -685,12 +695,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -710,11 +720,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 196, y: 0} m_SizeDelta: {x: 242, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -742,6 +753,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -774,12 +786,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -799,11 +811,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 178, y: 78} m_SizeDelta: {x: 320, y: 128} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -831,6 +844,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -868,10 +882,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Drag m_TagString: Untagged @@ -893,11 +907,12 @@ RectTransform: - {fileID: 1408280581} m_Father: {fileID: 250857271} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -921,10 +936,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -958,6 +973,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -985,9 +1001,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -1008,21 +1024,22 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2046579558 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2046579559} - - 222: {fileID: 2046579561} - - 114: {fileID: 2046579560} + - component: {fileID: 2046579559} + - component: {fileID: 2046579561} + - component: {fileID: 2046579560} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1042,11 +1059,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 602940323} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2046579560 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Source/Assets/TouchScript/Examples/Colors/Colors.unity.meta b/Source/Assets/TouchScript/Examples/Colors/Colors.unity.meta index e00912d5d..f611b96b5 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Colors.unity.meta +++ b/Source/Assets/TouchScript/Examples/Colors/Colors.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: c56b29ea5ec5a4713b65552d4a8bd9ac DefaultImporter: - userData: + userData: "7" diff --git a/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs b/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs index a660146d9..8f1196083 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs +++ b/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs @@ -4,9 +4,11 @@ using UnityEngine; using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; namespace TouchScript.Examples.Colors { + /// public class Circle : MonoBehaviour { private bool isDestroyed = false; @@ -34,8 +36,8 @@ private void OnTriggerEnter2D(Collider2D other) var otherColor = otherCircle.Kill(); var scale = - Mathf.Sqrt(otherCircle.transform.localScale.x*otherCircle.transform.localScale.x + - transform.localScale.x*transform.localScale.x); + Mathf.Sqrt(otherCircle.transform.localScale.x * otherCircle.transform.localScale.x + + transform.localScale.x * transform.localScale.x); var color = Color.Lerp(GetComponent().sharedMaterial.color, otherColor, .5f); var obj = Instantiate(gameObject) as GameObject; diff --git a/Source/Assets/TouchScript/Examples/Colors/Scripts/Colors.cs b/Source/Assets/TouchScript/Examples/Colors/Scripts/Colors.cs index 2739ecf38..db9a39431 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Scripts/Colors.cs +++ b/Source/Assets/TouchScript/Examples/Colors/Scripts/Colors.cs @@ -7,6 +7,7 @@ namespace TouchScript.Examples.Colors { + /// public class Colors : MonoBehaviour { public Transform Prefab; diff --git a/Source/Assets/TouchScript/Examples/Cube/Cube.unity b/Source/Assets/TouchScript/Examples/Cube/Cube.unity index 7b6e50a12..d2e80c837 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Cube.unity +++ b/Source/Assets/TouchScript/Examples/Cube/Cube.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 6 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -40,7 +40,7 @@ RenderSettings: --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 6 m_GIWorkflowMode: 1 m_LightmapsMode: 1 m_GISettings: @@ -66,7 +66,7 @@ LightmapSettings: m_FinalGather: 0 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -74,15 +74,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 @@ -97,7 +97,7 @@ GameObject: - 92: {fileID: 62216956} - 124: {fileID: 62216955} - 81: {fileID: 62216954} - - 114: {fileID: 62216958} + - 114: {fileID: 62216953} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -111,12 +111,35 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: .978753865, y: 0, z: 0, w: .205038756} + m_LocalRotation: {x: 0.97875386, y: 0, z: 0, w: 0.20503876} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 23.6635, y: -180, z: -180} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 +--- !u!114 &62216953 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: Camera + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 + layerMask: + serializedVersion: 2 + m_Bits: 4294967295 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -154,7 +177,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 30 orthographic: 0 @@ -170,23 +193,8 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 ---- !u!114 &62216958 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 62216951} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} - m_Name: - m_EditorClassIdentifier: - Name: Camera - layerMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!1 &172819027 GameObject: m_ObjectHideFlags: 0 @@ -212,6 +220,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 732284830} - {fileID: 891499233} @@ -221,7 +230,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &172819029 MonoBehaviour: m_ObjectHideFlags: 0 @@ -285,6 +294,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1679844150} - {fileID: 172819028} @@ -294,7 +304,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &543251036 Prefab: m_ObjectHideFlags: 0 @@ -337,46 +347,14 @@ Prefab: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: - objectReference: {fileID: 1459600544} + objectReference: {fileID: 62216953} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[1] value: - objectReference: {fileID: 62216958} + objectReference: {fileID: 1459600544} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &543251037 stripped -GameObject: - m_PrefabParentObject: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - m_PrefabInternal: {fileID: 543251036} ---- !u!114 &543251038 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 543251037} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - TouchTags: - tagList: - - Touch - MouseTags: - tagList: - - Mouse - PenTags: - tagList: - - Pen - Windows8Touch: 0 - Windows7Touch: 0 - WebPlayerTouch: 1 - WebGLTouch: 1 - Windows8Mouse: 1 - Windows7Mouse: 1 - UniversalWindowsMouse: 1 --- !u!1 &732284827 GameObject: m_ObjectHideFlags: 0 @@ -436,6 +414,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 172819028} m_RootOrder: 0 @@ -443,7 +422,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &740851131 GameObject: m_ObjectHideFlags: 0 @@ -470,6 +449,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1981142013} - {fileID: 1552723601} @@ -516,8 +496,10 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &891499232 GameObject: m_ObjectHideFlags: 0 @@ -545,14 +527,15 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 172819028} m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &891499234 MonoBehaviour: m_ObjectHideFlags: 0 @@ -594,6 +577,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -633,6 +617,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 2135305920} - {fileID: 62216952} @@ -678,7 +663,7 @@ GameObject: - 114: {fileID: 963048129} - 114: {fileID: 963048128} m_Layer: 0 - m_Name: Cube + m_Name: Image m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -690,9 +675,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 963048123} - m_LocalRotation: {x: 0, y: 0, z: 1, w: -1.62920685e-07} - m_LocalPosition: {x: 0, y: 0, z: 5.15999985} - m_LocalScale: {x: 2, y: 2, z: .047008425} + m_LocalRotation: {x: 0, y: 0, z: 1, w: -0.00000016292068} + m_LocalPosition: {x: 0, y: 0, z: 5.16} + m_LocalScale: {x: 2, y: 2, z: 0.047008425} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1459600543} m_RootOrder: 0 @@ -714,8 +700,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -750,6 +738,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.00001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &963048129 MonoBehaviour: m_ObjectHideFlags: 0 @@ -761,19 +755,44 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!1 &1138005899 @@ -802,6 +821,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 @@ -809,7 +829,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -870,14 +890,15 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -905,6 +926,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -941,7 +963,7 @@ GameObject: - 20: {fileID: 1459600547} - 114: {fileID: 1459600544} m_Layer: 0 - m_Name: RenderTexture Camera + m_Name: Scene Camera m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -953,9 +975,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1459600542} - m_LocalRotation: {x: 0, y: .744719267, z: 0, w: -.667377949} + m_LocalRotation: {x: 0, y: 0.74471927, z: 0, w: -0.66737795} m_LocalPosition: {x: 1000, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 963048124} m_Father: {fileID: 930800601} @@ -968,13 +991,20 @@ MonoBehaviour: m_GameObject: {fileID: 1459600542} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: RenderTexture Camera + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 1 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!20 &1459600547 Camera: m_ObjectHideFlags: 0 @@ -984,14 +1014,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -1007,7 +1037,7 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!1 &1552723600 GameObject: @@ -1036,14 +1066,15 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 178, y: 48.2000008} + m_AnchoredPosition: {x: 178, y: 48.2} m_SizeDelta: {x: 320, y: 122.32} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1071,6 +1102,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1126,6 +1158,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1138005900} - {fileID: 1408280581} @@ -1135,7 +1168,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1193,6 +1226,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 @@ -1220,6 +1254,15 @@ Prefab: value: objectReference: {fileID: 11468960, guid: 55576da10f8e2478e9aec42a40f85554, type: 2} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: pointerProxy + value: + objectReference: {fileID: 11468960, guid: 55576da10f8e2478e9aec42a40f85554, + type: 2} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} m_IsPrefabParent: 0 @@ -1268,14 +1311,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3fd90a8856e1a49eba25728d5aaac9f2, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] --- !u!23 &1880100170 @@ -1296,8 +1348,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -1327,9 +1381,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1880100167} - m_LocalRotation: {x: 0, y: -.327581882, z: 0, w: .944822788} - m_LocalPosition: {x: .0500000007, y: -2.9000001, z: -6.5} - m_LocalScale: {x: -2.61016512, y: -2.61016393, z: 2.6101644} + m_LocalRotation: {x: 0, y: -0.32758188, z: 0, w: 0.9448228} + m_LocalPosition: {x: 0.05, y: -2.9, z: -6.5} + m_LocalScale: {x: -2.610165, y: -2.610164, z: 2.6101644} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 2 @@ -1357,15 +1412,16 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 @@ -1388,9 +1444,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .32484895, y: -.867448151, z: .0434053168, w: .374329984} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.32484895, y: -0.86744815, z: 0.043405317, w: 0.37432998} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 @@ -1404,16 +1461,17 @@ Light: serializedVersion: 6 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 2 m_Resolution: 3 - m_Strength: .560000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} diff --git a/Source/Assets/TouchScript/Examples/Cube/Cube.unity.meta b/Source/Assets/TouchScript/Examples/Cube/Cube.unity.meta index 54ac72230..18eee7b08 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Cube.unity.meta +++ b/Source/Assets/TouchScript/Examples/Cube/Cube.unity.meta @@ -3,6 +3,6 @@ guid: 179bea80bb29f49ab9d5761fc9d3738b timeCreated: 1451049198 licenseType: Pro DefaultImporter: - userData: + userData: "8" assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Cube/Prefabs/Touch Hit.prefab b/Source/Assets/TouchScript/Examples/Cube/Prefabs/Pointer Hit.prefab similarity index 99% rename from Source/Assets/TouchScript/Examples/Cube/Prefabs/Touch Hit.prefab rename to Source/Assets/TouchScript/Examples/Cube/Prefabs/Pointer Hit.prefab index 6ace63305..a6e8459e7 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Prefabs/Touch Hit.prefab +++ b/Source/Assets/TouchScript/Examples/Cube/Prefabs/Pointer Hit.prefab @@ -30,7 +30,7 @@ GameObject: - 114: {fileID: 11454912} - 114: {fileID: 11468960} m_Layer: 0 - m_Name: Touch Hit + m_Name: Pointer Hit m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Source/Assets/TouchScript/Examples/Cube/Prefabs/Touch Hit.prefab.meta b/Source/Assets/TouchScript/Examples/Cube/Prefabs/Pointer Hit.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Examples/Cube/Prefabs/Touch Hit.prefab.meta rename to Source/Assets/TouchScript/Examples/Cube/Prefabs/Pointer Hit.prefab.meta diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs new file mode 100644 index 000000000..3fe57c913 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs @@ -0,0 +1,20 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Behaviors.Cursors; +using TouchScript.Pointers; + +namespace TouchScript.Examples.Cube +{ + /// + public class CustomPointerProxy : PointerCursor + { + protected override void updateOnce(IPointer pointer) + { + if (pointer.InputSource is RedirectInput) Hide(); + + base.updateOnce(pointer); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomTouchProxy.cs.meta b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Examples/Cube/Scripts/CustomTouchProxy.cs.meta rename to Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs.meta diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomTouchProxy.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomTouchProxy.cs deleted file mode 100644 index 02e0b4321..000000000 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomTouchProxy.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEngine; -using System.Collections; -using TouchScript.Behaviors.Visualizer; - -namespace TouchScript.Examples.Cube -{ - public class CustomTouchProxy : TouchScript.Behaviors.Visualizer.TouchProxy - { - protected override void updateOnce(TouchPoint touch) { - if (touch.InputSource is RedirectInput) Hide(); - - base.updateOnce(touch); - } - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs index 52a99c81d..4afc392b7 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs @@ -1,17 +1,22 @@ -using UnityEngine; -using System.Collections; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; using TouchScript.Layers; -namespace TouchScript.Examples.Cube +namespace TouchScript.Examples.Cube { - public class Init : MonoBehaviour + /// + public class Init : MonoBehaviour { - void Start () { + void Start() + { var d = GetComponent(); - var go = GameObject.Find("RenderTexture Camera"); - go.GetComponent().Delegate = d; + var go = GameObject.Find("Scene Camera"); + go.GetComponent().Delegate = d; go = GameObject.Find("Camera"); - go.GetComponent().Delegate = d; + go.GetComponent().Delegate = d; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs index 2e438fd55..4c0762420 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs @@ -1,19 +1,25 @@ -using UnityEngine; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; using TouchScript.Layers; +using TouchScript.Pointers; +using TouchScript.InputSources; namespace TouchScript.Examples.Cube { + /// public class LayerDelegate : MonoBehaviour, ILayerDelegate { - public RedirectInput Source; public TouchLayer RenderTextureLayer; - public bool ShouldReceiveTouch(TouchLayer layer, TouchPoint touch) + public bool ShouldReceivePointer(TouchLayer layer, IPointer pointer) { if (layer == RenderTextureLayer) - return touch.InputSource == Source; - return touch.InputSource != Source; + return pointer.InputSource == (IInputSource) Source; + return pointer.InputSource != (IInputSource) Source; } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs index 4ca8a02d5..cd87ed47f 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs @@ -1,31 +1,45 @@ -using UnityEngine; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; using System.Collections.Generic; using TouchScript.Gestures; using TouchScript.Hit; using TouchScript.InputSources; +using TouchScript.Pointers; +using TouchScript.Utils; namespace TouchScript.Examples.Cube { + /// public class RedirectInput : InputSource { - public int Width = 512; public int Height = 512; private MetaGesture gesture; - private Dictionary map = new Dictionary(); + private Dictionary map = new Dictionary(); - public override void CancelTouch(TouchPoint touch, bool @return) + public override bool CancelPointer(Pointer pointer, bool shouldReturn) { - base.CancelTouch(touch, @return); + base.CancelPointer(pointer, shouldReturn); - map.Remove(touch.Id); - if (@return) + map.Remove(pointer.Id); + if (shouldReturn) { - TouchHit hit; - if (!gesture.GetTargetHitResult(touch.Position, out hit)) return; - map.Add(touch.Id, beginTouch(processCoords(hit.RaycastHit.textureCoord), touch.Tags).Id); + HitData hit; + if (PointerUtils.IsPointerOnTarget(pointer, transform, out hit)) + { + var newPointer = PointerFactory.Create(pointer.Type, this); + newPointer.CopyFrom(pointer); + newPointer.Position = processCoords(hit.RaycastHit.textureCoord); + addPointer(newPointer); + pressPointer(newPointer); + map.Add(pointer.Id, newPointer); + } } + return true; } protected override void OnEnable() @@ -34,10 +48,10 @@ protected override void OnEnable() gesture = GetComponent(); if (gesture) { - gesture.TouchBegan += touchBeganHandler; - gesture.TouchMoved += touchMovedhandler; - gesture.TouchCancelled += touchCancelledhandler; - gesture.TouchEnded += touchEndedHandler; + gesture.PointerPressed += pointerPressedHandler; + gesture.PointerUpdated += pointerUpdatedHandler; + gesture.PointerCancelled += pointerCancelledhandler; + gesture.PointerReleased += pointerReleasedHandler; } } @@ -47,10 +61,10 @@ protected override void OnDisable() if (gesture) { - gesture.TouchBegan -= touchBeganHandler; - gesture.TouchMoved -= touchMovedhandler; - gesture.TouchCancelled -= touchCancelledhandler; - gesture.TouchEnded -= touchEndedHandler; + gesture.PointerPressed -= pointerPressedHandler; + gesture.PointerUpdated -= pointerUpdatedHandler; + gesture.PointerCancelled -= pointerCancelledhandler; + gesture.PointerReleased -= pointerReleasedHandler; } } @@ -59,42 +73,56 @@ private Vector2 processCoords(Vector2 value) return new Vector2(value.x * Width, value.y * Height); } - private void touchBeganHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) + private void pointerPressedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { - var touch = metaGestureEventArgs.Touch; - if (touch.InputSource == this) return; - map.Add(touch.Id, beginTouch(processCoords(touch.Hit.RaycastHit.textureCoord), touch.Tags).Id); + var pointer = metaGestureEventArgs.Pointer; + if (pointer.InputSource == (IInputSource) this) return; + + var newPointer = PointerFactory.Create(pointer.Type, this); + newPointer.CopyFrom(pointer); + newPointer.Position = processCoords(pointer.GetPressData().RaycastHit.textureCoord); + newPointer.Flags = pointer.Flags | Pointer.FLAG_ARTIFICIAL | Pointer.FLAG_INTERNAL; + addPointer(newPointer); + pressPointer(newPointer); + map.Add(pointer.Id, newPointer); } - private void touchMovedhandler(object sender, MetaGestureEventArgs metaGestureEventArgs) + private void pointerUpdatedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { - int id; - TouchHit hit; - var touch = metaGestureEventArgs.Touch; - if (touch.InputSource == this) return; - if (!map.TryGetValue(touch.Id, out id)) return; - if (!gesture.GetTargetHitResult(touch.Position, out hit)) return; - moveTouch(id, processCoords(hit.RaycastHit.textureCoord)); + var pointer = metaGestureEventArgs.Pointer; + + if (pointer.InputSource == (IInputSource) this) return; + + Pointer newPointer; + if (!map.TryGetValue(pointer.Id, out newPointer)) return; + HitData hit; + if (!PointerUtils.IsPointerOnTarget(pointer, transform, out hit)) return; + newPointer.Position = processCoords(hit.RaycastHit.textureCoord); + newPointer.Flags = pointer.Flags | Pointer.FLAG_ARTIFICIAL; + updatePointer(newPointer); } - private void touchEndedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) + private void pointerReleasedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { - int id; - var touch = metaGestureEventArgs.Touch; - if (touch.InputSource == this) return; - if (!map.TryGetValue(touch.Id, out id)) return; - endTouch(id); + var pointer = metaGestureEventArgs.Pointer; + if (pointer.InputSource == (IInputSource) this) return; + + Pointer newPointer; + if (!map.TryGetValue(pointer.Id, out newPointer)) return; + map.Remove(pointer.Id); + releasePointer(newPointer); + removePointer(newPointer); } - private void touchCancelledhandler(object sender, MetaGestureEventArgs metaGestureEventArgs) + private void pointerCancelledhandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { - int id; - var touch = metaGestureEventArgs.Touch; - if (touch.InputSource == this) return; - if (!map.TryGetValue(touch.Id, out id)) return; - cancelTouch(id); - } + var pointer = metaGestureEventArgs.Pointer; + if (pointer.InputSource == (IInputSource) this) return; + Pointer newPointer; + if (!map.TryGetValue(pointer.Id, out newPointer)) return; + map.Remove(pointer.Id); + cancelPointer(newPointer); + } } - } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Examples.unity b/Source/Assets/TouchScript/Examples/Examples.unity index 79d949c60..e68c675ed 100644 --- a/Source/Assets/TouchScript/Examples/Examples.unity +++ b/Source/Assets/TouchScript/Examples/Examples.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,50 +54,269 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &15691937 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 15691938} + - component: {fileID: 15691940} + - component: {fileID: 15691939} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &15691938 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 15691937} + 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: 1037999862} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &15691939 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 15691937} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use CameraLayer2D and Gesture.Cancel() to "give" touches to + another gesture. +--- !u!222 &15691940 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 15691937} +--- !u!1 &16824281 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 16824282} + - component: {fileID: 16824284} + - component: {fileID: 16824283} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &16824282 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 16824281} + 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: 758236082} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &16824283 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 16824281} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use TransformGesture and PinnedTransformGesture. +--- !u!222 &16824284 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 16824281} +--- !u!1 &37557108 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 37557109} + - component: {fileID: 37557110} + m_Layer: 5 + m_Name: Examples + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &37557109 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 37557108} + 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: 1317055114} + - {fileID: 767854197} + m_Father: {fileID: 2032927211} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 360, y: -60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &37557110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 37557108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d184134ce2b24f92834c7bd77c9dcd8, type: 3} + m_Name: + m_EditorClassIdentifier: + Content: {fileID: 2098255038} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -116,6 +336,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -153,7 +374,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 30 orthographic: 0 @@ -167,19 +388,162 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 +--- !u!1 &96104531 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 96104532} + - component: {fileID: 96104536} + - component: {fileID: 96104535} + - component: {fileID: 96104534} + - component: {fileID: 96104533} + m_Layer: 5 + m_Name: Previous + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &96104532 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 96104531} + 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: 1784197137} + m_Father: {fileID: 666412329} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 1, y: 0} +--- !u!114 &96104533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 96104531} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &96104534 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 96104531} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.15862095, g: 1, b: 0, a: 1} + m_PressedColor: {r: 0.9044118, g: 0.9044118, b: 0.9044118, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 96104535} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadPreviousLevel + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &96104535 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 96104531} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 8c24c9fccfbf94ef08c2da39f7245967, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &96104536 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 96104531} --- !u!1 &174295520 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 174295523} - - 114: {fileID: 174295522} + - component: {fileID: 174295523} + - component: {fileID: 174295522} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -199,75 +563,5470 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 + m_sendNavigationEvents: 0 m_DragThreshold: 5 --- !u!4 &174295523 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 174295520} - 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: 1654745587} - m_RootOrder: 0 ---- !u!1 &309713870 + m_GameObject: {fileID: 174295520} + 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: 1654745587} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &201561626 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 201561627} + - component: {fileID: 201561630} + - component: {fileID: 201561629} + - component: {fileID: 201561628} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &201561627 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 201561626} + 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: 870787322} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &201561628 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 201561626} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 201561629} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Camera + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &201561629 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 201561626} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &201561630 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 201561626} +--- !u!1 &299753858 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 299753859} + - component: {fileID: 299753861} + - component: {fileID: 299753860} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &299753859 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 299753858} + 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: 1037999862} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &299753860 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 299753858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 2ffae1f119ee1480785aa1061b1ab391, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &299753861 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 299753858} +--- !u!1 &309713870 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 309713871} + - component: {fileID: 309713874} + - component: {fileID: 309713873} + - component: {fileID: 309713872} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &309713871 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 309713870} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.6333333, y: 1.6333333, z: 1.6333333} + m_Children: [] + m_Father: {fileID: 1402896514} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -405.2041, y: -304} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &309713872 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 309713870} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 1} + m_EffectDistance: {x: 2, y: 2} + m_UseGraphicAlpha: 1 +--- !u!114 &309713873 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 309713870} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 53 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 53 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Make sure that you add example scenes to build settings! +--- !u!222 &309713874 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 309713870} +--- !u!1 &321008077 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 321008078} + - component: {fileID: 321008081} + - component: {fileID: 321008080} + - component: {fileID: 321008079} + m_Layer: 5 + m_Name: Portal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &321008078 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 321008077} + 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: 1449561975} + - {fileID: 1241691652} + - {fileID: 1894139120} + - {fileID: 329812103} + m_Father: {fileID: 2098255038} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &321008079 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 321008077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &321008080 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 321008077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &321008081 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 321008077} +--- !u!1 &329812102 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 329812103} + - component: {fileID: 329812105} + - component: {fileID: 329812104} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &329812103 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 329812102} + 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: 321008078} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &329812104 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 329812102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 1217c44a62d504b718e8d6b10d17c0cb, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &329812105 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 329812102} +--- !u!1 &341179472 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 341179473} + - component: {fileID: 341179476} + - component: {fileID: 341179475} + - component: {fileID: 341179474} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &341179473 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 341179472} + 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: 574950114} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &341179474 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 341179472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 341179475} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Taps + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &341179475 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 341179472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &341179476 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 341179472} +--- !u!1 &357107824 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 357107825} + - component: {fileID: 357107828} + - component: {fileID: 357107827} + - component: {fileID: 357107826} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &357107825 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 357107824} + 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: 1037999862} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &357107826 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 357107824} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &357107827 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 357107824} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: colors +--- !u!222 &357107828 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 357107824} +--- !u!1 &363049654 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 363049655} + - component: {fileID: 363049658} + - component: {fileID: 363049657} + - component: {fileID: 363049656} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &363049655 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 363049654} + 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: 758236082} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &363049656 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 363049654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 363049657} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Checkers + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &363049657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 363049654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &363049658 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 363049654} +--- !u!1 &385551182 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 385551183} + - component: {fileID: 385551185} + - component: {fileID: 385551184} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &385551183 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 385551182} + 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: 1004776690} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &385551184 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 385551182} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use 3D and 2D layers simultaneously. +--- !u!222 &385551185 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 385551182} +--- !u!1 &406504770 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 406504771} + - component: {fileID: 406504774} + - component: {fileID: 406504773} + - component: {fileID: 406504772} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &406504771 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 406504770} + 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: 1037999862} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &406504772 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 406504770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 406504773} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Colors + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &406504773 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 406504770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &406504774 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 406504770} +--- !u!1 &452970291 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 452970292} + - component: {fileID: 452970294} + - component: {fileID: 452970293} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &452970292 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 452970291} + 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: 870787322} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &452970293 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 452970291} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: d1c0e7f7a711f4935b11d81582893ee9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &452970294 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 452970291} +--- !u!1 &507770917 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 507770921} + - component: {fileID: 507770920} + - component: {fileID: 507770919} + - component: {fileID: 507770918} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &507770918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 507770917} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &507770919 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 507770917} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: cube +--- !u!222 &507770920 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 507770917} +--- !u!224 &507770921 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 507770917} + 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: 621592926} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &558528358 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 558528359} + - component: {fileID: 558528361} + - component: {fileID: 558528360} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &558528359 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 558528358} + 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: 2076713667} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &558528360 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 558528358} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e2a00bee3078646c684013506c4f40c4, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &558528361 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 558528358} +--- !u!1 &574950113 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 574950114} + - component: {fileID: 574950117} + - component: {fileID: 574950116} + - component: {fileID: 574950115} + m_Layer: 5 + m_Name: Taps + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &574950114 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 574950113} + 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: 1800191864} + - {fileID: 745674114} + - {fileID: 341179473} + - {fileID: 865431078} + m_Father: {fileID: 2098255038} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &574950115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 574950113} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &574950116 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 574950113} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &574950117 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 574950113} +--- !u!1 &595145114 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 595145115} + - component: {fileID: 595145117} + - component: {fileID: 595145116} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &595145115 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 595145114} + 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: 601448587} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &595145116 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 595145114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use TouchScript simply as a source of touches with no gestures + in scene. +--- !u!222 &595145117 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 595145114} +--- !u!1 &601448586 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 601448587} + - component: {fileID: 601448590} + - component: {fileID: 601448589} + - component: {fileID: 601448588} + m_Layer: 5 + m_Name: Raw Input + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &601448587 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 601448586} + 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: 1260024592} + - {fileID: 595145115} + - {fileID: 2001542684} + - {fileID: 2073758707} + m_Father: {fileID: 2098255038} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &601448588 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 601448586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &601448589 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 601448586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &601448590 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 601448586} +--- !u!1 &606054178 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 606054179} + - component: {fileID: 606054182} + - component: {fileID: 606054181} + - component: {fileID: 606054180} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &606054179 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 606054178} + 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: 2098255038} + m_Father: {fileID: 1317055114} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 25, y: -43} + m_SizeDelta: {x: -62, y: -104} + m_Pivot: {x: 0, y: 1} +--- !u!114 &606054180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 606054178} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &606054181 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 606054178} +--- !u!114 &606054182 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 606054178} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!1 &621592925 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 621592926} + - component: {fileID: 621592929} + - component: {fileID: 621592928} + - component: {fileID: 621592927} + m_Layer: 5 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &621592926 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 621592925} + 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: 507770921} + - {fileID: 749901011} + - {fileID: 842217637} + - {fileID: 2088901649} + m_Father: {fileID: 2098255038} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &621592927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 621592925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &621592928 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 621592925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &621592929 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 621592925} +--- !u!1 &666412328 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 666412329} + - component: {fileID: 666412330} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &666412329 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 666412328} + 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: 96104532} + - {fileID: 1412835668} + - {fileID: 1778454010} + m_Father: {fileID: 2032927211} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -141, y: 35} + m_SizeDelta: {x: 259, y: 49} + m_Pivot: {x: 0.50000036, y: 0.5} +--- !u!114 &666412330 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 666412328} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 2 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!1 &700544018 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 700544019} + - component: {fileID: 700544021} + - component: {fileID: 700544020} + m_Layer: 5 + m_Name: Ribbon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &700544019 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 700544018} + 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: 1924054934} + m_Father: {fileID: 1317055114} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.9607719} + m_AnchorMax: {x: 0.5, y: 0.9607719} + m_AnchoredPosition: {x: 0.000020981002, y: 7.3999023} + m_SizeDelta: {x: 262.6, y: 73.242} + m_Pivot: {x: 0.5, y: 0.49999997} +--- !u!114 &700544020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 700544018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 795edb780ddd9406493b04bb9b8ed002, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &700544021 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 700544018} +--- !u!1 &745674113 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 745674114} + - component: {fileID: 745674116} + - component: {fileID: 745674115} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &745674114 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 745674113} + 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: 574950114} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &745674115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 745674113} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: How to use TapGesture and LongPressGesture. +--- !u!222 &745674116 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 745674113} +--- !u!1 &749901010 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 749901011} + - component: {fileID: 749901013} + - component: {fileID: 749901012} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &749901011 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 749901010} + 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: 621592926} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &749901012 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 749901010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use a custom input source and TouchLayer.Delegate. +--- !u!222 &749901013 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 749901010} +--- !u!1 &758236081 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 758236082} + - component: {fileID: 758236085} + - component: {fileID: 758236084} + - component: {fileID: 758236083} + m_Layer: 5 + m_Name: Checkers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &758236082 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 758236081} + 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: 1280257797} + - {fileID: 16824282} + - {fileID: 363049655} + - {fileID: 1987127154} + m_Father: {fileID: 2098255038} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &758236083 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 758236081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &758236084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 758236081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &758236085 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 758236081} +--- !u!1 &767854196 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 767854197} + - component: {fileID: 767854200} + - component: {fileID: 767854199} + - component: {fileID: 767854198} + m_Layer: 5 + m_Name: Close + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &767854197 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 767854196} + 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: 37557109} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -31.199997, y: -39.700195} + m_SizeDelta: {x: 54.5, y: 54.4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &767854198 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 767854196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 1, g: 0.75, b: 0.75, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 767854199} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 37557108} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &767854199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 767854196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da634550c6a1c4ff38304b1c8566d809, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &767854200 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 767854196} +--- !u!1 &801696178 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 801696179} + - component: {fileID: 801696182} + - component: {fileID: 801696181} + - component: {fileID: 801696180} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &801696179 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 801696178} + 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: 2076713667} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &801696180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 801696178} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &801696181 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 801696178} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: photos +--- !u!222 &801696182 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 801696178} +--- !u!1 &812982524 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 812982525} + - component: {fileID: 812982528} + - component: {fileID: 812982527} + - component: {fileID: 812982526} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &812982525 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 812982524} + 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: 1920151151} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &812982526 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 812982524} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &812982527 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 812982524} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: pull +--- !u!222 &812982528 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 812982524} +--- !u!1 &842217636 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 842217637} + - component: {fileID: 842217640} + - component: {fileID: 842217639} + - component: {fileID: 842217638} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &842217637 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 842217636} + 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: 621592926} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &842217638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 842217636} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 842217639} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Cube + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &842217639 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 842217636} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &842217640 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 842217636} +--- !u!1 &865431077 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 865431078} + - component: {fileID: 865431080} + - component: {fileID: 865431079} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &865431078 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 865431077} + 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: 574950114} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &865431079 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 865431077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5a60ebe3657034c78bd3f829dc6b132e, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &865431080 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 865431077} +--- !u!1 &870787321 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 870787322} + - component: {fileID: 870787325} + - component: {fileID: 870787324} + - component: {fileID: 870787323} + m_Layer: 5 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &870787322 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 870787321} + 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: 879805661} + - {fileID: 1030186641} + - {fileID: 201561627} + - {fileID: 452970292} + m_Father: {fileID: 2098255038} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &870787323 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 870787321} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &870787324 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 870787321} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &870787325 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 870787321} +--- !u!1 &879805660 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 879805661} + - component: {fileID: 879805664} + - component: {fileID: 879805663} + - component: {fileID: 879805662} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &879805661 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 879805660} + 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: 870787322} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &879805662 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 879805660} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &879805663 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 879805660} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: camera +--- !u!222 &879805664 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 879805660} +--- !u!1 &962873576 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 962873577} + - component: {fileID: 962873580} + - component: {fileID: 962873579} + - component: {fileID: 962873578} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &962873577 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 962873576} + 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: 1004776690} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &962873578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 962873576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 962873579} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Multiuser + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &962873579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 962873576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &962873580 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 962873576} +--- !u!1 &1004776689 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1004776690} + - component: {fileID: 1004776693} + - component: {fileID: 1004776692} + - component: {fileID: 1004776691} + m_Layer: 5 + m_Name: Multiuser + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1004776690 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1004776689} + 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: 2008717908} + - {fileID: 385551183} + - {fileID: 962873577} + - {fileID: 1608867050} + m_Father: {fileID: 2098255038} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1004776691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1004776689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &1004776692 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1004776689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1004776693 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1004776689} +--- !u!1 &1030186640 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1030186641} + - component: {fileID: 1030186643} + - component: {fileID: 1030186642} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1030186641 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1030186640} + 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: 870787322} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1030186642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1030186640} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: How to use TransformGesture to make a camera which can orbit and move around + an object. +--- !u!222 &1030186643 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1030186640} +--- !u!1 &1037999861 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1037999862} + - component: {fileID: 1037999865} + - component: {fileID: 1037999864} + - component: {fileID: 1037999863} + m_Layer: 5 + m_Name: Colors + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1037999862 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1037999861} + 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: 357107825} + - {fileID: 15691938} + - {fileID: 406504771} + - {fileID: 299753859} + m_Father: {fileID: 2098255038} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1037999863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1037999861} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &1037999864 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1037999861} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1037999865 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1037999861} +--- !u!1 &1168732682 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1168732683} + - component: {fileID: 1168732685} + - component: {fileID: 1168732684} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1168732683 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1168732682} + 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: 2076713667} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1168732684 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1168732682} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to use UI Layer to interact with UI elements. +--- !u!222 &1168732685 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1168732682} +--- !u!1 &1173809305 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1173809306} + - component: {fileID: 1173809309} + - component: {fileID: 1173809308} + - component: {fileID: 1173809307} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1173809306 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1173809305} + 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: 1778454010} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -1} + m_SizeDelta: {x: 0, y: -11} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1173809307 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1173809305} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.297} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &1173809308 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1173809305} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 28 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: '>>' +--- !u!222 &1173809309 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1173809305} +--- !u!1 &1241691651 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1241691652} + - component: {fileID: 1241691654} + - component: {fileID: 1241691653} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1241691652 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1241691651} + 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: 321008078} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1241691653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1241691651} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to cancel a gesture. +--- !u!222 &1241691654 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1241691651} +--- !u!1 &1260024591 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1260024592} + - component: {fileID: 1260024595} + - component: {fileID: 1260024594} + - component: {fileID: 1260024593} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1260024592 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1260024591} + 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: 601448587} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1260024593 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1260024591} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &1260024594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1260024591} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: raw input +--- !u!222 &1260024595 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1260024591} +--- !u!1 &1280257796 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1280257797} + - component: {fileID: 1280257800} + - component: {fileID: 1280257799} + - component: {fileID: 1280257798} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1280257797 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1280257796} + 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: 758236082} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1280257798 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1280257796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &1280257799 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1280257796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: checkers +--- !u!222 &1280257800 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1280257796} +--- !u!1 &1317055113 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1317055114} + - component: {fileID: 1317055117} + - component: {fileID: 1317055116} + - component: {fileID: 1317055115} + m_Layer: 5 + m_Name: Examples List + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1317055114 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1317055113} + 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: 606054179} + - {fileID: 700544019} + m_Father: {fileID: 37557109} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0, y: -10} + m_SizeDelta: {x: -41, y: -60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1317055115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1317055113} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9162f54c0795b4623b5616fc423eec6a, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1317055116 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1317055113} +--- !u!114 &1317055117 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1317055113} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 2098255038} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 606054179} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!1 &1361172026 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1361172027} + - component: {fileID: 1361172030} + - component: {fileID: 1361172029} + - component: {fileID: 1361172028} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1361172027 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361172026} + 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: 2076713667} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1361172028 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361172026} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1361172029} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Photos + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1361172029 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361172026} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1361172030 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361172026} +--- !u!1 &1402896513 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1402896514} + - component: {fileID: 1402896517} + - component: {fileID: 1402896516} + - component: {fileID: 1402896515} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1402896514 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1402896513} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 309713871} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1402896515 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1402896513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c534619fb2794426fb1495e64ec4bcb7, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1402896516 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1402896513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1402896517 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1402896513} + m_Enabled: 0 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &1411566800 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1411566801} + - component: {fileID: 1411566803} + - component: {fileID: 1411566802} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1411566801 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1411566800} + 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: 1920151151} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1411566802 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1411566800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ed91d97df020e4a8cb289e68e82485be, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1411566803 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1411566800} +--- !u!1 &1412835664 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1412835668} + - component: {fileID: 1412835667} + - component: {fileID: 1412835666} + - component: {fileID: 1412835665} + - component: {fileID: 1412835669} + m_Layer: 5 + m_Name: List + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1412835665 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1412835664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0, g: 0.95862055, b: 1, a: 1} + m_PressedColor: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1412835666} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1412835666 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1412835664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 0afc57b6a109d46f6a1168e3fce8d788, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1412835667 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1412835664} +--- !u!224 &1412835668 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1412835664} + 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: 1487808224} + m_Father: {fileID: 666412329} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 1, y: 0} +--- !u!114 &1412835669 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1412835664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 100 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!1 &1449561974 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1449561975} + - component: {fileID: 1449561978} + - component: {fileID: 1449561977} + - component: {fileID: 1449561976} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1449561975 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449561974} + 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: 321008078} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1449561976 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449561974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &1449561977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449561974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: portal +--- !u!222 &1449561978 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449561974} +--- !u!1 &1487808223 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1487808224} + - component: {fileID: 1487808226} + - component: {fileID: 1487808225} + - component: {fileID: 1487808227} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1487808224 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1487808223} + 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: 1412835668} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 2} + m_SizeDelta: {x: 0, y: -4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1487808225 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1487808223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 16 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: EXAMPLES LIST +--- !u!222 &1487808226 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1487808223} +--- !u!114 &1487808227 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1487808223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.297} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1 &1562323887 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1562323888} + - component: {fileID: 1562323890} + - component: {fileID: 1562323889} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1562323888 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562323887} + 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: 1920151151} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 15.699997, y: -4.8999996} + m_SizeDelta: {x: -131.9, y: -51.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1562323889 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562323887} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 8 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 8 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Shows how to write a custom gesture. +--- !u!222 &1562323890 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562323887} +--- !u!1 &1567954097 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1567954098} + - component: {fileID: 1567954101} + - component: {fileID: 1567954100} + - component: {fileID: 1567954099} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1567954098 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1567954097} + 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: 1920151151} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1567954099 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1567954097} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1567954100} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Pull + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1567954100 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1567954097} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1567954101 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1567954097} +--- !u!1 &1608867049 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1608867050} + - component: {fileID: 1608867052} + - component: {fileID: 1608867051} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1608867050 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1608867049} + 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: 1004776690} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1608867051 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1608867049} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 7948ef2b5570c4deaa033186f8e3cada, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1608867052 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1608867049} +--- !u!1 &1654745586 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1654745587} + - component: {fileID: 1654745588} + - component: {fileID: 1654745589} + m_Layer: 0 + m_Name: Examples + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1654745587 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1654745586} + 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: 174295523} + - {fileID: 2032927211} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1654745588 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1654745586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d0145ec13410624f9b2939e5d5a99be, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1654745589 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1654745586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: ScreenSpace UI Layer + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 0 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 1 + layerMask: + serializedVersion: 2 + m_Bits: 4294967295 + useHitFilters: 0 +--- !u!1 &1778454009 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1778454010} + - component: {fileID: 1778454014} + - component: {fileID: 1778454013} + - component: {fileID: 1778454012} + - component: {fileID: 1778454011} + m_Layer: 5 + m_Name: Next + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1778454010 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1778454009} + 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: 1173809306} + m_Father: {fileID: 666412329} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 1, y: 0} +--- !u!114 &1778454011 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1778454009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &1778454012 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1778454009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.15862095, g: 1, b: 0, a: 1} + m_PressedColor: {r: 0.9044118, g: 0.9044118, b: 0.9044118, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1778454013} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadNextLevel + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1778454013 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1778454009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 8c24c9fccfbf94ef08c2da39f7245967, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1778454014 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1778454009} +--- !u!1 &1784197136 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1784197137} + - component: {fileID: 1784197140} + - component: {fileID: 1784197139} + - component: {fileID: 1784197138} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1784197137 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1784197136} + 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: 96104532} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -2} + m_SizeDelta: {x: 0, y: -12} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1784197138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1784197136} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.297} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &1784197139 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1784197136} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 28 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: << +--- !u!222 &1784197140 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1784197136} +--- !u!1 &1800191863 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1800191864} + - component: {fileID: 1800191867} + - component: {fileID: 1800191866} + - component: {fileID: 1800191865} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1800191864 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1800191863} + 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: 574950114} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1800191865 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1800191863} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &1800191866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1800191863} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: taps +--- !u!222 &1800191867 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1800191863} +--- !u!1 &1894139119 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1894139120} + - component: {fileID: 1894139123} + - component: {fileID: 1894139122} + - component: {fileID: 1894139121} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1894139120 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1894139119} + 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: 321008078} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1894139121 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1894139119} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1894139122} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Portal + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1894139122 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1894139119} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1894139123 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1894139119} +--- !u!1 &1920151150 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1920151151} + - component: {fileID: 1920151154} + - component: {fileID: 1920151153} + - component: {fileID: 1920151152} + m_Layer: 5 + m_Name: Pull + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1920151151 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1920151150} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.99999774, y: 0.99999774, z: 0.99999774} + m_Children: + - {fileID: 812982525} + - {fileID: 1562323888} + - {fileID: 1567954098} + - {fileID: 1411566801} + m_Father: {fileID: 2098255038} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1920151152 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1920151150} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &1920151153 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1920151150} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1920151154 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1920151150} +--- !u!1 &1924054933 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1924054934} + - component: {fileID: 1924054937} + - component: {fileID: 1924054936} + - component: {fileID: 1924054935} + m_Layer: 5 + m_Name: Examples + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1924054934 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1924054933} + 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: 700544019} + 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.000024319, y: 7.9} + m_SizeDelta: {x: 151.8, y: 24.8} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1924054935 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1924054933} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.516} + m_EffectDistance: {x: 1, y: 1} + m_UseGraphicAlpha: 0 +--- !u!114 &1924054936 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1924054933} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0.96517026, b: 0.85294116, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 10 + m_MaxSize: 90 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: EXAMPLES +--- !u!222 &1924054937 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1924054933} +--- !u!1 &1987127153 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1987127154} + - component: {fileID: 1987127156} + - component: {fileID: 1987127155} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1987127154 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1987127153} + 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: 758236082} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1987127155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1987127153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: af230e20959134865a1c53e6e8edbbe7, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1987127156 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1987127153} +--- !u!1 &2001542683 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2001542684} + - component: {fileID: 2001542687} + - component: {fileID: 2001542686} + - component: {fileID: 2001542685} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2001542684 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2001542683} + 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: 601448587} + m_RootOrder: 2 + 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: 100, y: -4.9} + m_SizeDelta: {x: 36.7, y: 36.6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2001542685 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2001542683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.75735295, g: 1, b: 0.769067, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2001542686} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1654745588} + m_MethodName: LoadLevel + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: RawInput + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 37557110} + m_MethodName: ShowHide + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &2001542686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2001542683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 5410db89f39a24e0fa785adf88e19b01, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &2001542687 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2001542683} +--- !u!1 &2008717907 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 309713871} - - 222: {fileID: 309713874} - - 114: {fileID: 309713873} - - 114: {fileID: 309713872} + - component: {fileID: 2008717908} + - component: {fileID: 2008717911} + - component: {fileID: 2008717910} + - component: {fileID: 2008717909} m_Layer: 5 - m_Name: Text + m_Name: Title m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &309713871 +--- !u!224 &2008717908 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 309713870} + m_GameObject: {fileID: 2008717907} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.63333333, y: 1.63333333, z: 1.63333333} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 1402896514} + m_Father: {fileID: 1004776690} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -405.204102, y: -304} - m_Pivot: {x: .5, y: .5} ---- !u!114 &309713872 + m_AnchoredPosition: {x: 33.699997, y: 21.6} + m_SizeDelta: {x: -94.8, y: -68.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2008717909 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 309713870} + m_GameObject: {fileID: 2008717907} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_EffectColor: {r: 0, g: 0, b: 0, a: 1} - m_EffectDistance: {x: 2, y: 2} - m_UseGraphicAlpha: 1 ---- !u!114 &309713873 + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 0 +--- !u!114 &2008717910 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 309713870} + m_GameObject: {fileID: 2008717907} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -275,42 +6034,43 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 53 + m_Font: {fileID: 12800000, guid: e423173afdece4d3fa49ed8e89391fce, type: 3} + m_FontSize: 14 m_FontStyle: 0 m_BestFit: 1 m_MinSize: 10 m_MaxSize: 40 - m_Alignment: 4 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Make sure that you add example scenes to build settings! ---- !u!222 &309713874 + m_Text: multiuser +--- !u!222 &2008717911 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 309713870} ---- !u!1 &740851131 + m_GameObject: {fileID: 2008717907} +--- !u!1 &2032927210 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} - - 114: {fileID: 740851133} + - component: {fileID: 2032927211} + - component: {fileID: 2032927214} + - component: {fileID: 2032927213} + - component: {fileID: 2032927212} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -318,30 +6078,32 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &740851132 +--- !u!224 &2032927211 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 2032927210} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 1412835668} + - {fileID: 666412329} + - {fileID: 37557109} m_Father: {fileID: 1654745587} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!114 &740851133 +--- !u!114 &2032927212 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 2032927210} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -352,12 +6114,12 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 ---- !u!114 &740851134 +--- !u!114 &2032927213 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 2032927210} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -373,14 +6135,14 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 ---- !u!223 &740851135 +--- !u!223 &2032927214 Canvas: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 2032927210} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -388,158 +6150,143 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 - m_SortingOrder: 9001 ---- !u!1 &1402896513 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &2073758706 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1402896514} - - 223: {fileID: 1402896517} - - 114: {fileID: 1402896516} + - component: {fileID: 2073758707} + - component: {fileID: 2073758709} + - component: {fileID: 2073758708} m_Layer: 5 - m_Name: Canvas + m_Name: Image m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1402896514 +--- !u!224 &2073758707 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1402896513} + m_GameObject: {fileID: 2073758706} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 309713871} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &1402896516 + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 601448587} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2073758708 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1402896513} + m_GameObject: {fileID: 2073758706} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &1402896517 -Canvas: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 63efac244c09b40f093989ca7d903d38, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &2073758709 +CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1402896513} - m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!1 &1412835664 + m_GameObject: {fileID: 2073758706} +--- !u!1 &2076713666 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1412835668} - - 222: {fileID: 1412835667} - - 114: {fileID: 1412835666} - - 114: {fileID: 1412835665} - - 114: {fileID: 1412835669} + - component: {fileID: 2076713667} + - component: {fileID: 2076713670} + - component: {fileID: 2076713669} + - component: {fileID: 2076713668} m_Layer: 5 - m_Name: Button + m_Name: Photos m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1412835665 +--- !u!224 &2076713667 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2076713666} + 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: 801696179} + - {fileID: 1168732683} + - {fileID: 1361172027} + - {fileID: 558528359} + m_Father: {fileID: 2098255038} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2076713668 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1412835664} + m_GameObject: {fileID: 2076713666} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .654411793, g: .985699773, b: 1, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} - m_ColorMultiplier: 1 - m_FadeDuration: .100000001 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1412835666} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 1654745588} - m_MethodName: LoadNextLevel - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &1412835666 + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 80 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &2076713669 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1412835664} + m_GameObject: {fileID: 2076713666} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -553,182 +6300,151 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: c9526d00e23c94f788b5b0e8833d5941, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: b8fce26041bc947319fee43a8ec9bb5d, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!222 &1412835667 +--- !u!222 &2076713670 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1412835664} ---- !u!224 &1412835668 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1412835664} - 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: 1487808224} - m_Father: {fileID: 740851132} - m_RootOrder: 0 - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -4, y: 4} - m_SizeDelta: {x: 120, y: 40} - m_Pivot: {x: 1, y: 0} ---- !u!114 &1412835669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1412835664} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] ---- !u!1 &1487808223 + m_GameObject: {fileID: 2076713666} +--- !u!1 &2088901648 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1487808224} - - 222: {fileID: 1487808226} - - 114: {fileID: 1487808225} + - component: {fileID: 2088901649} + - component: {fileID: 2088901651} + - component: {fileID: 2088901650} m_Layer: 5 - m_Name: Text + m_Name: Image m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1487808224 +--- !u!224 &2088901649 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487808223} + m_GameObject: {fileID: 2088901648} 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: 1412835668} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1487808225 + m_Father: {fileID: 621592926} + m_RootOrder: 3 + 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: -86.3, y: 3.8} + m_SizeDelta: {x: 46, y: 54} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2088901650 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487808223} + m_GameObject: {fileID: 2088901648} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 12 - m_FontStyle: 1 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: NEXT EXAMPLE ---- !u!222 &1487808226 + m_Sprite: {fileID: 21300000, guid: 8ba5d3ffe53b94eb9b457550d9d0c8d8, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &2088901651 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487808223} ---- !u!1 &1654745586 + m_GameObject: {fileID: 2088901648} +--- !u!1 &2098255037 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1654745587} - - 114: {fileID: 1654745588} - - 114: {fileID: 1654745589} - m_Layer: 0 - m_Name: Examples + - component: {fileID: 2098255038} + - component: {fileID: 2098255039} + m_Layer: 5 + m_Name: Content m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1654745587 -Transform: +--- !u!224 &2098255038 +RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1654745586} + m_GameObject: {fileID: 2098255037} 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: 174295523} - - {fileID: 740851132} - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!114 &1654745588 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1654745586} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5d0145ec13410624f9b2939e5d5a99be, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1654745589 + - {fileID: 601448587} + - {fileID: 574950114} + - {fileID: 870787322} + - {fileID: 2076713667} + - {fileID: 758236082} + - {fileID: 321008078} + - {fileID: 1037999862} + - {fileID: 621592926} + - {fileID: 1004776690} + - {fileID: 1920151151} + m_Father: {fileID: 606054179} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 815} + m_Pivot: {x: 0, y: 1} +--- !u!114 &2098255039 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1654745586} + m_GameObject: {fileID: 2098255037} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 26a72f9b3b6704180978dbce08cf231e, type: 3} + m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - Name: UI Layer + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 2 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 diff --git a/Source/Assets/TouchScript/Examples/Examples.unity.meta b/Source/Assets/TouchScript/Examples/Examples.unity.meta index 130d3c1ca..806ba1109 100644 --- a/Source/Assets/TouchScript/Examples/Examples.unity.meta +++ b/Source/Assets/TouchScript/Examples/Examples.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 7cba6bf72365a4167930fec2f6f39b74 DefaultImporter: - userData: + userData: "0" diff --git a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity index b17cd18a8..a208c35ad 100644 --- a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity +++ b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 6 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -40,7 +40,7 @@ RenderSettings: --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 6 m_GIWorkflowMode: 1 m_LightmapsMode: 1 m_GISettings: @@ -66,7 +66,7 @@ LightmapSettings: m_FinalGather: 0 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -74,15 +74,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!4 &67866218 stripped @@ -437,8 +437,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 269580355} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -.101000004, z: 0} - m_LocalScale: {x: 10, y: .200000003, z: 10} + m_LocalPosition: {x: 0, y: -0.101, z: 0} + m_LocalScale: {x: 10, y: 0.2, z: 10} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1164346782} m_RootOrder: 0 @@ -451,7 +452,7 @@ Rigidbody: serializedVersion: 2 m_Mass: 1 m_Drag: 0 - m_AngularDrag: .0500000007 + m_AngularDrag: 0.05 m_UseGravity: 0 m_IsKinematic: 1 m_Interpolate: 0 @@ -469,7 +470,7 @@ BoxCollider: m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: .00999999978, z: 0} + m_Center: {x: 0, y: 0.01, z: 0} --- !u!23 &269580359 MeshRenderer: m_ObjectHideFlags: 0 @@ -489,8 +490,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -534,14 +537,15 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1622510500} m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &437243917 MonoBehaviour: m_ObjectHideFlags: 0 @@ -583,6 +587,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -624,6 +629,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1360329865} - {fileID: 878382147} @@ -670,8 +676,10 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!4 &494059473 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -702,8 +710,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 501236164} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.20000005, y: -22.1000004, z: 0} + m_LocalPosition: {x: -1.2, y: -22.1, z: 0} m_LocalScale: {x: 3, y: 3, z: 3} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 2096873804} m_RootOrder: 0 @@ -719,16 +728,30 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTap: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null numberOfTapsRequired: 1 timeLimit: Infinity distanceLimit: Infinity @@ -752,6 +775,7 @@ BoxCollider2D: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 501236164} m_Enabled: 1 + m_Density: 1 m_Material: {fileID: 0} m_IsTrigger: 0 m_UsedByEffector: 0 @@ -777,14 +801,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!1 &519196852 GameObject: m_ObjectHideFlags: 0 @@ -811,8 +839,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 519196852} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -.101000004, z: 0} - m_LocalScale: {x: 10, y: .200000003, z: 10} + m_LocalPosition: {x: 0, y: -0.101, z: 0} + m_LocalScale: {x: 10, y: 0.2, z: 10} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1388179442} m_RootOrder: 0 @@ -825,7 +854,7 @@ Rigidbody: serializedVersion: 2 m_Mass: 1 m_Drag: 0 - m_AngularDrag: .0500000007 + m_AngularDrag: 0.05 m_UseGravity: 0 m_IsKinematic: 1 m_Interpolate: 0 @@ -843,7 +872,7 @@ BoxCollider: m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: .00999999978, z: 0} + m_Center: {x: 0, y: 0.01, z: 0} --- !u!23 &519196856 MeshRenderer: m_ObjectHideFlags: 0 @@ -863,8 +892,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -903,8 +934,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 529543778} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6.5999999, y: -22.1000004, z: 0} + m_LocalPosition: {x: 6.6, y: -22.1, z: 0} m_LocalScale: {x: 3, y: 3, z: 3} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 2096873804} m_RootOrder: 2 @@ -920,16 +952,30 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTap: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null numberOfTapsRequired: 1 timeLimit: Infinity distanceLimit: Infinity @@ -953,6 +999,7 @@ BoxCollider2D: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 529543778} m_Enabled: 1 + m_Density: 1 m_Material: {fileID: 0} m_IsTrigger: 0 m_UsedByEffector: 0 @@ -978,14 +1025,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!1001 &543251036 Prefab: m_ObjectHideFlags: 0 @@ -1052,38 +1103,6 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &543251037 stripped -GameObject: - m_PrefabParentObject: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - m_PrefabInternal: {fileID: 543251036} ---- !u!114 &543251038 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 543251037} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - TouchTags: - tagList: - - Touch - MouseTags: - tagList: - - Mouse - PenTags: - tagList: - - Pen - Windows8Touch: 0 - Windows7Touch: 0 - WebPlayerTouch: 1 - WebGLTouch: 1 - Windows8Mouse: 1 - Windows7Mouse: 1 - UniversalWindowsMouse: 1 --- !u!1001 &583512110 Prefab: m_ObjectHideFlags: 0 @@ -1242,6 +1261,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1969944223} - {fileID: 871116140} @@ -1336,9 +1356,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 723351972} - m_LocalRotation: {x: 0, y: .347671896, z: 0, w: -.937616289} + m_LocalRotation: {x: 0, y: 0.3476719, z: 0, w: -0.9376163} m_LocalPosition: {x: 100, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1388179442} m_Father: {fileID: 655915741} @@ -1354,6 +1375,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &723351976 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1365,19 +1392,44 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!4 &739470077 stripped @@ -1408,6 +1460,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1828860094} - {fileID: 2014918824} @@ -1466,6 +1519,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 @@ -1590,11 +1644,11 @@ Camera: m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} m_NormalizedViewPortRect: serializedVersion: 2 - x: .5 + x: 0.5 y: 0 - width: .5 + width: 0.5 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -1610,7 +1664,7 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!4 &871116140 Transform: @@ -1618,9 +1672,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 871116138} - m_LocalRotation: {x: -.426461279, y: .452098191, z: -.261019111, w: -.738652229} - m_LocalPosition: {x: 104.459999, y: 9.65999985, z: -2.17000008} + m_LocalRotation: {x: -0.42646128, y: 0.4520982, z: -0.2610191, w: -0.7386522} + m_LocalPosition: {x: 104.46, y: 9.66, z: -2.17} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 60, y: -62.9381, z: 0} m_Children: [] m_Father: {fileID: 655915741} m_RootOrder: 1 @@ -1632,13 +1687,20 @@ MonoBehaviour: m_GameObject: {fileID: 871116138} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Right 3D Camera + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!4 &872399230 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -1670,6 +1732,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 479835906} m_RootOrder: 1 @@ -1677,7 +1740,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -152, y: -74} m_SizeDelta: {x: 276, y: 128} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &878382148 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1719,6 +1782,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 2 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1756,6 +1820,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1495978976} - {fileID: 1863190594} @@ -1765,7 +1830,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &897580454 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1940,8 +2005,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1060318960} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -9, y: -22.1000004, z: 0} + m_LocalPosition: {x: -9, y: -22.1, z: 0} m_LocalScale: {x: 3, y: 3, z: 3} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 2096873804} m_RootOrder: 1 @@ -1957,16 +2023,30 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTap: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null numberOfTapsRequired: 1 timeLimit: Infinity distanceLimit: Infinity @@ -1990,6 +2070,7 @@ BoxCollider2D: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1060318960} m_Enabled: 1 + m_Density: 1 m_Material: {fileID: 0} m_IsTrigger: 0 m_UsedByEffector: 0 @@ -2015,14 +2096,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!1001 &1140734431 Prefab: m_ObjectHideFlags: 0 @@ -2091,8 +2176,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1164346781} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: .100000001} + m_LocalPosition: {x: 0, y: 0, z: 0.1} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 269580356} - {fileID: 750573663} @@ -2110,18 +2196,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 2 - screenTransformThreshold: .0500000007 + screenTransformThreshold: 0.05 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1164346784 @@ -2155,8 +2266,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -2361,6 +2474,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 151770227} - {fileID: 96602513} @@ -2448,6 +2562,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1622510500} m_RootOrder: 0 @@ -2455,7 +2570,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1266638326 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2521,15 +2636,16 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1735991412} m_Father: {fileID: 479835906} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1388179441 GameObject: m_ObjectHideFlags: 0 @@ -2556,8 +2672,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1388179441} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: .100000001} + m_LocalPosition: {x: 0, y: 0, z: 0.1} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 519196853} - {fileID: 1212863163} @@ -2575,18 +2692,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 2 - screenTransformThreshold: .0500000007 + screenTransformThreshold: 0.05 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1388179444 @@ -2620,8 +2762,10 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 @@ -2703,8 +2847,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1416507462} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -51.8510284} + m_LocalPosition: {x: 0, y: 0, z: -51.85103} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 655915741} m_RootOrder: 2 @@ -2738,14 +2883,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 3 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -2761,7 +2906,7 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!114 &1416507468 MonoBehaviour: @@ -2771,14 +2916,20 @@ MonoBehaviour: m_GameObject: {fileID: 1416507462} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2c791a2415314ea3b9f44592097a9d1, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: 2D Camera + advancedProps: 0 + hitProps: 0 + hit3DObjects: 0 + hit2DObjects: 1 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 - layerIds: 00000000 + useHitFilters: 0 --- !u!4 &1442124646 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -2813,6 +2964,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 897580453} m_RootOrder: 0 @@ -2820,7 +2972,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1495978977 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2975,6 +3127,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1266638325} - {fileID: 437243916} @@ -2984,7 +3137,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1622510501 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3102,6 +3255,7 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 897580453} - {fileID: 1622510500} @@ -3111,7 +3265,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!4 &1749205319 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -3194,9 +3348,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1810922939} - m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381661, w: .875426114} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.10938166, w: 0.8754261} m_LocalPosition: {x: 0, y: 2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 655915741} m_RootOrder: 6 @@ -3217,9 +3372,10 @@ Light: m_Shadows: m_Type: 0 m_Resolution: 3 - m_Strength: .109999999 - m_Bias: .0500000007 - m_NormalBias: .400000006 + m_Strength: 0.11 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -3263,14 +3419,15 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 897580453} m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1863190595 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3312,6 +3469,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -3430,9 +3588,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1969944222} - m_LocalRotation: {x: .493134707, y: .143018648, z: -.0825718939, w: .85413456} - m_LocalPosition: {x: -101.980003, y: 10.0500002, z: -4.73999977} + m_LocalRotation: {x: 0.4931347, y: 0.14301865, z: -0.082571894, w: 0.85413456} + m_LocalPosition: {x: -101.98, y: 10.05, z: -4.74} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 60, y: 19.0112, z: 0} m_Children: [] m_Father: {fileID: 655915741} m_RootOrder: 0 @@ -3450,9 +3609,9 @@ Camera: serializedVersion: 2 x: 0 y: 0 - width: .5 + width: 0.5 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -3468,7 +3627,7 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!114 &1969944225 MonoBehaviour: @@ -3478,13 +3637,20 @@ MonoBehaviour: m_GameObject: {fileID: 1969944222} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Left 3D Camera + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!4 &2014918824 stripped Transform: m_PrefabParentObject: {fileID: 491238, guid: bb0a05fd2c374477cba1d93212b4600c, type: 2} @@ -3516,6 +3682,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -100, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1164346782} m_Father: {fileID: 655915741} @@ -3545,6 +3712,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &2041906759 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3556,19 +3729,44 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!1001 &2057195942 @@ -3637,6 +3835,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 501236165} - {fileID: 1060318961} diff --git a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity.meta b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity.meta index 77bd0faba..ec0b25d69 100644 --- a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity.meta +++ b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 3b34d0a4b336446dd98f5f9951fe6480 DefaultImporter: - userData: + userData: "9" diff --git a/Source/Assets/TouchScript/Examples/Multiuser/Scripts/Logo.cs b/Source/Assets/TouchScript/Examples/Multiuser/Scripts/Logo.cs index 34ccd9468..a7ec42026 100644 --- a/Source/Assets/TouchScript/Examples/Multiuser/Scripts/Logo.cs +++ b/Source/Assets/TouchScript/Examples/Multiuser/Scripts/Logo.cs @@ -9,10 +9,10 @@ namespace TouchScript.Examples.Multiuser { + /// public class Logo : MonoBehaviour { - private static Color[] COLORS = new[] - {Color.yellow, Color.red, Color.magenta, Color.green, Color.cyan, Color.blue}; + private static Color[] COLORS = new[] {Color.yellow, Color.red, Color.magenta, Color.green, Color.cyan, Color.blue}; private void OnEnable() { diff --git a/Source/Assets/TouchScript/Examples/Photos/Photos.unity b/Source/Assets/TouchScript/Examples/Photos/Photos.unity index fb17ffe9a..98d433d84 100644 --- a/Source/Assets/TouchScript/Examples/Photos/Photos.unity +++ b/Source/Assets/TouchScript/Examples/Photos/Photos.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,48 +54,70 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &44638783 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 44638786} - - 222: {fileID: 44638785} - - 114: {fileID: 44638784} + - component: {fileID: 44638786} + - component: {fileID: 44638785} + - component: {fileID: 44638784} m_Layer: 0 m_Name: Image m_TagString: Untagged @@ -115,7 +138,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -147,24 +170,25 @@ RectTransform: m_Children: [] m_Father: {fileID: 94606778} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -178,12 +202,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: -.262086809, y: .366962194, z: -.108559854, w: -.885925531} - m_LocalPosition: {x: 5.55999994, y: 4.82000017, z: -5.46000004} + m_LocalRotation: {x: -0.2620868, y: 0.3669622, z: -0.108559854, w: -0.88592553} + m_LocalPosition: {x: 5.56, y: 4.82, z: -5.46} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 32.96, y: -45, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -192,13 +217,21 @@ MonoBehaviour: m_GameObject: {fileID: 62216951} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Main Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 0 + hit2DObjects: 0 + hitWorldSpaceUI: 1 + hitScreenSpaceUI: 1 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -229,14 +262,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -250,22 +283,23 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!1 &94606777 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 94606778} - - 222: {fileID: 94606781} - - 114: {fileID: 94606780} - - 114: {fileID: 94606779} - - 114: {fileID: 94606782} + - component: {fileID: 94606778} + - component: {fileID: 94606781} + - component: {fileID: 94606780} + - component: {fileID: 94606779} m_Layer: 0 m_Name: Add Button m_TagString: Untagged @@ -287,11 +321,12 @@ RectTransform: - {fileID: 44638786} m_Father: {fileID: 1301221420} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .602483392, y: .314181447} + m_AnchorMax: {x: 0.6024834, y: 0.31418145} m_AnchoredPosition: {x: 7, y: 4.5} m_SizeDelta: {x: -19, y: -20} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &94606779 MonoBehaviour: m_ObjectHideFlags: 0 @@ -304,7 +339,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -312,11 +347,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: 0, g: 1, b: .00689649582, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0, g: 1, b: 1, a: 1} + m_PressedColor: {r: 0, g: 1, b: 0.006896496, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -377,37 +412,16 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 94606777} ---- !u!114 &94606782 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 94606777} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] --- !u!1 &101996206 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 101996207} - - 222: {fileID: 101996209} - - 114: {fileID: 101996208} + - component: {fileID: 101996207} + - component: {fileID: 101996209} + - component: {fileID: 101996208} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -427,11 +441,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 2107589903} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .800000012} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.8} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &101996208 MonoBehaviour: m_ObjectHideFlags: 0 @@ -445,7 +460,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -470,11 +485,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 107321542} - - 222: {fileID: 107321544} - - 114: {fileID: 107321543} + - component: {fileID: 107321542} + - component: {fileID: 107321544} + - component: {fileID: 107321543} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -494,11 +509,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 411870819} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &107321543 MonoBehaviour: m_ObjectHideFlags: 0 @@ -512,7 +528,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -537,11 +553,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 142216716} - - 222: {fileID: 142216718} - - 114: {fileID: 142216717} + - component: {fileID: 142216716} + - component: {fileID: 142216718} + - component: {fileID: 142216717} m_Layer: 0 m_Name: Text m_TagString: Untagged @@ -561,11 +577,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1932435999} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 74, y: -57} - m_SizeDelta: {x: -312.761932, y: 153.959473} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: -312.76193, y: 153.95947} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &142216717 MonoBehaviour: m_ObjectHideFlags: 0 @@ -579,7 +596,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -593,6 +610,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 80 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -609,12 +627,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 187227222} - - 222: {fileID: 187227225} - - 114: {fileID: 187227224} - - 114: {fileID: 187227223} + - component: {fileID: 187227222} + - component: {fileID: 187227225} + - component: {fileID: 187227224} + - component: {fileID: 187227223} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -638,11 +656,12 @@ RectTransform: - {fileID: 701351979} m_Father: {fileID: 2107589903} m_RootOrder: 1 - m_AnchorMin: {x: .5, y: .800000012} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.8} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: .5} + m_AnchoredPosition: {x: 0, y: 0.5} m_SizeDelta: {x: 0, y: -1} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &187227223 MonoBehaviour: m_ObjectHideFlags: 0 @@ -663,6 +682,8 @@ MonoBehaviour: m_Spacing: 4 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!114 &187227224 MonoBehaviour: m_ObjectHideFlags: 0 @@ -675,8 +696,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: .39199999} - m_RaycastTarget: 1 + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -701,12 +722,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 204253028} - - 223: {fileID: 204253031} - - 114: {fileID: 204253030} - - 114: {fileID: 204253029} + - component: {fileID: 204253028} + - component: {fileID: 204253031} + - component: {fileID: 204253030} + - component: {fileID: 204253029} m_Layer: 0 m_Name: Camera Canvas m_TagString: Untagged @@ -727,6 +748,7 @@ RectTransform: - {fileID: 1236964526} m_Father: {fileID: 930800601} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -776,7 +798,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 204253027} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 1 m_Camera: {fileID: 62216957} m_PlaneDistance: 3 @@ -784,17 +806,20 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 1 + m_TargetDisplay: 0 --- !u!1 &231102984 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 231102985} - - 114: {fileID: 231102986} + - component: {fileID: 231102985} + - component: {fileID: 231102986} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -817,11 +842,12 @@ RectTransform: - {fileID: 647493035} m_Father: {fileID: 660229293} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &231102986 MonoBehaviour: m_ObjectHideFlags: 0 @@ -842,20 +868,22 @@ MonoBehaviour: m_Spacing: -10 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!1 &238072896 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 238072899} - - 222: {fileID: 238072898} - - 114: {fileID: 238072897} - - 114: {fileID: 238072905} - - 114: {fileID: 238072901} - - 114: {fileID: 238072900} - - 114: {fileID: 238072902} + - component: {fileID: 238072899} + - component: {fileID: 238072898} + - component: {fileID: 238072897} + - component: {fileID: 238072905} + - component: {fileID: 238072901} + - component: {fileID: 238072900} + - component: {fileID: 238072902} m_Layer: 0 m_Name: Image 1 m_TagString: Untagged @@ -901,7 +929,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 238072896} - m_LocalRotation: {x: 4.13857464e-08, y: 1.03727782e-08, z: .179278508, w: .983798385} + m_LocalRotation: {x: 0.000000041385746, y: 0.000000010372778, z: 0.17927851, w: 0.9837984} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -909,11 +937,12 @@ RectTransform: - {fileID: 994844643} m_Father: {fileID: 1979221409} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} - m_AnchoredPosition: {x: -161, y: 123.999542} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 20.6555} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -161, y: 123.99954} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &238072900 MonoBehaviour: m_ObjectHideFlags: 0 @@ -925,6 +954,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 1 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &238072901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -936,19 +971,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &238072902 @@ -962,16 +1021,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &238072905 MonoBehaviour: @@ -990,11 +1062,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 281947296} - - 222: {fileID: 281947298} - - 114: {fileID: 281947297} + - component: {fileID: 281947296} + - component: {fileID: 281947298} + - component: {fileID: 281947297} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1014,11 +1086,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 647493035} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &281947297 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1057,11 +1130,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 290456373} - - 222: {fileID: 290456375} - - 114: {fileID: 290456374} + - component: {fileID: 290456373} + - component: {fileID: 290456375} + - component: {fileID: 290456374} m_Layer: 0 m_Name: Image m_TagString: Untagged @@ -1076,16 +1149,17 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 290456372} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 25.3999996} + m_LocalPosition: {x: 0, y: 0, z: 25.4} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1236964526} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 3.85500002} - m_SizeDelta: {x: 0, y: 7.71000004} - m_Pivot: {x: .5, y: .5} + m_AnchoredPosition: {x: 0, y: 3.855} + m_SizeDelta: {x: 0, y: 7.71} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &290456374 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1099,7 +1173,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1124,11 +1198,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 327443543} - - 222: {fileID: 327443545} - - 114: {fileID: 327443544} + - component: {fileID: 327443543} + - component: {fileID: 327443545} + - component: {fileID: 327443544} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1148,11 +1222,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1169177132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &327443544 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1191,11 +1266,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 346878481} - - 222: {fileID: 346878483} - - 114: {fileID: 346878482} + - component: {fileID: 346878481} + - component: {fileID: 346878483} + - component: {fileID: 346878482} m_Layer: 0 m_Name: Text m_TagString: Untagged @@ -1215,11 +1290,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 94606778} m_RootOrder: 0 - m_AnchorMin: {x: .085907571, y: .21797578} - m_AnchorMax: {x: .916279554, y: .790476441} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.08590757, y: 0.21797578} + m_AnchorMax: {x: 0.91627955, y: 0.79047644} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &346878482 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1233,7 +1309,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1247,6 +1323,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1258,58 +1335,17 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 346878480} ---- !u!1 &366022211 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 366022213} - - 114: {fileID: 366022212} - m_Layer: 0 - m_Name: TouchScript UI Layer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &366022212 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 366022211} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 26a72f9b3b6704180978dbce08cf231e, type: 3} - m_Name: - m_EditorClassIdentifier: - Name: UI Layer ---- !u!4 &366022213 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 366022211} - 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: 4 --- !u!1 &411870814 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 411870819} - - 222: {fileID: 411870818} - - 114: {fileID: 411870817} - - 114: {fileID: 411870816} - - 114: {fileID: 411870815} + - component: {fileID: 411870819} + - component: {fileID: 411870818} + - component: {fileID: 411870817} + - component: {fileID: 411870816} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -1317,27 +1353,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &411870815 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 411870814} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] --- !u!114 &411870816 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1350,7 +1365,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -1358,11 +1373,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 0, a: 1} m_PressedColor: {r: 1, g: 0, b: 0, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -1437,21 +1452,22 @@ RectTransform: - {fileID: 2077422342} m_Father: {fileID: 187227222} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &418595744 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 418595745} - - 223: {fileID: 418595748} - - 114: {fileID: 418595747} + - component: {fileID: 418595745} + - component: {fileID: 418595748} + - component: {fileID: 418595747} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -1472,7 +1488,8 @@ RectTransform: - {fileID: 660229293} - {fileID: 1414219394} m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -1506,7 +1523,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 418595744} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -1514,22 +1531,25 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &449324826 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 449324827} - - 222: {fileID: 449324833} - - 114: {fileID: 449324832} - - 114: {fileID: 449324828} - - 114: {fileID: 449324831} - - 114: {fileID: 449324830} - - 114: {fileID: 449324829} + - component: {fileID: 449324827} + - component: {fileID: 449324833} + - component: {fileID: 449324832} + - component: {fileID: 449324828} + - component: {fileID: 449324831} + - component: {fileID: 449324830} + - component: {fileID: 449324829} m_Layer: 0 m_Name: Image 6 m_TagString: Untagged @@ -1543,7 +1563,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 449324826} - m_LocalRotation: {x: 0, y: 0, z: .248051241, w: .96874696} + m_LocalRotation: {x: 0, y: 0, z: 0.24805124, w: 0.96874696} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -1551,11 +1571,12 @@ RectTransform: - {fileID: 1402680836} m_Father: {fileID: 1979221409} m_RootOrder: 5 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + 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: 250, y: 69} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &449324828 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1579,16 +1600,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &449324830 MonoBehaviour: @@ -1601,6 +1635,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &449324831 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1612,19 +1652,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &449324832 @@ -1664,11 +1728,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 494057711} - - 222: {fileID: 494057713} - - 114: {fileID: 494057712} + - component: {fileID: 494057711} + - component: {fileID: 494057713} + - component: {fileID: 494057712} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1688,11 +1752,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 620448983} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &494057712 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1731,15 +1796,15 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 536919388} - - 222: {fileID: 536919394} - - 114: {fileID: 536919393} - - 114: {fileID: 536919389} - - 114: {fileID: 536919392} - - 114: {fileID: 536919391} - - 114: {fileID: 536919390} + - component: {fileID: 536919388} + - component: {fileID: 536919394} + - component: {fileID: 536919393} + - component: {fileID: 536919389} + - component: {fileID: 536919392} + - component: {fileID: 536919391} + - component: {fileID: 536919390} m_Layer: 0 m_Name: Image 4 m_TagString: Untagged @@ -1753,7 +1818,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 536919387} - m_LocalRotation: {x: 0, y: 0, z: .248051241, w: .96874696} + m_LocalRotation: {x: 0, y: 0, z: 0.24805124, w: 0.96874696} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -1761,11 +1826,12 @@ RectTransform: - {fileID: 1772489001} m_Father: {fileID: 1979221409} m_RootOrder: 3 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 28.7244} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 223, y: 293} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &536919389 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1789,16 +1855,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &536919391 MonoBehaviour: @@ -1811,6 +1890,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &536919392 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1822,19 +1907,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &536919393 @@ -1878,7 +1987,7 @@ Prefab: m_Modifications: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.size - value: 2 + value: 1 objectReference: {fileID: 0} - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: m_LocalPosition.x @@ -1908,13 +2017,13 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: - objectReference: {fileID: 366022212} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[1] - value: objectReference: {fileID: 62216953} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} @@ -1924,12 +2033,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 551049735} - - 222: {fileID: 551049738} - - 114: {fileID: 551049737} - - 114: {fileID: 551049736} + - component: {fileID: 551049735} + - component: {fileID: 551049738} + - component: {fileID: 551049737} + - component: {fileID: 551049736} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1949,11 +2058,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 647493035} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &551049736 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1995,6 +2105,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -2013,11 +2124,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 581803647} - - 222: {fileID: 581803649} - - 114: {fileID: 581803648} + - component: {fileID: 581803647} + - component: {fileID: 581803649} + - component: {fileID: 581803648} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -2037,11 +2148,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 886654112} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &581803648 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2055,7 +2167,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2080,11 +2192,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 585113474} - - 222: {fileID: 585113476} - - 114: {fileID: 585113475} + - component: {fileID: 585113474} + - component: {fileID: 585113476} + - component: {fileID: 585113475} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -2104,11 +2216,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 701351979} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &585113475 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2122,7 +2235,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2147,10 +2260,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 620448983} - - 114: {fileID: 620448984} + - component: {fileID: 620448983} + - component: {fileID: 620448984} m_Layer: 5 m_Name: Move m_TagString: Untagged @@ -2172,11 +2285,12 @@ RectTransform: - {fileID: 899875349} m_Father: {fileID: 231102985} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &620448984 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2200,11 +2314,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 634725412} - - 222: {fileID: 634725414} - - 114: {fileID: 634725413} + - component: {fileID: 634725412} + - component: {fileID: 634725414} + - component: {fileID: 634725413} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -2224,11 +2338,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1485721903} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &634725413 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2242,7 +2357,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2267,10 +2382,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 647493035} - - 114: {fileID: 647493036} + - component: {fileID: 647493035} + - component: {fileID: 647493036} m_Layer: 5 m_Name: Color m_TagString: Untagged @@ -2292,11 +2407,12 @@ RectTransform: - {fileID: 551049735} m_Father: {fileID: 231102985} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &647493036 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2320,10 +2436,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 651643064} - - 114: {fileID: 651643063} + - component: {fileID: 651643064} + - component: {fileID: 651643063} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -2356,15 +2472,16 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &660229292 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 660229293} + - component: {fileID: 660229293} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -2385,21 +2502,22 @@ RectTransform: - {fileID: 231102985} m_Father: {fileID: 418595745} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &663465964 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 663465965} - - 222: {fileID: 663465967} - - 114: {fileID: 663465966} + - component: {fileID: 663465965} + - component: {fileID: 663465967} + - component: {fileID: 663465966} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -2419,11 +2537,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1979821161} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &663465966 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2437,7 +2556,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2462,11 +2581,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 689392537} - - 222: {fileID: 689392539} - - 114: {fileID: 689392538} + - component: {fileID: 689392537} + - component: {fileID: 689392539} + - component: {fileID: 689392538} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -2486,11 +2605,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1406281477} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &689392538 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2504,7 +2624,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 1, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2529,13 +2649,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 701351979} - - 222: {fileID: 701351983} - - 114: {fileID: 701351982} - - 114: {fileID: 701351981} - - 114: {fileID: 701351980} + - component: {fileID: 701351979} + - component: {fileID: 701351983} + - component: {fileID: 701351982} + - component: {fileID: 701351981} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -2557,32 +2676,12 @@ RectTransform: - {fileID: 1615394527} m_Father: {fileID: 187227222} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!114 &701351980 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 701351978} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &701351981 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2595,7 +2694,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -2603,11 +2702,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 0, a: 1} m_PressedColor: {r: 0, g: 1, b: 1, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -2673,15 +2772,15 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 886654112} - - 222: {fileID: 886654118} - - 114: {fileID: 886654117} - - 114: {fileID: 886654120} - - 114: {fileID: 886654115} - - 114: {fileID: 886654114} - - 114: {fileID: 886654113} + - component: {fileID: 886654112} + - component: {fileID: 886654118} + - component: {fileID: 886654117} + - component: {fileID: 886654120} + - component: {fileID: 886654115} + - component: {fileID: 886654114} + - component: {fileID: 886654113} m_Layer: 0 m_Name: Image 2 m_TagString: Untagged @@ -2695,7 +2794,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 886654111} - m_LocalRotation: {x: 3.98202182e-08, y: 6.83678891e-09, z: .248051226, w: .96874696} + m_LocalRotation: {x: 0.00000003982022, y: 0.000000006836789, z: 0.24805123, w: 0.96874696} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -2703,11 +2802,12 @@ RectTransform: - {fileID: 1423800608} m_Father: {fileID: 1979221409} m_RootOrder: 1 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} - m_AnchoredPosition: {x: 218, y: -143.998871} + 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: 218, y: -143.99887} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &886654113 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2719,16 +2819,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &886654114 MonoBehaviour: @@ -2741,6 +2854,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 1 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &886654115 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2752,19 +2871,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &886654117 @@ -2816,13 +2959,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 894414302} - - 20: {fileID: 894414306} - - 124: {fileID: 894414305} - - 92: {fileID: 894414304} - - 81: {fileID: 894414303} + - component: {fileID: 894414302} + - component: {fileID: 894414306} m_Layer: 0 m_Name: Camera m_TagString: Untagged @@ -2836,33 +2976,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 894414301} - m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709} - m_LocalPosition: {x: 0, y: 9.31999969, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0, y: 9.32, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1292123036} m_RootOrder: 1 ---- !u!81 &894414303 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 894414301} - m_Enabled: 0 ---- !u!92 &894414304 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 894414301} - m_Enabled: 0 ---- !u!124 &894414305 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 894414301} - m_Enabled: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!20 &894414306 Camera: m_ObjectHideFlags: 0 @@ -2872,14 +2992,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 0 @@ -2893,21 +3013,23 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!1 &899875348 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 899875349} - - 222: {fileID: 899875352} - - 114: {fileID: 899875351} - - 114: {fileID: 899875350} + - component: {fileID: 899875349} + - component: {fileID: 899875352} + - component: {fileID: 899875351} + - component: {fileID: 899875350} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -2927,11 +3049,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 620448983} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &899875350 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2973,6 +3096,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -2989,9 +3113,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} + - component: {fileID: 930800601} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -3016,16 +3140,17 @@ Transform: - {fileID: 2107589903} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &982847339 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 982847340} - - 222: {fileID: 982847342} - - 114: {fileID: 982847341} + - component: {fileID: 982847340} + - component: {fileID: 982847342} + - component: {fileID: 982847341} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -3045,11 +3170,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1101956163} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &982847341 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3063,7 +3189,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 0, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3088,13 +3214,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 994844643} - - 222: {fileID: 994844647} - - 114: {fileID: 994844646} - - 114: {fileID: 994844645} - - 114: {fileID: 994844644} + - component: {fileID: 994844643} + - component: {fileID: 994844647} + - component: {fileID: 994844646} + - component: {fileID: 994844645} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -3114,32 +3239,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 238072899} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &994844644 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 994844642} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &994844645 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3152,7 +3257,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -3160,11 +3265,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6691177, b: 0.6691177, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -3230,11 +3335,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1027187498} - - 222: {fileID: 1027187500} - - 114: {fileID: 1027187499} + - component: {fileID: 1027187498} + - component: {fileID: 1027187500} + - component: {fileID: 1027187499} m_Layer: 0 m_Name: Text m_TagString: Untagged @@ -3249,16 +3354,17 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1027187497} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 2.77790004e-05} + m_LocalPosition: {x: 0, y: 0, z: 0.000027779} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1236964526} m_RootOrder: 0 - m_AnchorMin: {x: .309000015, y: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.30900002, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -.134020001, y: -21.1000004} - m_SizeDelta: {x: -.267960012, y: 29.7999992} - m_Pivot: {x: .5, y: .5} + m_AnchoredPosition: {x: -0.13401794, y: -21.09999} + m_SizeDelta: {x: -0.26796, y: 29.8} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1027187499 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3272,7 +3378,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3286,6 +3392,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 100 m_Alignment: 2 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -3302,11 +3409,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1056464759} - - 222: {fileID: 1056464761} - - 114: {fileID: 1056464760} + - component: {fileID: 1056464759} + - component: {fileID: 1056464761} + - component: {fileID: 1056464760} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -3326,11 +3433,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 2107589903} m_RootOrder: 2 - m_AnchorMin: {x: .69750005, y: .69600004} - m_AnchorMax: {x: 1, y: .800000012} - m_AnchoredPosition: {x: 1.10000002, y: -6} - m_SizeDelta: {x: -30.2000008, y: -12} - m_Pivot: {x: .5, y: .5} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.69750005, y: 0.69600004} + m_AnchorMax: {x: 1, y: 0.8} + m_AnchoredPosition: {x: 1.1000061, y: -6} + m_SizeDelta: {x: -30.2, y: -12} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1056464760 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3344,7 +3452,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3358,6 +3466,7 @@ MonoBehaviour: m_MinSize: 5 m_MaxSize: 40 m_Alignment: 2 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -3374,11 +3483,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1065855870} - - 222: {fileID: 1065855872} - - 114: {fileID: 1065855871} + - component: {fileID: 1065855870} + - component: {fileID: 1065855872} + - component: {fileID: 1065855871} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -3398,11 +3507,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 536919388} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1065855871 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3416,7 +3526,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3441,13 +3551,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1101956163} - - 222: {fileID: 1101956167} - - 114: {fileID: 1101956166} - - 114: {fileID: 1101956165} - - 114: {fileID: 1101956164} + - component: {fileID: 1101956163} + - component: {fileID: 1101956167} + - component: {fileID: 1101956166} + - component: {fileID: 1101956165} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -3469,32 +3578,12 @@ RectTransform: - {fileID: 1820795547} m_Father: {fileID: 187227222} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1101956164 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1101956162} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1101956165 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3507,7 +3596,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -3515,11 +3604,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 0, a: 1} m_PressedColor: {r: 1, g: 0, b: 1, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -3585,10 +3674,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1169177132} - - 114: {fileID: 1169177133} + - component: {fileID: 1169177132} + - component: {fileID: 1169177133} m_Layer: 5 m_Name: Add m_TagString: Untagged @@ -3610,11 +3699,12 @@ RectTransform: - {fileID: 1430826382} m_Father: {fileID: 231102985} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1169177133 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3638,11 +3728,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1236964526} - - 222: {fileID: 1236964528} - - 114: {fileID: 1236964527} + - component: {fileID: 1236964526} + - component: {fileID: 1236964528} + - component: {fileID: 1236964527} m_Layer: 0 m_Name: Panel m_TagString: Untagged @@ -3656,9 +3746,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1236964525} - m_LocalRotation: {x: .0402504168, y: .380253881, z: -.00021144397, w: .924005926} + m_LocalRotation: {x: 0.040250417, y: 0.38025388, z: -0.00021144397, w: 0.9240059} m_LocalPosition: {x: 0, y: 0, z: -12} - m_LocalScale: {x: .600000024, y: .600000024, z: .600000024} + m_LocalScale: {x: 0.6, y: 0.6, z: 0.6} m_Children: - {fileID: 1027187498} - {fileID: 290456373} @@ -3666,11 +3756,12 @@ RectTransform: - {fileID: 1301221420} m_Father: {fileID: 204253028} m_RootOrder: 0 - m_AnchorMin: {x: .627800941, y: 0} - m_AnchorMax: {x: 1, y: .633322477} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.62780094, y: 0} + m_AnchorMax: {x: 1, y: 0.6333225} m_AnchoredPosition: {x: -8, y: -10} m_SizeDelta: {x: -36, y: -60} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1236964527 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3683,8 +3774,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: .39199999} - m_RaycastTarget: 1 + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3709,11 +3800,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1276931409} - - 222: {fileID: 1276931411} - - 114: {fileID: 1276931410} + - component: {fileID: 1276931409} + - component: {fileID: 1276931411} + - component: {fileID: 1276931410} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -3733,11 +3824,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1406281477} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1276931410 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3751,7 +3843,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3763,8 +3855,9 @@ MonoBehaviour: m_FontStyle: 1 m_BestFit: 1 m_MinSize: 10 - m_MaxSize: 20 + m_MaxSize: 34 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -3781,14 +3874,14 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1292123036} - - 33: {fileID: 1292123039} - - 64: {fileID: 1292123038} - - 23: {fileID: 1292123037} + - component: {fileID: 1292123036} + - component: {fileID: 1292123039} + - component: {fileID: 1292123038} + - component: {fileID: 1292123037} m_Layer: 0 - m_Name: Plane + m_Name: World Space Plane m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3808,6 +3901,7 @@ Transform: - {fileID: 894414302} m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1292123037 MeshRenderer: m_ObjectHideFlags: 0 @@ -3817,20 +3911,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!64 &1292123038 MeshCollider: @@ -3843,6 +3945,8 @@ MeshCollider: m_Enabled: 1 serializedVersion: 2 m_Convex: 0 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &1292123039 MeshFilter: @@ -3856,11 +3960,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1301221420} - - 222: {fileID: 1301221422} - - 114: {fileID: 1301221421} + - component: {fileID: 1301221420} + - component: {fileID: 1301221422} + - component: {fileID: 1301221421} m_Layer: 0 m_Name: Panel m_TagString: Untagged @@ -3875,17 +3979,18 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1301221419} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 7.11931079e-06} + m_LocalPosition: {x: 0, y: 0, z: 0.000007119311} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 94606778} m_Father: {fileID: 1236964526} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1301221421 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3899,7 +4004,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3924,13 +4029,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1402680836} - - 222: {fileID: 1402680840} - - 114: {fileID: 1402680839} - - 114: {fileID: 1402680838} - - 114: {fileID: 1402680837} + - component: {fileID: 1402680836} + - component: {fileID: 1402680840} + - component: {fileID: 1402680839} + - component: {fileID: 1402680838} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -3944,38 +4048,18 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1402680835} - m_LocalRotation: {x: 6.63101673e-07, y: -1.49011612e-07, z: -.0703569278, w: .997521877} + m_LocalRotation: {x: 0.0000006631017, y: -0.00000014901161, z: -0.07035693, w: 0.9975219} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 449324827} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1402680837 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1402680835} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1402680838 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3996,11 +4080,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6666667, b: 0.6666667, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -4066,13 +4150,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1406281477} - - 222: {fileID: 1406281481} - - 114: {fileID: 1406281480} - - 114: {fileID: 1406281479} - - 114: {fileID: 1406281478} + - component: {fileID: 1406281477} + - component: {fileID: 1406281481} + - component: {fileID: 1406281480} + - component: {fileID: 1406281479} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -4094,32 +4177,12 @@ RectTransform: - {fileID: 1276931409} m_Father: {fileID: 187227222} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1406281478 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1406281476} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1406281479 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4132,7 +4195,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -4140,11 +4203,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 0, a: 1} m_PressedColor: {r: 0, g: 1, b: 0, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -4210,12 +4273,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1414219394} - - 222: {fileID: 1414219393} - - 114: {fileID: 1414219392} - - 114: {fileID: 1414219391} + - component: {fileID: 1414219394} + - component: {fileID: 1414219393} + - component: {fileID: 1414219392} + - component: {fileID: 1414219391} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -4264,6 +4327,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -4288,23 +4352,23 @@ RectTransform: m_Children: [] m_Father: {fileID: 418595745} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 156, y: 48.2999992} + m_AnchoredPosition: {x: 156, y: 48.300003} m_SizeDelta: {x: 276, y: 68.5} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1423800607 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1423800608} - - 222: {fileID: 1423800612} - - 114: {fileID: 1423800611} - - 114: {fileID: 1423800610} - - 114: {fileID: 1423800609} + - component: {fileID: 1423800608} + - component: {fileID: 1423800612} + - component: {fileID: 1423800611} + - component: {fileID: 1423800610} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -4318,38 +4382,18 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1423800607} - m_LocalRotation: {x: 6.63101673e-07, y: -1.49011612e-07, z: -.0703569278, w: .997521877} + m_LocalRotation: {x: 0.0000006631017, y: -0.00000014901161, z: -0.07035693, w: 0.9975219} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 886654112} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1423800609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1423800607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1423800610 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4370,11 +4414,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6666667, b: 0.6666667, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -4440,12 +4484,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1430826382} - - 222: {fileID: 1430826385} - - 114: {fileID: 1430826384} - - 114: {fileID: 1430826383} + - component: {fileID: 1430826382} + - component: {fileID: 1430826385} + - component: {fileID: 1430826384} + - component: {fileID: 1430826383} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -4465,11 +4509,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1169177132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1430826383 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4511,6 +4556,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -4529,11 +4575,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1477172502} - - 222: {fileID: 1477172504} - - 114: {fileID: 1477172503} + - component: {fileID: 1477172502} + - component: {fileID: 1477172504} + - component: {fileID: 1477172503} m_Layer: 0 m_Name: RawImage m_TagString: Untagged @@ -4549,15 +4595,16 @@ RectTransform: m_GameObject: {fileID: 1477172501} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1.00000012, z: 1} + m_LocalScale: {x: 1, y: 1.0000001, z: 1} m_Children: [] m_Father: {fileID: 1236964526} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 1.90734863e-05, y: 4.19616699e-05} + m_AnchoredPosition: {x: 0.000019073486, y: 0.00004196167} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1477172503 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4571,7 +4618,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -4595,15 +4642,15 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1485721903} - - 222: {fileID: 1485721909} - - 114: {fileID: 1485721908} - - 114: {fileID: 1485721907} - - 114: {fileID: 1485721906} - - 114: {fileID: 1485721905} - - 114: {fileID: 1485721904} + - component: {fileID: 1485721903} + - component: {fileID: 1485721909} + - component: {fileID: 1485721908} + - component: {fileID: 1485721907} + - component: {fileID: 1485721906} + - component: {fileID: 1485721905} + - component: {fileID: 1485721904} m_Layer: 0 m_Name: Image 5 m_TagString: Untagged @@ -4617,7 +4664,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1485721902} - m_LocalRotation: {x: 0, y: 0, z: .248051241, w: .96874696} + m_LocalRotation: {x: 0, y: 0, z: 0.24805124, w: 0.96874696} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -4625,11 +4672,12 @@ RectTransform: - {fileID: 2041974587} m_Father: {fileID: 1979221409} m_RootOrder: 4 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + 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: 4, y: 14} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1485721904 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4641,16 +4689,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &1485721905 MonoBehaviour: @@ -4663,6 +4724,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &1485721906 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4674,19 +4741,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1485721907 @@ -4738,11 +4829,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1593048785} - - 222: {fileID: 1593048787} - - 114: {fileID: 1593048786} + - component: {fileID: 1593048785} + - component: {fileID: 1593048787} + - component: {fileID: 1593048786} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -4762,11 +4853,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 238072899} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1593048786 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4780,7 +4872,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -4805,11 +4897,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1615394527} - - 222: {fileID: 1615394529} - - 114: {fileID: 1615394528} + - component: {fileID: 1615394527} + - component: {fileID: 1615394529} + - component: {fileID: 1615394528} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -4829,11 +4921,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 701351979} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1615394528 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4847,7 +4940,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -4859,8 +4952,9 @@ MonoBehaviour: m_FontStyle: 1 m_BestFit: 1 m_MinSize: 10 - m_MaxSize: 20 + m_MaxSize: 34 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -4877,11 +4971,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1674922492} - - 222: {fileID: 1674922494} - - 114: {fileID: 1674922493} + - component: {fileID: 1674922492} + - component: {fileID: 1674922494} + - component: {fileID: 1674922493} m_Layer: 0 m_Name: Border m_TagString: Untagged @@ -4901,11 +4995,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 449324827} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1674922493 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4919,7 +5014,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -4954,13 +5049,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1772489001} - - 222: {fileID: 1772489005} - - 114: {fileID: 1772489004} - - 114: {fileID: 1772489003} - - 114: {fileID: 1772489002} + - component: {fileID: 1772489001} + - component: {fileID: 1772489005} + - component: {fileID: 1772489004} + - component: {fileID: 1772489003} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -4974,38 +5068,18 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1772489000} - m_LocalRotation: {x: 6.63101673e-07, y: -1.49011612e-07, z: -.0703569278, w: .997521877} + m_LocalRotation: {x: 0.0000006631017, y: -0.00000014901161, z: -0.07035693, w: 0.9975219} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 536919388} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1772489002 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1772489000} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1772489003 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5026,11 +5100,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6666667, b: 0.6666667, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -5096,11 +5170,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1820795547} - - 222: {fileID: 1820795549} - - 114: {fileID: 1820795548} + - component: {fileID: 1820795547} + - component: {fileID: 1820795549} + - component: {fileID: 1820795548} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -5120,11 +5194,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1101956163} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1820795548 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5138,7 +5213,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5150,8 +5225,9 @@ MonoBehaviour: m_FontStyle: 1 m_BestFit: 1 m_MinSize: 10 - m_MaxSize: 20 + m_MaxSize: 34 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -5168,12 +5244,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1932435999} - - 223: {fileID: 1932436002} - - 114: {fileID: 1932436001} - - 114: {fileID: 1932436000} + - component: {fileID: 1932435999} + - component: {fileID: 1932436002} + - component: {fileID: 1932436001} + - component: {fileID: 1932436000} m_Layer: 0 m_Name: World Space Canvas m_TagString: Untagged @@ -5187,20 +5263,21 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1932435998} - m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: .00999999978, y: .00999999978, z: .00999999978} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} m_Children: - {fileID: 2015117398} - {fileID: 1979221409} - {fileID: 142216716} m_Father: {fileID: 1292123036} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: .0100100003} + m_AnchoredPosition: {x: 0, y: 0.01001} m_SizeDelta: {x: 1000, y: 1000} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1932436000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5245,28 +5322,31 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1932435998} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 - m_Camera: {fileID: 0} + m_Camera: {fileID: 62216957} m_PlaneDistance: 100 m_PixelPerfect: 0 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &1979221408 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1979221409} - - 222: {fileID: 1979221411} - - 114: {fileID: 1979221410} - - 114: {fileID: 1979221412} - - 114: {fileID: 1979221413} + - component: {fileID: 1979221409} + - component: {fileID: 1979221411} + - component: {fileID: 1979221410} + - component: {fileID: 1979221412} + - component: {fileID: 1979221413} m_Layer: 0 m_Name: Field m_TagString: Untagged @@ -5292,11 +5372,12 @@ RectTransform: - {fileID: 449324827} m_Father: {fileID: 1932435999} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -2.68220901e-06} + m_AnchoredPosition: {x: 0, y: -0.000002682209} m_SizeDelta: {x: -40, y: -40} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1979221410 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5310,7 +5391,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5364,15 +5445,15 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1979821161} - - 222: {fileID: 1979821167} - - 114: {fileID: 1979821166} - - 114: {fileID: 1979821165} - - 114: {fileID: 1979821164} - - 114: {fileID: 1979821163} - - 114: {fileID: 1979821162} + - component: {fileID: 1979821161} + - component: {fileID: 1979821167} + - component: {fileID: 1979821166} + - component: {fileID: 1979821165} + - component: {fileID: 1979821164} + - component: {fileID: 1979821163} + - component: {fileID: 1979821162} m_Layer: 0 m_Name: Image 3 m_TagString: Untagged @@ -5386,7 +5467,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1979821160} - m_LocalRotation: {x: 0, y: 0, z: .248051241, w: .96874696} + m_LocalRotation: {x: 0, y: 0, z: 0.24805124, w: 0.96874696} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -5394,11 +5475,12 @@ RectTransform: - {fileID: 2082518918} m_Father: {fileID: 1979221409} m_RootOrder: 2 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + 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: -141, y: -231} m_SizeDelta: {x: 300, y: 300} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1979821162 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5410,16 +5492,29 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 --- !u!114 &1979821163 MonoBehaviour: @@ -5432,6 +5527,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: + enableSmoothing: 1 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.1 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 --- !u!114 &1979821164 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5443,19 +5544,43 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null type: 7 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1979821165 @@ -5507,11 +5632,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2015117398} - - 222: {fileID: 2015117400} - - 114: {fileID: 2015117399} + - component: {fileID: 2015117398} + - component: {fileID: 2015117400} + - component: {fileID: 2015117399} m_Layer: 0 m_Name: Checkerboard m_TagString: Untagged @@ -5531,11 +5656,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1932435999} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -40, y: -40} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2015117399 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5548,8 +5674,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: .0941176489} - m_RaycastTarget: 1 + m_Color: {r: 0, g: 0, b: 0, a: 0.09411765} + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5574,13 +5700,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2041974587} - - 222: {fileID: 2041974591} - - 114: {fileID: 2041974590} - - 114: {fileID: 2041974589} - - 114: {fileID: 2041974588} + - component: {fileID: 2041974587} + - component: {fileID: 2041974591} + - component: {fileID: 2041974590} + - component: {fileID: 2041974589} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -5594,38 +5719,18 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2041974586} - m_LocalRotation: {x: 6.63101673e-07, y: -1.49011612e-07, z: -.0703569278, w: .997521877} + m_LocalRotation: {x: 0.0000006631017, y: -0.00000014901161, z: -0.07035693, w: 0.9975219} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1485721903} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &2041974588 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2041974586} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2041974589 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5646,11 +5751,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6666667, b: 0.6666667, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -5716,11 +5821,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2077422342} - - 222: {fileID: 2077422344} - - 114: {fileID: 2077422343} + - component: {fileID: 2077422342} + - component: {fileID: 2077422344} + - component: {fileID: 2077422343} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -5740,11 +5845,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 411870819} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2077422343 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5758,7 +5864,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5770,8 +5876,9 @@ MonoBehaviour: m_FontStyle: 1 m_BestFit: 1 m_MinSize: 10 - m_MaxSize: 20 + m_MaxSize: 34 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -5788,13 +5895,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2082518918} - - 222: {fileID: 2082518922} - - 114: {fileID: 2082518921} - - 114: {fileID: 2082518920} - - 114: {fileID: 2082518919} + - component: {fileID: 2082518918} + - component: {fileID: 2082518922} + - component: {fileID: 2082518921} + - component: {fileID: 2082518920} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -5808,38 +5914,18 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2082518917} - m_LocalRotation: {x: 6.63101673e-07, y: -1.49011612e-07, z: -.0703569278, w: .997521877} + m_LocalRotation: {x: 0.0000006631017, y: -0.00000014901161, z: -0.07035693, w: 0.9975219} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1979821161} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 18, y: -18} m_SizeDelta: {x: 80, y: 80} - m_Pivot: {x: .5, y: .5} ---- !u!114 &2082518919 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2082518917} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c34dc6093a49a481db532b87b45132a4, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2082518920 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5860,11 +5946,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 1, g: 0.6666667, b: 0.6666667, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -5930,12 +6016,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2107589903} - - 223: {fileID: 2107589906} - - 114: {fileID: 2107589905} - - 114: {fileID: 2107589904} + - component: {fileID: 2107589903} + - component: {fileID: 2107589906} + - component: {fileID: 2107589905} + - component: {fileID: 2107589904} m_Layer: 5 m_Name: ScreenSpace Canvas m_TagString: Untagged @@ -5958,6 +6044,7 @@ RectTransform: - {fileID: 1056464759} m_Father: {fileID: 930800601} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -6007,7 +6094,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2107589902} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -6015,17 +6102,20 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -6039,12 +6129,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .422268212, y: -.484720409, z: -.0171990059, w: .765793622} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.4222682, y: -0.4847204, z: -0.017199006, w: 0.7657936} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -6052,19 +6143,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 1 m_Resolution: -1 - m_Strength: .200000003 - m_Bias: .0500000007 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.2 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -6073,7 +6166,9 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} diff --git a/Source/Assets/TouchScript/Examples/Photos/Photos.unity.meta b/Source/Assets/TouchScript/Examples/Photos/Photos.unity.meta index 0f6f22bfa..6499da86b 100644 --- a/Source/Assets/TouchScript/Examples/Photos/Photos.unity.meta +++ b/Source/Assets/TouchScript/Examples/Photos/Photos.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: e43bdd4f3bf144b74b4726208781dd66 DefaultImporter: - userData: + userData: "4" diff --git a/Source/Assets/TouchScript/Examples/Photos/Scripts/Container.cs b/Source/Assets/TouchScript/Examples/Photos/Scripts/Container.cs index 8d394061f..df0c095cc 100644 --- a/Source/Assets/TouchScript/Examples/Photos/Scripts/Container.cs +++ b/Source/Assets/TouchScript/Examples/Photos/Scripts/Container.cs @@ -7,6 +7,7 @@ namespace TouchScript.Examples.Photos { + /// public class Container : MonoBehaviour { public int Width = 500; @@ -19,8 +20,8 @@ public void Add() clone.transform.SetParent(transform); clone.transform.localScale = Vector3.one; clone.transform.localRotation = Quaternion.Euler(0f, 0f, Random.Range(0f, 360f)); - clone.transform.localPosition = new Vector3(Random.Range(-Width/2, Width/2), - Random.Range(-Height/2, Height/2), toClone.localPosition.z); + clone.transform.localPosition = new Vector3(Random.Range(-Width / 2, Width / 2), + Random.Range(-Height / 2, Height / 2), toClone.localPosition.z); initChild(clone.transform); } diff --git a/Source/Assets/TouchScript/Examples/Photos/Scripts/SetColor.cs b/Source/Assets/TouchScript/Examples/Photos/Scripts/SetColor.cs index 950a56604..e37fd5bbe 100644 --- a/Source/Assets/TouchScript/Examples/Photos/Scripts/SetColor.cs +++ b/Source/Assets/TouchScript/Examples/Photos/Scripts/SetColor.cs @@ -8,6 +8,7 @@ namespace TouchScript.Examples.UI { + /// public class SetColor : MonoBehaviour { public List Colors; diff --git a/Source/Assets/TouchScript/Examples/Portal/Portal.unity b/Source/Assets/TouchScript/Examples/Portal/Portal.unity index 9b3f7c071..c07cc2bdb 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Portal.unity +++ b/Source/Assets/TouchScript/Examples/Portal/Portal.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,51 +54,73 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -111,13 +134,14 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 498618157} m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 89.980194, y: 0, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -126,13 +150,21 @@ MonoBehaviour: m_GameObject: {fileID: 62216951} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 1 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -170,7 +202,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 40 field of view: 30 orthographic: 1 @@ -184,19 +216,89 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 +--- !u!1 &161419863 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 161419864} + - component: {fileID: 161419866} + - component: {fileID: 161419865} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &161419864 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 161419863} + 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: 1005780168} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 31, y: 0} + m_SizeDelta: {x: 60, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &161419865 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 161419863} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 26489b03725f747f998c39661c2583b5, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &161419866 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 161419863} --- !u!1 &250857269 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -224,6 +326,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -234,211 +338,24 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 1005780168} - {fileID: 1679844150} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!1 &481822342 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 481822343} - - 33: {fileID: 481822346} - - 23: {fileID: 481822345} - - 114: {fileID: 481822344} - - 135: {fileID: 481822347} - - 114: {fileID: 481822349} - - 114: {fileID: 481822348} - - 114: {fileID: 481822351} - - 114: {fileID: 481822350} - - 54: {fileID: 481822352} - m_Layer: 0 - m_Name: Planet - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &481822343 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_LocalRotation: {x: -8.94069672e-08, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -4.30000019, y: -6.05999994, z: .400000006} - m_LocalScale: {x: 5, y: 5, z: 5} - m_Children: [] - m_Father: {fileID: 1158035086} - m_RootOrder: 3 ---- !u!114 &481822344 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} - m_Name: - m_EditorClassIdentifier: - Speed: 100 - RotationSpeed: 40 - FallSpeed: .00999999978 ---- !u!23 &481822345 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_Materials: - - {fileID: 2100000, guid: 10bd026932ba047dcaca956b30263df6, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &481822346 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!135 &481822347 -SphereCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: .5 - m_Center: {x: 0, y: 9.53674316e-07, z: -2.38418579e-07} ---- !u!114 &481822348 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &481822349 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 - projection: 1 - projectionPlaneNormal: {x: 0, y: 0, z: 1} ---- !u!114 &481822350 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!114 &481822351 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!54 &481822352 -Rigidbody: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 481822342} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: .0500000007 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &498618156 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 498618157} + - component: {fileID: 498618157} m_Layer: 0 m_Name: Stuff m_TagString: Untagged @@ -453,13 +370,14 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 498618156} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.1500001, y: 0, z: 10} + m_LocalPosition: {x: 2.15, y: 0, z: 10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1283428183} - {fileID: 1158035086} m_Father: {fileID: 62216952} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &543251036 Prefab: m_ObjectHideFlags: 0 @@ -469,7 +387,7 @@ Prefab: m_Modifications: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.size - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: m_LocalPosition.x @@ -499,116 +417,282 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: - objectReference: {fileID: 0} + objectReference: {fileID: 62216953} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &740851131 +--- !u!1 &587840591 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} - - 114: {fileID: 740851133} + - component: {fileID: 587840592} + - component: {fileID: 587840596} + - component: {fileID: 587840595} + - component: {fileID: 587840594} + - component: {fileID: 587840593} m_Layer: 5 - m_Name: Canvas + m_Name: Spawner 2 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &740851132 +--- !u!224 &587840592 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_GameObject: {fileID: 587840591} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 1981142013} - - {fileID: 1552723601} - m_Father: {fileID: 0} - m_RootOrder: 3 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &740851133 + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 782750265} + 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: 282, y: -120} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &587840593 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 587840591} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 712d87efeee01774088f382a8449caab, type: 3} m_Name: m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &740851134 + Prefab: {fileID: 4252442136654676, guid: bff70878d8bdbdd409be0cca1fc3cfce, type: 2} + Position: {fileID: 699119955} +--- !u!114 &587840594 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 587840591} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 1 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 640, y: 480} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 1 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &740851135 -Canvas: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &587840595 +MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} + m_GameObject: {fileID: 587840591} m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!1 &762219656 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 762219657} - - 33: {fileID: 762219661} - - 23: {fileID: 762219659} - - 114: {fileID: 762219658} - m_Layer: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &587840596 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 587840591} +--- !u!1 &699119954 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 699119955} + m_Layer: 0 + m_Name: Planet 2 Position + m_TagString: Untagged + m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &699119955 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 699119954} + m_LocalRotation: {x: -0.00000005960465, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 9.3, y: -4.8, z: 0.3} + m_LocalScale: {x: 5, y: 4.999998, z: 4.999998} + m_Children: [] + m_Father: {fileID: 1158035086} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &718339113 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 718339114} + m_Layer: 0 + m_Name: Planet 4 Position + m_TagString: Untagged + m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &718339114 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 718339113} + m_LocalRotation: {x: -0.00000005960465, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -12, y: 0.7, z: 0.3} + m_LocalScale: {x: 5, y: 4.999998, z: 4.999998} + m_Children: [] + m_Father: {fileID: 1158035086} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &740851131 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &740851132 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1981142013} + - {fileID: 1552723601} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &740851134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 640, y: 480} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &740851135 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_TargetDisplay: 0 +--- !u!1 &762219656 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 762219657} + - component: {fileID: 762219661} + - component: {fileID: 762219659} + - component: {fileID: 762219658} + m_Layer: 0 m_Name: Quad m_TagString: Untagged m_Icon: {fileID: 0} @@ -621,12 +705,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 762219656} - m_LocalRotation: {x: -5.96046519e-08, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -.100000001} + m_LocalRotation: {x: -0.00000005960465, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.1} m_LocalScale: {x: 6, y: 6, z: 6} m_Children: [] m_Father: {fileID: 1283428183} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &762219658 MonoBehaviour: m_ObjectHideFlags: 0 @@ -648,20 +733,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: 2105a6ce9f7624161ba30eefc0d839f3, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &762219661 MeshFilter: @@ -670,423 +763,433 @@ MeshFilter: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 762219656} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &851559560 +--- !u!1 &782750261 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 851559561} - - 33: {fileID: 851559563} - - 23: {fileID: 851559562} - - 114: {fileID: 851559564} - - 135: {fileID: 851559567} - - 114: {fileID: 851559566} - - 114: {fileID: 851559565} - - 114: {fileID: 851559569} - - 114: {fileID: 851559568} - - 54: {fileID: 851559570} - m_Layer: 0 - m_Name: Planet + - component: {fileID: 782750265} + - component: {fileID: 782750264} + - component: {fileID: 782750262} + - component: {fileID: 782750263} + m_Layer: 5 + m_Name: Game Canvas m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &851559561 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.01000023, y: -3.6400001, z: .100000001} - m_LocalScale: {x: 5, y: 5, z: 5} - m_Children: [] - m_Father: {fileID: 1158035086} - m_RootOrder: 0 ---- !u!23 &851559562 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_Materials: - - {fileID: 2100000, guid: 150b901d18f3f45d08b29f50aaec86b9, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &851559563 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!114 &851559564 +--- !u!114 &782750262 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} + m_GameObject: {fileID: 782750261} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - Speed: 100 - RotationSpeed: 10 - FallSpeed: .00999999978 ---- !u!114 &851559565 + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &782750263 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} + m_GameObject: {fileID: 782750261} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &851559566 -MonoBehaviour: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 640, y: 480} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &782750264 +Canvas: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} + m_GameObject: {fileID: 782750261} m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 - projection: 1 - projectionPlaneNormal: {x: 0, y: 0, z: 1} ---- !u!135 &851559567 -SphereCollider: + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &782750265 +RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: .5 - m_Center: {x: 0, y: -4.76837158e-07, z: -2.38418579e-07} ---- !u!114 &851559568 + m_GameObject: {fileID: 782750261} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 965152938} + - {fileID: 587840592} + - {fileID: 1732869220} + - {fileID: 1247142069} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &854248630 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 854248631} + - component: {fileID: 854248634} + - component: {fileID: 854248633} + - component: {fileID: 854248632} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &854248631 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 854248630} + 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: 1005780168} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 193, y: 0} + m_SizeDelta: {x: 235, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &854248632 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} + m_GameObject: {fileID: 854248630} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Script: {fileID: 1573420865, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!114 &851559569 + m_EffectColor: {r: 0, g: 0, b: 0, a: 1} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &854248633 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} + m_GameObject: {fileID: 854248630} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!54 &851559570 -Rigidbody: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Press a Unity logo to spawn a planet. +--- !u!222 &854248634 +CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 851559560} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: .0500000007 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!1 &893756805 + m_GameObject: {fileID: 854248630} +--- !u!1 &930800600 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 893756806} - - 33: {fileID: 893756809} - - 23: {fileID: 893756808} - - 114: {fileID: 893756807} - - 135: {fileID: 893756810} - - 114: {fileID: 893756812} - - 114: {fileID: 893756811} - - 114: {fileID: 893756814} - - 114: {fileID: 893756813} - - 54: {fileID: 893756815} + - component: {fileID: 930800601} m_Layer: 0 - m_Name: Planet + m_Name: Scene m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &893756806 +--- !u!4 &930800601 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - m_LocalRotation: {x: -8.94069672e-08, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6.23999977, y: 6.07999992, z: .300000012} - m_LocalScale: {x: 5, y: 5, z: 5} - m_Children: [] - m_Father: {fileID: 1158035086} - m_RootOrder: 2 ---- !u!114 &893756807 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} - m_Name: - m_EditorClassIdentifier: - Speed: 100 - RotationSpeed: 30 - FallSpeed: .00999999978 ---- !u!23 &893756808 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_Materials: - - {fileID: 2100000, guid: 148079725ce574b75ae65e81f6be1567, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &893756809 -MeshFilter: + m_GameObject: {fileID: 930800600} + 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: 2135305920} + - {fileID: 62216952} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &965152937 +GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!135 &893756810 -SphereCollider: + serializedVersion: 5 + m_Component: + - component: {fileID: 965152938} + - component: {fileID: 965152942} + - component: {fileID: 965152941} + - component: {fileID: 965152940} + - component: {fileID: 965152939} + m_Layer: 5 + m_Name: Spawner 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &965152938 +RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: .5 - m_Center: {x: 0, y: -7.15255737e-07, z: -2.38418579e-07} ---- !u!114 &893756811 + m_GameObject: {fileID: 965152937} + 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: 782750265} + 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: 259, y: 126} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &965152939 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} + m_GameObject: {fileID: 965152937} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Script: {fileID: 11500000, guid: 712d87efeee01774088f382a8449caab, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &893756812 + Prefab: {fileID: 4587602474649486, guid: 7c0291284cacbcf4d93907ef9bfae4b9, type: 2} + Position: {fileID: 1730821178} +--- !u!114 &965152940 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} + m_GameObject: {fileID: 965152937} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] - type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 - projection: 1 - projectionPlaneNormal: {x: 0, y: 0, z: 1} ---- !u!114 &893756813 + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &965152941 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} + m_GameObject: {fileID: 965152937} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!114 &893756814 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &965152942 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 965152937} +--- !u!1 &1005780167 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1005780168} + - component: {fileID: 1005780169} + m_Layer: 5 + m_Name: Press + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1005780168 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1005780167} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9999968, y: 0.9999968, z: 0.9999968} + m_Children: + - {fileID: 161419864} + - {fileID: 854248631} + m_Father: {fileID: 250857271} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1005780169 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} + m_GameObject: {fileID: 1005780167} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!54 &893756815 -Rigidbody: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 893756805} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: .0500000007 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!1 &930800600 + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 60 + m_PreferredWidth: -1 + m_PreferredHeight: 60 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!1 &1090564253 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} + - component: {fileID: 1090564254} m_Layer: 0 - m_Name: Scene + m_Name: Planet 3 Position m_TagString: Untagged - m_Icon: {fileID: 0} + m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &930800601 +--- !u!4 &1090564254 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 930800600} - 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: 2135305920} - - {fileID: 62216952} - m_Father: {fileID: 0} + m_GameObject: {fileID: 1090564253} + m_LocalRotation: {x: -0.00000005960465, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: -7.3, z: 0.3} + m_LocalScale: {x: 5, y: 4.999998, z: 4.999998} + m_Children: [] + m_Father: {fileID: 1158035086} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1138005899 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1106,11 +1209,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1149,9 +1253,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1158035086} + - component: {fileID: 1158035086} m_Layer: 0 m_Name: Planets m_TagString: Untagged @@ -1166,214 +1270,145 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1158035085} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0, z: 1.59000003} + m_LocalPosition: {x: 0, y: -0, z: 1.59} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 851559561} - - {fileID: 1166789652} - - {fileID: 893756806} - - {fileID: 481822343} + - {fileID: 1730821178} + - {fileID: 699119955} + - {fileID: 1090564254} + - {fileID: 718339114} m_Father: {fileID: 498618157} m_RootOrder: 1 ---- !u!1 &1166789651 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1247142068 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1166789652} - - 33: {fileID: 1166789655} - - 23: {fileID: 1166789654} - - 114: {fileID: 1166789653} - - 135: {fileID: 1166789656} - - 114: {fileID: 1166789658} - - 114: {fileID: 1166789657} - - 114: {fileID: 1166789660} - - 114: {fileID: 1166789659} - - 54: {fileID: 1166789661} - m_Layer: 0 - m_Name: Planet + - component: {fileID: 1247142069} + - component: {fileID: 1247142073} + - component: {fileID: 1247142072} + - component: {fileID: 1247142071} + - component: {fileID: 1247142070} + m_Layer: 5 + m_Name: Spawner 4 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1166789652 -Transform: +--- !u!224 &1247142069 +RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_LocalRotation: {x: -8.94069672e-08, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -8.31999969, y: 4.82000017, z: .200000003} - m_LocalScale: {x: 5, y: 5, z: 5} + m_GameObject: {fileID: 1247142068} + 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: 1158035086} - m_RootOrder: 1 ---- !u!114 &1166789653 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} - m_Name: - m_EditorClassIdentifier: - Speed: 100 - RotationSpeed: 20 - FallSpeed: .00999999978 ---- !u!23 &1166789654 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_Materials: - - {fileID: 2100000, guid: 0ed169bc21381479799fe7ba05d2939b, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &1166789655 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!135 &1166789656 -SphereCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: .5 - m_Center: {x: 0, y: -4.76837158e-07, z: -2.38418579e-07} ---- !u!114 &1166789657 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1166789658 + m_Father: {fileID: 782750265} + m_RootOrder: 3 + 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: -251, y: 14} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1247142070 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} + m_GameObject: {fileID: 1247142068} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Script: {fileID: 11500000, guid: 712d87efeee01774088f382a8449caab, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - minScreenPointsDistance: .5 - screenTransformThreshold: .100000001 - projection: 1 - projectionPlaneNormal: {x: 0, y: 0, z: 1} ---- !u!114 &1166789659 + Prefab: {fileID: 4567459449971028, guid: 4d11e87ec08ce584a818342513bf6616, type: 2} + Position: {fileID: 718339114} +--- !u!114 &1247142071 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} + m_GameObject: {fileID: 1247142068} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} m_Name: m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null ignoreChildren: 0 ---- !u!114 &1166789660 +--- !u!114 &1247142072 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} + m_GameObject: {fileID: 1247142068} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!54 &1166789661 -Rigidbody: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1247142073 +CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1166789651} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: .0500000007 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 + m_GameObject: {fileID: 1247142068} --- !u!1 &1283428182 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1283428183} - - 135: {fileID: 1283428184} - - 114: {fileID: 1283428185} + - component: {fileID: 1283428183} + - component: {fileID: 1283428184} + - component: {fileID: 1283428185} m_Layer: 0 m_Name: Vortex m_TagString: Untagged @@ -1395,6 +1430,7 @@ Transform: - {fileID: 762219657} m_Father: {fileID: 498618157} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!135 &1283428184 SphereCollider: m_ObjectHideFlags: 0 @@ -1405,7 +1441,7 @@ SphereCollider: m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Radius: 1.97000003 + m_Radius: 1.97 m_Center: {x: 0, y: 0, z: 0} --- !u!114 &1283428185 MonoBehaviour: @@ -1423,12 +1459,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1448,11 +1484,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1480,6 +1517,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1510,12 +1548,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1535,11 +1573,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 178, y: 78} - m_SizeDelta: {x: 320, y: 128} - m_Pivot: {x: .5, y: .5} + m_AnchoredPosition: {x: 178, y: 90} + m_SizeDelta: {x: 320, y: 151} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1567,6 +1606,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1574,7 +1614,7 @@ MonoBehaviour: m_Text: 'Portal - This example shows how to cancel a gesture. + This example shows how to cancel a gesture or "give" its pointers to another gesture. When you drag a planet close to the portal TransformGesture is cancelled and the @@ -1605,10 +1645,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Drag m_TagString: Untagged @@ -1629,12 +1669,13 @@ RectTransform: - {fileID: 1138005900} - {fileID: 1408280581} m_Father: {fileID: 250857271} - m_RootOrder: 0 + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1653,17 +1694,164 @@ MonoBehaviour: m_PreferredHeight: 60 m_FlexibleWidth: -1 m_FlexibleHeight: -1 +--- !u!1 &1730821177 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1730821178} + m_Layer: 0 + m_Name: Planet 1 Position + m_TagString: Untagged + m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1730821178 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1730821177} + m_LocalRotation: {x: -0.00000005960465, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 8.23, y: 5.06, z: 0.3} + m_LocalScale: {x: 5, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 1158035086} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1732869219 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1732869220} + - component: {fileID: 1732869224} + - component: {fileID: 1732869223} + - component: {fileID: 1732869222} + - component: {fileID: 1732869221} + m_Layer: 5 + m_Name: Spawner 3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1732869220 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1732869219} + 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: 782750265} + m_RootOrder: 2 + 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: 2, y: -186} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1732869221 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1732869219} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 712d87efeee01774088f382a8449caab, type: 3} + m_Name: + m_EditorClassIdentifier: + Prefab: {fileID: 4675551579099594, guid: e6c45ad0ad3ece84b91f569ca505eba9, type: 2} + Position: {fileID: 1090564254} +--- !u!114 &1732869222 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1732869219} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 1 + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &1732869223 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1732869219} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 533b9df4691d947d9921a0053b5ce231, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1732869224 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1732869219} --- !u!1 &1762297554 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1762297559} - - 33: {fileID: 1762297558} - - 23: {fileID: 1762297556} - - 114: {fileID: 1762297555} + - component: {fileID: 1762297559} + - component: {fileID: 1762297558} + - component: {fileID: 1762297556} + - component: {fileID: 1762297555} m_Layer: 0 m_Name: Quad m_TagString: Untagged @@ -1692,20 +1880,28 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: 2105a6ce9f7624161ba30eefc0d839f3, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &1762297558 MeshFilter: @@ -1726,15 +1922,16 @@ Transform: m_Children: [] m_Father: {fileID: 1283428183} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1764701046 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -1767,7 +1964,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -1795,9 +1993,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -1818,20 +2016,21 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -1845,12 +2044,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .241942912, y: -.49854365, z: .221075788, w: .802523136} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.24194291, y: -0.49854365, z: 0.22107579, w: 0.80252314} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -1858,19 +2058,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 2 m_Resolution: 3 - m_Strength: .560000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1879,7 +2081,9 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} diff --git a/Source/Assets/TouchScript/Examples/Portal/Portal.unity.meta b/Source/Assets/TouchScript/Examples/Portal/Portal.unity.meta index 2bb2a8c8b..bc963d131 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Portal.unity.meta +++ b/Source/Assets/TouchScript/Examples/Portal/Portal.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 20ddca9320eeb4eb28b7ce5fcb289923 DefaultImporter: - userData: + userData: "6" diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs.meta b/Source/Assets/TouchScript/Examples/Portal/Prefabs.meta new file mode 100644 index 000000000..f46a58b2c --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 04d6b05909265f14b959a306ec367037 +folderAsset: yes +timeCreated: 1500762512 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab new file mode 100644 index 000000000..a2f61d994 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab @@ -0,0 +1,273 @@ +%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: 1723810235303300} + m_IsPrefabParent: 1 +--- !u!1 &1723810235303300 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4587602474649486} + - component: {fileID: 33699283477361520} + - component: {fileID: 23136522374025466} + - component: {fileID: 114451894822869470} + - component: {fileID: 135508365643771480} + - component: {fileID: 114826848715069466} + - component: {fileID: 114536039364076494} + - component: {fileID: 114380460329550602} + - component: {fileID: 114610899262215960} + - component: {fileID: 54030889479251752} + m_Layer: 0 + m_Name: Planet 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4587602474649486 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_LocalRotation: {x: -0.00000008940697, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23136522374025466 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 148079725ce574b75ae65e81f6be1567, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33699283477361520 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54030889479251752 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114380460329550602 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114451894822869470 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} + m_Name: + m_EditorClassIdentifier: + Speed: 100 + RotationSpeed: 30 + FallSpeed: 0.01 +--- !u!114 &114536039364076494 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Name: + m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 +--- !u!114 &114610899262215960 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnRelease: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114826848715069466 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + type: 1 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 + projection: 1 + projectionPlaneNormal: {x: 0, y: 0, z: 1} +--- !u!135 &135508365643771480 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1723810235303300} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: -0.00000071525574, z: -0.00000023841858} diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab.meta b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab.meta new file mode 100644 index 000000000..85636ffe9 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 1.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7c0291284cacbcf4d93907ef9bfae4b9 +timeCreated: 1500762519 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab new file mode 100644 index 000000000..baa1e6e82 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab @@ -0,0 +1,273 @@ +%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: 1732047919889238} + m_IsPrefabParent: 1 +--- !u!1 &1732047919889238 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4252442136654676} + - component: {fileID: 33531297961261376} + - component: {fileID: 23305764506643510} + - component: {fileID: 114932396362750984} + - component: {fileID: 135434814455161676} + - component: {fileID: 114329650201689084} + - component: {fileID: 114489562153011798} + - component: {fileID: 114347950312683466} + - component: {fileID: 114602335792670362} + - component: {fileID: 54986752027795250} + m_Layer: 0 + m_Name: Planet 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4252442136654676 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23305764506643510 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 150b901d18f3f45d08b29f50aaec86b9, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33531297961261376 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54986752027795250 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114329650201689084 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + type: 1 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 + projection: 1 + projectionPlaneNormal: {x: 0, y: 0, z: 1} +--- !u!114 &114347950312683466 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114489562153011798 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Name: + m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 +--- !u!114 &114602335792670362 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnRelease: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114932396362750984 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} + m_Name: + m_EditorClassIdentifier: + Speed: 100 + RotationSpeed: 10 + FallSpeed: 0.01 +--- !u!135 &135434814455161676 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1732047919889238} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: -0.00000047683716, z: -0.00000023841858} diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab.meta b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab.meta new file mode 100644 index 000000000..7acc63971 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 2.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bff70878d8bdbdd409be0cca1fc3cfce +timeCreated: 1500762529 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab new file mode 100644 index 000000000..cb583414c --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab @@ -0,0 +1,273 @@ +%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: 1069462480597282} + m_IsPrefabParent: 1 +--- !u!1 &1069462480597282 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4675551579099594} + - component: {fileID: 33212346599330584} + - component: {fileID: 23284574870311418} + - component: {fileID: 114146275313109388} + - component: {fileID: 135509675147651788} + - component: {fileID: 114408875339017466} + - component: {fileID: 114920083122602460} + - component: {fileID: 114757214019137374} + - component: {fileID: 114574854580529156} + - component: {fileID: 54113724369616440} + m_Layer: 0 + m_Name: Planet 3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4675551579099594 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_LocalRotation: {x: -0.00000008940697, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23284574870311418 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 10bd026932ba047dcaca956b30263df6, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33212346599330584 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54113724369616440 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114146275313109388 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} + m_Name: + m_EditorClassIdentifier: + Speed: 100 + RotationSpeed: 40 + FallSpeed: 0.01 +--- !u!114 &114408875339017466 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + type: 1 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 + projection: 1 + projectionPlaneNormal: {x: 0, y: 0, z: 1} +--- !u!114 &114574854580529156 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnRelease: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114757214019137374 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114920083122602460 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Name: + m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 +--- !u!135 &135509675147651788 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1069462480597282} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0.0000009536743, z: -0.00000023841858} diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab.meta b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab.meta new file mode 100644 index 000000000..0a794aa06 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 3.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e6c45ad0ad3ece84b91f569ca505eba9 +timeCreated: 1500762542 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab new file mode 100644 index 000000000..a309dbbd3 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab @@ -0,0 +1,273 @@ +%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: 1680841336266350} + m_IsPrefabParent: 1 +--- !u!1 &1680841336266350 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4567459449971028} + - component: {fileID: 33214459495948154} + - component: {fileID: 23155191792782146} + - component: {fileID: 114421577017359426} + - component: {fileID: 135886790604417350} + - component: {fileID: 114367742515556682} + - component: {fileID: 114222141242542914} + - component: {fileID: 114974252932633120} + - component: {fileID: 114634450885023396} + - component: {fileID: 54059909185387790} + m_Layer: 0 + m_Name: Planet 4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4567459449971028 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_LocalRotation: {x: -0.00000008940697, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 5, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23155191792782146 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 0ed169bc21381479799fe7ba05d2939b, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33214459495948154 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54059909185387790 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114222141242542914 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} + m_Name: + m_EditorClassIdentifier: + enableSmoothing: 0 + smoothingFactor: 0.0001 + positionThreshold: 0.0001 + rotationThreshold: 0.01 + scaleThreshold: 0.0001 + allowChangingFromOutside: 0 +--- !u!114 &114367742515556682 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11ea9930ecb674732bee27116520fad8, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnTransformStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransform: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnTransformComplete: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + type: 1 + screenTransformThreshold: 0.1 + minScreenPointsDistance: 0.5 + projectionProps: 0 + projection: 1 + projectionPlaneNormal: {x: 0, y: 0, z: 1} +--- !u!114 &114421577017359426 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11cabe64e6b9945c88b060d042861428, type: 3} + m_Name: + m_EditorClassIdentifier: + Speed: 100 + RotationSpeed: 20 + FallSpeed: 0.01 +--- !u!114 &114634450885023396 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 141e75b9b7edb42df80a22a14f03ae4b, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnRelease: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!114 &114974252932633120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 0 + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + combinePointers: 0 + combinePointersInterval: 0.3 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] + OnPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + ignoreChildren: 0 +--- !u!135 &135886790604417350 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680841336266350} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: -0.00000047683716, z: -0.00000023841858} diff --git a/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab.meta b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab.meta new file mode 100644 index 000000000..767bf248d --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Prefabs/Planet 4.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4d11e87ec08ce584a818342513bf6616 +timeCreated: 1500762549 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs b/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs index 093464481..b2e04a0ba 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs @@ -4,9 +4,11 @@ using UnityEngine; using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; namespace TouchScript.Examples.Portal { + /// public class Planet : MonoBehaviour { private enum PlanetStatus @@ -47,7 +49,7 @@ private void Update() { case PlanetStatus.Free: transform.RotateAround(transform.parent.position, Vector3.up, - Speed*Time.deltaTime/transform.localPosition.sqrMagnitude); + Speed * Time.unscaledDeltaTime / transform.localPosition.sqrMagnitude); break; case PlanetStatus.Manual: break; @@ -58,7 +60,7 @@ private void Update() break; } - transform.Rotate(0, 0, Time.deltaTime*RotationSpeed); + transform.Rotate(0, 0, Time.unscaledDeltaTime * RotationSpeed); } void pressedhandler(object sender, System.EventArgs e) diff --git a/Source/Assets/TouchScript/Examples/Portal/Scripts/Rotator.cs b/Source/Assets/TouchScript/Examples/Portal/Scripts/Rotator.cs index 2e51297d1..4b5f86ca0 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Scripts/Rotator.cs +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Rotator.cs @@ -6,13 +6,14 @@ namespace TouchScript.Examples.Portal { + /// public class Rotator : MonoBehaviour { public float RotationSpeed = 1f; void Update() { - transform.localRotation *= Quaternion.Euler(0, 0, Time.deltaTime*RotationSpeed); + transform.localRotation *= Quaternion.Euler(0, 0, Time.unscaledDeltaTime * RotationSpeed); } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs b/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs new file mode 100644 index 000000000..29e377c44 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs @@ -0,0 +1,40 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using TouchScript.Gestures; +using UnityEngine; + +namespace TouchScript.Examples.Portal +{ + /// + public class Spawner : MonoBehaviour + { + public Transform Prefab; + public Transform Position; + + private PressGesture press; + + private void OnEnable() + { + press = GetComponent(); + press.Pressed += pressHandler; + } + + private void OnDisable() + { + press.Pressed -= pressHandler; + } + + private void pressHandler(object sender, EventArgs eventArgs) + { + var target = Instantiate(Prefab, Position.parent); + target.position = Position.position; + + LayerManager.Instance.SetExclusive(target); + press.Cancel(true, true); + LayerManager.Instance.ClearExclusive(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs.meta b/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs.meta new file mode 100644 index 000000000..5ee5b0f6c --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Spawner.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 712d87efeee01774088f382a8449caab +timeCreated: 1500762320 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Portal/Scripts/Vortex.cs b/Source/Assets/TouchScript/Examples/Portal/Scripts/Vortex.cs index fa59ba387..bc42ec982 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Scripts/Vortex.cs +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Vortex.cs @@ -6,6 +6,7 @@ namespace TouchScript.Examples.Portal { + /// public class Vortex : MonoBehaviour { private void OnTriggerEnter(Collider other) diff --git a/Source/Assets/TouchScript/Examples/Pull.meta b/Source/Assets/TouchScript/Examples/Pull.meta new file mode 100644 index 000000000..00e830361 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1a092b00a4e374c60a1f1b5af1727a4c +folderAsset: yes +timeCreated: 1501590523 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Materials.meta b/Source/Assets/TouchScript/Examples/Pull/Materials.meta new file mode 100644 index 000000000..41948a301 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0d02fe6a7404f4fa8b9b5214e052cd7d +folderAsset: yes +timeCreated: 1501599114 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat b/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat new file mode 100644 index 000000000..a11dc3831 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Green + m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 1, b: 0.048275948, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat.meta b/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat.meta new file mode 100644 index 000000000..4ff475c12 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Materials/Green.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6a7cc3aeb872a43c9b48602411ff0128 +timeCreated: 1501599163 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Prefabs.meta b/Source/Assets/TouchScript/Examples/Pull/Prefabs.meta new file mode 100644 index 000000000..26c7eed13 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e930c60b631064c8282b18e4fd304215 +folderAsset: yes +timeCreated: 1501590612 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab b/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab new file mode 100644 index 000000000..6d1afd749 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab @@ -0,0 +1,276 @@ +%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: 1583770791137080} + m_IsPrefabParent: 1 +--- !u!1 &1187127904395504 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4273383945290788} + - component: {fileID: 120722583279136224} + m_Layer: 0 + m_Name: Line + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1583770791137080 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4092497047216208} + - component: {fileID: 33076793992048592} + - component: {fileID: 65806177754892914} + - component: {fileID: 23586366584321034} + - component: {fileID: 54930536093548728} + - component: {fileID: 114518461671103506} + - component: {fileID: 114334082651901656} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4092497047216208 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.02, y: 0.69, z: -2.33} + m_LocalScale: {x: 1.5896826, y: 1.589683, z: 1.589683} + m_Children: + - {fileID: 4273383945290788} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4273383945290788 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1187127904395504} + 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: 4092497047216208} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23586366584321034 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33076793992048592 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54930536093548728 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &65806177754892914 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &114334082651901656 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 057fc4dd3742040c9b65eac0a4e3cac7, type: 3} + m_Name: + m_EditorClassIdentifier: + ForceMultiplier: 100 + Line: {fileID: 120722583279136224} +--- !u!114 &114518461671103506 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1583770791137080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 767c446d703184f6faf8a12a85d591eb, type: 3} + m_Name: + m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 0 + generalProps: 0 + limitsProps: 0 + advancedProps: 0 + minPointers: 0 + maxPointers: 0 + useSendMessage: 0 + sendStateChangeMessages: 0 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 + requireGestureToFail: {fileID: 0} + friendlyGestures: [] +--- !u!120 &120722583279136224 +LineRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1187127904395504} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 6a7cc3aeb872a43c9b48602411ff0128, 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_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: 10} + m_Parameters: + serializedVersion: 2 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 2 + time: 0 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - serializedVersion: 2 + time: 1 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, 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 + m_UseWorldSpace: 1 + m_Loop: 0 diff --git a/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab.meta b/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab.meta new file mode 100644 index 000000000..eb5fb7666 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Prefabs/Cube.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 21a4063eaa6b1410f8b9be15c9d964df +timeCreated: 1501590642 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Pull.unity b/Source/Assets/TouchScript/Examples/Pull/Pull.unity new file mode 100644 index 000000000..6ed0b637b --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Pull.unity @@ -0,0 +1,1990 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 8 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 8 + m_Resolution: 1 + m_BakeResolution: 50 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 0 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &43919907 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 43919908} + - component: {fileID: 43919912} + - component: {fileID: 43919911} + - component: {fileID: 43919910} + - component: {fileID: 43919909} + m_Layer: 0 + m_Name: Static Cube (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &43919908 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 43919907} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -6.04, y: 0.69, z: 0.21} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &43919909 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 43919907} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &43919910 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 43919907} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &43919911 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 43919907} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &43919912 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 43919907} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &62216951 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} + m_Layer: 0 + m_Name: Scene Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &62216952 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_LocalRotation: {x: 0.26945794, y: 0, z: 0, w: 0.96301216} + m_LocalPosition: {x: -1.11, y: 10.1, z: -17.45} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 930800601} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 31.264, y: 0, z: 0} +--- !u!114 &62216953 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: Scene Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 + layerMask: + serializedVersion: 2 + m_Bits: 4294967295 + useHitFilters: 0 +--- !u!81 &62216954 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 +--- !u!124 &62216955 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 +--- !u!92 &62216956 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 +--- !u!20 &62216957 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 62216951} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 40 + field of view: 30 + orthographic: 0 + orthographic size: 100 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!1 &250857269 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 250857271} + - component: {fileID: 250857270} + m_Layer: 5 + m_Name: List + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &250857270 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 250857269} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!224 &250857271 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 250857269} + 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: 922779737} + - {fileID: 1679844150} + m_Father: {fileID: 1981142013} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &312263519 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 312263520} + m_Layer: 0 + m_Name: Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &312263520 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 312263519} + 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: 497908867} + - {fileID: 1348713904} + - {fileID: 1523632846} + - {fileID: 703341282} + - {fileID: 2086987748} + - {fileID: 525512062} + - {fileID: 43919908} + m_Father: {fileID: 930800601} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &497908867 stripped +Transform: + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 1411228864} +--- !u!1 &525512061 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 525512062} + - component: {fileID: 525512066} + - component: {fileID: 525512065} + - component: {fileID: 525512064} + - component: {fileID: 525512063} + m_Layer: 0 + m_Name: Static Cube (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &525512062 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 525512061} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.27, y: 0.69, z: 2.94} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &525512063 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 525512061} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &525512064 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 525512061} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &525512065 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 525512061} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &525512066 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 525512061} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &543251036 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: layers.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: layers.Array.data[0] + value: + objectReference: {fileID: 62216953} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &584553677 stripped +Transform: + m_PrefabParentObject: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + m_PrefabInternal: {fileID: 599866430} +--- !u!1001 &599866430 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 930800601} + m_Modifications: + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalPosition.x + value: -0.04 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalPosition.y + value: -12.97 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalPosition.z + value: 0.26 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalRotation.y + value: 0.36056674 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9327335 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalScale.x + value: 17 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalScale.y + value: 17 + objectReference: {fileID: 0} + - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_LocalScale.z + value: 17 + objectReference: {fileID: 0} + - target: {fileID: 100004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 9500000, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + m_ParentPrefab: {fileID: 100100000, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + m_IsPrefabParent: 0 +--- !u!1 &703341281 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 703341282} + - component: {fileID: 703341286} + - component: {fileID: 703341285} + - component: {fileID: 703341284} + - component: {fileID: 703341283} + m_Layer: 0 + m_Name: Static Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &703341282 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 703341281} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.55, y: 0.69, z: 5.28} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &703341283 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 703341281} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &703341284 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 703341281} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &703341285 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 703341281} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &703341286 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 703341281} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &721853795 stripped +GameObject: + m_PrefabParentObject: {fileID: 100006, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + m_PrefabInternal: {fileID: 599866430} +--- !u!64 &721853799 +MeshCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 721853795} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 + m_Mesh: {fileID: 4300006, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} +--- !u!1 &740851131 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &740851132 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1981142013} + - {fileID: 1552723601} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &740851134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 640, y: 480} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &740851135 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 740851131} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &922779735 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 922779737} + - component: {fileID: 922779736} + m_Layer: 5 + m_Name: Drag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &922779736 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 922779735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 60 + m_PreferredWidth: -1 + m_PreferredHeight: 60 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!224 &922779737 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 922779735} + 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: 1149683276} + - {fileID: 1166494019} + m_Father: {fileID: 250857271} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &930800600 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 930800601} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &930800601 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 930800600} + 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: 2135305920} + - {fileID: 62216952} + - {fileID: 584553677} + - {fileID: 312263520} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1138005899 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1138005900 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1138005899} + 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: 1679844150} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 31, y: 0} + m_SizeDelta: {x: 60, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1138005901 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1138005899} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 26489b03725f747f998c39661c2583b5, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1138005902 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1138005899} +--- !u!1 &1149683275 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1149683276} + - component: {fileID: 1149683278} + - component: {fileID: 1149683277} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1149683276 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149683275} + 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: 922779737} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 31, y: 0} + m_SizeDelta: {x: 60, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1149683277 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149683275} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: dcd0c08ae57e04a64bd2388ac4057dc6, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1149683278 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149683275} +--- !u!1 &1166494018 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1166494019} + - component: {fileID: 1166494022} + - component: {fileID: 1166494021} + - component: {fileID: 1166494020} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1166494019 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1166494018} + 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: 922779737} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 177.5, y: 0} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1166494020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1166494018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1573420865, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 1} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &1166494021 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1166494018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Press and drag \nthe central cube" +--- !u!222 &1166494022 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1166494018} +--- !u!1 &1271849413 stripped +GameObject: + m_PrefabParentObject: {fileID: 100008, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} + m_PrefabInternal: {fileID: 599866430} +--- !u!64 &1271849417 +MeshCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1271849413} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 + m_Mesh: {fileID: 4300004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} +--- !u!1 &1348713903 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1348713904} + - component: {fileID: 1348713908} + - component: {fileID: 1348713907} + - component: {fileID: 1348713906} + - component: {fileID: 1348713905} + m_Layer: 0 + m_Name: Static Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1348713904 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1348713903} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.97, y: 0.69, z: 0.26} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1348713905 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1348713903} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &1348713906 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1348713903} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &1348713907 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1348713903} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1348713908 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1348713903} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1408280580 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1408280581 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1408280580} + 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: 1679844150} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 177.5, y: 0} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1408280582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1408280580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Release the touch \nto apply the force" +--- !u!222 &1408280583 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1408280580} +--- !u!114 &1408280584 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1408280580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1573420865, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 1} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1001 &1411228864 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 312263520} + m_Modifications: + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalPosition.x + value: 0.02 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalPosition.y + value: 0.69 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalPosition.z + value: -2.33 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 21a4063eaa6b1410f8b9be15c9d964df, type: 2} + m_IsPrefabParent: 0 +--- !u!1 &1523632845 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1523632846} + - component: {fileID: 1523632850} + - component: {fileID: 1523632849} + - component: {fileID: 1523632848} + - component: {fileID: 1523632847} + m_Layer: 0 + m_Name: Static Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1523632846 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1523632845} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.45, y: 0.69, z: 3.53} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1523632847 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1523632845} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &1523632848 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1523632845} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &1523632849 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1523632845} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1523632850 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1523632845} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1552723600 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1552723601 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1552723600} + 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: 740851132} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 178, y: 58} + m_SizeDelta: {x: 320, y: 88} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1552723602 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1552723600} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Pull\n\x03\nThis example shows how to write a custom gesture.\nPullGesture + on the central cube is written specially for this scene." +--- !u!222 &1552723603 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1552723600} +--- !u!114 &1552723604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1552723600} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1573420865, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 1} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1 &1679844149 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} + m_Layer: 5 + m_Name: Tap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1679844150 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1679844149} + 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: 1138005900} + - {fileID: 1408280581} + m_Father: {fileID: 250857271} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1679844151 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1679844149} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: 60 + m_PreferredWidth: -1 + m_PreferredHeight: 60 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!1 &1764701046 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1764701049 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1764701046} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &1764701050 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1764701046} + 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: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1772227325 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: useDPI + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + m_IsPrefabParent: 0 +--- !u!1 &1981142012 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1981142013} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1981142013 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1981142012} + 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: 250857271} + m_Father: {fileID: 740851132} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.25263783, y: 1} + m_AnchoredPosition: {x: 5, y: 50} + m_SizeDelta: {x: -10, y: -120} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2086987747 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1583770791137080, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2086987748} + - component: {fileID: 2086987752} + - component: {fileID: 2086987751} + - component: {fileID: 2086987750} + - component: {fileID: 2086987749} + m_Layer: 0 + m_Name: Static Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2086987748 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4092497047216208, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2086987747} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.71, y: 0.69, z: 5.16} + m_LocalScale: {x: 1.58968, y: 1.58968, z: 1.58968} + m_Children: [] + m_Father: {fileID: 312263520} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &2086987749 +Rigidbody: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 54930536093548728, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2086987747} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!23 &2086987750 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 23586366584321034, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2086987747} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 69c151168e0de486b9df0688ff9e4891, 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_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &2086987751 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 65806177754892914, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2086987747} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &2086987752 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 33076793992048592, guid: 21a4063eaa6b1410f8b9be15c9d964df, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2086987747} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2135305919 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} + m_Layer: 0 + m_Name: Directional light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2135305920 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135305919} + m_LocalRotation: {x: 0.24194291, y: -0.49854365, z: 0.22107579, w: 0.80252314} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 930800601} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 37.5, y: -60.899998, z: 8.2324} +--- !u!108 &2135305921 +Light: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135305919} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1.3 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: 3 + m_CustomResolution: -1 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 diff --git a/Source/Assets/TouchScript/Examples/Pull/Pull.unity.meta b/Source/Assets/TouchScript/Examples/Pull/Pull.unity.meta new file mode 100644 index 000000000..208dcabb4 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Pull.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6696ec8da4feb4725bf860ab58fa830f +timeCreated: 1501590562 +licenseType: Pro +DefaultImporter: + userData: "10" + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Scripts.meta b/Source/Assets/TouchScript/Examples/Pull/Scripts.meta new file mode 100644 index 000000000..d9a665ab9 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Scripts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d450e111ead04433cb8527f73c6a561a +folderAsset: yes +timeCreated: 1501591264 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs b/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs new file mode 100644 index 000000000..a16196f05 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs @@ -0,0 +1,104 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; + +namespace TouchScript.Tutorial +{ + public class Logic : MonoBehaviour + { + // Force multiplier + public float ForceMultiplier = 100f; + public LineRenderer Line; + + private PullGesture gesture; + private Rigidbody body; + + private Vector3 forceToApply; + private bool shouldApplyForce = false; + + private void OnEnable() + { + body = GetComponent(); + gesture = GetComponent(); + + Line.enabled = false; + + gesture.Pressed += pressedHandler; + gesture.Pulled += pulledHandler; + gesture.Released += releasedHandler; + gesture.Cancelled += cancelledHandler; + + releaseObject(); + } + + private void OnDisable() + { + gesture.Pressed -= pressedHandler; + gesture.Pulled -= pulledHandler; + gesture.Released -= releasedHandler; + gesture.Cancelled -= cancelledHandler; + } + + private void FixedUpdate() + { + // Apply force in FixedUpdate to make physics happy + if (shouldApplyForce) + { + body.AddForce(forceToApply); + shouldApplyForce = false; + } + } + + // Switch to manual mode + private void takeObject() + { + body.isKinematic = true; + Line.enabled = true; + updateLine(); + } + + // Switch to automatic mode + private void releaseObject() + { + body.isKinematic = false; + Line.enabled = false; + } + + // Push the object when the gesture is ended + private void pushObject() + { + forceToApply = ForceMultiplier * gesture.Force; + shouldApplyForce = true; + } + + // Update the line + private void updateLine() + { + Line.SetPosition(0, gesture.StartPosition); + Line.SetPosition(1, gesture.Position); + } + + private void pressedHandler(object sender, System.EventArgs e) + { + takeObject(); + } + + private void pulledHandler(object sender, System.EventArgs e) + { + updateLine(); + } + + private void releasedHandler(object sender, System.EventArgs e) + { + releaseObject(); + pushObject(); + } + + private void cancelledHandler(object sender, System.EventArgs e) + { + releaseObject(); + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs.meta b/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs.meta new file mode 100644 index 000000000..0e939ac08 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Scripts/Logic.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 057fc4dd3742040c9b65eac0a4e3cac7 +timeCreated: 1501597106 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs b/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs new file mode 100644 index 000000000..f02eaf50f --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs @@ -0,0 +1,171 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Collections.Generic; +using UnityEngine; +using TouchScript.Gestures; +using TouchScript.Pointers; +using System; +using TouchScript.Layers; + +// Let's put our gesture into a namespace so it wouldn't clash with other classes in our project +namespace TouchScript.Tutorial +{ + // The class must inherit from Gesture + public class PullGesture : Gesture + { + public event EventHandler Pressed + { + add { pressedInvoker += value; } + remove { pressedInvoker -= value; } + } + + public event EventHandler Pulled + { + add { pulledInvoker += value; } + remove { pulledInvoker -= value; } + } + + public event EventHandler Released + { + add { releasedInvoker += value; } + remove { releasedInvoker -= value; } + } + + public Vector3 StartPosition + { + get + { + switch (State) + { + case GestureState.Began: + case GestureState.Changed: + case GestureState.Ended: + return startPosition; + default: + return transform.position; + } + } + } + + public Vector3 Position + { + get + { + switch (State) + { + case GestureState.Began: + case GestureState.Changed: + case GestureState.Ended: + return projection.ProjectTo(primaryPointer.Position, plane); + default: + return transform.position; + } + } + } + + public Vector3 Force + { + get { return StartPosition - Position; } + } + + // Needed to overcome iOS AOT limitations + private EventHandler pressedInvoker, pulledInvoker, releasedInvoker; + + // The only pointer we are interested in + private Pointer primaryPointer; + + // Layer projection parameters + private ProjectionParams projection; + + // 3D plane to project to + private Plane plane; + + // The world coordinates of the point where the gesture started + private Vector3 startPosition; + + // Pointers pressed this frame + protected override void pointersPressed(IList pointers) + { + if (State == GestureState.Idle) + { + primaryPointer = pointers[0]; + projection = primaryPointer.GetPressData().Layer.GetProjectionParams(primaryPointer); + plane = new Plane(Vector3.up, transform.position); + startPosition = projection.ProjectTo(primaryPointer.Position, plane); + + // Start the gesture + setState(GestureState.Began); + } + } + + // Pointers updated this frame + protected override void pointersUpdated(IList pointers) + { + foreach (var p in pointers) + { + if (p.Id == primaryPointer.Id) + { + // If the pointer we are interested in moved, change the state + setState(GestureState.Changed); + return; + } + } + } + + // Pointers released this frame + protected override void pointersReleased(IList pointers) + { + foreach (var p in pointers) + { + if (p.Id == primaryPointer.Id) + { + // If the pointer we are interested was released, end the gesture + setState(GestureState.Ended); + return; + } + } + } + + // Pointers cancelled this frame + protected override void pointersCancelled(IList pointers) + { + foreach (var p in pointers) + { + if (p.Id == primaryPointer.Id) + { + // If the pointer we are interested was cancelled, cancel the gesture + setState(GestureState.Cancelled); + return; + } + } + } + + // Called when the gesture transitions to Began state + protected override void onBegan() + { + if (pressedInvoker != null) pressedInvoker(this, EventArgs.Empty); + } + + // Called when the gesture transitions to Ended or Recognized states + protected override void onRecognized() + { + if (releasedInvoker != null) releasedInvoker(this, EventArgs.Empty); + } + + // Called when the gesture transitions to Changed state + protected override void onChanged() + { + if (pulledInvoker != null) pulledInvoker(this, EventArgs.Empty); +// Debug.LogFormat("Start position: {0}, current position: {1}, force: {2}", StartPosition, Position, Force.magnitude); + } + + // This method is called when gesture is reset when recognized or failed + protected override void reset() + { + base.reset(); + primaryPointer = null; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs.meta b/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs.meta new file mode 100644 index 000000000..e041b4880 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/Pull/Scripts/PullGesture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 767c446d703184f6faf8a12a85d591eb +timeCreated: 1501591283 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity b/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity index 41c59ad9d..a892f4c41 100644 --- a/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity +++ b/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,52 +54,73 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} - - 114: {fileID: 62216958} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -112,12 +134,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: .978753865, y: 0, z: 0, w: .205038756} + m_LocalRotation: {x: 0.97875386, y: 0, z: 0, w: 0.20503876} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 23.6635, y: -180, z: -180} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -167,7 +190,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 30 orthographic: 0 @@ -181,34 +204,21 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 ---- !u!114 &62216958 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 62216951} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} - m_Name: - m_EditorClassIdentifier: - Name: Camera - layerMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!1 &250857269 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -236,6 +246,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -249,11 +261,12 @@ RectTransform: - {fileID: 1679844150} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &543251036 Prefab: m_ObjectHideFlags: 0 @@ -293,55 +306,109 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[0] - value: + propertyPath: shouldCreateCameraLayer + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &543251037 stripped -GameObject: - m_PrefabParentObject: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - m_PrefabInternal: {fileID: 543251036} ---- !u!114 &543251038 -MonoBehaviour: +--- !u!1001 &630877083 +Prefab: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 543251037} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} - m_Name: - m_EditorClassIdentifier: - advancedProps: 0 - TouchTags: - tagList: - - Touch - MouseTags: - tagList: - - Mouse - PenTags: - tagList: - - Pen - Windows8Touch: 0 - Windows7Touch: 0 - WebPlayerTouch: 1 - WebGLTouch: 1 - Windows8Mouse: 1 - Windows7Mouse: 1 - UniversalWindowsMouse: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + m_IsPrefabParent: 0 --- !u!1 &740851131 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -363,6 +430,7 @@ RectTransform: - {fileID: 1552723601} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -396,7 +464,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 740851131} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -404,16 +472,19 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &930800600 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} + - component: {fileID: 930800601} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -435,16 +506,17 @@ Transform: - {fileID: 62216952} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1138005899 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -464,11 +536,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -507,12 +580,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -532,11 +605,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -564,6 +638,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -594,12 +669,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -619,11 +694,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 178, y: 48.2000008} - m_SizeDelta: {x: 320, y: 68.4000015} - m_Pivot: {x: .5, y: .5} + m_AnchoredPosition: {x: 178, y: 48.2} + m_SizeDelta: {x: 320, y: 68.4} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -651,6 +727,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -685,10 +762,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Touch m_TagString: Untagged @@ -710,11 +787,12 @@ RectTransform: - {fileID: 1408280581} m_Father: {fileID: 250857271} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -738,10 +816,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -775,36 +853,15 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 ---- !u!1001 &1772227325 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 11400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - m_IsPrefabParent: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1981142012 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -825,20 +882,21 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -852,12 +910,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .32484895, y: -.867448151, z: .0434053168, w: .374329984} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.32484895, y: -0.86744815, z: 0.043405317, w: 0.37432998} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -865,19 +924,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 2 m_Resolution: 3 - m_Strength: .560000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -886,7 +947,9 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} diff --git a/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity.meta b/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity.meta index 1cdb91458..803330be1 100644 --- a/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity.meta +++ b/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 9ee061879a6b743808a9f9056a52d885 DefaultImporter: - userData: + userData: "1" diff --git a/Source/Assets/TouchScript/Examples/RawInput/Scripts/Ball.cs b/Source/Assets/TouchScript/Examples/RawInput/Scripts/Ball.cs index aff73a9b6..1a2cfc856 100644 --- a/Source/Assets/TouchScript/Examples/RawInput/Scripts/Ball.cs +++ b/Source/Assets/TouchScript/Examples/RawInput/Scripts/Ball.cs @@ -6,6 +6,7 @@ namespace TouchScript.Examples.RawInput { + /// public class Ball : MonoBehaviour { public float Speed = 1f; @@ -13,7 +14,7 @@ public class Ball : MonoBehaviour private void Update() { Speed *= 1.01f; - transform.position += transform.forward*Speed*Time.deltaTime; + transform.position += transform.forward * Speed * Time.unscaledDeltaTime; if (Speed > 1000) Destroy(gameObject); } } diff --git a/Source/Assets/TouchScript/Examples/RawInput/Scripts/Spawner.cs b/Source/Assets/TouchScript/Examples/RawInput/Scripts/Spawner.cs index ca8f8daae..a4c1a89ae 100644 --- a/Source/Assets/TouchScript/Examples/RawInput/Scripts/Spawner.cs +++ b/Source/Assets/TouchScript/Examples/RawInput/Scripts/Spawner.cs @@ -6,6 +6,7 @@ namespace TouchScript.Examples.RawInput { + /// public class Spawner : MonoBehaviour { public GameObject Prefab; @@ -14,7 +15,7 @@ private void OnEnable() { if (TouchManager.Instance != null) { - TouchManager.Instance.TouchBegan += touchBeganHandler; + TouchManager.Instance.PointersPressed += pointersPressedHandler; } } @@ -22,7 +23,7 @@ private void OnDisable() { if (TouchManager.Instance != null) { - TouchManager.Instance.TouchBegan -= touchBeganHandler; + TouchManager.Instance.PointersPressed -= pointersPressedHandler; } } @@ -33,9 +34,12 @@ private void spawnPrefabAt(Vector2 position) obj.transform.rotation = transform.rotation; } - private void touchBeganHandler(object sender, TouchEventArgs e) + private void pointersPressedHandler(object sender, PointerEventArgs e) { - spawnPrefabAt(e.Touch.Position); + foreach (var pointer in e.Pointers) + { + spawnPrefabAt(pointer.Position); + } } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Taps/Scripts/Break.cs b/Source/Assets/TouchScript/Examples/Taps/Scripts/Break.cs index 6ce9ba248..4ec3f7129 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Scripts/Break.cs +++ b/Source/Assets/TouchScript/Examples/Taps/Scripts/Break.cs @@ -9,6 +9,7 @@ namespace TouchScript.Examples.Tap { + /// public class Break : MonoBehaviour { public float Power = 10.0f; @@ -51,7 +52,7 @@ private void Update() { if (growing) { - growingTime += Time.deltaTime; + growingTime += Time.unscaledDeltaTime; rnd.material.color = Color.Lerp(Color.white, Color.red, growingTime); } } @@ -87,9 +88,9 @@ private void longPressedHandler(object sender, GestureStateChangeEventArgs e) var cube = obj.transform; cube.parent = transform.parent; cube.name = "Cube"; - cube.localScale = 0.5f*transform.localScale; - cube.position = transform.TransformPoint(directions[i]/4); - cube.GetComponent().AddForce(Power*Random.insideUnitSphere, ForceMode.Impulse); + cube.localScale = 0.5f * transform.localScale; + cube.position = transform.TransformPoint(directions[i] / 4); + cube.GetComponent().AddForce(Power * Random.insideUnitSphere, ForceMode.Impulse); cube.GetComponent().material.color = Color.white; } Destroy(gameObject); diff --git a/Source/Assets/TouchScript/Examples/Taps/Scripts/Kick.cs b/Source/Assets/TouchScript/Examples/Taps/Scripts/Kick.cs index a8f24d6d2..43029cc9d 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Scripts/Kick.cs +++ b/Source/Assets/TouchScript/Examples/Taps/Scripts/Kick.cs @@ -7,6 +7,7 @@ namespace TouchScript.Examples.Tap { + /// public class Kick : MonoBehaviour { public float Force = 3f; @@ -14,10 +15,12 @@ public class Kick : MonoBehaviour private TapGesture gesture; private Rigidbody rb; + private Camera activeCamera; private void OnEnable() { rb = GetComponent(); + activeCamera = GameObject.Find("Scene Camera").GetComponent(); gesture = GetComponent(); gesture.Tapped += tappedHandler; } @@ -29,11 +32,11 @@ private void OnDisable() private void tappedHandler(object sender, System.EventArgs e) { - var ray = Camera.main.ScreenPointToRay(gesture.ScreenPosition); + var ray = activeCamera.ScreenPointToRay(gesture.ScreenPosition); RaycastHit hit; if (Physics.Raycast(ray, out hit) && hit.transform == transform) { - rb.AddForceAtPosition(ray.direction*Force, hit.point, ForceMode.Impulse); + rb.AddForceAtPosition(ray.direction * Force, hit.point, ForceMode.Impulse); Instantiate(Particles, hit.point, Quaternion.identity); } } diff --git a/Source/Assets/TouchScript/Examples/Taps/Scripts/Spawn.cs b/Source/Assets/TouchScript/Examples/Taps/Scripts/Spawn.cs index 4aea36434..29fd674f0 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Scripts/Spawn.cs +++ b/Source/Assets/TouchScript/Examples/Taps/Scripts/Spawn.cs @@ -9,6 +9,7 @@ namespace TouchScript.Examples.Tap { + /// public class Spawn : MonoBehaviour { public Transform CubePrefab; @@ -28,14 +29,13 @@ private void OnDisable() private void tappedHandler(object sender, EventArgs e) { var gesture = sender as TapGesture; - TouchHit hit; - gesture.GetTargetHitResult(out hit); + HitData hit = gesture.GetScreenPositionHitData(); var cube = Instantiate(CubePrefab) as Transform; cube.parent = Container; cube.name = "Cube"; - cube.localScale = Vector3.one*Scale*cube.localScale.x; - cube.position = hit.Point + hit.Normal*.5f; + cube.localScale = Vector3.one * Scale * cube.localScale.x; + cube.position = hit.Point + hit.Normal * .5f; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/Taps/Taps.unity b/Source/Assets/TouchScript/Examples/Taps/Taps.unity index 78d1bb3d1..f5c2aacd0 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Taps.unity +++ b/Source/Assets/TouchScript/Examples/Taps/Taps.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a07fadb24ea940240afba3afc1a692cc, type: 2} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,53 +54,75 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 8 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_ShadowMaskMode: 2 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &62216951 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 62216952} - - 20: {fileID: 62216957} - - 92: {fileID: 62216956} - - 124: {fileID: 62216955} - - 81: {fileID: 62216954} - - 114: {fileID: 62216953} + - component: {fileID: 62216952} + - component: {fileID: 62216957} + - component: {fileID: 62216956} + - component: {fileID: 62216955} + - component: {fileID: 62216954} + - component: {fileID: 62216953} m_Layer: 0 - m_Name: Camera + m_Name: Scene Camera m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -111,12 +134,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 62216951} - m_LocalRotation: {x: .269457936, y: 0, z: 0, w: .963012159} - m_LocalPosition: {x: -1.11000001, y: 10.1000004, z: -17.4500008} + m_LocalRotation: {x: 0.26945794, y: 0, z: 0, w: 0.96301216} + m_LocalPosition: {x: -1.11, y: 10.1, z: -17.45} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 31.264, y: 0, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -125,13 +149,21 @@ MonoBehaviour: m_GameObject: {fileID: 62216951} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4c21776f7e73345948c045618b3fad6f, type: 3} + m_Script: {fileID: 11500000, guid: 7e5768c36d1bb4acea50bd233372843a, type: 3} m_Name: m_EditorClassIdentifier: - Name: Camera + Name: Scene Camera + basicEditor: 1 + advancedProps: 0 + hitProps: 0 + hit3DObjects: 1 + hit2DObjects: 0 + hitWorldSpaceUI: 0 + hitScreenSpaceUI: 0 layerMask: serializedVersion: 2 m_Bits: 4294967295 + useHitFilters: 0 --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -169,7 +201,7 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 40 field of view: 30 orthographic: 0 @@ -183,9 +215,11 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!4 &110191049 stripped Transform: @@ -196,11 +230,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 242343086} - - 222: {fileID: 242343088} - - 114: {fileID: 242343087} + - component: {fileID: 242343086} + - component: {fileID: 242343088} + - component: {fileID: 242343087} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -220,11 +254,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &242343087 MonoBehaviour: m_ObjectHideFlags: 0 @@ -263,10 +298,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 250857271} - - 114: {fileID: 250857270} + - component: {fileID: 250857271} + - component: {fileID: 250857270} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -294,6 +329,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!224 &250857271 RectTransform: m_ObjectHideFlags: 0 @@ -309,11 +346,12 @@ RectTransform: - {fileID: 1962593004} m_Father: {fileID: 1981142013} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &279059992 Prefab: m_ObjectHideFlags: 0 @@ -377,9 +415,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 312263520} + - component: {fileID: 312263520} m_Layer: 0 m_Name: Container m_TagString: Untagged @@ -405,6 +443,7 @@ Transform: - {fileID: 1411274273} m_Father: {fileID: 930800601} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &497908867 stripped Transform: m_PrefabParentObject: {fileID: 496116, guid: 3c294c033fb7140d09b0bd33830617bb, type: 2} @@ -418,7 +457,7 @@ Prefab: m_Modifications: - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.size - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: m_LocalPosition.x @@ -448,10 +487,14 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} propertyPath: layers.Array.data[0] value: - objectReference: {fileID: 0} + objectReference: {fileID: 62216953} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 @@ -474,19 +517,34 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, type: 3} m_Name: m_EditorClassIdentifier: + OnStateChange: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + basicEditor: 0 + generalProps: 0 + limitsProps: 0 advancedProps: 0 - minTouches: 0 - maxTouches: 0 - combineTouches: 0 - combineTouchesInterval: .300000012 + minPointers: 0 + maxPointers: 0 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] + OnTap: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.Gestures.Gesture+GestureEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null numberOfTapsRequired: 2 - timeLimit: Infinity + timeLimit: 1 distanceLimit: Infinity + combinePointers: 0 + combinePointersInterval: 0.3 --- !u!114 &584553679 MonoBehaviour: m_ObjectHideFlags: 0 @@ -510,15 +568,15 @@ Prefab: m_Modifications: - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalPosition.x - value: -.0399999991 + value: -0.04 objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalPosition.y - value: -12.9700003 + value: -12.97 objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalPosition.z - value: .25999999 + value: 0.26 objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalRotation.x @@ -526,7 +584,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalRotation.y - value: .360566735 + value: 0.36056674 objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalRotation.z @@ -534,7 +592,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_LocalRotation.w - value: .932733476 + value: 0.9327335 objectReference: {fileID: 0} - target: {fileID: 400004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} propertyPath: m_RootOrder @@ -575,18 +633,19 @@ MeshCollider: m_Enabled: 1 serializedVersion: 2 m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 4300006, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} --- !u!1 &740851131 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 740851132} - - 223: {fileID: 740851135} - - 114: {fileID: 740851134} - - 114: {fileID: 740851133} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -608,27 +667,12 @@ RectTransform: - {fileID: 1552723601} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!114 &740851133 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 740851131} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!114 &740851134 MonoBehaviour: m_ObjectHideFlags: 0 @@ -657,7 +701,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 740851131} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -665,8 +709,11 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!4 &756017745 stripped Transform: m_PrefabParentObject: {fileID: 496116, guid: 3c294c033fb7140d09b0bd33830617bb, type: 2} @@ -780,10 +827,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 922779737} - - 114: {fileID: 922779736} + - component: {fileID: 922779737} + - component: {fileID: 922779736} m_Layer: 5 m_Name: Double tap m_TagString: Untagged @@ -823,19 +870,20 @@ RectTransform: - {fileID: 1166494019} m_Father: {fileID: 250857271} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &930800600 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 930800601} + - component: {fileID: 930800601} m_Layer: 0 m_Name: Scene m_TagString: Untagged @@ -859,16 +907,17 @@ Transform: - {fileID: 312263520} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1138005899 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1138005900} - - 222: {fileID: 1138005902} - - 114: {fileID: 1138005901} + - component: {fileID: 1138005900} + - component: {fileID: 1138005902} + - component: {fileID: 1138005901} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -888,11 +937,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1138005901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -931,11 +981,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1149683276} - - 222: {fileID: 1149683278} - - 114: {fileID: 1149683277} + - component: {fileID: 1149683276} + - component: {fileID: 1149683278} + - component: {fileID: 1149683277} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -955,11 +1005,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 922779737} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 31, y: 0} m_SizeDelta: {x: 60, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1149683277 MonoBehaviour: m_ObjectHideFlags: 0 @@ -998,12 +1049,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1166494019} - - 222: {fileID: 1166494022} - - 114: {fileID: 1166494021} - - 114: {fileID: 1166494020} + - component: {fileID: 1166494019} + - component: {fileID: 1166494022} + - component: {fileID: 1166494021} + - component: {fileID: 1166494020} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1023,11 +1074,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 922779737} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1166494020 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1069,6 +1121,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1155,18 +1208,20 @@ MeshCollider: m_Enabled: 1 serializedVersion: 2 m_Convex: 1 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 4300004, guid: 648250201fabe574b8591ee45cddcf4a, type: 3} --- !u!1 &1399100003 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1399100004} - - 222: {fileID: 1399100006} - - 114: {fileID: 1399100005} - - 114: {fileID: 1399100007} + - component: {fileID: 1399100004} + - component: {fileID: 1399100006} + - component: {fileID: 1399100005} + - component: {fileID: 1399100007} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1186,11 +1241,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1962593004} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1399100005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1218,6 +1274,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1248,12 +1305,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1408280581} - - 222: {fileID: 1408280583} - - 114: {fileID: 1408280582} - - 114: {fileID: 1408280584} + - component: {fileID: 1408280581} + - component: {fileID: 1408280583} + - component: {fileID: 1408280582} + - component: {fileID: 1408280584} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -1273,11 +1330,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1679844150} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 177.5, y: 0} - m_SizeDelta: {x: 204.699997, y: 0} - m_Pivot: {x: .5, y: .5} + m_SizeDelta: {x: 204.7, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1408280582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1305,6 +1363,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1381,12 +1440,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1552723601} - - 222: {fileID: 1552723603} - - 114: {fileID: 1552723602} - - 114: {fileID: 1552723604} + - component: {fileID: 1552723601} + - component: {fileID: 1552723603} + - component: {fileID: 1552723602} + - component: {fileID: 1552723604} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1406,11 +1465,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 740851132} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 178, y: 78} m_SizeDelta: {x: 320, y: 128} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1438,6 +1498,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1527,10 +1588,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1679844150} - - 114: {fileID: 1679844151} + - component: {fileID: 1679844150} + - component: {fileID: 1679844151} m_Layer: 5 m_Name: Tap m_TagString: Untagged @@ -1552,11 +1613,12 @@ RectTransform: - {fileID: 1408280581} m_Father: {fileID: 250857271} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1679844151 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1584,10 +1646,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1764701050} - - 114: {fileID: 1764701049} + - component: {fileID: 1764701050} + - component: {fileID: 1764701049} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -1621,6 +1683,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -1628,18 +1691,86 @@ Prefab: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 11400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - propertyPath: m_Enabled + propertyPath: useDPI value: 1 objectReference: {fileID: 0} - target: {fileID: 100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} m_IsPrefabParent: 0 @@ -1648,10 +1779,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1962593004} - - 114: {fileID: 1962593005} + - component: {fileID: 1962593004} + - component: {fileID: 1962593005} m_Layer: 5 m_Name: Hold m_TagString: Untagged @@ -1673,11 +1804,12 @@ RectTransform: - {fileID: 1399100004} m_Father: {fileID: 250857271} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1962593005 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1701,9 +1833,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1981142013} + - component: {fileID: 1981142013} m_Layer: 5 m_Name: Panel m_TagString: Untagged @@ -1724,20 +1856,21 @@ RectTransform: - {fileID: 250857271} m_Father: {fileID: 740851132} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .252637833, y: 1} + m_AnchorMax: {x: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} m_SizeDelta: {x: -10, y: -120} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2135305919 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 2135305920} - - 108: {fileID: 2135305921} + - component: {fileID: 2135305920} + - component: {fileID: 2135305921} m_Layer: 0 m_Name: Directional light m_TagString: Untagged @@ -1751,12 +1884,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} - m_LocalRotation: {x: .241942912, y: -.49854365, z: .221075788, w: .802523136} - m_LocalPosition: {x: 6.10041475, y: 15.5403843, z: -20.5662251} + m_LocalRotation: {x: 0.24194291, y: -0.49854365, z: 0.22107579, w: 0.80252314} + m_LocalPosition: {x: 6.1004148, y: 15.540384, z: -20.566225} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 37.5, y: -60.899998, z: 8.2324} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -1764,19 +1898,21 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2135305919} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1.29999995 + m_Intensity: 1.3 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: m_Type: 2 m_Resolution: 3 - m_Strength: .560000002 - m_Bias: .100000001 - m_NormalBias: .400000006 + m_CustomResolution: -1 + m_Strength: 0.56 + m_Bias: 0.1 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1785,7 +1921,9 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} diff --git a/Source/Assets/TouchScript/Examples/Taps/Taps.unity.meta b/Source/Assets/TouchScript/Examples/Taps/Taps.unity.meta index 5df313c60..38e69afdf 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Taps.unity.meta +++ b/Source/Assets/TouchScript/Examples/Taps/Taps.unity.meta @@ -1,4 +1,4 @@ fileFormatVersion: 2 guid: 5013fa58cea314376b273bd8905581f4 DefaultImporter: - userData: + userData: "2" diff --git a/Source/Assets/TouchScript/Examples/_misc/Fonts.meta b/Source/Assets/TouchScript/Examples/_misc/Fonts.meta new file mode 100644 index 000000000..1bcb860ad --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Fonts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 30b6b9c7cc86046c5b991089c741f63f +folderAsset: yes +timeCreated: 1470733534 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf b/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf new file mode 100644 index 000000000..01b535af2 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf.meta b/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf.meta new file mode 100644 index 000000000..2e769a68c --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Fonts/LuckiestGuy.ttf.meta @@ -0,0 +1,19 @@ +fileFormatVersion: 2 +guid: e423173afdece4d3fa49ed8e89391fce +timeCreated: 1470733538 +licenseType: Pro +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/Checker.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/Checker.cs index 11c7cdf92..3782cf0d8 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/Checker.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Checker.cs @@ -4,11 +4,14 @@ using System; using UnityEngine; -using TouchScript.Gestures; using TouchScript.Behaviors; +using TouchScript.Gestures.TransformGestures; namespace TouchScript.Examples { + /// + /// This component controlls the movement of a Checker on the Board. + /// public class Checker : MonoBehaviour { private TransformGesture gesture; @@ -17,24 +20,30 @@ public class Checker : MonoBehaviour private void OnEnable() { + // The gesture gesture = GetComponent(); + // Transformer component actually MOVES the object transformer = GetComponent(); rb = GetComponent(); transformer.enabled = false; rb.isKinematic = false; + + // Subscribe to gesture events gesture.TransformStarted += transformStartedHandler; gesture.TransformCompleted += transformCompletedHandler; } private void OnDisable() { + // Unsubscribe from gesture events gesture.TransformStarted -= transformStartedHandler; gesture.TransformCompleted -= transformCompletedHandler; } private void transformStartedHandler(object sender, EventArgs e) { + // When movement starts we need to tell physics that now WE are moving this object manually rb.isKinematic = true; transformer.enabled = true; } diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs new file mode 100644 index 000000000..47f0ff31e --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs @@ -0,0 +1,22 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; + +/// +public class ExamplesList : MonoBehaviour +{ + public RectTransform Content; + + void Start() + { + gameObject.SetActive(false); + } + + public void ShowHide() + { + gameObject.SetActive(!gameObject.activeSelf); + Content.localPosition = Vector3.zero; + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs.meta b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs.meta new file mode 100644 index 000000000..3ce92d5e7 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1d184134ce2b24f92834c7bd77c9dcd8 +timeCreated: 1470770698 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs new file mode 100644 index 000000000..a7c4b7e5b --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs @@ -0,0 +1,42 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; +using TouchScript.Behaviors.UI; + +/// +public class Highlight : MonoBehaviour +{ + public Color OverColor = Color.red; + + private OverHelper over; + private MeshRenderer r; + private Material oldMaterial; + + private void OnEnable() + { + over = GetComponent(); + r = GetComponent(); + oldMaterial = r.sharedMaterial; + + over.Over += overHandler; + over.Out += outHandler; + } + + private void OnDisable() + { + over.Over -= overHandler; + over.Out -= outHandler; + } + + void overHandler(object sender, System.EventArgs e) + { + r.material.color = OverColor; + } + + void outHandler(object sender, System.EventArgs e) + { + r.material = oldMaterial; + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs.meta b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs.meta new file mode 100644 index 000000000..967ec9b42 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f91ca003806bd40f7938a006eee71921 +timeCreated: 1468203566 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs index e88357af7..52c84878a 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs @@ -7,6 +7,7 @@ namespace TouchScript.Examples { + /// public class KillMe : MonoBehaviour { public float Delay = 1f; diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs index f8f226c8c..115c549b9 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs @@ -4,20 +4,56 @@ using UnityEngine; using TouchScript.Layers; +using System.Collections; +#if UNITY_EDITOR +using UnityEditor; +using System; +#endif +#if UNITY_5_3_OR_NEWER +using UnityEngine.SceneManagement; + +#endif namespace TouchScript.Examples { + /// public class Runner : MonoBehaviour { private static Runner instance; - private UILayer layer; + private TouchLayer layer; + + public void LoadLevel(string name) + { +#if UNITY_5_3_OR_NEWER + SceneManager.LoadScene(name); +#else + Application.LoadLevel(name); +#endif + } public void LoadNextLevel() { - Application.LoadLevel((Application.loadedLevel + 1)%Application.levelCount); +#if UNITY_5_3_OR_NEWER + SceneManager.LoadScene((SceneManager.GetActiveScene().buildIndex + 1) % SceneManager.sceneCountInBuildSettings); +#else + Application.LoadLevel((Application.loadedLevel + 1)%Application.levelCount); +#endif } - private void Awake() + public void LoadPreviousLevel() + { +#if UNITY_5_3_OR_NEWER + var newLevel = SceneManager.GetActiveScene().buildIndex - 1; + if (newLevel == 0) newLevel = SceneManager.sceneCountInBuildSettings - 1; + SceneManager.LoadScene(newLevel); +#else + var newLevel = Application.loadedLevel - 1; + if (newLevel == 0) newLevel = Application.levelCount - 1; + Application.LoadLevel(newLevel); +#endif + } + + private void Start() { if (instance == null) { @@ -25,17 +61,71 @@ private void Awake() DontDestroyOnLoad(gameObject); } - layer = GetComponent(); + layer = GetComponent(); + +#if UNITY_EDITOR + var guids = AssetDatabase.FindAssets("t:Scene", new string[] {"Assets/TouchScript/Examples"}); + if (EditorBuildSettings.scenes.Length != guids.Length) + { + if (EditorUtility.DisplayDialog("Add Example Scenes to Build Settings?", + "You are running Examples scene but example scenes are not added to Build Settings. Do you want to add them now?", "Yes", "No")) + { + var importers = Array.ConvertAll(guids, (string guid) => AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(guid))); + Array.Sort(importers, (AssetImporter a, AssetImporter b) => + { + var i1 = string.IsNullOrEmpty(a.userData) ? 42 : Convert.ToInt32(a.userData); + var i2 = string.IsNullOrEmpty(b.userData) ? 42 : Convert.ToInt32(b.userData); + if (i1 == i2) return 0; + return i1 - i2; + }); + EditorBuildSettings.scenes = Array.ConvertAll(importers, (AssetImporter i) => new EditorBuildSettingsScene(i.assetPath, true)); + EditorUtility.DisplayDialog("Success", "Example scenes were added to Build Settings. Please restart Play Mode.", "OK"); + } + } +#endif + +#if UNITY_5_4_OR_NEWER + SceneManager.sceneLoaded += sceneLoadedHandler; +#endif - if (Application.loadedLevelName == "Examples" && Application.levelCount > 1) +#if UNITY_5_3_OR_NEWER + if (SceneManager.GetActiveScene().name == "Examples" && SceneManager.sceneCountInBuildSettings > 1) +#else + if (Application.loadedLevelName == "Examples" && Application.levelCount > 1) +#endif { LoadNextLevel(); } } + private void OnDestroy() + { +#if UNITY_5_4_OR_NEWER + SceneManager.sceneLoaded -= sceneLoadedHandler; +#endif + } + + private void Update() + { + if (Input.GetKeyDown(KeyCode.Escape)) Application.Quit(); + } + +#if UNITY_5_4_OR_NEWER + private void sceneLoadedHandler(Scene scene, LoadSceneMode mode) + { + StartCoroutine(resetUILayer()); + } +#else private void OnLevelWasLoaded(int num) { - TouchManager.Instance.AddLayer(layer); + StartCoroutine(resetUILayer()); + } +#endif + + private IEnumerator resetUILayer() + { + yield return new WaitForEndOfFrame(); + LayerManager.Instance.AddLayer(layer, 0); } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs new file mode 100644 index 000000000..8f3a5d564 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs @@ -0,0 +1,18 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; +using System.Collections; + +/// +public class ShowMe : MonoBehaviour +{ + IEnumerator Start() + { + var canvas = GetComponent(); + canvas.enabled = false; + yield return new WaitForSeconds(.5f); + canvas.enabled = true; + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs.meta b/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs.meta new file mode 100644 index 000000000..01f169f9a --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c534619fb2794426fb1495e64ec4bcb7 +timeCreated: 1470770477 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Shaders/BorderDiffuse.shader b/Source/Assets/TouchScript/Examples/_misc/Shaders/BorderDiffuse.shader index 7c0ddce20..c6c7716cb 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Shaders/BorderDiffuse.shader +++ b/Source/Assets/TouchScript/Examples/_misc/Shaders/BorderDiffuse.shader @@ -21,7 +21,7 @@ struct Input { void surf (Input IN, inout SurfaceOutput o) { fixed4 c; if (IN.uv_MainTex.x < _Border || IN.uv_MainTex.x > 1 - _Border || IN.uv_MainTex.y < _Border || IN.uv_MainTex.y > 1 - _Border) - c = float4(1); + c = float4(1, 1, 1, 1); else c = tex2D(_MainTex, IN.uv_MainTex); o.Albedo = c.rgb; diff --git a/Source/Assets/TouchScript/Examples/_misc/Shaders/UnlitColor.shader b/Source/Assets/TouchScript/Examples/_misc/Shaders/UnlitColor.shader index f5e7b3c2d..218e91400 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Shaders/UnlitColor.shader +++ b/Source/Assets/TouchScript/Examples/_misc/Shaders/UnlitColor.shader @@ -27,7 +27,7 @@ SubShader { v2f vert (appdata_t v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples.meta new file mode 100644 index 000000000..ee0b7f57e --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ff612c7fb2450453db0aa0aae5024d9f +folderAsset: yes +timeCreated: 1477787804 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png new file mode 100644 index 000000000..8678008c6 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png.meta new file mode 100644 index 000000000..d449219cf --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Camera.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: d1c0e7f7a711f4935b11d81582893ee9 +timeCreated: 1477787811 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png new file mode 100644 index 000000000..59e0b9a3d Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png.meta new file mode 100644 index 000000000..954b1f745 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Checkers.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: af230e20959134865a1c53e6e8edbbe7 +timeCreated: 1477787869 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png new file mode 100644 index 000000000..034b73dce Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png.meta new file mode 100644 index 000000000..190b68656 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Colors.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 2ffae1f119ee1480785aa1061b1ab391 +timeCreated: 1477787932 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png new file mode 100644 index 000000000..add172aca Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png.meta new file mode 100644 index 000000000..ba1052a77 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Cube.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 8ba5d3ffe53b94eb9b457550d9d0c8d8 +timeCreated: 1477787993 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png new file mode 100644 index 000000000..509e95581 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png.meta new file mode 100644 index 000000000..fa7c1a391 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Multiuser.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 7948ef2b5570c4deaa033186f8e3cada +timeCreated: 1477788047 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png new file mode 100644 index 000000000..b44018261 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png.meta new file mode 100644 index 000000000..8aa77d0af --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Photos.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: e2a00bee3078646c684013506c4f40c4 +timeCreated: 1477788133 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png new file mode 100644 index 000000000..e4326afde Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png.meta new file mode 100644 index 000000000..43999417c --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Portal.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 1217c44a62d504b718e8d6b10d17c0cb +timeCreated: 1477788189 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png new file mode 100644 index 000000000..718d1d0d6 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png.meta new file mode 100644 index 000000000..bbb0c8a4a --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Pull.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: ed91d97df020e4a8cb289e68e82485be +timeCreated: 1501601998 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + 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: 1 + spriteTessellationDetail: -1 + textureType: 8 + 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 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png new file mode 100644 index 000000000..e1e3c817a Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png.meta new file mode 100644 index 000000000..8f6f40b22 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/RawInput.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 63efac244c09b40f093989ca7d903d38 +timeCreated: 1477788242 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png new file mode 100644 index 000000000..403dc8180 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png.meta new file mode 100644 index 000000000..58a8e0c3f --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Examples/Taps.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 5a60ebe3657034c78bd3f829dc6b132e +timeCreated: 1477788299 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/drag_media_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/drag_media_gestureworks.png.meta index f1ca4c802..d0285d330 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/drag_media_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/drag_media_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/keyboard.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/keyboard.png.meta index 10236f2a3..b6df9f5e3 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/keyboard.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/keyboard.png.meta @@ -50,7 +50,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/media_rotate_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/media_rotate_gestureworks.png.meta index 07dc6eae1..f1f68ad1d 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/media_rotate_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/media_rotate_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_double_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_double_tap_gestureworks.png.meta index dc5bdae87..307f28e6c 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_double_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_double_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_drag_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_drag_gestureworks.png.meta index 8663d7711..71c6e36d3 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_drag_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_drag_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_flick_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_flick_gestureworks.png.meta index 05cfd3ad5..eb3aa2cea 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_flick_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_flick_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_hold_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_hold_gestureworks.png.meta index b75a33d71..3ff47c9e5 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_hold_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_hold_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_scroll_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_scroll_gestureworks.png.meta index 6cedb89df..0bb9d6098 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_scroll_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_scroll_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_split_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_split_gestureworks.png.meta index 66b960629..5bbf48519 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_split_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_split_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_swipe_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_swipe_gestureworks.png.meta index ce01157bf..c6e3cff25 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_swipe_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_swipe_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_tap_gestureworks.png.meta index 20a476662..bacafdbbe 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_triple_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_triple_tap_gestureworks.png.meta index 68edb5089..5e94e49b6 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_triple_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/one_finger_triple_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_double_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_double_tap_gestureworks.png.meta index 185a71d38..abf272900 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_double_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_double_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_drag_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_drag_gestureworks.png.meta index a24f9cea6..0421d555f 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_drag_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_drag_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_flick_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_flick_gestureworks.png.meta index 9a590a88f..51dcdcfa7 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_flick_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_flick_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_hold_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_hold_gestureworks.png.meta index 7f37d7c1f..0a5715390 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_hold_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_hold_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_horizontal_scale_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_horizontal_scale_gestureworks.png.meta index e4b80f643..c6818dc4f 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_horizontal_scale_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_horizontal_scale_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_rotate_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_rotate_gestureworks.png.meta index 2dbf3c5ce..505c6f755 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_rotate_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_rotate_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scale_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scale_gestureworks.png.meta index d2f62dbdf..5c3584edb 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scale_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scale_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scroll_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scroll_gestureworks.png.meta index 3ac1a2fd3..2517a53c1 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scroll_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_scroll_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_split_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_split_gestureworks.png.meta index 5a16e70da..33b183540 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_split_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_split_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_swipe_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_swipe_gestureworks.png.meta index 3c224ac24..0aa21c19d 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_swipe_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_swipe_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_tap_gestureworks.png.meta index 8fd334448..b1aa90a02 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_triple_tap_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_triple_tap_gestureworks.png.meta index 862ce7ce6..aa09cc6fa 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_triple_tap_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_triple_tap_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_vertical_scale_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_vertical_scale_gestureworks.png.meta index 1aaca0caf..a49a8ce3b 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_vertical_scale_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_finger_vertical_scale_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_rotate_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_rotate_gestureworks.png.meta index f814cde10..92bc22993 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_rotate_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_rotate_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_two_finger_rotate_gestureworks.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_two_finger_rotate_gestureworks.png.meta index 242e8189e..56e55f087 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_two_finger_rotate_gestureworks.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/Icons/two_hand_two_finger_rotate_gestureworks.png.meta @@ -20,6 +20,9 @@ TextureImporter: isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 128 @@ -30,7 +33,9 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 + rGBM: 0 compressionQuality: 50 + allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 @@ -43,5 +48,7 @@ TextureImporter: buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: GestureIcons + spritePackingTag: ui userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI.meta new file mode 100644 index 000000000..17718c61f --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 66c01f575ae174ef3b38e9aeb6a2be8f +folderAsset: yes +timeCreated: 1470731059 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png new file mode 100644 index 000000000..62280c324 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png differ diff --git a/Source/Assets/TouchScript/Textures/Touch.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png.meta similarity index 83% rename from Source/Assets/TouchScript/Textures/Touch.png.meta rename to Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png.meta index 34912225d..dfbe840e6 100644 --- a/Source/Assets/TouchScript/Textures/Touch.png.meta +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_blue.png.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: f5c75ed8c6bed0f489d9003aa739aff7 +guid: 0afc57b6a109d46f6a1168e3fce8d788 +timeCreated: 1470736874 +licenseType: Pro TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 @@ -24,11 +26,11 @@ TextureImporter: cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 - textureFormat: -2 - maxTextureSize: 1024 + textureFormat: -1 + maxTextureSize: 2048 textureSettings: - filterMode: 1 - aniso: 0 + filterMode: -1 + aniso: 16 mipBias: -1 wrapMode: 1 nPOTScale: 0 @@ -44,11 +46,11 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 1 - textureType: 5 + textureType: 8 buildTargetSettings: [] spriteSheet: sprites: [] - spritePackingTag: + spritePackingTag: ui userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png new file mode 100644 index 000000000..d92028304 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png.meta new file mode 100644 index 000000000..a2249bbc2 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_green.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 8c24c9fccfbf94ef08c2da39f7245967 +timeCreated: 1470735958 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png new file mode 100644 index 000000000..0d39c8862 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png.meta new file mode 100644 index 000000000..5a1d77aca --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_text.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 5410db89f39a24e0fa785adf88e19b01 +timeCreated: 1470733972 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png new file mode 100644 index 000000000..b68066a1c Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png.meta new file mode 100644 index 000000000..5bfffde1a --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/button_x.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: da634550c6a1c4ff38304b1c8566d809 +timeCreated: 1470731060 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png new file mode 100644 index 000000000..7edc2b8fd Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png.meta new file mode 100644 index 000000000..1d1f2a3f3 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_bg.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 9162f54c0795b4623b5616fc423eec6a +timeCreated: 1470733131 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 59, y: 126, z: 81, w: 127} + spritePixelsToUnits: 200 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png new file mode 100644 index 000000000..1bae23654 Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png.meta new file mode 100644 index 000000000..7d7e181d3 --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_header.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 795edb780ddd9406493b04bb9b8ed002 +timeCreated: 1470731060 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png new file mode 100644 index 000000000..d01705bab Binary files /dev/null and b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png differ diff --git a/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png.meta b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png.meta new file mode 100644 index 000000000..8048ec0fa --- /dev/null +++ b/Source/Assets/TouchScript/Examples/_misc/Textures/UI/list_item.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: b8fce26041bc947319fee43a8ec9bb5d +timeCreated: 1470731060 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: ui + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Examples/_prefabs.meta b/Source/Assets/TouchScript/Examples/_prefabs.meta deleted file mode 100644 index 6cc00175b..000000000 --- a/Source/Assets/TouchScript/Examples/_prefabs.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 007aa1b53f52c9440a4718611de401d4 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Source/Assets/TouchScript/Examples/_prefabs/TouchScript.prefab b/Source/Assets/TouchScript/Examples/_prefabs/TouchScript.prefab deleted file mode 100644 index 5c4f385ef..000000000 --- a/Source/Assets/TouchScript/Examples/_prefabs/TouchScript.prefab +++ /dev/null @@ -1,59 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &100002 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 400002} - - 114: {fileID: 11400000} - m_Layer: 0 - m_Name: TouchScript - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &400002 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 100002} - 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 ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 100002} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0dd4c394fe06f4ea49e03aaa5e7a8190, type: 3} - m_Name: - m_EditorClassIdentifier: - displayDevice: {fileID: 0} - shouldCreateCameraLayer: 1 - shouldCreateStandardInput: 1 - useSendMessage: 0 - sendMessageEvents: 60 - sendMessageTarget: {fileID: 0} - layers: [] ---- !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: 100002} - m_IsPrefabParent: 1 diff --git a/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs b/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs index ac65128ea..a50fac3a2 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs +++ b/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs @@ -1,6 +1,10 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_TUIO using TouchScript.InputSources; using UnityEditor; -using UnityEditorInternal; using UnityEngine; namespace TouchScript.Editor.InputSources @@ -9,13 +13,10 @@ namespace TouchScript.Editor.InputSources internal sealed class TuioInputEditor : InputSourceEditor { private static readonly GUIContent INPUT_TYPES = new GUIContent("Input Types", "Supported input types."); - private static readonly GUIContent OBJECT_MAPPINGS = new GUIContent("TUIO Object Mappings", "TUIO Object to Tag list."); private TuioInput instance; - private SerializedProperty supportedInputs, tuioObjectMappings; - private SerializedProperty cursorTags, blobTags, objectTags; + private SerializedProperty supportedInputs; private SerializedProperty tuioPort; - private ReorderableList list; protected override void OnEnable() { @@ -23,45 +24,16 @@ protected override void OnEnable() instance = target as TuioInput; supportedInputs = serializedObject.FindProperty("supportedInputs"); - tuioObjectMappings = serializedObject.FindProperty("tuioObjectMappings"); - cursorTags = serializedObject.FindProperty("cursorTags"); - blobTags = serializedObject.FindProperty("blobTags"); - objectTags = serializedObject.FindProperty("objectTags"); tuioPort = serializedObject.FindProperty("tuioPort"); - - list = new ReorderableList(serializedObject, tuioObjectMappings, false, true, true, true); - list.drawHeaderCallback += rect => GUI.Label(rect, OBJECT_MAPPINGS); - list.drawElementCallback += (rect, index, active, focused) => - { - EditorGUI.BeginChangeCheck(); - var element = instance.TuioObjectMappings[index]; - rect.height = 16; - rect.y += 2; - var r = rect; - r.width = 20; - GUI.Label(r, "id:"); - r.x += r.width; - r.width = 50; - var newId = EditorGUI.IntField(r, element.Id); - r.x += r.width; - r.width = 40; - GUI.Label(r, " tag:"); - r.x += r.width; - r.width = rect.width - r.x + rect.x; - var newTag = GUI.TextField(r, element.Tag); - - if (EditorGUI.EndChangeCheck()) - { - element.Id = newId; - element.Tag = newTag; - EditorUtility.SetDirty(target); - } - }; } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif EditorGUILayout.PropertyField(tuioPort); @@ -77,22 +49,9 @@ public override void OnInspectorGUI() } EditorGUI.EndProperty(); - if ((sMask & TuioInput.InputType.Objects) != 0) - { - list.DoLayoutList(); - } - serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); } - - protected override void drawAdvanced() - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(cursorTags); - EditorGUILayout.PropertyField(blobTags); - EditorGUILayout.PropertyField(objectTags); - EditorGUI.indentLevel--; - } } } +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Modules/TUIO/Libraries/OSCsharp.dll.meta b/Source/Assets/TouchScript/Modules/TUIO/Libraries/OSCsharp.dll.meta index d03ca1a4e..18e5d2e69 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Libraries/OSCsharp.dll.meta +++ b/Source/Assets/TouchScript/Modules/TUIO/Libraries/OSCsharp.dll.meta @@ -6,13 +6,73 @@ PluginImporter: executionOrder: {} isPreloaded: 0 platformData: - Any: + Android: enabled: 1 + settings: + CPU: AnyCPU + Any: + enabled: 0 settings: {} Editor: - enabled: 0 + enabled: 1 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Modules/TUIO/Libraries/TUIOsharp.dll.meta b/Source/Assets/TouchScript/Modules/TUIO/Libraries/TUIOsharp.dll.meta index 2b3c14087..7f8062162 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Libraries/TUIOsharp.dll.meta +++ b/Source/Assets/TouchScript/Modules/TUIO/Libraries/TUIOsharp.dll.meta @@ -6,13 +6,73 @@ PluginImporter: executionOrder: {} isPreloaded: 0 platformData: - Any: + Android: enabled: 1 + settings: + CPU: AnyCPU + Any: + enabled: 0 settings: {} Editor: - enabled: 0 + enabled: 1 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs b/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs index b4b0f49b2..dcf62db52 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs +++ b/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs @@ -2,8 +2,12 @@ * @author Valentin Simonov / http://va.lent.in/ */ +#if TOUCHSCRIPT_TUIO +#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_IOS || UNITY_ANDROID using System; using System.Collections.Generic; +using TouchScript.Pointers; +using TouchScript.Utils; using TUIOsharp; using TUIOsharp.DataProcessors; using TUIOsharp.Entities; @@ -15,16 +19,11 @@ namespace TouchScript.InputSources /// Processes TUIO 1.1 input. /// [AddComponentMenu("TouchScript/Input Sources/TUIO Input")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_InputSources_TuioInput.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_InputSources_TuioInput.htm")] public sealed class TuioInput : InputSource { #region Constants - /// - /// TUIO tag used for touches. - /// - public const string SOURCE_TUIO = "TUIO"; - /// /// Type of TUIO input object. /// @@ -32,7 +31,7 @@ public sealed class TuioInput : InputSource public enum InputType { /// - /// Touch/pointer. + /// Pointer. /// Cursors = 1 << 0, @@ -79,38 +78,6 @@ public InputType SupportedInputs } } - /// - /// List of TUIO object ids to tag mappings. - /// - public IList TuioObjectMappings - { - get { return tuioObjectMappings; } - } - - /// - /// Tags for new cursors. - /// - public Tags CursorTags - { - get { return cursorTags; } - } - - /// - /// Tags for new blobs. - /// - public Tags BlobTags - { - get { return blobTags; } - } - - /// - /// Tags for new objects. - /// - public Tags ObjectTags - { - get { return objectTags; } - } - #endregion #region Private variables @@ -121,118 +88,142 @@ public Tags ObjectTags [SerializeField] private InputType supportedInputs = InputType.Cursors | InputType.Blobs | InputType.Objects; - [SerializeField] - private List tuioObjectMappings = new List(); - - [SerializeField] - private Tags cursorTags = new Tags(SOURCE_TUIO, Tags.INPUT_TOUCH); - - [SerializeField] - private Tags blobTags = new Tags(SOURCE_TUIO, Tags.INPUT_TOUCH); - - [SerializeField] - private Tags objectTags = new Tags(SOURCE_TUIO, Tags.INPUT_OBJECT); - private TuioServer server; private CursorProcessor cursorProcessor; private ObjectProcessor objectProcessor; private BlobProcessor blobProcessor; - private Dictionary cursorToInternalId = new Dictionary(); - private Dictionary blobToInternalId = new Dictionary(); - private Dictionary objectToInternalId = new Dictionary(); + private Dictionary cursorToInternalId = new Dictionary(10); + private Dictionary blobToInternalId = new Dictionary(); + private Dictionary objectToInternalId = new Dictionary(); private int screenWidth; private int screenHeight; + private ObjectPool touchPool; + private ObjectPool objectPool; + + #endregion + + #region Constructor + + public TuioInput() + { + touchPool = new ObjectPool(20, () => new TouchPointer(this), null, resetPointer); + objectPool = new ObjectPool(10, () => new ObjectPointer(this), null, resetPointer); + } + #endregion #region Public methods /// - public override void UpdateInput() + public override bool UpdateInput() { - base.UpdateInput(); + if (base.UpdateInput()) return true; + screenWidth = Screen.width; screenHeight = Screen.height; + + return true; } /// - public override void CancelTouch(TouchPoint touch, bool @return) + public override bool CancelPointer(Pointer pointer, bool shouldReturn) { - base.CancelTouch(touch, @return); + base.CancelPointer(pointer, shouldReturn); lock (this) { - TuioCursor cursor = null; - foreach (var touchPoint in cursorToInternalId) + if (pointer.Type == Pointer.PointerType.Touch) { - if (touchPoint.Value.Id == touch.Id) + TuioCursor cursor = null; + foreach (var touchPoint in cursorToInternalId) { - cursor = touchPoint.Key; - break; + if (touchPoint.Value.Id == pointer.Id) + { + cursor = touchPoint.Key; + break; + } } - } - if (cursor != null) - { - cancelTouch(touch.Id); - if (@return) - { - cursorToInternalId[cursor] = beginTouch(touch.Position, touch.Tags, false); - } - else + if (cursor != null) { - cursorToInternalId.Remove(cursor); + cancelPointer(pointer); + if (shouldReturn) + { + cursorToInternalId[cursor] = internalReturnTouch(pointer as TouchPointer); + } + else + { + cursorToInternalId.Remove(cursor); + } + return true; } - return; + return false; } - TuioBlob blob = null; - foreach (var touchPoint in blobToInternalId) + TuioObject obj = null; + foreach (var touchPoint in objectToInternalId) { - if (touchPoint.Value.Id == touch.Id) + if (touchPoint.Value.Id == pointer.Id) { - blob = touchPoint.Key; + obj = touchPoint.Key; break; } } - if (blob != null) + if (obj != null) { - cancelTouch(touch.Id); - if (@return) + cancelPointer(pointer); + if (shouldReturn) { - var t = beginTouch(touch.Position, touch.Tags, false); - t.Properties = touch.Properties; - blobToInternalId[blob] = t; + objectToInternalId[obj] = internalReturnObject(pointer as ObjectPointer, pointer.Position); } else { - blobToInternalId.Remove(blob); + objectToInternalId.Remove(obj); } - return; + return true; } - TuioObject obj = null; - foreach (var touchPoint in objectToInternalId) + TuioBlob blob = null; + foreach (var touchPoint in blobToInternalId) { - if (touchPoint.Value.Id == touch.Id) + if (touchPoint.Value.Id == pointer.Id) { - obj = touchPoint.Key; + blob = touchPoint.Key; break; } } - if (obj != null) + if (blob != null) { - cancelTouch(touch.Id); - if (@return) + cancelPointer(pointer); + if (shouldReturn) { - var t = beginTouch(touch.Position, touch.Tags, false); - t.Properties = touch.Properties; - objectToInternalId[obj] = t; + blobToInternalId[blob] = internalReturnObject(pointer as ObjectPointer, pointer.Position); } else { - objectToInternalId.Remove(obj); + blobToInternalId.Remove(blob); } + return true; } + + return false; + } + } + + #endregion + + #region Internal methods + + /// + public override void INTERNAL_DiscardPointer(Pointer pointer) + { + if (pointer.Type == Pointer.PointerType.Touch) + { + touchPool.Release(pointer as TouchPointer); + } + else if (pointer.Type == Pointer.PointerType.Object) + { + objectPool.Release(pointer as ObjectPointer); } } @@ -277,6 +268,48 @@ protected override void OnDisable() #region Private functions + private TouchPointer internalAddTouch(Vector2 position) + { + var pointer = touchPool.Get(); + pointer.Position = remapCoordinates(position); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + addPointer(pointer); + pressPointer(pointer); + return pointer; + } + + private TouchPointer internalReturnTouch(TouchPointer pointer) + { + var newPointer = touchPool.Get(); + newPointer.CopyFrom(pointer); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + pressPointer(newPointer); + return newPointer; + } + + private ObjectPointer internalAddObject(Vector2 position) + { + var pointer = objectPool.Get(); + pointer.Position = remapCoordinates(position); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + addPointer(pointer); + pressPointer(pointer); + return pointer; + } + + private ObjectPointer internalReturnObject(ObjectPointer pointer, Vector2 position) + { + var newPointer = objectPool.Get(); + newPointer.CopyFrom(pointer); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + pressPointer(newPointer); + return newPointer; + } + private void connect() { if (!Application.isPlaying) return; @@ -296,9 +329,12 @@ private void disconnect() server = null; } - foreach (var i in cursorToInternalId) cancelTouch(i.Value.Id); - foreach (var i in blobToInternalId) cancelTouch(i.Value.Id); - foreach (var i in objectToInternalId) cancelTouch(i.Value.Id); + foreach (var i in cursorToInternalId) cancelPointer(i.Value); + foreach (var i in blobToInternalId) cancelPointer(i.Value); + foreach (var i in objectToInternalId) cancelPointer(i.Value); + cursorToInternalId.Clear(); + blobToInternalId.Clear(); + objectToInternalId.Clear(); } private void updateInputs() @@ -313,37 +349,22 @@ private void updateInputs() else server.RemoveDataProcessor(objectProcessor); } - private void updateBlobProperties(TouchPoint touch, TuioBlob blob) + private void updateBlobProperties(ObjectPointer obj, TuioBlob target) { - var props = touch.Properties; - - props["Angle"] = blob.Angle; - props["Width"] = blob.Width; - props["Height"] = blob.Height; - props["Area"] = blob.Area; - props["RotationVelocity"] = blob.RotationVelocity; - props["RotationAcceleration"] = blob.RotationAcceleration; + obj.Width = target.Width; + obj.Height = target.Height; + obj.Angle = target.Angle; } - private void updateObjectProperties(TouchPoint touch, TuioObject obj) + private void updateObjectProperties(ObjectPointer obj, TuioObject target) { - var props = touch.Properties; - - props["Angle"] = obj.Angle; - props["ObjectId"] = obj.ClassId; - props["RotationVelocity"] = obj.RotationVelocity; - props["RotationAcceleration"] = obj.RotationAcceleration; + obj.ObjectId = target.ClassId; + obj.Angle = target.Angle; } - private string getTagById(int id) + private void resetPointer(Pointer p) { - var count = TuioObjectMappings.Count; - for (var i = 0; i < count; i++) - { - var tuioObjectMapping = tuioObjectMappings[i]; - if (tuioObjectMapping.Id == id) return tuioObjectMapping.Tag; - } - return null; + p.INTERNAL_Reset(); } #endregion @@ -357,7 +378,7 @@ private void OnCursorAdded(object sender, TuioCursorEventArgs e) { var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - cursorToInternalId.Add(entity, beginTouch(new Vector2(x, y), CursorTags)); + cursorToInternalId.Add(entity, internalAddTouch(new Vector2(x, y))); } } @@ -366,13 +387,14 @@ private void OnCursorUpdated(object sender, TuioCursorEventArgs e) var entity = e.Cursor; lock (this) { - TouchPoint touch; + TouchPointer touch; if (!cursorToInternalId.TryGetValue(entity, out touch)) return; var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - moveTouch(touch.Id, new Vector2(x, y)); + touch.Position = remapCoordinates(new Vector2(x, y)); + updatePointer(touch); } } @@ -381,11 +403,12 @@ private void OnCursorRemoved(object sender, TuioCursorEventArgs e) var entity = e.Cursor; lock (this) { - TouchPoint touch; + TouchPointer touch; if (!cursorToInternalId.TryGetValue(entity, out touch)) return; cursorToInternalId.Remove(entity); - endTouch(touch.Id); + releasePointer(touch); + removePointer(touch); } } @@ -396,7 +419,7 @@ private void OnBlobAdded(object sender, TuioBlobEventArgs e) { var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - var touch = beginTouch(new Vector2(x, y), BlobTags); + var touch = internalAddObject(new Vector2(x, y)); updateBlobProperties(touch, entity); blobToInternalId.Add(entity, touch); } @@ -407,14 +430,15 @@ private void OnBlobUpdated(object sender, TuioBlobEventArgs e) var entity = e.Blob; lock (this) { - TouchPoint touch; + ObjectPointer touch; if (!blobToInternalId.TryGetValue(entity, out touch)) return; var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - moveTouch(touch.Id, new Vector2(x, y)); + touch.Position = remapCoordinates(new Vector2(x, y)); updateBlobProperties(touch, entity); + updatePointer(touch); } } @@ -423,11 +447,12 @@ private void OnBlobRemoved(object sender, TuioBlobEventArgs e) var entity = e.Blob; lock (this) { - TouchPoint touch; + ObjectPointer touch; if (!blobToInternalId.TryGetValue(entity, out touch)) return; blobToInternalId.Remove(entity); - endTouch(touch.Id); + releasePointer(touch); + removePointer(touch); } } @@ -438,7 +463,7 @@ private void OnObjectAdded(object sender, TuioObjectEventArgs e) { var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - var touch = beginTouch(new Vector2(x, y), new Tags(ObjectTags, getTagById(entity.ClassId))); + var touch = internalAddObject(new Vector2(x, y)); updateObjectProperties(touch, entity); objectToInternalId.Add(entity, touch); } @@ -449,14 +474,15 @@ private void OnObjectUpdated(object sender, TuioObjectEventArgs e) var entity = e.Object; lock (this) { - TouchPoint touch; + ObjectPointer touch; if (!objectToInternalId.TryGetValue(entity, out touch)) return; var x = entity.X * screenWidth; var y = (1 - entity.Y) * screenHeight; - moveTouch(touch.Id, new Vector2(x, y)); + touch.Position = remapCoordinates(new Vector2(x, y)); updateObjectProperties(touch, entity); + updatePointer(touch); } } @@ -465,31 +491,18 @@ private void OnObjectRemoved(object sender, TuioObjectEventArgs e) var entity = e.Object; lock (this) { - TouchPoint touch; + ObjectPointer touch; if (!objectToInternalId.TryGetValue(entity, out touch)) return; objectToInternalId.Remove(entity); - endTouch(touch.Id); + releasePointer(touch); + removePointer(touch); } } #endregion } - - /// - /// TUIO object id to tag mapping value object. - /// - [Serializable] - public class TuioObjectMapping - { - /// - /// TUIO object id. - /// - public int Id; - - /// - /// Tag to attach to this object. - /// - public string Tag; - } } + +#endif +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Plugins.meta b/Source/Assets/TouchScript/Plugins.meta new file mode 100644 index 000000000..7d3c28e8f --- /dev/null +++ b/Source/Assets/TouchScript/Plugins.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4e748cd3d42a59c42aaf04d413a6bd11 +folderAsset: yes +timeCreated: 1457295412 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Plugins/WindowsTouch.meta b/Source/Assets/TouchScript/Plugins/WindowsTouch.meta new file mode 100644 index 000000000..197d240a2 --- /dev/null +++ b/Source/Assets/TouchScript/Plugins/WindowsTouch.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cb1d7db789f20dc46bdb2a85009389cc +folderAsset: yes +timeCreated: 1457295412 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Plugins/WindowsTouch/.gitignore b/Source/Assets/TouchScript/Plugins/WindowsTouch/.gitignore new file mode 100644 index 000000000..1ffb55b97 --- /dev/null +++ b/Source/Assets/TouchScript/Plugins/WindowsTouch/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!WindowsTouch.dll.meta +!x64 \ No newline at end of file diff --git a/Source/Assets/TouchScript/Plugins/WindowsTouch/WindowsTouch.dll.meta b/Source/Assets/TouchScript/Plugins/WindowsTouch/WindowsTouch.dll.meta new file mode 100644 index 000000000..1e04b3ad3 --- /dev/null +++ b/Source/Assets/TouchScript/Plugins/WindowsTouch/WindowsTouch.dll.meta @@ -0,0 +1,54 @@ +fileFormatVersion: 2 +guid: f19915b81e7ae204c980cfa00fe7873e +timeCreated: 1457295417 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Plugins/WindowsTouch/x64/WindowsTouch.dll.meta b/Source/Assets/TouchScript/Plugins/WindowsTouch/x64/WindowsTouch.dll.meta new file mode 100644 index 000000000..188319501 --- /dev/null +++ b/Source/Assets/TouchScript/Plugins/WindowsTouch/x64/WindowsTouch.dll.meta @@ -0,0 +1,54 @@ +fileFormatVersion: 2 +guid: 8e52c1b48a294e940a1adaa46209e4d7 +timeCreated: 1457295417 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/Cursors.meta b/Source/Assets/TouchScript/Prefabs/Cursors.meta new file mode 100644 index 000000000..fbd865c7c --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: af9d07bfec60f4f0a9e09613cb47f394 +folderAsset: yes +timeCreated: 1478310493 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/Touch Visualizer.prefab b/Source/Assets/TouchScript/Prefabs/Cursors.prefab similarity index 72% rename from Source/Assets/TouchScript/Prefabs/Touch Visualizer.prefab rename to Source/Assets/TouchScript/Prefabs/Cursors.prefab index 3ceaf4f72..58008feac 100644 --- a/Source/Assets/TouchScript/Prefabs/Touch Visualizer.prefab +++ b/Source/Assets/TouchScript/Prefabs/Cursors.prefab @@ -5,13 +5,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 22401058} - - 114: {fileID: 11400000} - - 223: {fileID: 22341586} + - component: {fileID: 22401058} + - component: {fileID: 11400000} + - component: {fileID: 22341586} m_Layer: 0 - m_Name: Touch Visualizer + m_Name: Cursors m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -43,11 +43,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 75324aa372886435faa21a4145210f8e, type: 3} m_Name: m_EditorClassIdentifier: - touchProxy: {fileID: 11468960, guid: 4230502e1973f4c9e9ef6767dcc8c602, type: 2} - showTouchId: 1 - showTags: 1 + generalProps: 0 + advancedProps: 0 + mouseCursor: {fileID: 11416202, guid: a71503570adc6194b9bbc69bf19cc2de, type: 2} + touchCursor: {fileID: 11435582, guid: 7fd82b375cf1cdc45b55e2751d814207, type: 2} + penCursor: {fileID: 11486812, guid: 7af150e8b98b05449aaf9462bd6c7109, type: 2} + objectCursor: {fileID: 11468960, guid: 4230502e1973f4c9e9ef6767dcc8c602, type: 2} useDPI: 1 - touchSize: 1 + cursorSize: 2 + cursorPixelSize: 64 --- !u!1002 &11400001 EditorExtensionImpl: serializedVersion: 6 @@ -61,7 +65,7 @@ Canvas: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 100000} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -69,8 +73,11 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 1 m_SortingLayerID: 0 - m_SortingOrder: 9000 + m_SortingOrder: 32767 + m_TargetDisplay: 0 --- !u!224 &22401058 RectTransform: m_ObjectHideFlags: 1 @@ -83,6 +90,7 @@ RectTransform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -94,7 +102,11 @@ Prefab: serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} - m_Modifications: [] + m_Modifications: + - target: {fileID: 0} + propertyPath: pointerProxy + value: + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 100000} diff --git a/Source/Assets/TouchScript/Prefabs/Touch Visualizer.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Prefabs/Touch Visualizer.prefab.meta rename to Source/Assets/TouchScript/Prefabs/Cursors.prefab.meta diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat b/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat new file mode 100644 index 000000000..6951e644f --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Cursor + m_Shader: {fileID: 4800000, guid: 2af36406130024644b499213db069f78, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: 0.5 + data: + first: + name: _Parallax + second: 0.02 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: 0.5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + data: + first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat.meta new file mode 100644 index 000000000..814588848 --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Cursor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10886028a78e7634d8d44ee11f7b1c08 +timeCreated: 1500213727 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab b/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab new file mode 100644 index 000000000..fa9cc149a --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab @@ -0,0 +1,433 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &152322 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22498922} + - component: {fileID: 22253470} + - component: {fileID: 11415522} + - component: {fileID: 11446012} + m_Layer: 0 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &183852 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22471328} + - component: {fileID: 22246154} + - component: {fileID: 11446800} + - component: {fileID: 11419342} + - component: {fileID: 114695260886518812} + m_Layer: 0 + m_Name: Pressed + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &185820 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22499528} + - component: {fileID: 11416202} + - component: {fileID: 223878911915740246} + - component: {fileID: 225715774982127120} + m_Layer: 0 + m_Name: Mouse Cursor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &189110 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22497446} + - component: {fileID: 22249184} + - component: {fileID: 11453278} + - component: {fileID: 11448672} + - component: {fileID: 114973988835986202} + m_Layer: 0 + m_Name: Default + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &11415522 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 1, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &11416202 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c8fbf4dedcb22ba4c955bd24592e0845, type: 3} + m_Name: + m_EditorClassIdentifier: + ShowPointerId: 0 + ShowFlags: 0 + Text: {fileID: 11415522} + DefaultCursor: {fileID: 0} + PressedCursor: {fileID: 114695260886518812} + ShowButtons: 0 +--- !u!114 &11419342 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} + m_Name: + m_EditorClassIdentifier: + Gradient: + serializedVersion: 2 + key0: {r: 0, g: 0, b: 0, a: 0} + key1: {r: 0, g: 1, b: 0, a: 0.23529412} + key2: {r: 0, g: 1, b: 0, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 1} + key4: {r: 0, g: 0, b: 0, a: 1} + key5: {r: 0, g: 0, b: 0, a: 0.23529412} + key6: {r: 0, g: 0, b: 0, a: 0.25490198} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 31905 + ctime1: 33371 + ctime2: 44754 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 17591 + atime1: 18712 + atime2: 25007 + atime3: 26042 + atime4: 55791 + atime5: 56826 + atime6: 64242 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 4 + m_NumAlphaKeys: 8 + Name: Mouse Pressed + Resolution: 256 +--- !u!114 &11446012 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.541} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &11446800 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &11448672 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 189110} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} + m_Name: + m_EditorClassIdentifier: + Gradient: + serializedVersion: 2 + key0: {r: 0, g: 1, b: 0, a: 1} + key1: {r: 0, g: 1, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 0.23529412} + 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: 9572 + ctime2: 10779 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 9658 + atime2: 11124 + atime3: 19229 + atime4: 20264 + atime5: 64571 + atime6: 64571 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 3 + m_NumAlphaKeys: 5 + Name: Mouse Default + Resolution: 256 +--- !u!114 &11453278 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 189110} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &22246154 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} +--- !u!222 &22249184 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 189110} +--- !u!222 &22253470 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} +--- !u!224 &22471328 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + 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: 22499528} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22497446 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 189110} + 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: 22499528} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22498922 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + 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: 22499528} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 3, y: 0} + m_SizeDelta: {x: 100, y: 64} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &22499528 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + 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: 22497446} + - {fileID: 22471328} + - {fileID: 22498922} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 500, y: 300} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0.5, y: 0.5} +--- !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: 185820} + m_IsPrefabParent: 1 +--- !u!114 &114695260886518812 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a709300256ec1e4995018f4f91470aa, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114973988835986202 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 189110} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a709300256ec1e4995018f4f91470aa, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!223 &223878911915740246 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!225 &225715774982127120 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab.meta new file mode 100644 index 000000000..de2e3cbbe --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Mouse Cursor.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a71503570adc6194b9bbc69bf19cc2de +timeCreated: 1500147529 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab b/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab new file mode 100644 index 000000000..c77271042 --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab @@ -0,0 +1,435 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &108352 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22483962} + - component: {fileID: 22239818} + - component: {fileID: 11439998} + - component: {fileID: 11426034} + m_Layer: 0 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &118164 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22480400} + - component: {fileID: 11486812} + - component: {fileID: 223912096970254378} + - component: {fileID: 225894359780410702} + m_Layer: 0 + m_Name: Pen Cursor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &133736 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22479482} + - component: {fileID: 22231526} + - component: {fileID: 11469244} + - component: {fileID: 11473414} + - component: {fileID: 114485558856495662} + m_Layer: 0 + m_Name: Default + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &167092 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22408358} + - component: {fileID: 22255864} + - component: {fileID: 11426810} + - component: {fileID: 11438738} + - component: {fileID: 114380379277784028} + m_Layer: 0 + m_Name: Pressed + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &11426034 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 108352} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.541} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &11426810 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &11438738 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} + m_Name: + m_EditorClassIdentifier: + Gradient: + serializedVersion: 2 + key0: {r: 0, g: 0, b: 0, a: 0} + key1: {r: 0.99607843, g: 0.9254902, b: 0, a: 0.23529412} + key2: {r: 0.99607843, g: 0.9254902, b: 0, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 1} + key4: {r: 0, g: 0, b: 0, a: 1} + key5: {r: 0, g: 0, b: 0, a: 0.23529412} + key6: {r: 0, g: 0, b: 0, a: 0.25490198} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 31905 + ctime1: 33371 + ctime2: 44754 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 17591 + atime1: 18712 + atime2: 25007 + atime3: 26042 + atime4: 55791 + atime5: 56826 + atime6: 64242 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 4 + m_NumAlphaKeys: 8 + Name: Pen Pressed + Resolution: 256 +--- !u!114 &11439998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 108352} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.99607843, g: 0.9254902, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &11469244 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 133736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &11473414 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 133736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} + m_Name: + m_EditorClassIdentifier: + Gradient: + serializedVersion: 2 + key0: {r: 0.99607843, g: 0.92941177, b: 0.003921569, a: 1} + key1: {r: 0.99607843, g: 0.9254902, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 0.23529412} + 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: 9572 + ctime2: 10779 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 9572 + atime2: 11124 + atime3: 19229 + atime4: 20264 + atime5: 64571 + atime6: 64571 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 3 + m_NumAlphaKeys: 5 + Name: Pen Default + Resolution: 256 +--- !u!114 &11486812 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118164} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 181d9c001cb470f44ac60c140a847605, type: 3} + m_Name: + m_EditorClassIdentifier: + ShowPointerId: 0 + ShowFlags: 0 + Text: {fileID: 11439998} + DefaultCursor: {fileID: 114485558856495662} + PressedCursor: {fileID: 114380379277784028} + ShowButtons: 0 + ShowPressure: 0 + ShowRotation: 0 +--- !u!222 &22231526 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 133736} +--- !u!222 &22239818 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 108352} +--- !u!222 &22255864 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167092} +--- !u!224 &22408358 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167092} + 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: 22480400} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22479482 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 133736} + 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: 22480400} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22480400 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118164} + 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: 22479482} + - {fileID: 22408358} + - {fileID: 22483962} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 500, y: 400} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22483962 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 108352} + 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: 22480400} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 3, y: 0.00000071525574} + m_SizeDelta: {x: 100, y: 64} + m_Pivot: {x: 0, y: 0.5} +--- !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: 118164} + m_IsPrefabParent: 1 +--- !u!114 &114380379277784028 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a709300256ec1e4995018f4f91470aa, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114485558856495662 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 133736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a709300256ec1e4995018f4f91470aa, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!223 &223912096970254378 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118164} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!225 &225894359780410702 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118164} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab.meta new file mode 100644 index 000000000..5df709948 --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Pen Cursor.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7af150e8b98b05449aaf9462bd6c7109 +timeCreated: 1500153289 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/Touch Hit.prefab b/Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab similarity index 53% rename from Source/Assets/TouchScript/Prefabs/Touch Hit.prefab rename to Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab index 48d66cf97..18c2dff48 100644 --- a/Source/Assets/TouchScript/Prefabs/Touch Hit.prefab +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab @@ -1,18 +1,18 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &152322 +--- !u!1 &117830 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 22498922} - - 222: {fileID: 22253470} - - 114: {fileID: 11415522} - - 114: {fileID: 11446012} + - component: {fileID: 22436736} + - component: {fileID: 22287504} + - component: {fileID: 11421528} + - component: {fileID: 11442452} m_Layer: 0 - m_Name: Text + m_Name: Pressed m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -23,94 +23,87 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 22471328} - - 222: {fileID: 22246154} - - 114: {fileID: 11454912} - - 114: {fileID: 11468960} + - component: {fileID: 22471328} + - component: {fileID: 11468960} + - component: {fileID: 223813922742015622} + - component: {fileID: 225429637618999960} m_Layer: 0 - m_Name: Touch Hit + m_Name: Pointer m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &11415522 +--- !u!114 &11421528 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152322} + m_GameObject: {fileID: 117830} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: .00392156886, g: .996078491, b: .996078491, a: 1} + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 3 - m_RichText: 0 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Id: 0 - - Tags: Bla' ---- !u!114 &11446012 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152322} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_EffectColor: {r: 0, g: 0, b: 0, a: .541000009} - m_EffectDistance: {x: 1, y: -1} - m_UseGraphicAlpha: 1 ---- !u!114 &11454912 + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &11442452 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 183852} + m_GameObject: {fileID: 117830} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: f5c75ed8c6bed0f489d9003aa739aff7, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 + Gradient: + serializedVersion: 2 + key0: {r: 0, g: 0, b: 0, a: 0} + key1: {r: 0.003921569, g: 0.99607843, b: 0.99607843, a: 0.23529412} + key2: {r: 0.003921569, g: 0.99607843, b: 0.99607843, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 1} + key4: {r: 0, g: 0, b: 0, a: 1} + key5: {r: 0, g: 0, b: 0, a: 0.23529412} + key6: {r: 0, g: 0, b: 0, a: 0.25490198} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 31905 + ctime1: 33371 + ctime2: 44754 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 17591 + atime1: 18712 + atime2: 25007 + atime3: 26042 + atime4: 55791 + atime5: 56826 + atime6: 64242 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 4 + m_NumAlphaKeys: 8 + Name: Pointer Pressed + Resolution: 256 --- !u!114 &11468960 MonoBehaviour: m_ObjectHideFlags: 1 @@ -122,19 +115,30 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7cb960f8e83f447beb42da7d064d77e2, type: 3} m_Name: m_EditorClassIdentifier: - Text: {fileID: 11415522} ---- !u!222 &22246154 +--- !u!222 &22287504 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 183852} ---- !u!222 &22253470 -CanvasRenderer: + m_GameObject: {fileID: 117830} +--- !u!224 &22436736 +RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152322} + m_GameObject: {fileID: 117830} + 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: 22471328} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.000091552734, y: 0} + m_SizeDelta: {x: -0.00005722046, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &22471328 RectTransform: m_ObjectHideFlags: 1 @@ -145,31 +149,15 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 22498922} + - {fileID: 22436736} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 472, y: 378} + m_AnchoredPosition: {x: 500, y: 100} m_SizeDelta: {x: 64, y: 64} - m_Pivot: {x: .5, y: .5} ---- !u!224 &22498922 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 152322} - 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: 22471328} - m_RootOrder: 0 - m_AnchorMin: {x: 1, y: .5} - m_AnchorMax: {x: 1, y: .5} - m_AnchoredPosition: {x: 3, y: 0} - m_SizeDelta: {x: 100, y: 47} - m_Pivot: {x: 0, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 @@ -181,3 +169,34 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 183852} m_IsPrefabParent: 1 +--- !u!223 &223813922742015622 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!225 &225429637618999960 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Source/Assets/TouchScript/Prefabs/Touch Hit.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Prefabs/Touch Hit.prefab.meta rename to Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab.meta diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab b/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab new file mode 100644 index 000000000..3d6ffbbe2 --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab @@ -0,0 +1,297 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &152322 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22498922} + - component: {fileID: 22253470} + - component: {fileID: 11415522} + - component: {fileID: 11446012} + m_Layer: 0 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &183852 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22471328} + - component: {fileID: 22246154} + - component: {fileID: 11490436} + - component: {fileID: 11433328} + m_Layer: 0 + m_Name: Pressed + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &185820 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 22499528} + - component: {fileID: 11435582} + - component: {fileID: 223147991810450650} + - component: {fileID: 225477107791102178} + m_Layer: 0 + m_Name: Touch Cursor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &11415522 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.003921569, g: 0.9960785, b: 0.9960785, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &11433328 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, type: 3} + m_Name: + m_EditorClassIdentifier: + Gradient: + serializedVersion: 2 + key0: {r: 0, g: 0, b: 0, a: 0} + key1: {r: 0.003921569, g: 0.99607843, b: 0.99607843, a: 0.23529412} + key2: {r: 0.003921569, g: 0.99607843, b: 0.99607843, a: 0.23529412} + key3: {r: 0, g: 0, b: 0, a: 1} + key4: {r: 0, g: 0, b: 0, a: 1} + key5: {r: 0, g: 0, b: 0, a: 0.23529412} + key6: {r: 0, g: 0, b: 0, a: 0.25490198} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 31905 + ctime1: 33371 + ctime2: 44754 + ctime3: 46306 + ctime4: 45875 + ctime5: 59068 + ctime6: 0 + ctime7: 0 + atime0: 17591 + atime1: 18712 + atime2: 25007 + atime3: 26042 + atime4: 55791 + atime5: 56826 + atime6: 64242 + atime7: 64571 + m_Mode: 0 + m_NumColorKeys: 4 + m_NumAlphaKeys: 8 + Name: Touch Pressed + Resolution: 256 +--- !u!114 &11435582 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d3a5cfcc9939fb340b2c3ed29a3d0b5d, type: 3} + m_Name: + m_EditorClassIdentifier: + ShowPointerId: 0 + ShowFlags: 0 + Text: {fileID: 11415522} + ShowPressure: 0 + ShowRotation: 0 +--- !u!114 &11446012 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.541} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &11490436 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 10886028a78e7634d8d44ee11f7b1c08, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &22246154 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} +--- !u!222 &22253470 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} +--- !u!224 &22471328 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 183852} + 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: 22499528} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22498922 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152322} + 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: 22499528} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 3, y: 0.00000035762787} + m_SizeDelta: {x: 100, y: 64} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &22499528 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + 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: 22471328} + - {fileID: 22498922} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 500, y: 200} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0.5, y: 0.5} +--- !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: 185820} + m_IsPrefabParent: 1 +--- !u!223 &223147991810450650 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!225 &225477107791102178 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 185820} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab.meta new file mode 100644 index 000000000..e71f5ff4c --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/Cursors/Touch Cursor.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7fd82b375cf1cdc45b55e2751d814207 +timeCreated: 1500151683 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Prefabs/TouchManager.prefab b/Source/Assets/TouchScript/Prefabs/TouchManager.prefab new file mode 100644 index 000000000..8e8469645 --- /dev/null +++ b/Source/Assets/TouchScript/Prefabs/TouchManager.prefab @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100002 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 400002} + - component: {fileID: 11400000} + - component: {fileID: 11478012} + m_Layer: 0 + m_Name: TouchManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400002 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100002} + 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 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0dd4c394fe06f4ea49e03aaa5e7a8190, type: 3} + m_Name: + m_EditorClassIdentifier: + debugMode: 1 + OnFrameStart: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+FrameEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnFrameFinish: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+FrameEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersAdd: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersUpdate: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersPress: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersRelease: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersRemove: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + OnPointersCancel: + m_PersistentCalls: + m_Calls: [] + m_TypeName: TouchScript.TouchManager+PointerEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + advancedProps: 0 + displayDevice: {fileID: 0} + shouldCreateCameraLayer: 1 + shouldCreateStandardInput: 1 + useSendMessage: 0 + sendMessageEvents: 60 + sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + layers: [] +--- !u!114 &11478012 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e276ccba4f7314d9988af19f9b3a611b, type: 3} + m_Name: + m_EditorClassIdentifier: + advancedProps: 0 + generalProps: 0 + windowsProps: 0 + windows8API: 0 + windows7API: 0 + webGLTouch: 1 + windows8Mouse: 1 + windows7Mouse: 1 + universalWindowsMouse: 1 + emulateSecondMousePointer: 1 +--- !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: 100002} + m_IsPrefabParent: 1 diff --git a/Source/Assets/TouchScript/Examples/_prefabs/TouchScript.prefab.meta b/Source/Assets/TouchScript/Prefabs/TouchManager.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Examples/_prefabs/TouchScript.prefab.meta rename to Source/Assets/TouchScript/Prefabs/TouchManager.prefab.meta diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Behaviors/Visualizer.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/Cursors.meta diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs new file mode 100644 index 000000000..d901bf4e8 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs @@ -0,0 +1,381 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Collections.Generic; +using TouchScript.Utils; +using TouchScript.Pointers; +using TouchScript.Utils.Attributes; +using UnityEngine; +using UnityEngine.Profiling; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Pointer visualizer which shows pointer circles with debug text using Unity UI. + /// The script should be placed on an element with RectTransform or a Canvas. A reference prefab is provided in TouchScript package. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_CursorManager.htm")] + public class CursorManager : MonoBehaviour + { + #region Public properties + + /// + /// Prefab to use as mouse cursors template. + /// + public PointerCursor MouseCursor + { + get { return mouseCursor; } + set { mouseCursor = value; } + } + + /// + /// Prefab to use as touch cursors template. + /// + public PointerCursor TouchCursor + { + get { return touchCursor; } + set { touchCursor = value; } + } + + /// + /// Prefab to use as pen cursors template. + /// + public PointerCursor PenCursor + { + get { return penCursor; } + set { penCursor = value; } + } + + /// + /// Prefab to use as object cursors template. + /// + public PointerCursor ObjectCursor + { + get { return objectCursor; } + set { objectCursor = value; } + } + + /// + /// Gets or sets whether is using DPI to scale pointer cursors. + /// + /// true if DPI value is used; otherwise, false. + public bool UseDPI + { + get { return useDPI; } + set + { + useDPI = value; + updateCursorSize(); + } + } + + /// + /// Gets or sets the size of pointer cursors in cm. This value is only used when is set to true. + /// + /// The size of pointer cursors in cm. + public float CursorSize + { + get { return cursorSize; } + set + { + cursorSize = value; + updateCursorSize(); + } + } + + /// + /// Cursor size in pixels. + /// + public uint CursorPixelSize + { + get { return cursorPixelSize; } + set + { + cursorPixelSize = value; + updateCursorSize(); + } + } + + #endregion + + #region Private variables + + [SerializeField] + private bool cursorsProps; // Used in the custom inspector + + [SerializeField] + private PointerCursor mouseCursor; + + [SerializeField] + private PointerCursor touchCursor; + + [SerializeField] + private PointerCursor penCursor; + + [SerializeField] + private PointerCursor objectCursor; + + [SerializeField] + [ToggleLeft] + private bool useDPI = true; + + [SerializeField] + private float cursorSize = 1f; + + [SerializeField] + private uint cursorPixelSize = 64; + + private RectTransform rect; + private ObjectPool mousePool; + private ObjectPool touchPool; + private ObjectPool penPool; + private ObjectPool objectPool; + private Dictionary cursors = new Dictionary(10); + +#if UNITY_5_6_OR_NEWER + private CustomSampler cursorSampler; +#endif + + #endregion + + #region Unity methods + + private void Awake() + { +#if UNITY_5_6_OR_NEWER + cursorSampler = CustomSampler.Create("[TouchScript] Update Cursors"); + cursorSampler.Begin(); +#endif + + mousePool = new ObjectPool(2, instantiateMouseProxy, null, clearProxy); + touchPool = new ObjectPool(10, instantiateTouchProxy, null, clearProxy); + penPool = new ObjectPool(2, instantiatePenProxy, null, clearProxy); + objectPool = new ObjectPool(2, instantiateObjectProxy, null, clearProxy); + + updateCursorSize(); + + rect = transform as RectTransform; + if (rect == null) + { + Debug.LogError("CursorManager must be on an UI element!"); + enabled = false; + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void OnEnable() + { + if (TouchManager.Instance != null) + { + TouchManager.Instance.PointersAdded += pointersAddedHandler; + TouchManager.Instance.PointersRemoved += pointersRemovedHandler; + TouchManager.Instance.PointersPressed += pointersPressedHandler; + TouchManager.Instance.PointersReleased += pointersReleasedHandler; + TouchManager.Instance.PointersUpdated += PointersUpdatedHandler; + TouchManager.Instance.PointersCancelled += pointersCancelledHandler; + } + } + + private void OnDisable() + { + if (TouchManager.Instance != null) + { + TouchManager.Instance.PointersAdded -= pointersAddedHandler; + TouchManager.Instance.PointersRemoved -= pointersRemovedHandler; + TouchManager.Instance.PointersPressed -= pointersPressedHandler; + TouchManager.Instance.PointersReleased -= pointersReleasedHandler; + TouchManager.Instance.PointersUpdated -= PointersUpdatedHandler; + TouchManager.Instance.PointersCancelled -= pointersCancelledHandler; + } + } + + #endregion + + #region Private functions + + private PointerCursor instantiateMouseProxy() + { + return Instantiate(mouseCursor); + } + + private PointerCursor instantiateTouchProxy() + { + return Instantiate(touchCursor); + } + + private PointerCursor instantiatePenProxy() + { + return Instantiate(penCursor); + } + + private PointerCursor instantiateObjectProxy() + { + return Instantiate(objectCursor); + } + + private void clearProxy(PointerCursor cursor) + { + cursor.Hide(); + } + + private void updateCursorSize() + { + if (useDPI) cursorPixelSize = (uint) (cursorSize * TouchManager.Instance.DotsPerCentimeter); + } + + #endregion + + #region Event handlers + + private void pointersAddedHandler(object sender, PointerEventArgs e) + { +#if UNITY_5_6_OR_NEWER + cursorSampler.Begin(); +#endif + + updateCursorSize(); + + var count = e.Pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = e.Pointers[i]; + // Don't show internal pointers + if ((pointer.Flags & Pointer.FLAG_INTERNAL) > 0) continue; + + PointerCursor cursor; + switch (pointer.Type) + { + case Pointer.PointerType.Mouse: + cursor = mousePool.Get(); + break; + case Pointer.PointerType.Touch: + cursor = touchPool.Get(); + break; + case Pointer.PointerType.Pen: + cursor = penPool.Get(); + break; + case Pointer.PointerType.Object: + cursor = objectPool.Get(); + break; + default: + continue; + } + + cursor.Size = cursorPixelSize; + cursor.Init(rect, pointer); + cursors.Add(pointer.Id, cursor); + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void pointersRemovedHandler(object sender, PointerEventArgs e) + { +#if UNITY_5_6_OR_NEWER + cursorSampler.Begin(); +#endif + + var count = e.Pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = e.Pointers[i]; + PointerCursor cursor; + if (!cursors.TryGetValue(pointer.Id, out cursor)) continue; + cursors.Remove(pointer.Id); + + switch (pointer.Type) + { + case Pointer.PointerType.Mouse: + mousePool.Release(cursor); + break; + case Pointer.PointerType.Touch: + touchPool.Release(cursor); + break; + case Pointer.PointerType.Pen: + penPool.Release(cursor); + break; + case Pointer.PointerType.Object: + objectPool.Release(cursor); + break; + } + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void pointersPressedHandler(object sender, PointerEventArgs e) + { +#if UNITY_5_6_OR_NEWER + cursorSampler.Begin(); +#endif + + var count = e.Pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = e.Pointers[i]; + PointerCursor cursor; + if (!cursors.TryGetValue(pointer.Id, out cursor)) continue; + cursor.SetState(pointer, PointerCursor.CursorState.Pressed); + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void PointersUpdatedHandler(object sender, PointerEventArgs e) + { +#if UNITY_5_6_OR_NEWER + cursorSampler.Begin(); +#endif + + var count = e.Pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = e.Pointers[i]; + PointerCursor cursor; + if (!cursors.TryGetValue(pointer.Id, out cursor)) continue; + cursor.UpdatePointer(pointer); + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void pointersReleasedHandler(object sender, PointerEventArgs e) + { +#if UNITY_5_6_OR_NEWER + cursorSampler.Begin(); +#endif + + var count = e.Pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = e.Pointers[i]; + PointerCursor cursor; + if (!cursors.TryGetValue(pointer.Id, out cursor)) continue; + cursor.SetState(pointer, PointerCursor.CursorState.Released); + } + +#if UNITY_5_6_OR_NEWER + cursorSampler.End(); +#endif + } + + private void pointersCancelledHandler(object sender, PointerEventArgs e) + { + pointersRemovedHandler(sender, e); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs.meta index 39a9874cd..0b725e78b 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs new file mode 100644 index 000000000..290259ac7 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs @@ -0,0 +1,91 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Behaviors.Cursors.UI; +using TouchScript.Pointers; +using TouchScript.Utils; +using UnityEngine; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Cursor for mouse pointers. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_MouseCursor.htm")] + public class MouseCursor : TextPointerCursor + { + #region Public properties + + /// + /// Default cursor sub object. + /// + public TextureSwitch DefaultCursor; + + /// + /// Pressed cursor sub object. + /// + public TextureSwitch PressedCursor; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowButtons = false; + + #endregion + + #region Protected methods + + /// + protected override void updateOnce(IPointer pointer) + { + switch (state) + { + case CursorState.Released: + case CursorState.Over: + if (DefaultCursor != null) DefaultCursor.Show(); + if (PressedCursor != null) PressedCursor.Hide(); + break; + case CursorState.Pressed: + case CursorState.OverPressed: + if (DefaultCursor != null) DefaultCursor.Hide(); + if (PressedCursor != null) PressedCursor.Show(); + break; + } + + base.updateOnce(pointer); + } + + /// + protected override void generateText(MousePointer pointer, StringBuilder str) + { + base.generateText(pointer, str); + + if (ShowButtons) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Buttons: "); + PointerUtils.PressedButtonsToString(pointer.Buttons, str); + } + } + + /// + protected override bool textIsVisible() + { + return base.textIsVisible() || ShowButtons; + } + + /// + protected override uint gethash(MousePointer pointer) + { + var hash = base.gethash(pointer); + + if (ShowButtons) hash += (uint) (pointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed); + + return hash; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs.meta new file mode 100644 index 000000000..e435bd7cd --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/MouseCursor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c8fbf4dedcb22ba4c955bd24592e0845 +timeCreated: 1500143380 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs new file mode 100644 index 000000000..63d6f45d8 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs @@ -0,0 +1,84 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Cursor for object pointers. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_ObjectCursor.htm")] + public class ObjectCursor : TextPointerCursor + { + #region Public properties + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowObjectId = false; + + /// + /// Should the values of and be shown on the cursor. + /// + public bool ShowSize = false; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowAngle = false; + + #endregion + + #region Protected methods + + /// + protected override void generateText(ObjectPointer pointer, StringBuilder str) + { + base.generateText(pointer, str); + + if (ShowObjectId) + { + if (str.Length > 0) str.Append("\n"); + str.Append("ObjectId: "); + str.Append(pointer.ObjectId); + } + if (ShowSize) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Size: "); + str.Append(pointer.Width); + str.Append("x"); + str.Append(pointer.Height); + } + if (ShowAngle) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Angle: "); + str.Append(pointer.Angle); + } + } + + /// + protected override bool textIsVisible() + { + return base.textIsVisible() || ShowObjectId || ShowSize || ShowAngle; + } + + /// + protected override uint gethash(ObjectPointer pointer) + { + var hash = base.gethash(pointer); + + if (ShowSize) hash += (uint) (pointer.Width * 1024 + pointer.Height * 1024 * 1024) << 8; + if (ShowAngle) hash += (uint) (pointer.Angle * 1024) << 24; + + return hash; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs.meta new file mode 100644 index 000000000..3af02327b --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/ObjectCursor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 278a3da2a34252e45bd08b6726d68e87 +timeCreated: 1500144248 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs new file mode 100644 index 000000000..9f531d168 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs @@ -0,0 +1,115 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Behaviors.Cursors.UI; +using TouchScript.Pointers; +using TouchScript.Utils; +using UnityEngine; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Cursor for pen pointers. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_PenCursor.htm")] + public class PenCursor : TextPointerCursor + { + #region Public properties + + /// + /// Default cursor sub object. + /// + public TextureSwitch DefaultCursor; + + /// + /// Pressed cursor sub object. + /// + public TextureSwitch PressedCursor; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowButtons = false; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowPressure = false; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowRotation = false; + + #endregion + + #region Protected methods + + /// + protected override void updateOnce(IPointer pointer) + { + switch (state) + { + case CursorState.Released: + case CursorState.Over: + if (DefaultCursor != null) DefaultCursor.Show(); + if (PressedCursor != null) PressedCursor.Hide(); + break; + case CursorState.Pressed: + case CursorState.OverPressed: + if (DefaultCursor != null) DefaultCursor.Hide(); + if (PressedCursor != null) PressedCursor.Show(); + break; + } + + base.updateOnce(pointer); + } + + /// + protected override void generateText(PenPointer pointer, StringBuilder str) + { + base.generateText(pointer, str); + + if (ShowButtons) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Buttons: "); + PointerUtils.PressedButtonsToString(pointer.Buttons, str); + } + if (ShowPressure) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Pressure: "); + str.AppendFormat("{0:0.000}", pointer.Pressure); + } + if (ShowRotation) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Rotation: "); + str.Append(pointer.Rotation); + } + } + + /// + protected override bool textIsVisible() + { + return base.textIsVisible() || ShowButtons || ShowPressure || ShowRotation; + } + + /// + protected override uint gethash(PenPointer pointer) + { + var hash = base.gethash(pointer); + + if (ShowButtons) hash += (uint) (pointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed); + if (ShowPressure) hash += (uint) (pointer.Pressure * 1024) << 8; + if (ShowRotation) hash += (uint) (pointer.Rotation * 1024) << 16; + + return hash; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs.meta new file mode 100644 index 000000000..d41fff151 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PenCursor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 181d9c001cb470f44ac60c140a847605 +timeCreated: 1500144236 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs new file mode 100644 index 000000000..dd9ee0321 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs @@ -0,0 +1,338 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Pointers; +using TouchScript.Utils; +using UnityEngine; +using UnityEngine.UI; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Abstract class for pointer cursors with text. + /// + /// Pointer type. + /// + public abstract class TextPointerCursor : PointerCursor where T : IPointer + { + #region Public properties + + /// + /// Should the value of be shown on screen on the cursor. + /// + public bool ShowPointerId = true; + + /// + /// Should the value of be shown on screen on the cursor. + /// + public bool ShowFlags = false; + + /// + /// The link to UI.Text component. + /// + public Text Text; + + #endregion + + #region Private variables + + private static StringBuilder stringBuilder = new StringBuilder(64); + + #endregion + + #region Protected methods + + /// + protected override void updateOnce(IPointer pointer) + { + base.updateOnce(pointer); + + if (Text == null) return; + if (!textIsVisible()) + { + Text.enabled = false; + return; + } + + Text.enabled = true; + stringBuilder.Length = 0; + generateText((T) pointer, stringBuilder); + + Text.text = stringBuilder.ToString(); + } + + /// + /// Generates text for pointer. + /// + /// The pointer. + /// The string builder to use. + protected virtual void generateText(T pointer, StringBuilder str) + { + if (ShowPointerId) + { + str.Append("Id: "); + str.Append(pointer.Id); + } + if (ShowFlags) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Flags: "); + BinaryUtils.ToBinaryString(pointer.Flags, str, 8); + } + } + + /// + /// Indicates if text should be visible. + /// + /// True if pointer text should be displayed; false otherwise. + protected virtual bool textIsVisible() + { + return ShowPointerId || ShowFlags; + } + + /// + /// Typed version of . Returns a hash of a cursor state. + /// + /// The pointer. + /// Integer hash. + protected virtual uint gethash(T pointer) + { + var hash = (uint) state; + if (ShowFlags) hash += pointer.Flags << 3; + return hash; + } + + /// + protected sealed override uint getPointerHash(IPointer pointer) + { + return gethash((T) pointer); + } + + #endregion + } + + /// + /// Visual cursor implementation used by TouchScript. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_PointerCursor.htm")] + public class PointerCursor : MonoBehaviour + { + #region Consts + + /// + /// Possible states of a cursor. + /// + public enum CursorState + { + /// + /// Not pressed. + /// + Released, + + /// + /// Pressed. + /// + Pressed, + + /// + /// Over something. + /// + Over, + + /// + /// Over and pressed. + /// + OverPressed + } + + #endregion + + #region Public properties + + /// + /// Cursor size in pixels. + /// + public float Size + { + get { return size; } + set + { + size = value; + if (size > 0) + { + rect.sizeDelta = Vector2.one * size; + } + else + { + size = 0; + rect.sizeDelta = Vector2.one * defaultSize; + } + } + } + + #endregion + + #region Private variables + + /// + /// Current cursor state. + /// + protected CursorState state; + + /// + /// CUrrent cursor state data. + /// + protected object stateData; + + /// + /// Cached RectTransform. + /// + protected RectTransform rect; + + /// + /// Cursor size. + /// + protected float size = 0; + + /// + /// Initial cursor size in pixels. + /// + protected float defaultSize; + + /// + /// Last data hash. + /// + protected uint hash = uint.MaxValue; + + private CanvasGroup group; + + #endregion + + #region Public methods + + /// + /// Initializes (resets) the cursor. + /// + /// Parent container. + /// Pointer this cursor represents. + public void Init(RectTransform parent, IPointer pointer) + { + hash = uint.MaxValue; + group = GetComponent(); + + show(); + rect.SetParent(parent); + rect.SetAsLastSibling(); + state = CursorState.Released; + + UpdatePointer(pointer); + } + + /// + /// Updates the pointer. This method is called when the pointer is moved. + /// + /// Pointer this cursor represents. + public void UpdatePointer(IPointer pointer) + { + rect.anchoredPosition = pointer.Position; + var newHash = getPointerHash(pointer); + if (newHash != hash) updateOnce(pointer); + hash = newHash; + + update(pointer); + } + + /// + /// Sets the state of the cursor. + /// + /// The pointer. + /// The new state. + /// State data. + public void SetState(IPointer pointer, CursorState newState, object data = null) + { + state = newState; + stateData = data; + + var newHash = getPointerHash(pointer); + if (newHash != hash) updateOnce(pointer); + hash = newHash; + } + + /// + /// Hides this instance. + /// + public void Hide() + { + hide(); + } + + #endregion + + #region Unity methods + + private void Awake() + { + rect = transform as RectTransform; + if (rect == null) + { + Debug.LogError("PointerCursor must be on an UI element!"); + enabled = false; + return; + } + rect.anchorMin = rect.anchorMax = Vector2.zero; + defaultSize = rect.sizeDelta.x; + } + + #endregion + + #region Protected methods + + /// + /// Hides (clears) this instance. + /// + protected virtual void hide() + { + group.alpha = 0; +#if UNITY_EDITOR + gameObject.name = "Inactive Pointer"; +#endif + } + + /// + /// Shows this instance. + /// + protected virtual void show() + { + group.alpha = 1; +#if UNITY_EDITOR + gameObject.name = "Pointer"; +#endif + } + + /// + /// This method is called once when the cursor is initialized. + /// + /// The pointer. + protected virtual void updateOnce(IPointer pointer) {} + + /// + /// This method is called every time when the pointer changes. + /// + /// The pointer. + protected virtual void update(IPointer pointer) {} + + /// + /// Returns pointer hash. + /// + /// The pointer. + /// Integer hash value. + protected virtual uint getPointerHash(IPointer pointer) + { + return (uint) state; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs.meta index 814d41e12..7c9a29c24 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs new file mode 100644 index 000000000..e6c1ce249 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs @@ -0,0 +1,71 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Behaviors.Cursors +{ + /// + /// Cursor for touch pointers. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_TouchCursor.htm")] + public class TouchCursor : TextPointerCursor + { + #region Public properties + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowPressure = false; + + /// + /// Should the value of be shown on the cursor. + /// + public bool ShowRotation = false; + + #endregion + + #region Protected methods + + /// + protected override void generateText(TouchPointer pointer, StringBuilder str) + { + base.generateText(pointer, str); + + if (ShowPressure) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Pressure: "); + str.AppendFormat("{0:0.000}", pointer.Pressure); + } + if (ShowRotation) + { + if (str.Length > 0) str.Append("\n"); + str.Append("Rotation: "); + str.Append(pointer.Rotation); + } + } + + /// + protected override bool textIsVisible() + { + return base.textIsVisible() || ShowPressure || ShowRotation; + } + + /// + protected override uint gethash(TouchPointer pointer) + { + var hash = base.gethash(pointer); + + if (ShowPressure) hash += (uint) (pointer.Pressure * 1024) << 8; + if (ShowRotation) hash += (uint) (pointer.Rotation * 1024) << 16; + + return hash; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs.meta new file mode 100644 index 000000000..1e6680559 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/TouchCursor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d3a5cfcc9939fb340b2c3ed29a3d0b5d +timeCreated: 1500144224 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI.meta new file mode 100644 index 000000000..20a9f09b9 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e004f1e8c67a2194bbd272848892c468 +folderAsset: yes +timeCreated: 1500212489 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs new file mode 100644 index 000000000..2040a1a66 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs @@ -0,0 +1,130 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace TouchScript.Behaviors.Cursors.UI +{ + /// + /// Generates a texture with a circle gradient. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_UI_GradientTexture.htm")] + public class GradientTexture : MonoBehaviour + { + /// + /// Resolution in pixels. + /// + public enum Res + { + /// + /// 16x16 + /// + Pix16 = 16, + + /// + /// 32x32 + /// + Pix32 = 32, + + /// + /// 64x64 + /// + Pix64 = 64, + + /// + /// 128x128 + /// + Pix128 = 128, + + /// + /// 256x256 + /// + Pix256 = 256, + + /// + /// 512x512 + /// + Pix512 = 512 + } + + /// + /// The gradient. + /// + public Gradient Gradient = new Gradient(); + + /// + /// Gradient's name. Used to cache textures. + /// + public string Name = "Gradient"; + + /// + /// Texture resolution. + /// + public Res Resolution = Res.Pix128; + + private Texture2D texture; + private static Dictionary textureCache = new Dictionary(); + + /// + /// Generates the gradient texture. + /// + /// Generated texture. + public Texture2D Generate() + { + var res = (int) Resolution; + var tex = new Texture2D(res, 1, TextureFormat.ARGB32, false, true) + { + name = Name, + filterMode = FilterMode.Bilinear, + wrapMode = TextureWrapMode.Clamp + }; + + var colors = new Color[res]; + float div = res; + for (var i = 0; i < res; i++) + { + float t = i / div; + colors[i] = Gradient.Evaluate(t); + } + tex.SetPixels(colors); + tex.Apply(false, true); + + return tex; + } + + private void Start() + { + var hash = Name.GetHashCode(); + if (!textureCache.TryGetValue(hash, out texture)) + { + texture = Generate(); + textureCache.Add(hash, texture); + } + apply(); + } + + private void OnValidate() + { + refresh(); + } + + private void refresh() + { + if (texture != null) + DestroyImmediate(texture); + texture = Generate(); + apply(); + } + + private void apply() + { + var r = GetComponent(); + if (r == null) throw new Exception("GradientTexture must be on an UI element with RawImage component."); + r.texture = texture; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs.meta new file mode 100644 index 000000000..35ce4ef3c --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/GradientTexture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d78b78253cc71a64ca6bf0978d7ac99e +timeCreated: 1500212518 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs new file mode 100644 index 000000000..6c3d6ab14 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs @@ -0,0 +1,40 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; + +namespace TouchScript.Behaviors.Cursors.UI +{ + /// + /// A helper class to turn on and off without causing allocations. + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_UI_TextureSwitch.htm")] + public class TextureSwitch : MonoBehaviour + { + + private CanvasRenderer r; + + /// + /// Shows this instance. + /// + public void Show() + { + r.SetAlpha(1); + } + + /// + /// Hides this instance. + /// + public void Hide() + { + r.SetAlpha(0); + } + + private void Awake() + { + r = GetComponent(); + } + + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs.meta new file mode 100644 index 000000000..516f9df40 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/UI/TextureSwitch.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1a709300256ec1e4995018f4f91470aa +timeCreated: 1500663748 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs b/Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs deleted file mode 100644 index c4359e780..000000000 --- a/Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs +++ /dev/null @@ -1,586 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using System.Text; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace TouchScript.Behaviors -{ - /// - /// Unity UI compatible Input Module which sends all TouchScript data to UI EventSystem. - /// It works without any layers or gestures but can be used with for examle a CameraLayer and BoxColliders on UI elements to attach gestures to them. - /// - [AddComponentMenu("TouchScript/TouchScript Input Module")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Behaviors_TouchScriptInputModule.htm")] - public class TouchScriptInputModule : BaseInputModule - { - #region Public properties - - /// - /// Gets or sets the name of Unity horizontal axis. Required to be compatible with other input. - /// - /// The name of Unity horizontal axis. - public string HorizontalAxis - { - get { return horizontalAxis; } - set { horizontalAxis = value; } - } - - /// - /// Gets or sets the name of Unity vertical axis. Required to be compatible with other input. - /// - /// The name of Unity vertical axis. - public string VerticalAxis - { - get { return verticalAxis; } - set { verticalAxis = value; } - } - - /// - /// Gets or sets the name of Unity submit button. Required to be compatible with other input. - /// - /// The name of Unity submit button. - public string SubmitButton - { - get { return submitButton; } - set { submitButton = value; } - } - - /// - /// Gets or sets the name of Unity cancel button. Required to be compatible with other input. - /// - /// The name of Unity cancel button. - public string CancelButton - { - get { return cancelButton; } - set { cancelButton = value; } - } - - #endregion - - #region Private variables - - /// - /// id to event data. - /// - protected Dictionary pointerEvents = new Dictionary(); - - [SerializeField] - private string horizontalAxis = "Horizontal"; - - [SerializeField] - private string verticalAxis = "Vertical"; - - [SerializeField] - private string submitButton = "Submit"; - - [SerializeField] - private string cancelButton = "Cancel"; - - [SerializeField] - private float inputActionsPerSecond = 10f; - - [SerializeField] - private float repeatDelay = 0.5f; - - private float nextActionTime; - private MoveDirection lastMoveDirection; - private float lastMoveStartTime; - - #endregion - - #region Public methods - - /// - public override bool IsModuleSupported() - { - return true; - } - - /// - public override bool ShouldActivateModule() - { - if (!base.ShouldActivateModule()) - return false; - - //var shouldActivate = Input.GetButtonDown(submitButton); - //shouldActivate |= Input.GetButtonDown(cancelButton); - //shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(horizontalAxis), 0.0f); - //shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(verticalAxis), 0.0f); - //return shouldActivate; - - return true; - } - - /// - public override bool IsPointerOverGameObject(int pointerId) - { - var lastPointer = getLastPointerEventData(pointerId); - if (lastPointer != null) - return lastPointer.pointerEnter != null; - return false; - } - - /// - public override void ActivateModule() - { - base.ActivateModule(); - - var touchManager = TouchManager.Instance; - if (touchManager != null) - { - touchManager.TouchBegan += touchBeganHandler; - touchManager.TouchMoved += touchMovedHandler; - touchManager.TouchEnded += touchEndedHandler; - touchManager.TouchCancelled += touchCancelledHandler; - } - - var toSelect = eventSystem.currentSelectedGameObject; - if (toSelect == null) - toSelect = eventSystem.firstSelectedGameObject; - - eventSystem.SetSelectedGameObject(toSelect, GetBaseEventData()); - } - - /// - public override void DeactivateModule() - { - base.DeactivateModule(); - - var touchManager = TouchManager.Instance; - if (touchManager != null) - { - touchManager.TouchBegan -= touchBeganHandler; - touchManager.TouchMoved -= touchMovedHandler; - touchManager.TouchEnded -= touchEndedHandler; - touchManager.TouchCancelled -= touchCancelledHandler; - } - - clearSelection(); - } - - /// - public override void Process() - { - bool usedEvent = sendUpdateEventToSelectedObject(); - - if (eventSystem.sendNavigationEvents) - { - if (!usedEvent) - usedEvent |= sendMoveEventToSelectedObject(); - - if (!usedEvent) - sendSubmitEventToSelectedObject(); - } - } - - /// - public override string ToString() - { - var sb = new StringBuilder("Pointer Input Module of type: " + GetType()); - sb.AppendLine(); - foreach (var pointer in pointerEvents) - { - if (pointer.Value == null) - continue; - sb.AppendLine("Pointer: " + pointer.Key); - sb.AppendLine(pointer.Value.ToString()); - } - return sb.ToString(); - } - - #endregion - - #region Protected functions - - /// - /// Does a raycast with pointer data. - /// - /// Pointer data. - protected void raycastPointer(PointerEventData pointerEvent) - { - eventSystem.RaycastAll(pointerEvent, m_RaycastResultCache); - var raycast = FindFirstRaycast(m_RaycastResultCache); - pointerEvent.pointerCurrentRaycast = raycast; - m_RaycastResultCache.Clear(); - } - - /// - /// Initializes pointer data for a touch. - /// - /// The touch to initialize pointer data from. - /// Pointer data for the touch. - protected PointerEventData initPointerData(TouchPoint touch) - { - PointerEventData pointerEvent; - getPointerData(touch.Id, out pointerEvent, true); - - pointerEvent.position = touch.Position; - pointerEvent.button = PointerEventData.InputButton.Left; - pointerEvent.eligibleForClick = true; - pointerEvent.delta = Vector2.zero; - pointerEvent.dragging = false; - pointerEvent.useDragThreshold = true; - pointerEvent.pressPosition = pointerEvent.position; - - return pointerEvent; - } - - /// - /// Injects the pointer into UI. - /// - /// The pointer data to inject. - protected void injectPointer(PointerEventData pointerEvent) - { - pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast; - var currentOverGo = pointerEvent.pointerCurrentRaycast.gameObject; - - deselectIfSelectionChanged(currentOverGo, pointerEvent); - - if (pointerEvent.pointerEnter != currentOverGo) - { - // send a pointer enter to the touched element if it isn't the one to select... - HandlePointerExitAndEnter(pointerEvent, currentOverGo); - pointerEvent.pointerEnter = currentOverGo; - } - - // search for the control that will receive the press - // if we can't find a press handler set the press - // handler to be what would receive a click. - var newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, - ExecuteEvents.pointerDownHandler); - - // didnt find a press handler... search for a click handler - if (newPressed == null) - newPressed = ExecuteEvents.GetEventHandler(currentOverGo); - - // TODO: double-tap - pointerEvent.clickCount = 1; - pointerEvent.pointerPress = newPressed; - pointerEvent.rawPointerPress = currentOverGo; - pointerEvent.clickTime = Time.unscaledTime; - - // Save the drag handler as well - pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler(currentOverGo); - - if (pointerEvent.pointerDrag != null) - ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag); - } - - /// - /// Updates pointer data for touch. - /// - /// The touch. - /// Updated pointer data. - protected PointerEventData updatePointerData(TouchPoint touch) - { - PointerEventData pointerEvent; - getPointerData(touch.Id, out pointerEvent, true); - - pointerEvent.position = touch.Position; - pointerEvent.delta = touch.Position - touch.PreviousPosition; - - return pointerEvent; - } - - /// - /// Moves injected pointer in UI. - /// - /// The pointer data. - protected void movePointer(PointerEventData pointerEvent) - { - var targetGO = pointerEvent.pointerCurrentRaycast.gameObject; - HandlePointerExitAndEnter(pointerEvent, targetGO); - - bool moving = pointerEvent.IsPointerMoving(); - - if (moving && pointerEvent.pointerDrag != null - && !pointerEvent.dragging - && - shouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, eventSystem.pixelDragThreshold, - pointerEvent.useDragThreshold)) - { - ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler); - pointerEvent.dragging = true; - } - - // Drag notification - if (pointerEvent.dragging && moving && pointerEvent.pointerDrag != null) - { - // Before doing drag we should cancel any pointer down state - // And clear selection! - if (pointerEvent.pointerPress != pointerEvent.pointerDrag) - { - ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler); - - pointerEvent.eligibleForClick = false; - pointerEvent.pointerPress = null; - pointerEvent.rawPointerPress = null; - } - ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler); - } - } - - /// - /// Sends ended event for injected pointer. - /// - /// The pointer data. - protected void endPointer(PointerEventData pointerEvent) - { - var currentOverGo = pointerEvent.pointerCurrentRaycast.gameObject; - - ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler); - - // see if we mouse up on the same element that we clicked on... - var pointerUpHandler = ExecuteEvents.GetEventHandler(currentOverGo); - - // PointerClick and Drop events - if (pointerEvent.pointerPress == pointerUpHandler && pointerEvent.eligibleForClick) - { - ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler); - } - else if (pointerEvent.pointerDrag != null) - { - ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, ExecuteEvents.dropHandler); - } - - pointerEvent.eligibleForClick = false; - pointerEvent.pointerPress = null; - pointerEvent.rawPointerPress = null; - - if (pointerEvent.pointerDrag != null && pointerEvent.dragging) - ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler); - - pointerEvent.dragging = false; - pointerEvent.pointerDrag = null; - - // send exit events as we need to simulate this on touch up on touch device - ExecuteEvents.ExecuteHierarchy(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler); - pointerEvent.pointerEnter = null; - - removePointerData(pointerEvent); - } - - /// - /// Gets pointer data for a touch. - /// - /// Touch id. - /// Pointer data. - /// If set to true not found pointer data is created. - /// true if pointer data is found or created; false otherwise. - protected bool getPointerData(int id, out PointerEventData data, bool create) - { - if (!pointerEvents.TryGetValue(id, out data) && create) - { - data = new PointerEventData(eventSystem) - { - pointerId = id, - }; - pointerEvents.Add(id, data); - return true; - } - return false; - } - - /// - /// Removes pointer data. - /// - /// The data. - protected void removePointerData(PointerEventData data) - { - pointerEvents.Remove(data.pointerId); - } - - /// - /// Gets the last pointer event data. - /// - /// Touch id. - /// Pointer data. - protected PointerEventData getLastPointerEventData(int id) - { - PointerEventData data; - getPointerData(id, out data, false); - return data; - } - - /// - /// Clears UI selection. - /// - protected void clearSelection() - { - var baseEventData = GetBaseEventData(); - - foreach (var pointer in pointerEvents.Values) - { - // clear all selection - HandlePointerExitAndEnter(pointer, null); - } - - pointerEvents.Clear(); - eventSystem.SetSelectedGameObject(null, baseEventData); - } - - /// - /// Deselects if selection changed. - /// - /// GameObject which has the touch over it. - /// Pointer data for the touch. - protected void deselectIfSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent) - { - // Selection tracking - var selectHandlerGO = ExecuteEvents.GetEventHandler(currentOverGo); - // if we have clicked something new, deselect the old thing - // leave 'selection handling' up to the press event though. - if (selectHandlerGO != eventSystem.currentSelectedGameObject) - eventSystem.SetSelectedGameObject(null, pointerEvent); - } - - #endregion - - #region Private functions - - private void processBegan(TouchPoint touch) - { - PointerEventData pointerEvent = initPointerData(touch); - raycastPointer(pointerEvent); - injectPointer(pointerEvent); - } - - private void processMove(TouchPoint touch) - { - PointerEventData pointerEvent = updatePointerData(touch); - raycastPointer(pointerEvent); - movePointer(pointerEvent); - } - - private void processEnded(TouchPoint touch) - { - PointerEventData pointerEvent = updatePointerData(touch); - raycastPointer(pointerEvent); - endPointer(pointerEvent); - } - - private bool allowMoveEventProcessing(float time) - { - bool allow = Input.GetButtonDown(horizontalAxis); - allow |= Input.GetButtonDown(verticalAxis); - allow |= (time > nextActionTime); - return allow; - } - - private static bool shouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold) - { - if (!useDragThreshold) - return true; - - return (pressPos - currentPos).sqrMagnitude >= threshold * threshold; - } - - private bool sendSubmitEventToSelectedObject() - { - if (eventSystem.currentSelectedGameObject == null) - return false; - - var data = GetBaseEventData(); - if (Input.GetButtonDown(submitButton)) - ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler); - - if (Input.GetButtonDown(cancelButton)) - ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler); - return data.used; - } - - private Vector2 getRawMoveVector() - { - Vector2 move = Vector2.zero; - move.x = Input.GetAxisRaw(horizontalAxis); - move.y = Input.GetAxisRaw(verticalAxis); - - if (Input.GetButtonDown(horizontalAxis)) - { - if (move.x < 0) - move.x = -1f; - if (move.x > 0) - move.x = 1f; - } - if (Input.GetButtonDown(verticalAxis)) - { - if (move.y < 0) - move.y = -1f; - if (move.y > 0) - move.y = 1f; - } - return move; - } - - private bool sendMoveEventToSelectedObject() - { - float time = Time.unscaledTime; - - if (!allowMoveEventProcessing(time)) - return false; - - Vector2 movement = getRawMoveVector(); - var axisEventData = GetAxisEventData(movement.x, movement.y, 0.6f); - MoveDirection moveDir = axisEventData.moveDir; - - // Repeat delay - if (moveDir != lastMoveDirection) - { - lastMoveDirection = moveDir; - lastMoveStartTime = time; - } - else - { - if (time < lastMoveStartTime + repeatDelay) - return false; - } - - if (moveDir != MoveDirection.None) - { - ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler); - } - nextActionTime = time + 1f / inputActionsPerSecond; - return axisEventData.used; - } - - private bool sendUpdateEventToSelectedObject() - { - if (eventSystem.currentSelectedGameObject == null) - return false; - - var data = GetBaseEventData(); - ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.updateSelectedHandler); - return data.used; - } - - #endregion - - #region Touch event callbacks - - private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs) - { - processBegan(touchEventArgs.Touch); - } - - private void touchMovedHandler(object sender, TouchEventArgs touchEventArgs) - { - processMove(touchEventArgs.Touch); - } - - private void touchEndedHandler(object sender, TouchEventArgs touchEventArgs) - { - processEnded(touchEventArgs.Touch); - } - - private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs) - { - processEnded(touchEventArgs.Touch); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs index 2a29856c8..af22125cc 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs @@ -1,10 +1,12 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ using System; -using System.Collections.Generic; using TouchScript.Gestures; +using TouchScript.Gestures.TransformGestures; +using TouchScript.Gestures.TransformGestures.Base; +using TouchScript.Utils.Attributes; using UnityEngine; namespace TouchScript.Behaviors @@ -13,13 +15,152 @@ namespace TouchScript.Behaviors /// Component which transforms an object according to events from transform gestures: , , and others. /// [AddComponentMenu("TouchScript/Behaviors/Transformer")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Behaviors_Transformer.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Transformer.htm")] public class Transformer : MonoBehaviour { + // Here's how it works. + // + // If smoothing is not enabled, the component just gets gesture events in stateChangedHandler(), passes Changed event to manualUpdate() which calls applyValues() to sett updated values. + // The value of transformMask is used to only set values which were changed not to interfere with scripts changing this values. + // + // If smoothing is enabled — targetPosition, targetScale, targetRotation are cached and a lerp from current position to these target positions is applied every frame in update() method. It also checks transformMask to change only needed values. + // If none of the delta values pass the threshold, the component transitions to idle state. + + #region Consts + + /// + /// State for internal Transformer state machine. + /// + private enum TransformerState + { + /// + /// Nothing is happening. + /// + Idle, + + /// + /// The object is under manual control, i.e. user is transforming it. + /// + Manual, + + /// + /// The object is under automatic control, i.e. it's being smoothly moved into target position when user lifted all fingers off. + /// + Automatic + } + + #endregion + + #region Public properties + + /// + /// Gets or sets a value indicating whether Smoothing is enabled. Smoothing allows to reduce jagged movements but adds some visual lag. + /// + /// + /// true if Smoothing is enabled; otherwise, false. + /// + public bool EnableSmoothing + { + get { return enableSmoothing; } + set { enableSmoothing = value; } + } + + /// + /// Gets or sets the smoothing factor. + /// + /// + /// The smoothing factor. Indicates how much smoothing to apply. 0 - no smoothing, 100000 - maximum. + /// + public float SmoothingFactor + { + get { return smoothingFactor * 100000f; } + set { smoothingFactor = Mathf.Clamp(value / 100000f, 0, 1); } + } + + /// + /// Gets or sets the position threshold. + /// + /// + /// Minimum distance between target position and smoothed position when to stop automatic movement. + /// + public float PositionThreshold + { + get { return Mathf.Sqrt(positionThreshold); } + set { positionThreshold = value * value; } + } + + /// + /// Gets or sets the rotation threshold. + /// + /// + /// Minimum angle between target rotation and smoothed rotation when to stop automatic movement. + /// + public float RotationThreshold + { + get { return rotationThreshold; } + set { rotationThreshold = value; } + } + + /// + /// Gets or sets the scale threshold. + /// + /// + /// Minimum difference between target scale and smoothed scale when to stop automatic movement. + /// + public float ScaleThreshold + { + get { return Mathf.Sqrt(scaleThreshold); } + set { scaleThreshold = value * value; } + } + + /// + /// Gets or sets a value indicating whether this transform can be changed from another script. + /// + /// + /// true if this transform can be changed from another script; otherwise, false. + /// + public bool AllowChangingFromOutside + { + get { return allowChangingFromOutside; } + set { allowChangingFromOutside = value; } + } + + #endregion + #region Private variables + [SerializeField] + [ToggleLeft] + private bool enableSmoothing = false; + + [SerializeField] + private float smoothingFactor = 1f / 100000f; + + [SerializeField] + private float positionThreshold = 0.01f; + + [SerializeField] + private float rotationThreshold = 0.1f; + + [SerializeField] + private float scaleThreshold = 0.01f; + + [SerializeField] + [ToggleLeft] + private bool allowChangingFromOutside = false; + + private TransformerState state; + + private TransformGestureBase gesture; private Transform cachedTransform; - private List gestures = new List(); + + private TransformGesture.TransformType transformMask; + private Vector3 targetPosition, targetScale; + private Quaternion targetRotation; + + // last* variables are needed to detect when Transform's properties were changed outside of this script + private Vector3 lastPosition, lastScale; + private Quaternion lastRotation; #endregion @@ -32,35 +173,194 @@ private void Awake() private void OnEnable() { - var g = GetComponents(); - for (var i = 0; i < g.Length; i++) - { - var transformGesture = g[i] as ITransformGesture; - if (transformGesture == null) continue; + gesture = GetComponent(); + gesture.StateChanged += stateChangedHandler; + TouchManager.Instance.FrameFinished += frameFinishedHandler; - gestures.Add(transformGesture); - transformGesture.Transformed += transformHandler; - } + stateIdle(); } private void OnDisable() { - for (var i = 0; i < gestures.Count; i++) + if (gesture != null) gesture.StateChanged -= stateChangedHandler; + if (TouchManager.Instance != null) + TouchManager.Instance.FrameFinished -= frameFinishedHandler; + + stateIdle(); + } + + #endregion + + #region States + + private void stateIdle() + { + var prevState = state; + setState(TransformerState.Idle); + + if (enableSmoothing && prevState == TransformerState.Automatic) + { + transform.position = lastPosition = targetPosition; + var newLocalScale = lastScale = targetScale; + // prevent recalculating colliders when no scale occurs + if (newLocalScale != transform.localScale) transform.localScale = newLocalScale; + transform.rotation = lastRotation = targetRotation; + } + + transformMask = TransformGesture.TransformType.None; + } + + private void stateManual() + { + setState(TransformerState.Manual); + + targetPosition = lastPosition = cachedTransform.position; + targetRotation = lastRotation = cachedTransform.rotation; + targetScale = lastScale = cachedTransform.localScale; + transformMask = TransformGesture.TransformType.None; + } + + private void stateAutomatic() + { + setState(TransformerState.Automatic); + + if (!enableSmoothing || transformMask == TransformGesture.TransformType.None) stateIdle(); + } + + private void setState(TransformerState newState) + { + state = newState; + } + + #endregion + + #region Private functions + + private void update() + { + if (state == TransformerState.Idle) return; + + if (!enableSmoothing) return; + + var fraction = 1 - Mathf.Pow(smoothingFactor, Time.unscaledDeltaTime); + var changed = false; + + if ((transformMask & TransformGesture.TransformType.Scaling) != 0) { - var transformGesture = gestures[i]; - transformGesture.Transformed -= transformHandler; + var scale = transform.localScale; + if (allowChangingFromOutside) + { + // Changed by someone else. + // Need to make sure to check per component here. + if (!Mathf.Approximately(scale.x, lastScale.x)) + targetScale.x = scale.x; + if (!Mathf.Approximately(scale.y, lastScale.y)) + targetScale.y = scale.y; + if (!Mathf.Approximately(scale.z, lastScale.z)) + targetScale.z = scale.z; + } + var newLocalScale = Vector3.Lerp(scale, targetScale, fraction); + // Prevent recalculating colliders when no scale occurs. + if (newLocalScale != scale) + { + transform.localScale = newLocalScale; + // Something might have adjusted our scale. + lastScale = transform.localScale; + } + + if (state == TransformerState.Automatic && !changed && (targetScale - lastScale).sqrMagnitude > scaleThreshold) changed = true; + } + + if ((transformMask & TransformGesture.TransformType.Rotation) != 0) + { + if (allowChangingFromOutside) + { + // Changed by someone else. + if (transform.rotation != lastRotation) targetRotation = transform.rotation; + } + transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, fraction); + // Something might have adjusted our rotation. + lastRotation = transform.rotation; + + if (state == TransformerState.Automatic && !changed && Quaternion.Angle(targetRotation, lastRotation) > rotationThreshold) changed = true; + } + + if ((transformMask & TransformGesture.TransformType.Translation) != 0) + { + var pos = transform.position; + if (allowChangingFromOutside) + { + // Changed by someone else. + // Need to make sure to check per component here. + if (!Mathf.Approximately(pos.x, lastPosition.x)) + targetPosition.x = pos.x; + if (!Mathf.Approximately(pos.y, lastPosition.y)) + targetPosition.y = pos.y; + if (!Mathf.Approximately(pos.z, lastPosition.z)) + targetPosition.z = pos.z; + } + transform.position = Vector3.Lerp(pos, targetPosition, fraction); + // Something might have adjusted our position (most likely Unity UI). + lastPosition = transform.position; + + if (state == TransformerState.Automatic && !changed && (targetPosition - lastPosition).sqrMagnitude > positionThreshold) changed = true; } - gestures.Clear(); + + if (state == TransformerState.Automatic && !changed) stateIdle(); + } + + private void manualUpdate() + { + if (state != TransformerState.Manual) stateManual(); + + var mask = gesture.TransformMask; + if ((mask & TransformGesture.TransformType.Scaling) != 0) targetScale *= gesture.DeltaScale; + if ((mask & TransformGesture.TransformType.Rotation) != 0) + targetRotation = Quaternion.AngleAxis(gesture.DeltaRotation, gesture.RotationAxis) * targetRotation; + if ((mask & TransformGesture.TransformType.Translation) != 0) targetPosition += gesture.DeltaPosition; + transformMask |= mask; + + gesture.OverrideTargetPosition(targetPosition); + + if (!enableSmoothing) applyValues(); + } + + private void applyValues() + { + if ((transformMask & TransformGesture.TransformType.Scaling) != 0) cachedTransform.localScale = targetScale; + if ((transformMask & TransformGesture.TransformType.Rotation) != 0) cachedTransform.rotation = targetRotation; + if ((transformMask & TransformGesture.TransformType.Translation) != 0) cachedTransform.position = targetPosition; + transformMask = TransformGesture.TransformType.None; } #endregion #region Event handlers - private void transformHandler(object sender, EventArgs e) + private void stateChangedHandler(object sender, GestureStateChangeEventArgs gestureStateChangeEventArgs) + { + switch (gestureStateChangeEventArgs.State) + { + case Gesture.GestureState.Possible: + stateManual(); + break; + case Gesture.GestureState.Changed: + manualUpdate(); + break; + case Gesture.GestureState.Ended: + case Gesture.GestureState.Cancelled: + stateAutomatic(); + break; + case Gesture.GestureState.Failed: + case Gesture.GestureState.Idle: + if (gestureStateChangeEventArgs.PreviousState == Gesture.GestureState.Possible) stateAutomatic(); + break; + } + } + + private void frameFinishedHandler(object sender, EventArgs eventArgs) { - var gesture = sender as ITransformGesture; - gesture.ApplyTransform(cachedTransform); + update(); } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs.meta index 0a2ae6bd5..e9767a115 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/UI.meta b/Source/Assets/TouchScript/Scripts/Behaviors/UI.meta new file mode 100644 index 000000000..39f8490be --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fb6db513e55511045b8e5bf15efdb30d +folderAsset: yes +timeCreated: 1500209323 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs new file mode 100644 index 000000000..03ed25894 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs @@ -0,0 +1,145 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using TouchScript.Pointers; +using TouchScript.Utils; +using UnityEngine; + +namespace TouchScript.Behaviors.UI +{ + + /// + /// This component listens for pointer events and dispatches event when the first touch enters the area of the GameObject it is attached to and event when the last touch leaves it. + /// + [AddComponentMenu("TouchScript/Behaviors/OverHelper")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_UI_OverHelper.htm")] + public class OverHelper : MonoBehaviour + { + + #region Events + + /// + /// Occurs when the first (non-pressed) touch enters the area of the GameObject. + /// + public event EventHandler Over; + + /// + /// Occurs when the last touch leaves the area of the GameObject. + /// + public event EventHandler Out; + + #endregion + + #region Private variable + + private HashSet pointers = new HashSet(); + + #endregion + + #region Unity methods + + private void OnEnable() + { + TouchManager.Instance.PointersAdded += pointersAddedHandler; + TouchManager.Instance.PointersUpdated += pointersUpdatedHandler; + TouchManager.Instance.PointersReleased += pointersReleasedHandler; + TouchManager.Instance.PointersRemoved += pointersRemovedHandler; + TouchManager.Instance.PointersCancelled += pointersRemovedHandler; + } + + private void OnDisable() + { + if (TouchManager.Instance == null) return; + TouchManager.Instance.PointersAdded -= pointersAddedHandler; + TouchManager.Instance.PointersUpdated -= pointersUpdatedHandler; + TouchManager.Instance.PointersReleased -= pointersReleasedHandler; + TouchManager.Instance.PointersRemoved -= pointersRemovedHandler; + TouchManager.Instance.PointersCancelled -= pointersRemovedHandler; + } + + #endregion + + #region Private functions + + private void dispatchOver() + { + if (Over != null) Over.InvokeHandleExceptions(this, EventArgs.Empty); + } + + private void dispatchOut() + { + if (Out != null) Out.InvokeHandleExceptions(this, EventArgs.Empty); + } + + #endregion + + #region Callbacks + + private void pointersAddedHandler(object sender, PointerEventArgs pointerEventArgs) + { + var over = pointers.Count; + var p = pointerEventArgs.Pointers; + var count = p.Count; + for (var i = 0; i < count; i++) + { + var pointer = p[i]; + if (PointerUtils.IsPointerOnTarget(pointer, transform)) pointers.Add(pointer.Id); + } + + if (over == 0 && pointers.Count > 0) dispatchOver(); + } + + private void pointersUpdatedHandler(object sender, PointerEventArgs pointerEventArgs) + { + var over = pointers.Count; + var p = pointerEventArgs.Pointers; + var count = p.Count; + for (var i = 0; i < count; i++) + { + var pointer = p[i]; + if ((pointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) continue; // we ignore pressed pointers + if (PointerUtils.IsPointerOnTarget(pointer, transform)) pointers.Add(pointer.Id); + else pointers.Remove(pointer.Id); + } + + if (over == 0 && pointers.Count > 0) dispatchOver(); + else if (over > 0 && pointers.Count == 0) dispatchOut(); + } + + private void pointersReleasedHandler(object sender, PointerEventArgs pointerEventArgs) + { + var over = pointers.Count; + var p = pointerEventArgs.Pointers; + var count = p.Count; + for (var i = 0; i < count; i++) + { + var pointer = p[i]; + if (PointerUtils.IsPointerOnTarget(pointer, transform)) pointers.Add(pointer.Id); + else pointers.Remove(pointer.Id); + } + + if (over == 0 && pointers.Count > 0) dispatchOver(); + else if (over > 0 && pointers.Count == 0) dispatchOut(); + } + + private void pointersRemovedHandler(object sender, PointerEventArgs pointerEventArgs) + { + var over = pointers.Count; + var p = pointerEventArgs.Pointers; + var count = p.Count; + for (var i = 0; i < count; i++) + { + var pointer = p[i]; + pointers.Remove(pointer.Id); + } + + if (over > 0 && pointers.Count == 0) dispatchOut(); + } + + #endregion + + } +} diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs.meta new file mode 100644 index 000000000..e4e79dceb --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 66f406de0e0ca42828041209d7c5f611 +timeCreated: 1468201700 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs deleted file mode 100644 index 74cbe4cfb..000000000 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchProxy.cs +++ /dev/null @@ -1,193 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Text; -using UnityEngine; -using UnityEngine.UI; - -namespace TouchScript.Behaviors.Visualizer -{ - /// - /// Visual cursor implementation used by TouchScript. - /// - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Behaviors_TouchProxy.htm")] - public class TouchProxy : TouchProxyBase - { - /// - /// The link to UI.Text component. - /// - public Text Text; - - private StringBuilder stringBuilder = new StringBuilder(64); - - #region Protected methods - - /// - protected override void updateOnce(TouchPoint touch) - { - base.updateOnce(touch); - - stringBuilder.Length = 0; - stringBuilder.Append("Touch id: "); - stringBuilder.Append(touch.Id); - gameObject.name = stringBuilder.ToString(); - - if (Text == null) return; - if (!ShowTouchId && !ShowTags) return; - - stringBuilder.Length = 0; - if (ShowTouchId) - { - stringBuilder.Append("Id: "); - stringBuilder.Append(touch.Id); - } - if (ShowTags) - { - if (stringBuilder.Length > 0) stringBuilder.Append("\n"); - stringBuilder.Append("Tags: "); - stringBuilder.Append(touch.Tags.ToString()); - } - Text.text = stringBuilder.ToString(); - } - - #endregion - } - - /// - /// Base class for cursors. - /// - public class TouchProxyBase : MonoBehaviour - { - #region Public properties - - /// - /// Gets or sets cursor size. - /// - /// Cursor size in pixels. - public int Size - { - get { return size; } - set - { - size = value; - rect.sizeDelta = Vector2.one * size; - } - } - - /// - /// Gets or sets a value indicating whether touch id text should be displayed on screen. - /// - /// true if touch id text should be displayed on screen; otherwise, false. - public bool ShowTouchId { get; set; } - - /// - /// Gets or sets a value indicating whether touch tags text should be displayed on screen. - /// - /// true if touch tags text should be displayed on screen; otherwise, false. - public bool ShowTags { get; set; } - - #endregion - - #region Private variables - - /// - /// Cached RectTransform. - /// - protected RectTransform rect; - - /// - /// Cursor size. - /// - protected int size = 1; - - #endregion - - #region Public methods - - /// - /// Initializes (resets) the cursor. - /// - /// Parent container. - /// Touch this cursor represents. - public void Init(RectTransform parent, TouchPoint touch) - { - show(); - rect.SetParent(parent); - rect.SetAsLastSibling(); - updateOnce(touch); - update(touch); - } - - /// - /// Updates the touch. This method is called when the touch is moved. - /// - /// Touch this cursor represents. - public void UpdateTouch(TouchPoint touch) - { - update(touch); - } - - /// - /// Hides this instance. - /// - public void Hide() - { - hide(); - } - - #endregion - - #region Unity methods - - private void Awake() - { - rect = transform as RectTransform; - if (rect == null) - { - Debug.LogError("TouchProxy must be on an UI element!"); - enabled = false; - return; - } - rect.anchorMin = rect.anchorMax = Vector2.zero; - } - - #endregion - - #region Protected methods - - /// - /// Hides (clears) this instance. - /// - protected virtual void hide() - { - gameObject.SetActive(false); - gameObject.name = "inactive touch"; - } - - /// - /// Shows this instance. - /// - protected virtual void show() - { - gameObject.SetActive(true); - } - - /// - /// This method is called once when the cursor is initialized. - /// - /// The touch. - protected virtual void updateOnce(TouchPoint touch) {} - - /// - /// This method is called every time when the touch changes. - /// - /// The touch. - public virtual void update(TouchPoint touch) - { - rect.anchoredPosition = touch.Position; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs deleted file mode 100644 index 0e9eda31a..000000000 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/TouchVisualizer.cs +++ /dev/null @@ -1,206 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Utils; -using UnityEngine; - -namespace TouchScript.Behaviors.Visualizer -{ - /// - /// Touch visualizer which shows touch circles with debug text using Unity UI. - /// The script should be placed on an element with RectTransform or a Canvas. A reference prefab is provided in TouchScript package. - /// - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Behaviors_TouchVisualizer.htm")] - public class TouchVisualizer : MonoBehaviour - { - #region Public properties - - /// - /// Gets or sets touch UI element prefab which represents a touch on screen. - /// - /// A prefab with a script derived from TouchProxyBase. - public TouchProxyBase TouchProxy - { - get { return touchProxy; } - set - { - touchProxy = value; - updateDefaultSize(); - } - } - - /// - /// Gets or sets a value indicating whether touch id text should be displayed on screen. - /// - /// true if touch id text should be displayed on screen; otherwise, false. - public bool ShowTouchId - { - get { return showTouchId; } - set { showTouchId = value; } - } - - /// - /// Gets or sets a value indicating whether touch tags text should be displayed on screen. - /// - /// true if touch tags text should be displayed on screen; otherwise, false. - public bool ShowTags - { - get { return showTags; } - set { showTags = value; } - } - - /// - /// Gets or sets whether is using DPI to scale touch cursors. - /// - /// true if DPI value is used; otherwise, false. - public bool UseDPI - { - get { return useDPI; } - set { useDPI = value; } - } - - /// - /// Gets or sets the size of touch cursors in cm. This value is only used when is set to true. - /// - /// The size of touch cursors in cm. - public float TouchSize - { - get { return touchSize; } - set { touchSize = value; } - } - - #endregion - - #region Private variables - - [SerializeField] - private TouchProxyBase touchProxy; - - [SerializeField] - private bool showTouchId = true; - - [SerializeField] - private bool showTags = false; - - [SerializeField] - private bool useDPI = true; - - [SerializeField] - private float touchSize = 1f; - - private int defaultSize = 64; - private RectTransform rect; - private ObjectPool pool; - private Dictionary proxies = new Dictionary(10); - - #endregion - - #region Unity methods - - private void Awake() - { - pool = new ObjectPool(10, instantiateProxy, null, clearProxy); - rect = transform as RectTransform; - if (rect == null) - { - Debug.LogError("TouchVisualizer must be on an UI element!"); - enabled = false; - } - updateDefaultSize(); - } - - private void OnEnable() - { - if (TouchManager.Instance != null) - { - TouchManager.Instance.TouchBegan += touchBeganHandler; - TouchManager.Instance.TouchEnded += touchEndedHandler; - TouchManager.Instance.TouchMoved += touchMovedHandler; - TouchManager.Instance.TouchCancelled += touchCancelledHandler; - } - } - - private void OnDisable() - { - if (TouchManager.Instance != null) - { - TouchManager.Instance.TouchBegan -= touchBeganHandler; - TouchManager.Instance.TouchEnded -= touchEndedHandler; - TouchManager.Instance.TouchMoved -= touchMovedHandler; - TouchManager.Instance.TouchCancelled -= touchCancelledHandler; - } - } - - #endregion - - #region Private functions - - private TouchProxyBase instantiateProxy() - { - return Instantiate(touchProxy); - } - - private void clearProxy(TouchProxyBase proxy) - { - proxy.Hide(); - } - - private int getTouchSize() - { - if (useDPI) return (int) (touchSize * TouchManager.Instance.DotsPerCentimeter); - return defaultSize; - } - - private void updateDefaultSize() - { - if (touchProxy != null) - { - var rt = touchProxy.GetComponent(); - if (rt) defaultSize = (int) rt.sizeDelta.x; - } - } - - #endregion - - #region Event handlers - - private void touchBeganHandler(object sender, TouchEventArgs e) - { - if (touchProxy == null) return; - - var touch = e.Touch; - var proxy = pool.Get(); - proxy.Size = getTouchSize(); - proxy.ShowTouchId = showTouchId; - proxy.ShowTags = showTags; - proxy.Init(rect, touch); - proxies.Add(touch.Id, proxy); - } - - private void touchMovedHandler(object sender, TouchEventArgs e) - { - var touch = e.Touch; - TouchProxyBase proxy; - if (!proxies.TryGetValue(touch.Id, out proxy)) return; - proxy.UpdateTouch(touch); - } - - private void touchEndedHandler(object sender, TouchEventArgs e) - { - var touch = e.Touch; - TouchProxyBase proxy; - if (!proxies.TryGetValue(touch.Id, out proxy)) return; - proxies.Remove(touch.Id); - pool.Release(proxy); - } - - private void touchCancelledHandler(object sender, TouchEventArgs e) - { - touchEndedHandler(sender, e); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Clusters/Clusters.cs b/Source/Assets/TouchScript/Scripts/Clusters/Clusters2D.cs similarity index 86% rename from Source/Assets/TouchScript/Scripts/Clusters/Clusters.cs rename to Source/Assets/TouchScript/Scripts/Clusters/Clusters2D.cs index 6d4649e9f..3082e4fcf 100644 --- a/Source/Assets/TouchScript/Scripts/Clusters/Clusters.cs +++ b/Source/Assets/TouchScript/Scripts/Clusters/Clusters2D.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Clusters @@ -11,7 +12,7 @@ namespace TouchScript.Clusters /// /// Represents a pool of points separated into two clusters. /// - public sealed class Clusters + public sealed class Clusters2D { #region Constants @@ -69,19 +70,19 @@ public bool HasClusters #region Private variables - private List points = new List(); + private List points = new List(); private bool dirty; - private List cluster1 = new List(); - private List cluster2 = new List(); + private List cluster1 = new List(); + private List cluster2 = new List(); private float minPointDistance, minPointDistanceSqr; private bool hasClusters = false; #endregion /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Clusters() + public Clusters2D() { MinPointsDistance = 0; markDirty(); @@ -93,7 +94,7 @@ public Clusters() /// Calculates the center position of one of the clusters. /// /// Cluster id. Either or . - /// Cluster's centroid position or if cluster contains no points. + /// Cluster's centroid position or if cluster contains no pointers. public Vector2 GetCenterPosition(int id) { if (!HasClusters) return TouchManager.INVALID_POSITION; @@ -117,7 +118,7 @@ public Vector2 GetCenterPosition(int id) /// Calculates previous center position of one of the clusters. /// /// Cluster id. Either or . - /// Cluster's centroid previous position or if cluster contains no points. + /// Cluster's centroid previous position or if cluster contains no pointers. public Vector2 GetPreviousCenterPosition(int id) { if (!HasClusters) return TouchManager.INVALID_POSITION; @@ -138,50 +139,50 @@ public Vector2 GetPreviousCenterPosition(int id) } /// - /// Adds a point to cluster. - /// A point. - public void AddPoint(TouchPoint point) + /// Adds a pointer to cluster. + /// A pointer. + public void AddPoint(Pointer pointer) { - if (points.Contains(point)) return; + if (points.Contains(pointer)) return; - points.Add(point); + points.Add(pointer); markDirty(); } /// - /// Adds a list of points to cluster. + /// Adds a list of pointers to cluster. /// - /// List of points. - public void AddPoints(IList points) + /// List of pointers. + public void AddPoints(IList pointers) { - var count = points.Count; - for (var i = 0; i < count; i++) AddPoint(points[i]); + var count = pointers.Count; + for (var i = 0; i < count; i++) AddPoint(pointers[i]); } /// - /// Removes a point from cluster. + /// Removes a pointer from cluster. /// - /// A point. - public void RemovePoint(TouchPoint point) + /// A pointer. + public void RemovePoint(Pointer pointer) { - if (!points.Contains(point)) return; + if (!points.Contains(pointer)) return; - points.Remove(point); + points.Remove(pointer); markDirty(); } /// - /// Removes a list of points from cluster. + /// Removes a list of pointers from cluster. /// - /// List of points. - public void RemovePoints(IList points) + /// List of pointers. + public void RemovePoints(IList points) { var count = points.Count; for (var i = 0; i < count; i++) RemovePoint(points[i]); } /// - /// Removes all points from cluster. + /// Removes all pointers from cluster. /// public void RemoveAllPoints() { @@ -224,8 +225,8 @@ private void distributePoints() { var center1 = ClusterUtils.Get2DCenterPosition(cluster1); var center2 = ClusterUtils.Get2DCenterPosition(cluster2); - TouchPoint obj1 = null; - TouchPoint obj2 = null; + Pointer obj1 = null; + Pointer obj2 = null; // Take most distant points from cluster1 and cluster2 var maxDist1 = -float.MaxValue; diff --git a/Source/Assets/TouchScript/Scripts/Clusters/Clusters.cs.meta b/Source/Assets/TouchScript/Scripts/Clusters/Clusters2D.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Clusters/Clusters.cs.meta rename to Source/Assets/TouchScript/Scripts/Clusters/Clusters2D.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Core.meta b/Source/Assets/TouchScript/Scripts/Core.meta new file mode 100644 index 000000000..515de20f1 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Core.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bb470f21b40fb46658df225e066112a2 +folderAsset: yes +timeCreated: 1500961062 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs b/Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs similarity index 92% rename from Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs rename to Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs index 780a54bde..61bd36e44 100644 --- a/Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs +++ b/Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -7,7 +7,7 @@ #endif using UnityEngine; -namespace TouchScript +namespace TouchScript.Core { /// /// A debuggable component. When built with TOUCHSCRIPT_DEBUG define has a checkbox to turn debug information on and off. @@ -15,7 +15,7 @@ namespace TouchScript public class DebuggableMonoBehaviour : MonoBehaviour, IDebuggable { /// - public bool DebugMode + public virtual bool DebugMode { get { diff --git a/Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs.meta b/Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs.meta rename to Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Core/GestureManagerInstance.cs b/Source/Assets/TouchScript/Scripts/Core/GestureManagerInstance.cs new file mode 100644 index 000000000..5bbaad504 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Core/GestureManagerInstance.cs @@ -0,0 +1,705 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using TouchScript.Gestures; +using TouchScript.Utils; +using TouchScript.Pointers; +using UnityEngine; +using UnityEngine.Profiling; + +namespace TouchScript.Core +{ + /// + /// Internal implementation of . + /// + internal sealed class GestureManagerInstance : MonoBehaviour, IGestureManager + { + #region Public properties + + /// + /// Gets the instance of GestureManager singleton. + /// + public static IGestureManager Instance + { + get + { + if (shuttingDown) return null; + if (instance == null) + { + if (!Application.isPlaying) return null; + var objects = FindObjectsOfType(); + if (objects.Length == 0) + { + var go = new GameObject("GestureManager Instance"); + instance = go.AddComponent(); + } + else if (objects.Length >= 1) + { + instance = objects[0]; + } + } + return instance; + } + } + + /// + public IGestureDelegate GlobalGestureDelegate { get; set; } + + #endregion + + #region Private variables + + private static GestureManagerInstance instance; + private static bool shuttingDown = false; + + // Upcoming changes + private List gesturesToReset = new List(20); + private Dictionary> pointerToGestures = new Dictionary>(10); + +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Temporary collections + + // Temporary collections for update methods. + // Dictionary> - pointers sorted by targets + private Dictionary> pointersOnTarget = new Dictionary>(10); + // Dictionary> - pointers sorted by gesture + private Dictionary> pointersToDispatchForGesture = new Dictionary>(10); + private List activeGesturesThisUpdate = new List(20); + + private Dictionary> hierarchyEndingWithCache = new Dictionary>(4); + private Dictionary> hierarchyBeginningWithCache = new Dictionary>(4); + + #endregion + + #region Pools + + private static ObjectPool> gestureListPool = new ObjectPool>(10, + () => new List(10), null, (l) => l.Clear(), "GestureManager/Gesture"); + + private static ObjectPool> pointerListPool = new ObjectPool>(20, + () => new List(10), null, (l) => l.Clear(), "GestureManager/Pointer"); + + private static ObjectPool> transformListPool = new ObjectPool>(10, + () => new List(10), null, (l) => l.Clear(), "GestureManager/Transform"); + + #endregion + + #region Unity + + private void Awake() + { + if (instance == null) + { + instance = this; + } + else if (instance != this) + { + Destroy(this); + return; + } + + gameObject.hideFlags = HideFlags.HideInHierarchy; + DontDestroyOnLoad(gameObject); + + gestureListPool.WarmUp(20); + pointerListPool.WarmUp(20); + transformListPool.WarmUp(1); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Update Gestures"); +#endif + } + + private void OnEnable() + { + var touchManager = TouchManager.Instance; + if (touchManager != null) + { + touchManager.FrameStarted += frameStartedHandler; + touchManager.FrameFinished += frameFinishedHandler; + touchManager.PointersUpdated += pointersUpdatedHandler; + touchManager.PointersPressed += pointersPressedHandler; + touchManager.PointersReleased += pointersReleasedHandler; + touchManager.PointersCancelled += pointersCancelledHandler; + } + } + + private void OnDisable() + { + var touchManager = TouchManager.Instance; + if (touchManager != null) + { + touchManager.FrameStarted -= frameStartedHandler; + touchManager.FrameFinished -= frameFinishedHandler; + touchManager.PointersUpdated -= pointersUpdatedHandler; + touchManager.PointersPressed -= pointersPressedHandler; + touchManager.PointersReleased -= pointersReleasedHandler; + touchManager.PointersCancelled -= pointersCancelledHandler; + } + } + + private void OnApplicationQuit() + { + shuttingDown = true; + } + + #endregion + + #region Internal methods + + internal Gesture.GestureState INTERNAL_GestureChangeState(Gesture gesture, Gesture.GestureState state) + { + bool recognized = false; + switch (state) + { + case Gesture.GestureState.Idle: + case Gesture.GestureState.Possible: + break; + case Gesture.GestureState.Began: + switch (gesture.State) + { + case Gesture.GestureState.Idle: + case Gesture.GestureState.Possible: + break; + default: + print(string.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", + new object[] {gesture, state, gesture.State})); + break; + } + recognized = recognizeGestureIfNotPrevented(gesture); + if (!recognized) + { + if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); + return Gesture.GestureState.Failed; + } + break; + case Gesture.GestureState.Changed: + switch (gesture.State) + { + case Gesture.GestureState.Began: + case Gesture.GestureState.Changed: + break; + default: + print(string.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", + new object[] {gesture, state, gesture.State})); + break; + } + break; + case Gesture.GestureState.Failed: + if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); + break; + case Gesture.GestureState.Recognized: // Ended + if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); + switch (gesture.State) + { + case Gesture.GestureState.Idle: + case Gesture.GestureState.Possible: + recognized = recognizeGestureIfNotPrevented(gesture); + if (!recognized) return Gesture.GestureState.Failed; + break; + case Gesture.GestureState.Began: + case Gesture.GestureState.Changed: + break; + default: + print(string.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", + new object[] {gesture, state, gesture.State})); + break; + } + break; + case Gesture.GestureState.Cancelled: + if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); + break; + } + + return state; + } + + #endregion + + #region Private functions + + private void updatePressed(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + var activeTargets = transformListPool.Get(); + var gesturesInHierarchy = gestureListPool.Get(); + var startedGestures = gestureListPool.Get(); + + // Arrange pointers by target. + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + var target = pointer.GetPressData().Target; + if (target == null) continue; + + List list; + if (!pointersOnTarget.TryGetValue(target, out list)) + { + list = pointerListPool.Get(); + pointersOnTarget.Add(target, list); + activeTargets.Add(target); + } + list.Add(pointer); + } + + // Process all targets - get and sort all gestures on targets in hierarchy. + count = activeTargets.Count; + for (var i = 0; i < count; i++) + { + var target = activeTargets[i]; + + // Pointers that hit . + var targetPointers = pointersOnTarget[target]; + var targetPointersCount = targetPointers.Count; + + // Gestures on objects in the hierarchy from "root" to target. + var gesturesOnParentsAndMe = getHierarchyEndingWith(target); + + // Gestures in the target's hierarchy which might affect gestures on the target. + // Gestures on all parents and all children. + gesturesInHierarchy.AddRange(gesturesOnParentsAndMe); + gesturesInHierarchy.AddRange(getHierarchyBeginningWith(target)); + var gesturesInHierarchyCount = gesturesInHierarchy.Count; + + for (var j = 0; j < gesturesInHierarchyCount; j++) + { + var gesture = gesturesInHierarchy[j]; + if (gesture.State == Gesture.GestureState.Began || gesture.State == Gesture.GestureState.Changed) startedGestures.Add(gesture); + } + + var startedCount = startedGestures.Count; + var possibleGestureCount = gesturesOnParentsAndMe.Count; + for (var j = 0; j < possibleGestureCount; j++) + { + // WARNING! Gesture state might change during this loop. + // For example when one of them recognizes. + + var possibleGesture = gesturesOnParentsAndMe[j]; + + // If the gesture is not active it can't start or recognize. + if (!gestureIsActive(possibleGesture)) continue; + + var canReceivePointers = true; + + // For every possible gesture in gesturesInHierarchy we need to check if it prevents gestureOnParentOrMe from getting pointers. + for (var k = 0; k < startedCount; k++) + { + var startedGesture = startedGestures[k]; + + if (possibleGesture == startedGesture) continue; + + // This gesture has started. Is gestureOnParentOrMe allowed to work in parallel? + if (canPreventGesture(startedGesture, possibleGesture)) + { + // activeGesture has already began and prevents gestureOnParentOrMe from getting pointers. + canReceivePointers = false; + break; + } + } + + if (!canReceivePointers) continue; + + // Filter incoming pointers for gesture. + var pointersSentToGesture = pointerListPool.Get(); + for (var k = 0; k < targetPointersCount; k++) + { + var pointer = targetPointers[k]; + if (shouldReceivePointer(possibleGesture, pointer)) pointersSentToGesture.Add(pointer); + } + + // If there are any pointers to send. + if (pointersSentToGesture.Count > 0) + { + if (pointersToDispatchForGesture.ContainsKey(possibleGesture)) + { + pointersToDispatchForGesture[possibleGesture].AddRange(pointersSentToGesture); + pointerListPool.Release(pointersSentToGesture); + } + else + { + // Add gesture to the list of active gestures this update. + activeGesturesThisUpdate.Add(possibleGesture); + pointersToDispatchForGesture.Add(possibleGesture, pointersSentToGesture); + } + } + else + { + pointerListPool.Release(pointersSentToGesture); + } + } + + gesturesInHierarchy.Clear(); + startedGestures.Clear(); + pointerListPool.Release(targetPointers); + } + + gestureListPool.Release(gesturesInHierarchy); + gestureListPool.Release(startedGestures); + transformListPool.Release(activeTargets); + + // Dispatch gesture events with pointers assigned to them. + count = activeGesturesThisUpdate.Count; + for (var i = 0; i < count; i++) + { + var gesture = activeGesturesThisUpdate[i]; + var list = pointersToDispatchForGesture[gesture]; + if (!gestureIsActive(gesture)) + { + pointerListPool.Release(list); + continue; + } + + var numPointers = list.Count; + for (var j = 0; j < numPointers; j++) + { + var pointer = list[j]; + List gestureList; + if (!pointerToGestures.TryGetValue(pointer.Id, out gestureList)) + { + gestureList = gestureListPool.Get(); + pointerToGestures.Add(pointer.Id, gestureList); + } + gestureList.Add(gesture); + } + + gesture.INTERNAL_PointersPressed(list); + pointerListPool.Release(list); + } + + pointersOnTarget.Clear(); + activeGesturesThisUpdate.Clear(); + pointersToDispatchForGesture.Clear(); + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + private void updateUpdated(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + sortPointersForActiveGestures(pointers); + + var count = activeGesturesThisUpdate.Count; + for (var i = 0; i < count; i++) + { + var gesture = activeGesturesThisUpdate[i]; + var list = pointersToDispatchForGesture[gesture]; + if (gestureIsActive(gesture)) + { + gesture.INTERNAL_PointersUpdated(list); + } + pointerListPool.Release(list); + } + + activeGesturesThisUpdate.Clear(); + pointersToDispatchForGesture.Clear(); + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + private void updateReleased(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + sortPointersForActiveGestures(pointers); + + var count = activeGesturesThisUpdate.Count; + for (var i = 0; i < count; i++) + { + var gesture = activeGesturesThisUpdate[i]; + var list = pointersToDispatchForGesture[gesture]; + if (gestureIsActive(gesture)) + { + gesture.INTERNAL_PointersReleased(list); + } + pointerListPool.Release(list); + } + + removePointers(pointers); + activeGesturesThisUpdate.Clear(); + pointersToDispatchForGesture.Clear(); + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + private void updateCancelled(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + sortPointersForActiveGestures(pointers); + + var count = activeGesturesThisUpdate.Count; + for (var i = 0; i < count; i++) + { + var gesture = activeGesturesThisUpdate[i]; + var list = pointersToDispatchForGesture[gesture]; + if (gestureIsActive(gesture)) + { + gesture.INTERNAL_PointersCancelled(list); + } + pointerListPool.Release(list); + } + + removePointers(pointers); + activeGesturesThisUpdate.Clear(); + pointersToDispatchForGesture.Clear(); + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + private void sortPointersForActiveGestures(IList pointers) + { + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + List gestures; + if (!pointerToGestures.TryGetValue(pointer.Id, out gestures)) continue; + + var gestureCount = gestures.Count; + for (var j = 0; j < gestureCount; j++) + { + var gesture = gestures[j]; + List toDispatch; + if (!pointersToDispatchForGesture.TryGetValue(gesture, out toDispatch)) + { + toDispatch = pointerListPool.Get(); + pointersToDispatchForGesture.Add(gesture, toDispatch); + activeGesturesThisUpdate.Add(gesture); + } + toDispatch.Add(pointer); + } + } + } + + private void removePointers(IList pointers) + { + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + List list; + if (!pointerToGestures.TryGetValue(pointer.Id, out list)) continue; + + pointerToGestures.Remove(pointer.Id); + gestureListPool.Release(list); + } + } + + private void resetGestures() + { + if (gesturesToReset.Count == 0) return; + + var count = gesturesToReset.Count; + for (var i = 0; i < count; i++) + { + var gesture = gesturesToReset[i]; + if (Equals(gesture, null)) continue; // Reference comparison + + var activePointers = gesture.ActivePointers; + var activeCount = activePointers.Count; + for (var j = 0; j < activeCount; j++) + { + var pointer = activePointers[j]; + List list; + if (pointerToGestures.TryGetValue(pointer.Id, out list)) list.Remove(gesture); + } + + if (gesture == null) continue; // Unity "null" comparison + gesture.INTERNAL_Reset(); + gesture.INTERNAL_SetState(Gesture.GestureState.Idle); + } + gesturesToReset.Clear(); + } + + private void clearFrameCaches() + { + foreach (var kv in hierarchyEndingWithCache) gestureListPool.Release(kv.Value); + foreach (var kv in hierarchyBeginningWithCache) gestureListPool.Release(kv.Value); + hierarchyEndingWithCache.Clear(); + hierarchyBeginningWithCache.Clear(); + } + + // parent <- parent <- target + private List getHierarchyEndingWith(Transform target) + { + List list; + if (hierarchyEndingWithCache.TryGetValue(target, out list)) return list; + + list = gestureListPool.Get(); + target.GetComponentsInParent(false, list); + hierarchyEndingWithCache.Add(target, list); + + return list; + } + + // target <- child* + private List getHierarchyBeginningWith(Transform target) + { + List list; + if (hierarchyBeginningWithCache.TryGetValue(target, out list)) return list; + + list = gestureListPool.Get(); + target.GetComponentsInChildren(list); + hierarchyBeginningWithCache.Add(target, list); + + return list; + } + + private bool gestureIsActive(Gesture gesture) + { + if (gesture.gameObject.activeInHierarchy == false) return false; + if (gesture.enabled == false) return false; + switch (gesture.State) + { + case Gesture.GestureState.Failed: + case Gesture.GestureState.Recognized: + case Gesture.GestureState.Cancelled: + return false; + default: + return true; + } + } + + private bool recognizeGestureIfNotPrevented(Gesture gesture) + { + if (!shouldBegin(gesture)) return false; + + var gesturesToFail = gestureListPool.Get(); + bool canRecognize = true; + var target = gesture.transform; + + var gesturesInHierarchy = gestureListPool.Get(); + gesturesInHierarchy.AddRange(getHierarchyEndingWith(target)); + gesturesInHierarchy.AddRange(getHierarchyBeginningWith(target)); + + var count = gesturesInHierarchy.Count; + for (var i = 0; i < count; i++) + { + var otherGesture = gesturesInHierarchy[i]; + if (gesture == otherGesture) continue; + if (!gestureIsActive(otherGesture)) continue; + + if (otherGesture.State == Gesture.GestureState.Began || + otherGesture.State == Gesture.GestureState.Changed) + { + if (canPreventGesture(otherGesture, gesture)) + { + canRecognize = false; + break; + } + } + else if (otherGesture.State == Gesture.GestureState.Possible) + { + if (canPreventGesture(gesture, otherGesture)) + { + gesturesToFail.Add(otherGesture); + } + } + } + + if (canRecognize) + { + count = gesturesToFail.Count; + for (var i = 0; i < count; i++) + { + failGesture(gesturesToFail[i]); + } + } + + gestureListPool.Release(gesturesToFail); + gestureListPool.Release(gesturesInHierarchy); + + return canRecognize; + } + + private void failGesture(Gesture gesture) + { + gesture.INTERNAL_SetState(Gesture.GestureState.Failed); + } + + private bool shouldReceivePointer(Gesture gesture, Pointer pointer) + { + bool result = true; + if (GlobalGestureDelegate != null) result = GlobalGestureDelegate.ShouldReceivePointer(gesture, pointer); + return result && gesture.ShouldReceivePointer(pointer); + } + + private bool shouldBegin(Gesture gesture) + { + bool result = true; + if (GlobalGestureDelegate != null) result = GlobalGestureDelegate.ShouldBegin(gesture); + return result && gesture.ShouldBegin(); + } + + private bool canPreventGesture(Gesture first, Gesture second) + { + bool result = true; + if (GlobalGestureDelegate != null) result = !GlobalGestureDelegate.ShouldRecognizeSimultaneously(first, second); + return result && first.CanPreventGesture(second); + } + + #endregion + + #region Pointer events handlers + + private void frameFinishedHandler(object sender, EventArgs eventArgs) + { + resetGestures(); + clearFrameCaches(); + } + + private void frameStartedHandler(object sender, EventArgs eventArgs) + { + resetGestures(); + } + + private void pointersPressedHandler(object sender, PointerEventArgs pointerEventArgs) + { + updatePressed(pointerEventArgs.Pointers); + } + + private void pointersUpdatedHandler(object sender, PointerEventArgs pointerEventArgs) + { + updateUpdated(pointerEventArgs.Pointers); + } + + private void pointersReleasedHandler(object sender, PointerEventArgs pointerEventArgs) + { + updateReleased(pointerEventArgs.Pointers); + } + + private void pointersCancelledHandler(object sender, PointerEventArgs pointerEventArgs) + { + updateCancelled(pointerEventArgs.Pointers); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs.meta b/Source/Assets/TouchScript/Scripts/Core/GestureManagerInstance.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs.meta rename to Source/Assets/TouchScript/Scripts/Core/GestureManagerInstance.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs b/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs new file mode 100644 index 000000000..5c78e6303 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs @@ -0,0 +1,279 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using TouchScript.Hit; +using TouchScript.Layers; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Core +{ + /// + /// Internal implementation of . + /// + internal sealed class LayerManagerInstance : MonoBehaviour, ILayerManager + { + #region Public properties + + /// + /// Gets the instance of GestureManager singleton. + /// + public static ILayerManager Instance + { + get + { + if (shuttingDown) return null; + if (instance == null) + { + if (!Application.isPlaying) return null; + var objects = FindObjectsOfType(); + if (objects.Length == 0) + { + var go = new GameObject("GestureManager Instance"); + instance = go.AddComponent(); + } + else if (objects.Length >= 1) + { + instance = objects[0]; + } + } + return instance; + } + } + + /// + public IList Layers + { + get { return new List(layers); } + } + + /// + public int LayerCount + { + get { return layerCount; } + } + + /// + public bool HasExclusive + { + get { return exclusiveCount > 0; } + } + + #endregion + + #region Private variables + + private static LayerManagerInstance instance; + private static bool shuttingDown = false; + + private ITouchManager manager; + private List layers = new List(10); + private int layerCount = 0; + + private HashSet exclusive = new HashSet(); + private int exclusiveCount = 0; + private int clearExclusiveDelay = -1; + + #endregion + + #region Temporary variables + + // Used in SetExclusive(). + private List tmpList = new List(20); + + #endregion + + #region Public methods + + /// + public bool AddLayer(TouchLayer layer, int index = -1, bool addIfExists = true) + { + if (layer == null) return false; + + var i = layers.IndexOf(layer); + if (i != -1) + { + if (!addIfExists) return false; + layers.RemoveAt(i); + layerCount--; + } + if (index == 0) + { + layers.Insert(0, layer); + layerCount++; + return i == -1; + } + if (index == -1 || index >= layerCount) + { + layers.Add(layer); + layerCount++; + return i == -1; + } + if (i != -1) + { + if (index < i) layers.Insert(index, layer); + else layers.Insert(index - 1, layer); + layerCount++; + return false; + } + layers.Insert(index, layer); + layerCount++; + return true; + } + + /// + public bool RemoveLayer(TouchLayer layer) + { + if (layer == null) return false; + var result = layers.Remove(layer); + if (result) layerCount--; + return result; + } + + /// + public void ChangeLayerIndex(int at, int to) + { + if (at < 0 || at >= layerCount) return; + if (to < 0 || to >= layerCount) return; + var data = layers[at]; + layers.RemoveAt(at); + layers.Insert(to, data); + } + + /// + public void ForEach(Func action) + { + for (var i = 0; i < layerCount; i++) + { + if (!action(layers[i])) break; + } + } + + /// + public bool GetHitTarget(IPointer pointer, out HitData hit) + { + hit = default(HitData); + + for (var i = 0; i < layerCount; i++) + { + var touchLayer = layers[i]; + if (touchLayer == null) continue; + var result = touchLayer.Hit(pointer, out hit); + switch (result) + { + case HitResult.Hit: + return true; + case HitResult.Discard: + return false; + } + } + + return false; + } + + /// + public void SetExclusive(Transform target, bool includeChildren = false) + { + if (target == null) return; + exclusive.Clear(); + clearExclusiveDelay = -1; + + exclusive.Add(target.GetHashCode()); + exclusiveCount = 1; + if (includeChildren) + { + target.GetComponentsInChildren(tmpList); + foreach (var t in tmpList) exclusive.Add(t.GetHashCode()); + exclusiveCount += tmpList.Count; + } + } + + /// + public void SetExclusive(IEnumerable targets) + { + if (targets == null) return; + exclusive.Clear(); + clearExclusiveDelay = -1; + + foreach (var t in targets) + { + exclusive.Add(t.GetHashCode()); + exclusiveCount++; + } + } + + /// + public bool IsExclusive(Transform target) + { + return exclusive.Contains(target.GetHashCode()); + } + + /// + public void ClearExclusive() + { + // It is incorrect to just set exclusiveCount to zero since the exclusive list is actually needed the next frame. Only after the next frame's FrameEnded event the list can be cleared. + // If we are inside the Pointer Frame, we need to wait for the second FrameEnded (this frame's event included). Otherwise, we need to wait for the next FrameEnded event. + clearExclusiveDelay = manager.IsInsidePointerFrame ? 2 : 1; + } + + #endregion + + #region Unity + + private void Awake() + { + if (instance == null) + { + instance = this; + } + else if (instance != this) + { + Destroy(this); + return; + } + + manager = TouchManager.Instance; + + gameObject.hideFlags = HideFlags.HideInHierarchy; + DontDestroyOnLoad(gameObject); + } + + private void OnEnable() + { + manager.FrameFinished += frameFinishedHandler; + } + + private void OnDisable() + { + manager.FrameFinished -= frameFinishedHandler; + } + + private void OnApplicationQuit() + { + shuttingDown = true; + } + + #endregion + + #region Private functions + + #endregion + + #region Event handlers + + private void frameFinishedHandler(object sender, EventArgs eventArgs) + { + clearExclusiveDelay--; + if (clearExclusiveDelay == 0) + { + exclusive.Clear(); + exclusiveCount = 0; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs.meta b/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs.meta new file mode 100644 index 000000000..44da71ae4 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Core/LayerManagerInstance.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 61a2ae412ada86b48aa49c2ec1557dcb +timeCreated: 1500755913 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs b/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs new file mode 100644 index 000000000..fee118951 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs @@ -0,0 +1,1089 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using TouchScript.Devices.Display; +using TouchScript.Hit; +using TouchScript.InputSources; +using TouchScript.Layers; +using TouchScript.Utils; +using TouchScript.Pointers; +using UnityEngine; +using UnityEngine.Profiling; +using TouchScript.Core; +#if TOUCHSCRIPT_DEBUG +using TouchScript.Debugging.GL; +using TouchScript.Debugging.Loggers; +#endif +#if UNITY_5_4_OR_NEWER +using UnityEngine.SceneManagement; +#endif + +namespace TouchScript.Core +{ + /// + /// Default implementation of . + /// + public sealed class TouchManagerInstance : DebuggableMonoBehaviour, ITouchManager + { + #region Events + + /// + public event EventHandler FrameStarted + { + add { frameStartedInvoker += value; } + remove { frameStartedInvoker -= value; } + } + + /// + public event EventHandler FrameFinished + { + add { frameFinishedInvoker += value; } + remove { frameFinishedInvoker -= value; } + } + + /// + public event EventHandler PointersAdded + { + add { pointersAddedInvoker += value; } + remove { pointersAddedInvoker -= value; } + } + + /// + public event EventHandler PointersUpdated + { + add { pointersUpdatedInvoker += value; } + remove { pointersUpdatedInvoker -= value; } + } + + /// + public event EventHandler PointersPressed + { + add { pointersPressedInvoker += value; } + remove { pointersPressedInvoker -= value; } + } + + /// + public event EventHandler PointersReleased + { + add { pointersReleasedInvoker += value; } + remove { pointersReleasedInvoker -= value; } + } + + /// + public event EventHandler PointersRemoved + { + add { pointersRemovedInvoker += value; } + remove { pointersRemovedInvoker -= value; } + } + + /// + public event EventHandler PointersCancelled + { + add { pointersCancelledInvoker += value; } + remove { pointersCancelledInvoker -= value; } + } + + // Needed to overcome iOS AOT limitations + private EventHandler pointersAddedInvoker, pointersUpdatedInvoker, pointersPressedInvoker, pointersReleasedInvoker, pointersRemovedInvoker, pointersCancelledInvoker; + + private EventHandler frameStartedInvoker, frameFinishedInvoker; + + #endregion + + #region Public properties + + /// + /// Gets the instance of TouchManager singleton. + /// + public static TouchManagerInstance Instance + { + get + { + if (shuttingDown) return null; + if (instance == null) + { + if (!Application.isPlaying) return null; + var objects = FindObjectsOfType(); + if (objects.Length == 0) + { + var go = new GameObject("TouchManager Instance"); + instance = go.AddComponent(); + } + else if (objects.Length >= 1) + { + instance = objects[0]; + } + } + return instance; + } + } + + /// + public IDisplayDevice DisplayDevice + { + get + { + if (displayDevice == null) + { + displayDevice = ScriptableObject.CreateInstance(); + } + return displayDevice; + } + set + { + if (value == null) + { + displayDevice = ScriptableObject.CreateInstance(); + } + else + { + displayDevice = value; + } + UpdateResolution(); + } + } + + /// + public float DPI + { + get { return dpi; } + } + + /// + public bool ShouldCreateCameraLayer + { + get { return shouldCreateCameraLayer; } + set { shouldCreateCameraLayer = value; } + } + + /// + public bool ShouldCreateStandardInput + { + get { return shouldCreateStandardInput; } + set { shouldCreateStandardInput = value; } + } + + /// + public IList Inputs + { + get { return new List(inputs); } + } + + /// + public float DotsPerCentimeter + { + get { return dotsPerCentimeter; } + } + + /// + public int PointersCount + { + get { return pointers.Count; } + } + + /// + public IList Pointers + { + get { return new List(pointers); } + } + + /// + public int PressedPointersCount + { + get { return pressedPointers.Count; } + } + + /// + public IList PressedPointers + { + get { return new List(pressedPointers); } + } + + /// + public bool IsInsidePointerFrame { get; private set; } + + #endregion + + #region Private variables + + private static bool shuttingDown = false; + private static TouchManagerInstance instance; + + private bool shouldCreateCameraLayer = true; + private bool shouldCreateStandardInput = true; + + private IDisplayDevice displayDevice; + private float dpi = 96; + private float dotsPerCentimeter = TouchManager.CM_TO_INCH * 96; + + private ILayerManager layerManager; + + private List inputs = new List(3); + private int inputCount = 0; + + private List pointers = new List(30); + private HashSet pressedPointers = new HashSet(); + private Dictionary idToPointer = new Dictionary(30); + + // Upcoming changes + private List pointersAdded = new List(10); + private HashSet pointersUpdated = new HashSet(); + private HashSet pointersPressed = new HashSet(); + private HashSet pointersReleased = new HashSet(); + private HashSet pointersRemoved = new HashSet(); + private HashSet pointersCancelled = new HashSet(); + + private static ObjectPool> pointerListPool = new ObjectPool>(2, + () => new List(10), null, (l) => l.Clear()); + + private static ObjectPool> intListPool = new ObjectPool>(3, () => new List(10), null, + (l) => l.Clear()); + + private int nextPointerId = 0; + private object pointerLock = new object(); + + // Cache delegates + private Func _layerAddPointer, _layerUpdatePointer, _layerRemovePointer, _layerCancelPointer; + + #endregion + + #region Temporary variables + + // Used in layer dispatch fucntions + private Pointer tmpPointer; + + #endregion + + #region Debug + +#if TOUCHSCRIPT_DEBUG + private IPointerLogger pLogger; +#endif + +#if UNITY_5_6_OR_NEWER + private CustomSampler samplerUpdateInputs, samplerUpdateAdded, samplerUpdatePressed, samplerUpdateUpdated, samplerUpdateReleased, samplerUpdateRemoved, samplerUpdateCancelled; +#endif + + #endregion + + #region Public methods + + /// + public bool AddInput(IInputSource input) + { + if (input == null) return false; + if (inputs.Contains(input)) return true; + inputs.Add(input); + inputCount++; + return true; + } + + /// + public bool RemoveInput(IInputSource input) + { + if (input == null) return false; + var result = inputs.Remove(input); + if (result) inputCount--; + return result; + } + + /// + public void CancelPointer(int id, bool shouldReturn) + { + Pointer pointer; + if (idToPointer.TryGetValue(id, out pointer)) + { + pointer.InputSource.CancelPointer(pointer, shouldReturn); + } + } + + /// + public void CancelPointer(int id) + { + CancelPointer(id, false); + } + + /// + public void UpdateResolution() + { + if (DisplayDevice != null) + { + DisplayDevice.UpdateDPI(); + dpi = DisplayDevice.DPI; + } + else + { + dpi = 96; + } + dotsPerCentimeter = TouchManager.CM_TO_INCH * dpi; +#if TOUCHSCRIPT_DEBUG + debugPointerSize = Vector2.one * dotsPerCentimeter; +#endif + + foreach (var input in inputs) input.UpdateResolution(); + } + + #endregion + + #region Internal methods + + internal void INTERNAL_AddPointer(Pointer pointer) + { + lock (pointerLock) + { + pointer.INTERNAL_Init(nextPointerId); + pointersAdded.Add(pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.IdAllocated); +#endif + + nextPointerId++; + } + } + + internal void INTERNAL_UpdatePointer(int id) + { + lock (pointerLock) + { + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { + // This pointer was added this frame + if (!wasPointerAddedThisFrame(id, out pointer)) + { + // No pointer with such id +#if TOUCHSCRIPT_DEBUG + if (DebugMode) Debug.LogWarning("TouchScript > Pointer with id [" + id + "] is requested to MOVE to but no pointer with such id found."); +#endif + return; + } + } + + pointersUpdated.Add(id); + } + } + + internal void INTERNAL_PressPointer(int id) + { + lock (pointerLock) + { + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { + // This pointer was added this frame + if (!wasPointerAddedThisFrame(id, out pointer)) + { + // No pointer with such id +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to PRESS but no pointer with such id found."); +#endif + return; + } + } +#if TOUCHSCRIPT_DEBUG + if (!pointersPressed.Add(id)) + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to PRESS more than once this frame."); +#else + pointersPressed.Add(id); +#endif + + } + } + + /// + internal void INTERNAL_ReleasePointer(int id) + { + lock (pointerLock) + { + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { + // This pointer was added this frame + if (!wasPointerAddedThisFrame(id, out pointer)) + { + // No pointer with such id +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to END but no pointer with such id found."); +#endif + return; + } + } +#if TOUCHSCRIPT_DEBUG + if (!pointersReleased.Add(id)) + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to END more than once this frame."); +#else + pointersReleased.Add(id); +#endif + + } + } + + /// + internal void INTERNAL_RemovePointer(int id) + { + lock (pointerLock) + { + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { + // This pointer was added this frame + if (!wasPointerAddedThisFrame(id, out pointer)) + { + // No pointer with such id +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to REMOVE but no pointer with such id found."); +#endif + return; + } + } +#if TOUCHSCRIPT_DEBUG + if (!pointersRemoved.Add(pointer.Id)) + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to REMOVE more than once this frame."); +#else + pointersRemoved.Add(pointer.Id); +#endif + + } + } + + /// + internal void INTERNAL_CancelPointer(int id) + { + lock (pointerLock) + { + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { + // This pointer was added this frame + if (!wasPointerAddedThisFrame(id, out pointer)) + { + // No pointer with such id +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to CANCEL but no pointer with such id found."); +#endif + return; + } + } +#if TOUCHSCRIPT_DEBUG + if (!pointersCancelled.Add(pointer.Id)) + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to CANCEL more than once this frame."); +#else + pointersCancelled.Add(pointer.Id); +#endif + + } + } + + #endregion + + #region Unity + + private void Awake() + { + if (instance == null) + { + instance = this; + } + else if (instance != this) + { + Destroy(this); + return; + } + +#if TOUCHSCRIPT_DEBUG + pLogger = Debugging.TouchScriptDebugger.Instance.PointerLogger; +#endif + +#if UNITY_5_4_OR_NEWER + SceneManager.sceneLoaded += sceneLoadedHandler; +#endif + + gameObject.hideFlags = HideFlags.HideInHierarchy; + DontDestroyOnLoad(gameObject); + + layerManager = LayerManager.Instance; + + UpdateResolution(); + + StopAllCoroutines(); + StartCoroutine(lateAwake()); + + pointerListPool.WarmUp(2); + intListPool.WarmUp(3); + + _layerAddPointer = layerAddPointer; + _layerUpdatePointer = layerUpdatePointer; + _layerRemovePointer = layerRemovePointer; + _layerCancelPointer = layerCancelPointer; + +#if UNITY_5_6_OR_NEWER + samplerUpdateInputs = CustomSampler.Create("[TouchScript] Update Inputs"); + samplerUpdateAdded = CustomSampler.Create("[TouchScript] Added Pointers"); + samplerUpdatePressed = CustomSampler.Create("[TouchScript] Press Pointers"); + samplerUpdateUpdated = CustomSampler.Create("[TouchScript] Update Pointers"); + samplerUpdateReleased = CustomSampler.Create("[TouchScript] Release Pointers"); + samplerUpdateRemoved = CustomSampler.Create("[TouchScript] Remove Pointers"); + samplerUpdateCancelled = CustomSampler.Create("[TouchScript] Cancel Pointers"); +#endif + } + +#if UNITY_5_4_OR_NEWER + private void sceneLoadedHandler(Scene scene, LoadSceneMode mode) + { + StopAllCoroutines(); + StartCoroutine(lateAwake()); + } +#else + private void OnLevelWasLoaded(int value) + { + StopAllCoroutines(); + StartCoroutine(lateAwake()); + } +#endif + + private IEnumerator lateAwake() + { + // Wait 2 frames: + // Frame 0: TouchManager adds layers in order + // Frame 1: Layers add themselves + // Frame 2: We add a layer if there are none + yield return null; + yield return null; + + createCameraLayer(); + createInput(); + } + + private void Update() + { + sendFrameStartedToPointers(); + updateInputs(); + updatePointers(); + } + + private void OnApplicationQuit() + { + shuttingDown = true; + } + + #endregion + + #region Private functions + + private void createCameraLayer() + { + if (layerManager.LayerCount == 0 && shouldCreateCameraLayer) + { + if (Camera.main != null) + { + if (Application.isEditor) + Debug.Log( + "[TouchScript] No touch layers found, adding StandardLayer for the main camera. (this message is harmless)"); + var layer = Camera.main.gameObject.AddComponent(); + layerManager.AddLayer(layer); + } + } + } + + private void createInput() + { + if (inputCount == 0 && shouldCreateStandardInput) + { + if (Application.isEditor) + Debug.Log("[TouchScript] No input source found, adding StandardInput. (this message is harmless)"); + GameObject obj = null; + var objects = FindObjectsOfType(); + if (objects.Length == 0) + { + obj = GameObject.Find("TouchScript"); + if (obj == null) obj = new GameObject("TouchScript"); + } + else + { + obj = objects[0].gameObject; + } + obj.AddComponent(); + } + } + + private void updateInputs() + { +#if UNITY_5_6_OR_NEWER + samplerUpdateInputs.Begin(); +#endif + for (var i = 0; i < inputCount; i++) inputs[i].UpdateInput(); +#if UNITY_5_6_OR_NEWER + samplerUpdateInputs.End(); +#endif + } + + private void updateAdded(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdateAdded.Begin(); +#endif + + var addedCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < addedCount; i++) + { + var pointer = pointers[i]; + list.Add(pointer); + this.pointers.Add(pointer); + idToPointer.Add(pointer.Id, pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Added); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerAddPointer); + tmpPointer = null; + +#if TOUCHSCRIPT_DEBUG + if (DebugMode) addDebugFigureForPointer(pointer); +#endif + } + + if (pointersAddedInvoker != null) + pointersAddedInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdateAdded.End(); +#endif + } + + private bool layerAddPointer(TouchLayer layer) + { + layer.INTERNAL_AddPointer(tmpPointer); + return true; + } + + private void updateUpdated(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdateUpdated.Begin(); +#endif + + var updatedCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < updatedCount; i++) + { + var id = pointers[i]; + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Id [" + id + + "] was in UPDATED list but no pointer with such id found."); +#endif + continue; + } + list.Add(pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Updated); +#endif + + var layer = pointer.GetPressData().Layer; + if (layer != null) layer.INTERNAL_UpdatePointer(pointer); + else + { + tmpPointer = pointer; + layerManager.ForEach(_layerUpdatePointer); + tmpPointer = null; + } + +#if TOUCHSCRIPT_DEBUG + if (DebugMode) addDebugFigureForPointer(pointer); +#endif + } + + if (pointersUpdatedInvoker != null) + pointersUpdatedInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdateUpdated.End(); +#endif + } + + private bool layerUpdatePointer(TouchLayer layer) + { + layer.INTERNAL_UpdatePointer(tmpPointer); + return true; + } + + private void updatePressed(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdatePressed.Begin(); +#endif + + var pressedCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < pressedCount; i++) + { + var id = pointers[i]; + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Id [" + id + + "] was in PRESSED list but no pointer with such id found."); +#endif + continue; + } + list.Add(pointer); + pressedPointers.Add(pointer); + + HitData hit = pointer.GetOverData(); + if (hit.Layer != null) + { + pointer.INTERNAL_SetPressData(hit); + hit.Layer.INTERNAL_PressPointer(pointer); + } + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Pressed); + if (DebugMode) addDebugFigureForPointer(pointer); +#endif + } + + if (pointersPressedInvoker != null) + pointersPressedInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdatePressed.End(); +#endif + } + + private void updateReleased(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdateReleased.Begin(); +#endif + + var releasedCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < releasedCount; i++) + { + var id = pointers[i]; + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { +#if TOUCHSCRIPT_DEBUG + if (DebugMode) Debug.LogWarning("TouchScript > Id [" + id + "] was in RELEASED list but no pointer with such id found."); +#endif + continue; + } + list.Add(pointer); + pressedPointers.Remove(pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Released); +#endif + + var layer = pointer.GetPressData().Layer; + if (layer != null) layer.INTERNAL_ReleasePointer(pointer); + +#if TOUCHSCRIPT_DEBUG + if (DebugMode) addDebugFigureForPointer(pointer); +#endif + } + + if (pointersReleasedInvoker != null) + pointersReleasedInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + + releasedCount = list.Count; + for (var i = 0; i < releasedCount; i++) + { + var pointer = list[i]; + pointer.INTERNAL_ClearPressData(); + } + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdateReleased.End(); +#endif + } + + private void updateRemoved(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdateRemoved.Begin(); +#endif + + var removedCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < removedCount; i++) + { + var id = pointers[i]; + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { +#if TOUCHSCRIPT_DEBUG + if (DebugMode) Debug.LogWarning("TouchScript > Id [" + id + "] was in REMOVED list but no pointer with such id found."); +#endif + continue; + } + idToPointer.Remove(id); + this.pointers.Remove(pointer); + pressedPointers.Remove(pointer); + list.Add(pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Removed); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerRemovePointer); + tmpPointer = null; + +#if TOUCHSCRIPT_DEBUG + if (DebugMode) removeDebugFigureForPointer(pointer); +#endif + } + + if (pointersRemovedInvoker != null) + pointersRemovedInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + + removedCount = list.Count; + for (var i = 0; i < removedCount; i++) + { + var pointer = list[i]; + pointer.InputSource.INTERNAL_DiscardPointer(pointer); + } + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdateRemoved.End(); +#endif + } + + private bool layerRemovePointer(TouchLayer layer) + { + layer.INTERNAL_RemovePointer(tmpPointer); + return true; + } + + private void updateCancelled(List pointers) + { +#if UNITY_5_6_OR_NEWER + samplerUpdateCancelled.Begin(); +#endif + + var cancelledCount = pointers.Count; + var list = pointerListPool.Get(); + for (var i = 0; i < cancelledCount; i++) + { + var id = pointers[i]; + Pointer pointer; + if (!idToPointer.TryGetValue(id, out pointer)) + { +#if TOUCHSCRIPT_DEBUG + if (DebugMode) + Debug.LogWarning("TouchScript > Id [" + id + + "] was in CANCELLED list but no pointer with such id found."); +#endif + continue; + } + idToPointer.Remove(id); + this.pointers.Remove(pointer); + pressedPointers.Remove(pointer); + list.Add(pointer); + +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Cancelled); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerCancelPointer); + tmpPointer = null; + +#if TOUCHSCRIPT_DEBUG + if (DebugMode) removeDebugFigureForPointer(pointer); +#endif + } + + if (pointersCancelledInvoker != null) + pointersCancelledInvoker.InvokeHandleExceptions(this, PointerEventArgs.GetCachedEventArgs(list)); + + for (var i = 0; i < cancelledCount; i++) + { + var pointer = list[i]; + pointer.InputSource.INTERNAL_DiscardPointer(pointer); + } + pointerListPool.Release(list); + +#if UNITY_5_6_OR_NEWER + samplerUpdateCancelled.End(); +#endif + } + + private bool layerCancelPointer(TouchLayer layer) + { + layer.INTERNAL_CancelPointer(tmpPointer); + return true; + } + + private void sendFrameStartedToPointers() + { + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + pointers[i].INTERNAL_FrameStarted(); + } + } + + private void updatePointers() + { + IsInsidePointerFrame = true; + if (frameStartedInvoker != null) frameStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); + + // need to copy buffers since they might get updated during execution + List addedList = null; + List updatedList = null; + List pressedList = null; + List releasedList = null; + List removedList = null; + List cancelledList = null; + lock (pointerLock) + { + if (pointersAdded.Count > 0) + { + addedList = pointerListPool.Get(); + addedList.AddRange(pointersAdded); + pointersAdded.Clear(); + } + if (pointersUpdated.Count > 0) + { + updatedList = intListPool.Get(); + updatedList.AddRange(pointersUpdated); + pointersUpdated.Clear(); + } + if (pointersPressed.Count > 0) + { + pressedList = intListPool.Get(); + pressedList.AddRange(pointersPressed); + pointersPressed.Clear(); + } + if (pointersReleased.Count > 0) + { + releasedList = intListPool.Get(); + releasedList.AddRange(pointersReleased); + pointersReleased.Clear(); + } + if (pointersRemoved.Count > 0) + { + removedList = intListPool.Get(); + removedList.AddRange(pointersRemoved); + pointersRemoved.Clear(); + } + if (pointersCancelled.Count > 0) + { + cancelledList = intListPool.Get(); + cancelledList.AddRange(pointersCancelled); + pointersCancelled.Clear(); + } + } + + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + pointers[i].INTERNAL_UpdatePosition(); + } + + if (addedList != null) + { + updateAdded(addedList); + pointerListPool.Release(addedList); + } + + if (updatedList != null) + { + updateUpdated(updatedList); + intListPool.Release(updatedList); + } + if (pressedList != null) + { + updatePressed(pressedList); + intListPool.Release(pressedList); + } + if (releasedList != null) + { + updateReleased(releasedList); + intListPool.Release(releasedList); + } + if (removedList != null) + { + updateRemoved(removedList); + intListPool.Release(removedList); + } + if (cancelledList != null) + { + updateCancelled(cancelledList); + intListPool.Release(cancelledList); + } + + if (frameFinishedInvoker != null) frameFinishedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); + IsInsidePointerFrame = false; + } + + private bool wasPointerAddedThisFrame(int id, out Pointer pointer) + { + pointer = null; + foreach (var p in pointersAdded) + { + if (p.Id == id) + { + pointer = p; + return true; + } + } + return false; + } + +#if TOUCHSCRIPT_DEBUG + private Vector2 debugPointerSize; + + private void removeDebugFigureForPointer(Pointer pointer) + { + GLDebug.RemoveFigure(TouchManager.DEBUG_GL_TOUCH + pointer.Id); + } + + private void addDebugFigureForPointer(Pointer pointer) + { + GLDebug.DrawSquareScreenSpace(TouchManager.DEBUG_GL_TOUCH + pointer.Id, pointer.Position, 0, debugPointerSize, + GLDebug.MULTIPLY, float.PositiveInfinity); + } +#endif + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs.meta b/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs.meta rename to Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Debugging.meta b/Source/Assets/TouchScript/Scripts/Debugging.meta new file mode 100644 index 000000000..ee42eb880 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a5ad27a8cf0eb496896014e5ba7e3064 +folderAsset: yes +timeCreated: 1500411050 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters.meta b/Source/Assets/TouchScript/Scripts/Debugging/Filters.meta new file mode 100644 index 000000000..331e6e464 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3c6e68831a3cb493b92de8387c4bc2e5 +folderAsset: yes +timeCreated: 1500522281 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs new file mode 100644 index 000000000..5fe884e13 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs @@ -0,0 +1,20 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using TouchScript.Debugging.Loggers; + +namespace TouchScript.Debugging.Filters +{ + /// + /// A filter of pointer data for . + /// + public interface IPointerDataFilter + { + + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs.meta new file mode 100644 index 000000000..701149ead --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerDataFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9538172481b6a4ba4920474db907b74f +timeCreated: 1500511734 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs new file mode 100644 index 000000000..36565637d --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs @@ -0,0 +1,25 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using TouchScript.Debugging.Loggers; + +namespace TouchScript.Debugging.Filters +{ + /// + /// A filter of event data for . + /// + public interface IPointerLogFilter + { + /// + /// Checks if an event should be filtered. + /// + /// The log eveny. + /// True if the event should be filtered; false otherwise. + bool Applies(ref PointerLog log); + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs.meta new file mode 100644 index 000000000..078e12061 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/IPointerLogFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e5a25273a78344e5688902b5d13e9a38 +timeCreated: 1500513432 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs b/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs new file mode 100644 index 000000000..39d63ed45 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs @@ -0,0 +1,39 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using TouchScript.Debugging.Loggers; + +namespace TouchScript.Debugging.Filters +{ + /// + /// An event log filter which filters data by events. + /// + /// + public class PointerLogFilter : IPointerLogFilter + { + /// + /// A binary mask of events based on values. + /// + public uint EventMask { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public PointerLogFilter() + { + EventMask = uint.MaxValue; + } + + /// + public bool Applies(ref PointerLog log) + { + var evt = (int) log.Event; + return (EventMask & (uint) (1 << evt)) != 0; + } + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs.meta new file mode 100644 index 000000000..9ba0124f0 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Filters/PointerLogFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ce62e2e87231b4fdc83e8c56eeb08b89 +timeCreated: 1500522632 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/UI.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL.meta similarity index 79% rename from Source/Assets/TouchScript/Scripts/Gestures/UI.meta rename to Source/Assets/TouchScript/Scripts/Debugging/GL.meta index a301f4b21..6bdfb9d1d 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/UI.meta +++ b/Source/Assets/TouchScript/Scripts/Debugging/GL.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ddd34b98b8bbe42a597fffd736c87e30 +guid: c8b78ed8d23cd4373bebaff448436deb folderAsset: yes timeCreated: 1447582128 licenseType: Pro diff --git a/Source/Assets/TouchScript/Scripts/Utils/Debug/DebugHelper.cs b/Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs similarity index 89% rename from Source/Assets/TouchScript/Scripts/Utils/Debug/DebugHelper.cs rename to Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs index fe0ea37df..53423adb1 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/Debug/DebugHelper.cs +++ b/Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs @@ -2,11 +2,11 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using UnityEngine; - #if TOUCHSCRIPT_DEBUG -namespace TouchScript.Utils.Debug +using UnityEngine; + +namespace TouchScript.Debugging.GL { public static class DebugHelper { diff --git a/Source/Assets/TouchScript/Scripts/Utils/Debug/DebugHelper.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/Debug/DebugHelper.cs.meta rename to Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Utils/Debug/GLDebug.cs b/Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs similarity index 87% rename from Source/Assets/TouchScript/Scripts/Utils/Debug/GLDebug.cs rename to Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs index 157373575..59a07e2ee 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/Debug/GLDebug.cs +++ b/Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs @@ -1,19 +1,23 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ * Based on http://pastebin.com/69QP1s45 */ + #if TOUCHSCRIPT_DEBUG -#if TOUCHSCRIPT_DEBUG - +using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Rendering; +#if UNITY_EDITOR +using UnityEditor; +using UnityEditor.Build; +#endif -namespace TouchScript.Utils.Debug +namespace TouchScript.Debugging.GL { public class GLDebug : MonoBehaviour { - public static readonly Color MULTIPLY = new Color(0, 0, 0, 0); public static readonly Vector2 DEFAULT_SCREEN_SPACE_SCALE = new Vector2(10, 10); @@ -58,6 +62,8 @@ private static GLDebug instance private Dictionary figuresMultiplyScreenSpace; private Dictionary figuresTmp; + private WaitForEndOfFrame wait; + #region Public methods public static void RemoveFigure(int id) @@ -79,7 +85,7 @@ public static int DrawLine(Vector3 start, Vector3 end, Color? color = null, floa public static int DrawLine(int? id, Vector3 start, Vector3 end, Color? color = null, float duration = 0, bool depthTest = false) { - return drawFigure(id, new List() { new Line(start, end) }, color ?? Color.white, duration, depthTest); + return drawFigure(id, new List() {new Line(start, end)}, color ?? Color.white, duration, depthTest); } public static int DrawLineScreenSpace(Vector2 start, Vector2 end, Color? color = null, float duration = 0) @@ -89,7 +95,7 @@ public static int DrawLineScreenSpace(Vector2 start, Vector2 end, Color? color = public static int DrawLineScreenSpace(int? id, Vector2 start, Vector2 end, Color? color = null, float duration = 0) { - return drawFigureScreenSpace(id, new List() { new Line(start, end) }, color ?? Color.white, duration); + return drawFigureScreenSpace(id, new List() {new Line(start, end)}, color ?? Color.white, duration); } #endregion @@ -285,6 +291,7 @@ private void Awake() figuresMultiplyNoDepthTest = new Dictionary(); figuresMultiplyScreenSpace = new Dictionary(); figuresTmp = new Dictionary(); + wait = new WaitForEndOfFrame(); setMaterials(); } @@ -295,43 +302,45 @@ private void Update() DisplayLines = !DisplayLines; } - private void OnPostRender() + private IEnumerator OnPostRender() { - if (!DisplayLines) return; + if (!DisplayLines) yield break; + + yield return wait; materialDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresDepthTest = draw(figuresDepthTest); - GL.End(); + UnityEngine.GL.End(); materialMultiplyDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresMultiplyDepthTest = draw(figuresMultiplyDepthTest); - GL.End(); + UnityEngine.GL.End(); materialNoDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresNoDepthTest = draw(figuresNoDepthTest); - GL.End(); + UnityEngine.GL.End(); materialMultiplyNoDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresMultiplyNoDepthTest = draw(figuresMultiplyNoDepthTest); - GL.End(); + UnityEngine.GL.End(); - GL.PushMatrix(); - GL.LoadPixelMatrix(); + UnityEngine.GL.PushMatrix(); + UnityEngine.GL.LoadPixelMatrix(); materialNoDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresScreenSpace = draw(figuresScreenSpace); - GL.End(); + UnityEngine.GL.End(); materialMultiplyNoDepthTest.SetPass(0); - GL.Begin(GL.LINES); + UnityEngine.GL.Begin(UnityEngine.GL.LINES); figuresMultiplyScreenSpace = draw(figuresMultiplyScreenSpace); - GL.End(); - GL.PopMatrix(); + UnityEngine.GL.End(); + UnityEngine.GL.PopMatrix(); } #endregion @@ -554,12 +563,10 @@ private static List createCubeLines(Matrix4x4 matrix) new Line(down_2, down_3), new Line(down_3, down_4), new Line(down_4, down_1), - new Line(down_1, up_1), new Line(down_2, up_2), new Line(down_3, up_3), new Line(down_4, up_4), - new Line(up_1, up_2), new Line(up_2, up_3), new Line(up_3, up_4), @@ -590,12 +597,12 @@ public Figure(int id, List lines, Color color, float duration) public float Draw() { - GL.Color(Color); + UnityEngine.GL.Color(Color); for (var i = 0; i < Lines.Count; i++) { Lines[i].Draw(); } - return Duration - Time.deltaTime; + return Duration - Time.unscaledDeltaTime; } } @@ -612,14 +619,53 @@ public Line(Vector3 start, Vector3 end) public void Draw() { - GL.Vertex(start); - GL.Vertex(end); + UnityEngine.GL.Vertex(start); + UnityEngine.GL.Vertex(end); } } #endregion + } +#if UNITY_EDITOR + internal class BuildProcessor : IPreprocessBuild, IPostprocessBuild + { + public int callbackOrder + { + get { return 0; } + } + + public void OnPreprocessBuild(BuildTarget target, string path) + { + // Add hidden shaders to the build. + var objs = Resources.FindObjectsOfTypeAll(); + var graphicsSettings = new SerializedObject(objs[0]); + var alwaysIncludedShaders = graphicsSettings.FindProperty("m_AlwaysIncludedShaders"); + insertShaderInProperty(alwaysIncludedShaders, "Hidden/DebugDepthTest"); + insertShaderInProperty(alwaysIncludedShaders, "Hidden/DebugNoDepthTest"); + insertShaderInProperty(alwaysIncludedShaders, "Hidden/DebugMultiplyDepthTest"); + insertShaderInProperty(alwaysIncludedShaders, "Hidden/DebugMultiplyNoDepthTest"); + graphicsSettings.ApplyModifiedProperties(); + } + + public void OnPostprocessBuild(BuildTarget target, string path) + { + // Reverd GraphicsSettings. + var objs = Resources.FindObjectsOfTypeAll(); + var graphicsSettings = new SerializedObject(objs[0]); + var alwaysIncludedShaders = graphicsSettings.FindProperty("m_AlwaysIncludedShaders"); + alwaysIncludedShaders.arraySize = alwaysIncludedShaders.arraySize - 4; + graphicsSettings.ApplyModifiedProperties(); + } + + private void insertShaderInProperty(SerializedProperty prop, string shaderName) + { + var index = prop.arraySize; + prop.InsertArrayElementAtIndex(index); + prop.GetArrayElementAtIndex(index).objectReferenceValue = Shader.Find(shaderName); + } } +#endif } #endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/Debug/GLDebug.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/Debug/GLDebug.cs.meta rename to Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers.meta b/Source/Assets/TouchScript/Scripts/Debugging/Loggers.meta new file mode 100644 index 000000000..c939545fc --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8610da401c05e4500ab00da47d037853 +folderAsset: yes +timeCreated: 1500522275 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs new file mode 100644 index 000000000..bd3d7395a --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs @@ -0,0 +1,134 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using TouchScript.Debugging.Filters; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Debugging.Loggers +{ + public class FileReaderLogger : IPointerLogger + { + public const int MIN_POINTER_LIST_SIZE = 1000; + + private int pointerCount = 0; + private BinaryReader reader; + + protected List data = new List(1); + protected List> events = new List>(1); + + /// + public int PointerCount + { + get { return pointerCount; } + } + + public FileReaderLogger(string path) + { + try + { + reader = new BinaryReader(new FileStream(path, FileMode.Open)); + } + catch (IOException e) + { + Debug.LogFormat("Error opening file at '{0}'. {1}", path, e.Message); + } + + try + { + while (true) + { + var type = (Pointer.PointerType) reader.ReadUInt32(); + var log = new PointerLog() + { + Id = reader.ReadInt32(), + Tick = reader.ReadInt64(), + PointerId = reader.ReadInt32(), + Event = (PointerEvent) reader.ReadUInt32(), + State = new PointerState() + { + Buttons = (Pointer.PointerButtonState) reader.ReadUInt32(), + Position = new Vector2(reader.ReadSingle(), reader.ReadSingle()), + PreviousPosition = new Vector2(reader.ReadSingle(), reader.ReadSingle()), + Flags = reader.ReadUInt32(), + Target = null, + TargetPath = reader.ReadString(), + } + }; + + checkId(log.PointerId, type); + var list = getPointerList(log.PointerId); + list.Add(log); + } + } + finally + { + reader.Close(); + } + } + + /// + public void Log(Pointer pointer, PointerEvent evt) + { + throw new NotImplementedException("FileReaderLogger doesn't support writing data."); + } + + /// + public List GetFilteredPointerData(IPointerDataFilter filter = null) + { + //if (filter == null) + return new List(data); + } + + /// + public List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null) + { + if (id < 0 || id >= pointerCount) + return new List(); + + List list = events[id]; + if (filter == null) + return new List(list); + + var count = list.Count; + List filtered = new List(count); + for (var i = 0; i < count; i++) + { + var item = list[i]; + if (filter.Applies(ref item)) filtered.Add(item); + } + return filtered; + } + + public void Dispose() {} + + private IList getPointerList(int id) + { + return events[id]; + } + + private void checkId(int id, Pointer.PointerType type) + { + if (id > pointerCount) throw new InvalidOperationException("Pointer id desync!"); + else if (id == pointerCount) + { + var list = new List(MIN_POINTER_LIST_SIZE); + events.Add(list); + data.Add(new PointerData() + { + Id = id, + Type = type, + }); + pointerCount++; + } + } + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs.meta new file mode 100644 index 000000000..c6e7e30e2 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileReaderLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cf11ad2c5a60cf64b859ed16fa453e64 +timeCreated: 1500796765 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs new file mode 100644 index 000000000..aedd6ade1 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs @@ -0,0 +1,81 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using TouchScript.Debugging.Filters; +using TouchScript.Pointers; +using TouchScript.Utils; +using UnityEngine; + +namespace TouchScript.Debugging.Loggers +{ + public class FileWriterLogger : IPointerLogger + { + private int eventCount = 0; + private BinaryWriter writer; + + /// + public int PointerCount + { + get { throw new NotImplementedException("FileWriterLogger doesn't support reading data."); } + } + + public FileWriterLogger() + { + var path = Path.Combine(Application.dataPath, "../TouchEvents.bin"); + try + { + writer = new BinaryWriter(new FileStream(path, FileMode.Create)); + } + catch (IOException e) + { + Debug.LogFormat("Error creating file at '{0}'. {1}", path, e.Message); + } + } + + /// + public void Log(Pointer pointer, PointerEvent evt) + { + var path = TransformUtils.GetHeirarchyPath(pointer.GetPressData().Target); + + writer.Write((uint) pointer.Type); + writer.Write(eventCount); + writer.Write(DateTime.Now.Ticks); + writer.Write(pointer.Id); + writer.Write((uint) evt); + writer.Write((uint) pointer.Buttons); + writer.Write(pointer.Position.x); + writer.Write(pointer.Position.y); + writer.Write(pointer.PreviousPosition.x); + writer.Write(pointer.PreviousPosition.y); + writer.Write(pointer.Flags); + writer.Write(path ?? ""); + + eventCount++; + } + + /// + public List GetFilteredPointerData(IPointerDataFilter filter = null) + { + throw new NotImplementedException("FileWriterLogger doesn't support reading data."); + } + + /// + public List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null) + { + throw new NotImplementedException("FileWriterLogger doesn't support reading data."); + } + + public void Dispose() + { + if (writer != null) writer.Close(); + } + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs.meta new file mode 100644 index 000000000..b31f029e0 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/FileWriterLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: df991832cfefaf844b8c08c5dd294afc +timeCreated: 1500795302 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs new file mode 100644 index 000000000..49d14ff07 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs @@ -0,0 +1,108 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System; +using System.Collections.Generic; +using TouchScript.Debugging.Filters; +using TouchScript.InputSources; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Debugging.Loggers +{ + /// + /// A logger to record pointer events. + /// + public interface IPointerLogger + { + /// + /// The number of different pointers recorded by this logger. + /// + int PointerCount { get; } + + /// + /// Logs the specified event. + /// + /// The pointer. + /// The event. + void Log(Pointer pointer, PointerEvent evt); + + /// + /// Returns a list of pointers. + /// + /// The filter to use. + /// A list of objects. + List GetFilteredPointerData(IPointerDataFilter filter = null); + + /// + /// Returns a lost of pointer events for a pointer. + /// + /// The pointer id. + /// The filter to use. + /// A list of entries. + List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null); + + /// + /// Releases resources. + /// + void Dispose(); + } + + /// + /// Pointer event. + /// + [Serializable] + public struct PointerLog + { + public int Id; + public long Tick; + public int PointerId; + public PointerEvent Event; + public PointerState State; + } + + /// + /// Pointer state during an event. + /// + [Serializable] + public struct PointerState + { + public Pointer.PointerButtonState Buttons; + public Vector2 Position; + public Vector2 PreviousPosition; + public uint Flags; + public Transform Target; + public string TargetPath; + } + + /// + /// Static pointer data. + /// + [Serializable] + public struct PointerData + { + public int Id; + public Pointer.PointerType Type; + public IInputSource InputSource; + } + + /// + /// Pointer event type. + /// + public enum PointerEvent + { + None, + IdAllocated, + Added, + Updated, + Pressed, + Released, + Removed, + Cancelled + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs.meta new file mode 100644 index 000000000..4064d563b --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/IPointerLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 36c90388cb60e47178ac7aeb22358611 +timeCreated: 1500411210 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs new file mode 100644 index 000000000..875e83a1c --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs @@ -0,0 +1,136 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System; +using System.Collections.Generic; +using TouchScript.Debugging.Filters; +using TouchScript.Pointers; +using TouchScript.Utils; + +namespace TouchScript.Debugging.Loggers +{ + /// + /// A default implementation of used in editor. + /// + /// + public class PointerLogger : IPointerLogger + { + #region Consts + + public const int MIN_POINTER_LIST_SIZE = 1000; + + #endregion + + #region Public properties + + /// + public int PointerCount + { + get { return pointerCount; } + } + + #endregion + + #region Private variables + + private int pointerCount = 0; + private int eventCount = 0; + + protected List data = new List(1); + protected List> events = new List>(1); + + #endregion + + #region Public methods + + /// + public virtual void Log(Pointer pointer, PointerEvent evt) + { + var id = checkId(pointer); + + var list = getPointerList(id); + var log = new PointerLog() + { + Id = eventCount, + Tick = DateTime.Now.Ticks, + PointerId = id, + Event = evt, + State = new PointerState() + { + Buttons = pointer.Buttons, + Position = pointer.Position, + PreviousPosition = pointer.PreviousPosition, + Flags = pointer.Flags, + Target = pointer.GetPressData().Target, + TargetPath = TransformUtils.GetHeirarchyPath(pointer.GetPressData().Target), + } + }; + list.Add(log); + eventCount++; + } + + /// + public virtual List GetFilteredPointerData(IPointerDataFilter filter = null) + { + //if (filter == null) + return new List(data); + } + + /// + public virtual List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null) + { + if (id < 0 || id >= pointerCount) + return new List(); + + List list = events[id]; + if (filter == null) + return new List(list); + + var count = list.Count; + List filtered = new List(count); + for (var i = 0; i < count; i++) + { + var item = list[i]; + if (filter.Applies(ref item)) filtered.Add(item); + } + return filtered; + } + + /// + public virtual void Dispose() {} + + #endregion + + #region Private functions + + private IList getPointerList(int id) + { + return events[id]; + } + + private int checkId(Pointer pointer) + { + var id = pointer.Id; + if (id > pointerCount) throw new InvalidOperationException("Pointer id desync!"); + if (id != pointerCount) return id; + + var list = new List(MIN_POINTER_LIST_SIZE); + events.Add(list); + data.Add(new PointerData() + { + Id = id, + Type = pointer.Type, + }); + pointerCount++; + + return id; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs.meta new file mode 100644 index 000000000..ce961f2d5 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/Loggers/PointerLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c562664b792404515b96fe4cbbc06988 +timeCreated: 1500522240 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs b/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs new file mode 100644 index 000000000..382909cf8 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs @@ -0,0 +1,101 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if TOUCHSCRIPT_DEBUG + +using System.Collections.Generic; +using TouchScript.Debugging.Filters; +using UnityEngine; +using TouchScript.Debugging.Loggers; +using TouchScript.Pointers; + +namespace TouchScript.Debugging +{ + /// + /// A set of debugging tools for TouchScript. + /// + public class TouchScriptDebugger : ScriptableObject + { + /// + /// The singleton instance of the debugger. + /// + public static TouchScriptDebugger Instance + { + get + { + if (instance == null) + { + var objs = Resources.FindObjectsOfTypeAll(); + if (objs.Length > 0) instance = objs[0]; + else + { + instance = CreateInstance(); + instance.hideFlags = HideFlags.HideAndDontSave; + } + } + return instance; + } + } + + /// + /// Current logger to record pointer events. + /// + public IPointerLogger PointerLogger + { + get { return pointerLogger; } + set + { + if (value == null) return; + if (pointerLogger == value) return; + if (pointerLogger != null) pointerLogger.Dispose(); + pointerLogger = value; + } + } + + private static TouchScriptDebugger instance; + private IPointerLogger pointerLogger; + + public void ClearPointerLogger() + { + if (Application.isEditor) + pointerLogger = new DummyLogger(); + else + pointerLogger = new FileWriterLogger(); + } + + private void OnEnable() + { + if (pointerLogger == null) ClearPointerLogger(); + } + + private void OnDisable() + { + if (pointerLogger != null) pointerLogger.Dispose(); + } + + private class DummyLogger : IPointerLogger + { + public int PointerCount + { + get { return 0; } + } + + public void Log(Pointer pointer, PointerEvent evt) {} + + public List GetFilteredPointerData(IPointerDataFilter filter = null) + { + return new List(); + } + + public List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null) + { + return new List(); + } + + public void Dispose() {} + } + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs.meta new file mode 100644 index 000000000..6d43f116a --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Debugging/TouchScriptDebugger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: feb5ce0eed35041f6a2db91bce359f03 +timeCreated: 1500411179 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Devices/Display/DisplayDevice.cs b/Source/Assets/TouchScript/Scripts/Devices/Display/DisplayDevice.cs index 8958d8468..66b1df59f 100644 --- a/Source/Assets/TouchScript/Scripts/Devices/Display/DisplayDevice.cs +++ b/Source/Assets/TouchScript/Scripts/Devices/Display/DisplayDevice.cs @@ -2,6 +2,9 @@ * @author Valentin Simonov / http://va.lent.in/ */ +#if UNITY_EDITOR +using UnityEditor; +#endif using UnityEngine; namespace TouchScript.Devices.Display @@ -9,8 +12,19 @@ namespace TouchScript.Devices.Display /// /// A simple display device which inherits from and can be saved in Unity assets. /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Devices_Display_DisplayDevice.htm")] public class DisplayDevice : ScriptableObject, IDisplayDevice { +#if UNITY_EDITOR + //[MenuItem("Window/TouchScript/CreateDisplayDevice")] + private static DisplayDevice CreateDisplayDevice() + { + var dd = CreateInstance(); + AssetDatabase.CreateAsset(dd, "Assets/DisplayDevice.asset"); + return dd; + } +#endif + /// public string Name { @@ -26,7 +40,18 @@ public string Name public virtual float DPI { get { return dpi; } - set { dpi = value; } + } + + /// + public virtual float NativeDPI + { + get { return nativeDPI; } + } + + /// + public virtual Vector2 NativeResolution + { + get { return nativeResolution; } } /// @@ -41,6 +66,21 @@ public virtual float DPI [SerializeField] protected float dpi = 96; + /// + /// Native device dpi. + /// + [SerializeField] + protected float nativeDPI = 96; + + /// + /// Native device resolution. + /// + [SerializeField] + protected Vector2 nativeResolution = new Vector2(1920, 1080); + + /// + public virtual void UpdateDPI() {} + /// /// OnEnable Unity method. /// diff --git a/Source/Assets/TouchScript/Scripts/Devices/Display/GenericDisplayDevice.cs b/Source/Assets/TouchScript/Scripts/Devices/Display/GenericDisplayDevice.cs index 733f28f7e..892dd2397 100644 --- a/Source/Assets/TouchScript/Scripts/Devices/Display/GenericDisplayDevice.cs +++ b/Source/Assets/TouchScript/Scripts/Devices/Display/GenericDisplayDevice.cs @@ -1,8 +1,11 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ using System.Text.RegularExpressions; +#if UNITY_STANDALONE_WIN +using TouchScript.Utils.Platform; +#endif using UnityEngine; namespace TouchScript.Devices.Display @@ -10,9 +13,10 @@ namespace TouchScript.Devices.Display /// /// Display device which tries to guess current DPI if it's not set by platform. /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Devices_Display_GenericDisplayDevice.htm")] public class GenericDisplayDevice : DisplayDevice { - internal static bool INTERNAL_IsLaptop + private static bool IsLaptop { get { @@ -29,110 +33,213 @@ internal static bool INTERNAL_IsLaptop private static bool? isLaptop = null; + /// + public override void UpdateDPI() + { + if (Screen.fullScreen) + { + var res = Screen.currentResolution; + dpi = Mathf.Max(res.width / nativeResolution.x, res.height / nativeResolution.y) * nativeDPI; + } + else + { + dpi = nativeDPI; + } + } + /// protected override void OnEnable() { base.OnEnable(); Name = Application.platform.ToString(); - if (INTERNAL_IsLaptop) Name += " (Laptop)"; + if (IsLaptop) Name += " (Laptop)"; - dpi = Screen.dpi; - if (dpi < float.Epsilon) + updateNativeResulotion(); + updateNativeDPI(); + UpdateDPI(); + } + + private void updateNativeResulotion() + { + switch (Application.platform) { - // Calculations based on http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density and probability - switch (Application.platform) - { - case RuntimePlatform.OSXEditor: - case RuntimePlatform.OSXDashboardPlayer: - case RuntimePlatform.OSXPlayer: - case RuntimePlatform.OSXWebPlayer: - case RuntimePlatform.WindowsEditor: - case RuntimePlatform.WindowsPlayer: - case RuntimePlatform.WindowsWebPlayer: - case RuntimePlatform.LinuxPlayer: - { - var width = Mathf.Max(Screen.currentResolution.width, Screen.currentResolution.height); - var height = Mathf.Min(Screen.currentResolution.width, Screen.currentResolution.height); + // Editors / windowed + case RuntimePlatform.LinuxEditor: + case RuntimePlatform.OSXEditor: + case RuntimePlatform.WindowsEditor: + // This has not been tested and is probably wrong. + if (getHighestResolution(out nativeResolution)) break; + var res = Screen.currentResolution; + nativeResolution = new Vector2(res.width, res.height); + break; + // Mobiles / fullscreen + case RuntimePlatform.Android: + case RuntimePlatform.IPhonePlayer: + case RuntimePlatform.TizenPlayer: + case RuntimePlatform.WSAPlayerARM: + case RuntimePlatform.WSAPlayerX64: + case RuntimePlatform.WSAPlayerX86: + // This has not been tested and is probably wrong. + if (getHighestResolution(out nativeResolution)) break; + res = Screen.currentResolution; + nativeResolution = new Vector2(res.width, res.height); + break; + // PCs + case RuntimePlatform.WindowsPlayer: +#if UNITY_STANDALONE_WIN + int width, height; + WindowsUtils.GetNativeMonitorResolution(out width, out height); + nativeResolution = new Vector2(width, height); +#endif + break; + case RuntimePlatform.LinuxPlayer: + case RuntimePlatform.OSXPlayer: + case RuntimePlatform.WebGLPlayer: + // This has not been tested and is probably wrong. + if (getHighestResolution(out nativeResolution)) break; + res = Screen.currentResolution; + nativeResolution = new Vector2(res.width, res.height); + break; + // Probably TVs + case RuntimePlatform.SamsungTVPlayer: +#if UNITY_5_6_OR_NEWER + case RuntimePlatform.Switch: +#endif + case RuntimePlatform.WiiU: + case RuntimePlatform.XboxOne: + case RuntimePlatform.tvOS: + // This has not been tested and is probably wrong. + if (getHighestResolution(out nativeResolution)) break; + res = Screen.currentResolution; + nativeResolution = new Vector2(res.width, res.height); + break; + case RuntimePlatform.PSP2: + nativeResolution = new Vector2(960, 544); + break; + default: + // This has not been tested and is probably wrong. + if (getHighestResolution(out nativeResolution)) break; + res = Screen.currentResolution; + nativeResolution = new Vector2(res.width, res.height); + break; + } + } - if (width >= 3840) - { - if (height <= 2160) dpi = 150; // 28-31" - else dpi = 200; - } - else if (width >= 2880 && height == 1800) dpi = 220; // 15" retina - else if (width >= 2560) - { - if (height >= 1600) - { - if (INTERNAL_IsLaptop) dpi = 226; // 13.3" retina - else dpi = 101; // 30" display - } - else if (height >= 1440) dpi = 109; // 27" iMac - } - else if (width >= 2048) - { - if (height <= 1152) dpi = 100; // 23-27" - else dpi = 171; // 15" laptop - } - else if (width >= 1920) - { - if (height >= 1440) dpi = 110; // 24" - else if (height >= 1200) dpi = 90; // 26-27" - else if (height >= 1080) - { - if (INTERNAL_IsLaptop) dpi = 130; // 15" - 18" laptop - else dpi = 92; // +-24" display - } - } - else if (width >= 1680) dpi = 129; // 15" laptop - else if (width >= 1600) dpi = 140; // 13" laptop - else if (width >= 1440) + private void updateNativeDPI() + { + nativeDPI = Screen.dpi; + if (nativeDPI > float.Epsilon) return; + + var res = Screen.currentResolution; + var width = Mathf.Max(res.width, res.height); + var height = Mathf.Min(res.width, res.height); + + switch (Application.platform) + { + // Editors / windowed + case RuntimePlatform.LinuxEditor: + case RuntimePlatform.OSXEditor: + case RuntimePlatform.WindowsEditor: + // PCs + case RuntimePlatform.WindowsPlayer: + case RuntimePlatform.LinuxPlayer: + case RuntimePlatform.OSXPlayer: + case RuntimePlatform.WebGLPlayer: + // This has not been tested and is probably wrong. + // Let's guess + if (width >= 3840) + { + if (height <= 2160) dpi = 150; // 28-31" + else dpi = 200; + } + else if (width >= 2880 && height == 1800) dpi = 220; // 15" retina + else if (width >= 2560) + { + if (height >= 1600) { - if (height >= 1050) dpi = 125; // 14" laptop - else dpi = 110; // 13" air or 15" macbook pro + if (IsLaptop) dpi = 226; // 13.3" retina + else dpi = 101; // 30" display } - else if (width >= 1366) dpi = 125; // 10"-14" laptops - else if (width >= 1280) dpi = 110; - else dpi = 96; - break; + else if (height >= 1440) dpi = 109; // 27" iMac } - case RuntimePlatform.Android: + else if (width >= 2048) { - var width = Mathf.Max(Screen.currentResolution.width, Screen.currentResolution.height); - var height = Mathf.Min(Screen.currentResolution.width, Screen.currentResolution.height); - if (width >= 1280) + if (height <= 1152) dpi = 100; // 23-27" + else dpi = 171; // 15" laptop + } + else if (width >= 1920) + { + if (height >= 1440) dpi = 110; // 24" + else if (height >= 1200) dpi = 90; // 26-27" + else if (height >= 1080) { - if (height >= 800) dpi = 285; //Galaxy Note - else dpi = 312; //Galaxy S3, Xperia S + if (IsLaptop) dpi = 130; // 15" - 18" laptop + else dpi = 92; // +-24" display } - else if (width >= 1024) dpi = 171; // Galaxy Tab - else if (width >= 960) dpi = 256; // Sensation - else if (width >= 800) dpi = 240; // Galaxy S2... - else dpi = 160; - break; } - case RuntimePlatform.IPhonePlayer: + else if (width >= 1680) dpi = 129; // 15" laptop + else if (width >= 1600) dpi = 140; // 13" laptop + else if (width >= 1440) { - var width = Mathf.Max(Screen.currentResolution.width, Screen.currentResolution.height); -// var height = Mathf.Min(Screen.currentResolution.width, Screen.currentResolution.height); - if (width >= 2048) dpi = 290; // iPad4 or ipad2 mini - else if (width >= 1136) dpi = 326; // iPhone 5+ - else if (width >= 1024) dpi = 160; // iPad mini1 - else if (width >= 960) dpi = 326; // iPhone 4+ - else dpi = 160; - break; + if (height >= 1050) dpi = 125; // 14" laptop + else dpi = 110; // 13" air or 15" macbook pro } - case RuntimePlatform.WSAPlayerARM: - case RuntimePlatform.WSAPlayerX64: - case RuntimePlatform.WSAPlayerX86: - dpi = 160; - break; - case RuntimePlatform.WP8Player: - dpi = 160; - break; - } + else if (width >= 1366) dpi = 125; // 10"-14" laptops + else if (width >= 1280) dpi = 110; + else dpi = 96; + break; + // Mobiles / fullscreen + case RuntimePlatform.Android: + case RuntimePlatform.IPhonePlayer: + case RuntimePlatform.TizenPlayer: + case RuntimePlatform.WSAPlayerARM: + case RuntimePlatform.WSAPlayerX64: + case RuntimePlatform.WSAPlayerX86: + // We just hope that mobiles report their DPI correctly + break; + // Probably TVs + case RuntimePlatform.SamsungTVPlayer: +#if UNITY_5_6_OR_NEWER + case RuntimePlatform.Switch: +#endif + case RuntimePlatform.WiiU: + case RuntimePlatform.XboxOne: + case RuntimePlatform.tvOS: + // This has not been tested and is probably wrong. + if (width >= 3840) + { + nativeDPI = 96; + } + else if (width >= 1920) + { + nativeDPI = 50; + } + else + { + nativeDPI = 40; + } + break; + case RuntimePlatform.PSP2: + nativeDPI = 220.68f; + break; + default: + // This has not been tested and is probably wrong. + nativeDPI = 160; + break; } } + + private bool getHighestResolution(out Vector2 resolution) + { + resolution = new Vector2(); + + var resolutions = Screen.resolutions; + if (resolutions.Length == 0) return false; + + var r = resolutions[resolutions.Length - 1]; + resolution = new Vector2(r.width, r.height); + return true; + } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Devices/Display/IDisplayDevice.cs b/Source/Assets/TouchScript/Scripts/Devices/Display/IDisplayDevice.cs index 21e3e3c78..8525f931f 100644 --- a/Source/Assets/TouchScript/Scripts/Devices/Display/IDisplayDevice.cs +++ b/Source/Assets/TouchScript/Scripts/Devices/Display/IDisplayDevice.cs @@ -2,6 +2,8 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using UnityEngine; + namespace TouchScript.Devices.Display { /// @@ -14,15 +16,28 @@ namespace TouchScript.Devices.Display public interface IDisplayDevice { /// - /// Gets or sets the name of display device. + /// Name of the display device. + /// + string Name { get; } + + /// + /// DPI of the game based on and . + /// + float DPI { get; } + + /// + /// Native DPI of the display device. + /// + float NativeDPI { get; } + + /// + /// Native resolution of the display device. /// - /// The name of display device. - string Name { get; set; } + Vector2 NativeResolution { get; } /// - /// Gets or sets DPI of display device. + /// Forces to recalculate . /// - /// DPI used by display device. - float DPI { get; set; } + void UpdateDPI(); } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/GestureManager.cs b/Source/Assets/TouchScript/Scripts/GestureManager.cs index e1654ef65..bbd7996e1 100644 --- a/Source/Assets/TouchScript/Scripts/GestureManager.cs +++ b/Source/Assets/TouchScript/Scripts/GestureManager.cs @@ -2,6 +2,7 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Core; using UnityEngine; namespace TouchScript @@ -9,6 +10,12 @@ namespace TouchScript /// /// Facade for current instance of . /// + /// + /// Why IList instead of Pointer in pointer events? + /// Right now touchesBegan/touchesMoved/touchesEnded methods in Gesture class accept IList as their argument which seems to overcomplicate a lot of stuff and just calling touchBegan(TouchPoint) would be easier. + /// The later approach was tried in 7.0 and reverted in 8.0 since it introduced a really hard to fix gesture priority issue. If with lists a gesture knows all touches changed during current frame, individual touchMoved calls have to be buffered till the end of frame. But there's no way to execute gesture recognition logic at the end of frame in the right hierarchical order. This concern resulted in the following issue: https://github.com/TouchScript/TouchScript/issues/203 + /// + /// public sealed class GestureManager : MonoBehaviour { #region Public properties diff --git a/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs b/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs deleted file mode 100644 index 6bb0b106f..000000000 --- a/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs +++ /dev/null @@ -1,488 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Collections.Generic; -using TouchScript.Gestures; -using TouchScript.Utils; -using UnityEngine; - -namespace TouchScript -{ - /// - /// Internal implementation of . - /// - internal sealed class GestureManagerInstance : MonoBehaviour, IGestureManager - { - #region Public properties - - public static IGestureManager Instance - { - get - { - if (shuttingDown) return null; - if (instance == null) - { - if (!Application.isPlaying) return null; - var objects = FindObjectsOfType(); - if (objects.Length == 0) - { - var go = new GameObject("GestureManager Instance"); - instance = go.AddComponent(); - } - else if (objects.Length >= 1) - { - instance = objects[0]; - } - } - return instance; - } - } - - public IGestureDelegate GlobalGestureDelegate { get; set; } - - #endregion - - #region Private variables - - private static GestureManagerInstance instance; - private static bool shuttingDown = false; - - // Upcoming changes - private List gesturesToReset = new List(20); - - private Action _updateBegan, _updateMoved, _updateEnded, _updateCancelled; - private Action _processTarget, _processTargetBegan; - - #endregion - - #region Temporary variables - - // Temporary variables for update methods. - private List activeGestures = new List(20); - - private static ObjectPool> gestureListPool = new ObjectPool>(10, - () => new List(20), null, (l) => l.Clear()); - - #endregion - - #region Unity - - private void Awake() - { - if (instance == null) - { - instance = this; - } - else if (instance != this) - { - Destroy(this); - return; - } - - gameObject.hideFlags = HideFlags.HideInHierarchy; - DontDestroyOnLoad(gameObject); - - _processTarget = processTarget; - _processTargetBegan = processTargetBegan; - _updateBegan = doUpdateBegan; - _updateMoved = doUpdateMoved; - _updateEnded = doUpdateEnded; - _updateCancelled = doUpdateCancelled; - - gestureListPool.WarmUp(5); - } - - private void OnEnable() - { - var touchManager = TouchManager.Instance; - if (touchManager != null) - { - touchManager.FrameStarted += frameStartedHandler; - touchManager.FrameFinished += frameFinishedHandler; - touchManager.TouchBegan += touchBeganHandler; - touchManager.TouchMoved += touchMovedHandler; - touchManager.TouchEnded += touchEndedHandler; - touchManager.TouchCancelled += touchCancelledHandler; - } - } - - private void OnDisable() - { - var touchManager = TouchManager.Instance; - if (touchManager != null) - { - touchManager.FrameStarted -= frameStartedHandler; - touchManager.FrameFinished -= frameFinishedHandler; - touchManager.TouchBegan -= touchBeganHandler; - touchManager.TouchMoved -= touchMovedHandler; - touchManager.TouchEnded -= touchEndedHandler; - touchManager.TouchCancelled -= touchCancelledHandler; - } - } - - private void OnApplicationQuit() - { - shuttingDown = true; - } - - #endregion - - #region Internal methods - - internal Gesture.GestureState INTERNAL_GestureChangeState(Gesture gesture, Gesture.GestureState state) - { - bool recognized = false; - switch (state) - { - case Gesture.GestureState.Possible: - break; - case Gesture.GestureState.Began: - switch (gesture.State) - { - case Gesture.GestureState.Possible: - break; - default: - print(String.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", - new object[] {gesture, state, gesture.State})); - break; - } - recognized = recognizeGestureIfNotPrevented(gesture); - if (!recognized) - { - if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); - return Gesture.GestureState.Failed; - } - break; - case Gesture.GestureState.Changed: - switch (gesture.State) - { - case Gesture.GestureState.Began: - case Gesture.GestureState.Changed: - break; - default: - print(String.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", - new object[] {gesture, state, gesture.State})); - break; - } - break; - case Gesture.GestureState.Failed: - if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); - break; - case Gesture.GestureState.Recognized: // Ended - if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); - switch (gesture.State) - { - case Gesture.GestureState.Possible: - recognized = recognizeGestureIfNotPrevented(gesture); - if (!recognized) - { - return Gesture.GestureState.Failed; - } - break; - case Gesture.GestureState.Began: - case Gesture.GestureState.Changed: - break; - default: - print(string.Format("Gesture {0} erroneously tried to enter state {1} from state {2}", - new object[] {gesture, state, gesture.State})); - break; - } - break; - case Gesture.GestureState.Cancelled: - if (!gesturesToReset.Contains(gesture)) gesturesToReset.Add(gesture); - break; - } - - return state; - } - - #endregion - - #region Private functions - - private void doUpdateBegan(Gesture gesture, TouchPoint touch) - { - gesture.INTERNAL_TouchBegan(touch); - } - - private void doUpdateMoved(Gesture gesture, TouchPoint touch) - { - gesture.INTERNAL_TouchMoved(touch); - } - - private void doUpdateEnded(Gesture gesture, TouchPoint touch) - { - gesture.INTERNAL_TouchEnded(touch); - } - - private void doUpdateCancelled(Gesture gesture, TouchPoint touch) - { - gesture.INTERNAL_TouchCancelled(touch); - } - - private void update(TouchPoint touch, Action process, - Action dispatch) - { - // WARNING! Arcane magic ahead! - // gestures which got any touch points - // needed because there's no order in dictionary - activeGestures.Clear(); - - if (touch.Target != null) process(touch.Target, touch); - var count = activeGestures.Count; - for (var i = 0; i < count; i++) - { - var gesture = activeGestures[i]; - if (gestureIsActive(gesture)) dispatch(gesture, touch); - } - } - - private void processTarget(Transform target, TouchPoint touch) - { - // gestures on objects in the hierarchy from "root" to target - var endingList = gestureListPool.Get(); - getHierarchyEndingWith(target, endingList); - - var count = endingList.Count; - for (var i = 0; i < count; i++) - { - var gesture = endingList[i]; - if (!gestureIsActive(gesture)) continue; - - if (gesture.HasTouch(touch)) activeGestures.Add(gesture); - } - gestureListPool.Release(endingList); - } - - private void processTargetBegan(Transform target, TouchPoint touch) - { - var containingList = gestureListPool.Get(); - var endingList = gestureListPool.Get(); - - // gestures in the target's hierarchy which might affect gesture on the target - getHierarchyContaining(target, containingList); - // gestures on objects in the hierarchy from "root" to target - getHierarchyEndingWith(target, endingList); - var count = endingList.Count; - for (var i = 0; i < count; i++) - { - var gesture = endingList[i]; - // WARNING! Gestures might change during this loop. - // For example when one of them recognizes. - if (!gestureIsActive(gesture)) continue; - - var canReceiveTouches = true; - var activeCount = containingList.Count; - for (var j = 0; j < activeCount; j++) - { - var activeGesture = containingList[j]; - - if (gesture == activeGesture) continue; - if ((activeGesture.State == Gesture.GestureState.Began || - activeGesture.State == Gesture.GestureState.Changed) && - (canPreventGesture(activeGesture, gesture))) - { - // there's a started gesture which prevents this one - canReceiveTouches = false; - break; - } - } - - if (canReceiveTouches && shouldReceiveTouch(gesture, touch)) activeGestures.Add(gesture); - } - - gestureListPool.Release(containingList); - gestureListPool.Release(endingList); - } - - private void resetGestures() - { - if (gesturesToReset.Count == 0) return; - - var count = gesturesToReset.Count; - for (var i = 0; i < count; i++) - { - var gesture = gesturesToReset[i]; - if (gesture == null) continue; - gesture.INTERNAL_Reset(); - gesture.INTERNAL_SetState(Gesture.GestureState.Possible); - } - gesturesToReset.Clear(); - } - - // parent <- parent <- target - private void getHierarchyEndingWith(Transform target, List outputList) - { - while (target != null) - { - getEnabledGesturesOnTarget(target, outputList); - target = target.parent; - } - } - - // target <- child* - private void getHierarchyBeginningWith(Transform target, List outputList, bool includeSelf) - { - if (includeSelf) - { - getEnabledGesturesOnTarget(target, outputList); - } - - var count = target.childCount; - for (var i = 0; i < count; i++) - { - getHierarchyBeginningWith(target.GetChild(i), outputList, true); - } - } - - private void getHierarchyContaining(Transform target, List outputList) - { - getHierarchyEndingWith(target, outputList); - getHierarchyBeginningWith(target, outputList, false); - } - - private void getEnabledGesturesOnTarget(Transform target, List outputList) - { - if (target.gameObject.activeInHierarchy) - { - var list = gestureListPool.Get(); - target.GetComponents(list); - var count = list.Count; - for (var i = 0; i < count; i++) - { - var gesture = list[i]; - if (gesture != null && gesture.enabled) outputList.Add(gesture); - } - gestureListPool.Release(list); - } - } - - private bool gestureIsActive(Gesture gesture) - { - if (gesture.gameObject.activeInHierarchy == false) return false; - if (gesture.enabled == false) return false; - switch (gesture.State) - { - case Gesture.GestureState.Failed: - case Gesture.GestureState.Recognized: - case Gesture.GestureState.Cancelled: - return false; - default: - return true; - } - } - - private bool recognizeGestureIfNotPrevented(Gesture gesture) - { - if (!shouldBegin(gesture)) return false; - - var gesturesToFail = gestureListPool.Get(); - var gesturesInHierarchy = gestureListPool.Get(); - bool canRecognize = true; - getHierarchyContaining(gesture.transform, gesturesInHierarchy); - - var count = gesturesInHierarchy.Count; - for (var i = 0; i < count; i++) - { - var otherGesture = gesturesInHierarchy[i]; - if (gesture == otherGesture) continue; - if (!gestureIsActive(otherGesture)) continue; - - if (otherGesture.State == Gesture.GestureState.Began || - otherGesture.State == Gesture.GestureState.Changed) - { - if (canPreventGesture(otherGesture, gesture)) - { - canRecognize = false; - break; - } - } - else - { - if (canPreventGesture(gesture, otherGesture)) - { - gesturesToFail.Add(otherGesture); - } - } - } - - if (canRecognize) - { - count = gesturesToFail.Count; - for (var i = 0; i < count; i++) - { - failGesture(gesturesToFail[i]); - } - } - - gestureListPool.Release(gesturesToFail); - gestureListPool.Release(gesturesInHierarchy); - - return canRecognize; - } - - private void failGesture(Gesture gesture) - { - gesture.INTERNAL_SetState(Gesture.GestureState.Failed); - } - - private bool shouldReceiveTouch(Gesture gesture, TouchPoint touch) - { - bool result = true; - if (GlobalGestureDelegate != null) result = GlobalGestureDelegate.ShouldReceiveTouch(gesture, touch); - return result && gesture.ShouldReceiveTouch(touch); - } - - private bool shouldBegin(Gesture gesture) - { - bool result = true; - if (GlobalGestureDelegate != null) result = GlobalGestureDelegate.ShouldBegin(gesture); - return result && gesture.ShouldBegin(); - } - - private bool canPreventGesture(Gesture first, Gesture second) - { - bool result = true; - if (GlobalGestureDelegate != null) result = !GlobalGestureDelegate.ShouldRecognizeSimultaneously(first, second); - return result && first.CanPreventGesture(second); - } - - #endregion - - #region Touch events handlers - - private void frameFinishedHandler(object sender, EventArgs eventArgs) - { - resetGestures(); - } - - private void frameStartedHandler(object sender, EventArgs eventArgs) - { - resetGestures(); - } - - private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs) - { - update(touchEventArgs.Touch, _processTargetBegan, _updateBegan); - } - - private void touchMovedHandler(object sender, TouchEventArgs touchEventArgs) - { - update(touchEventArgs.Touch, _processTarget, _updateMoved); - } - - private void touchEndedHandler(object sender, TouchEventArgs touchEventArgs) - { - update(touchEventArgs.Touch, _processTarget, _updateEnded); - } - - private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs) - { - update(touchEventArgs.Touch, _processTarget, _updateCancelled); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs index ef1ddc260..4b69b4887 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs @@ -3,16 +3,19 @@ */ using System; +using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { /// - /// Recognizes fast movement before releasing touches. Doesn't care how much time touch points were on surface and how much they moved. + /// Recognizes fast movement before releasing pointers. Doesn't care how much time pointers were on surface and how much they moved. /// [AddComponentMenu("TouchScript/Gestures/Flick Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_FlickGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_FlickGesture.htm")] public class FlickGesture : Gesture { #region Constants @@ -64,9 +67,9 @@ public event EventHandler Flicked #region Public properties /// - /// Gets or sets time interval in seconds in which touch points must move by for gesture to succeed. + /// Gets or sets time interval in seconds in which pointers must move by for gesture to succeed. /// - /// Interval in seconds in which touch points must move by for gesture to succeed. + /// Interval in seconds in which pointers must move by for gesture to succeed. public float FlickTime { get { return flickTime; } @@ -84,9 +87,9 @@ public float MinDistance } /// - /// Gets or sets minimum distance in cm touches must move to start recognizing this gesture. + /// Gets or sets minimum distance in cm pointers must move to start recognizing this gesture. /// - /// Minimum distance in cm touches must move to start recognizing this gesture. + /// Minimum distance in cm pointers must move to start recognizing this gesture. /// Prevents misinterpreting taps. public float MovementThreshold { @@ -110,7 +113,7 @@ public GestureDirection Direction public Vector2 ScreenFlickVector { get; private set; } /// - /// Gets flick time in seconds touches moved by . + /// Gets flick time in seconds pointers moved by . /// public float ScreenFlickTime { get; private set; } @@ -135,10 +138,24 @@ public GestureDirection Direction private bool isActive = false; private TimedSequence deltaSequence = new TimedSequence(); +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + #endregion #region Unity methods + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Flick Gesture"); +#endif + } + /// protected void LateUpdate() { @@ -147,32 +164,50 @@ protected void LateUpdate() deltaSequence.Add(ScreenPosition - PreviousScreenPosition); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif - if (touchesNumState == TouchesNumState.PassedMaxThreshold || - touchesNumState == TouchesNumState.PassedMinMaxThreshold) + base.pointersPressed(pointers); + + if (pointersNumState == PointersNumState.PassedMaxThreshold || + pointersNumState == PointersNumState.PassedMinMaxThreshold) { if (State == GestureState.Possible) setState(GestureState.Failed); } - else if (touchesNumState == TouchesNumState.PassedMinThreshold) + else if (pointersNumState == PointersNumState.PassedMinThreshold) { // Starting the gesture when it is already active? => we released one finger and pressed again while moving if (isActive) setState(GestureState.Failed); else isActive = true; } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { - base.touchMoved(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersUpdated(pointers); if (isActive || !moving) { @@ -183,25 +218,36 @@ protected override void touchMoved(TouchPoint touch) moving = true; } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); - if (NumTouches == 0) + if (NumPointers == 0) { if (!isActive || !moving) { setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif return; } deltaSequence.Add(ScreenPosition - PreviousScreenPosition); float lastTime; - var deltas = deltaSequence.FindElementsLaterThan(Time.time - FlickTime, out lastTime); + var deltas = deltaSequence.FindElementsLaterThan(Time.unscaledTime - FlickTime, out lastTime); var totalMovement = Vector2.zero; var count = deltas.Count; for (var i = 0; i < count; i++) totalMovement += deltas[i]; @@ -223,10 +269,14 @@ protected override void touchEnded(TouchPoint touch) else { ScreenFlickVector = totalMovement; - ScreenFlickTime = Time.time - lastTime; + ScreenFlickTime = Time.unscaledTime - lastTime; setState(GestureState.Recognized); } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// diff --git a/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs.meta index 7e1b8adf1..63565ad48 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs index 7700d38ea..59b285373 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs @@ -6,10 +6,12 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using TouchScript.Hit; -using TouchScript.Layers; using TouchScript.Utils; using TouchScript.Utils.Attributes; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Events; +using TouchScript.Core; namespace TouchScript.Gestures { @@ -20,6 +22,12 @@ public abstract class Gesture : DebuggableMonoBehaviour { #region Constants + /// + /// Unity event for gesture state changes. + /// + [Serializable] + public class GestureEvent : UnityEvent {} + /// /// Message sent when gesture changes state if SendMessage is used. /// @@ -36,7 +44,12 @@ public abstract class Gesture : DebuggableMonoBehaviour public enum GestureState { /// - /// Gesture is possible. + /// Gesture is idle. + /// + Idle, + + /// + /// Gesture started looking for the patern. /// Possible, @@ -72,37 +85,37 @@ public enum GestureState } /// - /// Current state of the number of touch points. + /// Current state of the number of pointers. /// - protected enum TouchesNumState + protected enum PointersNumState { /// - /// The number of touch points is between min and max thresholds. + /// The number of pointers is between min and max thresholds. /// InRange, /// - /// The number of touch points is less than min threshold. + /// The number of pointers is less than min threshold. /// TooFew, /// - /// The number of touch points is greater than max threshold. + /// The number of pointers is greater than max threshold. /// TooMany, /// - /// The number of touch points passed min threshold this frame and is now in range. + /// The number of pointers passed min threshold this frame and is now in range. /// PassedMinThreshold, /// - /// The number of touch points passed max threshold this frame and is now in range. + /// The number of pointers passed max threshold this frame and is now in range. /// PassedMaxThreshold, /// - /// The number of touch points passed both min and max thresholds. + /// The number of pointers passed both min and max thresholds. /// PassedMinMaxThreshold } @@ -133,37 +146,42 @@ public event EventHandler Cancelled private EventHandler stateChangedInvoker; private EventHandler cancelledInvoker; + /// + /// Occurs when gesture changes state. + /// + public GestureEvent OnStateChange = new GestureEvent(); + #endregion #region Public properties /// - /// Gets or sets minimum number of touches this gesture reacts to. - /// The gesture will not be recognized if it has less than touches. + /// Gets or sets minimum number of pointers this gesture reacts to. + /// The gesture will not be recognized if it has less than pointers. /// - /// Minimum number of touches. - public int MinTouches + /// Minimum number of pointers. + public int MinPointers { - get { return minTouches; } + get { return minPointers; } set { if (value < 0) return; - minTouches = value; + minPointers = value; } } /// - /// Gets or sets maximum number of touches this gesture reacts to. - /// The gesture will not be recognized if it has more than touches. + /// Gets or sets maximum number of pointers this gesture reacts to. + /// The gesture will not be recognized if it has more than pointers. /// - /// Maximum number of touches. - public int MaxTouches + /// Maximum number of pointers. + public int MaxPointers { - get { return maxTouches; } + get { return maxPointers; } set { if (value < 0) return; - maxTouches = value; + maxPointers = value; } } @@ -176,6 +194,8 @@ public Gesture RequireGestureToFail get { return requireGestureToFail; } set { + if (!Application.isPlaying) return; + if (requireGestureToFail != null) requireGestureToFail.StateChanged -= requiredToFailGestureStateChangedHandler; requireGestureToFail = value; @@ -184,29 +204,6 @@ public Gesture RequireGestureToFail } } - /// - /// Gets or sets the flag if touches should be treated as a cluster. - /// - /// true if touches should be treated as a cluster; otherwise, false. - /// - /// At the end of a gesture when touches are lifted off due to the fact that computers are faster than humans the very last touch's position will be gesture's after that. This flag is used to combine several touch which from the point of a user were lifted off simultaneously and set their centroid as gesture's . - /// - public bool CombineTouches - { - get { return combineTouches; } - set { combineTouches = value; } - } - - /// - /// Gets or sets time interval before gesture is recognized to combine all lifted touch points into a cluster to use its center as . - /// - /// Time in seconds to treat touches lifted off during this interval as a single gesture. - public float CombineTouchesInterval - { - get { return combineTouchesInterval; } - set { combineTouchesInterval = value; } - } - /// /// Gets or sets whether gesture should use Unity's SendMessage in addition to C# events. /// @@ -218,7 +215,7 @@ public bool UseSendMessage } /// - /// Gets or sets a value indicating whether state change events are broadcasted if is true.. + /// Gets or sets a value indicating whether state change events are broadcasted if is true. /// /// true if state change events should be broadcaster; otherwise, false. public bool SendStateChangeMessages @@ -241,6 +238,26 @@ public GameObject SendMessageTarget } } + /// + /// Gets or sets whether gesture should use Unity Events in addition to C# events. + /// + /// true if gesture uses Unity Events; otherwise, false. + public bool UseUnityEvents + { + get { return useUnityEvents; } + set { useUnityEvents = value; } + } + + /// + /// Gets or sets a value indicating whether state change events are broadcasted if is true. + /// + /// true if state change events should be broadcaster; otherwise, false. + public bool SendStateChangeEvents + { + get { return sendStateChangeEvents; } + set { sendStateChangeEvents = value; } + } + /// /// Gets current gesture state. /// @@ -255,20 +272,23 @@ private set switch (value) { + case GestureState.Idle: + onIdle(); + break; case GestureState.Possible: onPossible(); break; case GestureState.Began: - retainTouches(); + retainPointers(); onBegan(); break; case GestureState.Changed: onChanged(); break; case GestureState.Recognized: - // Only retain/release touches for continuos gestures + // Only retain/release pointers for continuos gestures if (PreviousState == GestureState.Changed || PreviousState == GestureState.Began) - releaseTouches(true); + releasePointers(true); onRecognized(); break; case GestureState.Failed: @@ -276,16 +296,16 @@ private set break; case GestureState.Cancelled: if (PreviousState == GestureState.Changed || PreviousState == GestureState.Began) - releaseTouches(false); + releasePointers(false); onCancelled(); break; } if (stateChangedInvoker != null) - stateChangedInvoker.InvokeHandleExceptions(this, - new GestureStateChangeEventArgs(state, PreviousState)); + stateChangedInvoker.InvokeHandleExceptions(this, GestureStateChangeEventArgs.GetCachedEventArgs(state, PreviousState)); if (useSendMessage && sendStateChangeMessages && SendMessageTarget != null) sendMessageTarget.SendMessage(STATE_CHANGE_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (useUnityEvents && sendStateChangeEvents) OnStateChange.Invoke(this); } } @@ -303,12 +323,12 @@ public virtual Vector2 ScreenPosition { get { - if (NumTouches == 0) + if (NumPointers == 0) { if (!TouchManager.IsInvalidPosition(cachedScreenPosition)) return cachedScreenPosition; return TouchManager.INVALID_POSITION; } - return ClusterUtils.Get2DCenterPosition(activeTouches); + return activePointers[0].Position; } } @@ -320,13 +340,13 @@ public virtual Vector2 PreviousScreenPosition { get { - if (NumTouches == 0) + if (NumPointers == 0) { if (!TouchManager.IsInvalidPosition(cachedPreviousScreenPosition)) return cachedPreviousScreenPosition; return TouchManager.INVALID_POSITION; } - return ClusterUtils.GetPrevious2DCenterPosition(activeTouches); + return activePointers[0].PreviousPosition; } } @@ -359,26 +379,26 @@ public Vector2 PreviousNormalizedScreenPosition } /// - /// Gets list of gesture's active touch points. + /// Gets list of gesture's active pointers. /// - /// The list of touches owned by this gesture. - public IList ActiveTouches + /// The list of pointers owned by this gesture. + public IList ActivePointers { get { - if (readonlyActiveTouches == null) - readonlyActiveTouches = new ReadOnlyCollection(activeTouches); - return readonlyActiveTouches; + if (readonlyActivePointers == null) + readonlyActivePointers = new ReadOnlyCollection(activePointers); + return readonlyActivePointers; } } /// - /// Gets the number of active touch points. + /// Gets the number of active pointerss. /// - /// The number of touches owned by this gesture. - public int NumTouches + /// The number of pointers owned by this gesture. + public int NumPointers { - get { return numTouches; } + get { return numPointers; } } /// @@ -403,38 +423,45 @@ protected IGestureManager gestureManager /// /// Reference to global TouchManager. /// - protected ITouchManager touchManager { get; private set; } + protected TouchManagerInstance touchManager { get; private set; } /// - /// The state of min/max number of touches. + /// The state of min/max number of pointers. /// - protected TouchesNumState touchesNumState { get; private set; } + protected PointersNumState pointersNumState { get; private set; } /// - /// Touch points the gesture currently owns and works with. + /// Pointers the gesture currently owns and works with. /// - protected List activeTouches = new List(10); + protected List activePointers = new List(10); /// /// Cached transform of the parent object. /// protected Transform cachedTransform; + /// [SerializeField] - private bool advancedProps; // is used to save if advanced properties are opened or closed + [HideInInspector] + protected bool basicEditor = true; - [SerializeField] - private int minTouches = 0; + [SerializeField] + [HideInInspector] + private bool generalProps; // Used in the custom inspector - [SerializeField] - private int maxTouches = 0; + [SerializeField] + [HideInInspector] + private bool limitsProps; // Used in the custom inspector - [SerializeField] - [ToggleLeft] - private bool combineTouches = false; + [SerializeField] + [HideInInspector] + private bool advancedProps; // Used in the custom inspector + + [SerializeField] + private int minPointers = 0; [SerializeField] - private float combineTouchesInterval = .3f; + private int maxPointers = 0; [SerializeField] [ToggleLeft] @@ -447,34 +474,40 @@ protected IGestureManager gestureManager [SerializeField] private GameObject sendMessageTarget; + [SerializeField] + private bool useUnityEvents = false; + + [SerializeField] + [ToggleLeft] + private bool sendStateChangeEvents = false; + [SerializeField] - [NullToggle] + [NullToggle] private Gesture requireGestureToFail; [SerializeField] // Serialized list of gestures for Unity IDE. private List friendlyGestures = new List(); - private int numTouches; - private TouchLayer layer; - private ReadOnlyCollection readonlyActiveTouches; - private TimedSequence touchSequence = new TimedSequence(); + private int numPointers; + private ReadOnlyCollection readonlyActivePointers; private GestureManagerInstance gestureManagerInstance; - private GestureState delayedStateChange = GestureState.Possible; + private GestureState delayedStateChange = GestureState.Idle; private bool requiredGestureFailed = false; - private GestureState state = GestureState.Possible; + private FakePointer fakePointer = new FakePointer(); + private GestureState state = GestureState.Idle; /// /// Cached screen position. - /// Used to keep tap's position which can't be calculated from touch points when the gesture is recognized since all touch points are gone. + /// Used to keep tap's position which can't be calculated from pointers when the gesture is recognized since all pointers are gone. /// - private Vector2 cachedScreenPosition; + protected Vector2 cachedScreenPosition; /// /// Cached previous screen position. - /// Used to keep tap's position which can't be calculated from touch points when the gesture is recognized since all touch points are gone. + /// Used to keep tap's position which can't be calculated from pointers when the gesture is recognized since all pointers are gone. /// - private Vector2 cachedPreviousScreenPosition; + protected Vector2 cachedPreviousScreenPosition; #endregion @@ -503,66 +536,13 @@ public bool IsFriendly(Gesture gesture) } /// - /// Gets result of casting a ray from gesture touch points' centroid screen position. + /// Determines whether gesture controls a pointer. /// - /// true if ray hits gesture's target; false otherwise. - public bool GetTargetHitResult() + /// The pointer. + /// true if gesture controls the pointer point; false otherwise. + public bool HasPointer(Pointer pointer) { - TouchHit hit; - return GetTargetHitResult(ScreenPosition, out hit); - } - - /// - /// Gets result of casting a ray from gesture touch points centroid screen position. - /// - /// Raycast result - /// true if ray hits gesture's target; false otherwise. - public virtual bool GetTargetHitResult(out TouchHit hit) - { - return GetTargetHitResult(ScreenPosition, out hit); - } - - /// - /// Gets result of casting a ray from specific screen position. - /// - /// The position. - /// true if ray hits gesture's target; false otherwise. - public bool GetTargetHitResult(Vector2 position) - { - TouchHit hit; - return GetTargetHitResult(position, out hit); - } - - /// - /// Gets result of casting a ray from specific screen position. - /// - /// The position. - /// Raycast result. - /// true if ray hits gesture's target; false otherwise. - public virtual bool GetTargetHitResult(Vector2 position, out TouchHit hit) - { - if (layer != null) - { - if (layer.Hit(position, out hit) != TouchLayer.LayerHitResult.Hit) return false; - } - else - { - TouchLayer l = null; - if (!touchManager.GetHitTarget(position, out hit, out l)) return false; - } - - if (cachedTransform == hit.Transform || hit.Transform.IsChildOf(cachedTransform)) return true; - return false; - } - - /// - /// Determines whether gesture controls a touch point. - /// - /// The touch. - /// true if gesture controls the touch point; false otherwise. - public bool HasTouch(TouchPoint touch) - { - return activeTouches.Contains(touch); + return activePointers.Contains(pointer); } /// @@ -592,14 +572,14 @@ public virtual bool CanBePreventedByGesture(Gesture gesture) } /// - /// Specifies if gesture can receive this specific touch point. + /// Specifies if gesture can receive this specific pointer point. /// - /// The touch. - /// true if this touch should be received by the gesture; false otherwise. - public virtual bool ShouldReceiveTouch(TouchPoint touch) + /// The pointer. + /// true if this pointer should be received by the gesture; false otherwise. + public virtual bool ShouldReceivePointer(Pointer pointer) { if (Delegate == null) return true; - return Delegate.ShouldReceiveTouch(this, touch); + return Delegate.ShouldReceivePointer(this, pointer); } /// @@ -615,22 +595,21 @@ public virtual bool ShouldBegin() /// /// Cancels this gesture. /// - /// if set to true also implicitly cancels all touches owned by the gesture. - /// if set to true redispatched all canceled touches. - public void Cancel(bool cancelTouches, bool returnTouches) + /// if set to true also implicitly cancels all pointers owned by the gesture. + /// if set to true redispatched all canceled pointers. + public void Cancel(bool cancelPointers, bool returnPointers) { switch (state) { case GestureState.Cancelled: - case GestureState.Ended: case GestureState.Failed: return; } setState(GestureState.Cancelled); - if (!cancelTouches) return; - for (var i = 0; i < numTouches; i++) touchManager.CancelTouch(activeTouches[i].Id, returnTouches); + if (!cancelPointers) return; + for (var i = 0; i < numPointers; i++) touchManager.CancelPointer(activePointers[i].Id, returnPointers); } /// @@ -641,6 +620,17 @@ public void Cancel() Cancel(false, false); } + /// + /// Returns for gesture's , i.e. what is right beneath it. + /// + public virtual HitData GetScreenPositionHitData() + { + HitData hit; + fakePointer.Position = ScreenPosition; + LayerManager.Instance.GetHitTarget(fakePointer, out hit); + return hit; + } + #endregion #region Unity methods @@ -659,12 +649,12 @@ protected virtual void Awake() } /// - /// Unity3d Start handler. + /// Unity Start handler. /// protected virtual void OnEnable() { // TouchManager might be different in another scene - touchManager = TouchManager.Instance; + touchManager = TouchManager.Instance as TouchManagerInstance; gestureManagerInstance = GestureManager.Instance as GestureManagerInstance; if (touchManager == null) @@ -677,15 +667,15 @@ protected virtual void OnEnable() } /// - /// Unity3d OnDisable handler. + /// Unity OnDisable handler. /// protected virtual void OnDisable() { - setState(GestureState.Failed); + setState(GestureState.Cancelled); } /// - /// Unity3d OnDestroy handler. + /// Unity OnDestroy handler. /// protected virtual void OnDestroy() { @@ -709,180 +699,169 @@ internal void INTERNAL_SetState(GestureState value) internal void INTERNAL_Reset() { - activeTouches.Clear(); - numTouches = 0; - delayedStateChange = GestureState.Possible; - touchesNumState = TouchesNumState.TooFew; + activePointers.Clear(); + numPointers = 0; + delayedStateChange = GestureState.Idle; + pointersNumState = PointersNumState.TooFew; requiredGestureFailed = false; reset(); } - internal void INTERNAL_TouchBegan(TouchPoint touch) + internal void INTERNAL_PointersPressed(IList pointers) { - if (numTouches == 0) layer = touch.Layer; + var count = pointers.Count; + var total = numPointers + count; + pointersNumState = PointersNumState.InRange; - var total = numTouches + 1; - touchesNumState = TouchesNumState.InRange; - - if (minTouches <= 0) + if (minPointers <= 0) { - // minTouches is not set and we got our first touches - if (numTouches == 0) touchesNumState = TouchesNumState.PassedMinThreshold; + // MinPointers is not set and we got our first pointers + if (numPointers == 0) pointersNumState = PointersNumState.PassedMinThreshold; } else { - if (numTouches < minTouches) + if (numPointers < minPointers) { - // had < minTouches, got >= minTouches - if (total >= minTouches) touchesNumState = TouchesNumState.PassedMinThreshold; - else touchesNumState = TouchesNumState.TooFew; + // had < MinPointers, got >= MinPointers + if (total >= minPointers) pointersNumState = PointersNumState.PassedMinThreshold; + else pointersNumState = PointersNumState.TooFew; } } - if (maxTouches > 0) + if (maxPointers > 0) { - if (numTouches <= maxTouches) + if (numPointers <= maxPointers) { - if (total > maxTouches) + if (total > maxPointers) { - // this event we crossed both minTouches and maxTouches - if (touchesNumState == TouchesNumState.PassedMinThreshold) touchesNumState = TouchesNumState.PassedMinMaxThreshold; - // this event we crossed maxTouches - else touchesNumState = TouchesNumState.PassedMaxThreshold; + // this event we crossed both MinPointers and MaxPointers + if (pointersNumState == PointersNumState.PassedMinThreshold) pointersNumState = PointersNumState.PassedMinMaxThreshold; + // this event we crossed MaxPointers + else pointersNumState = PointersNumState.PassedMaxThreshold; } } - // last event we already were over maxTouches - else touchesNumState = TouchesNumState.TooMany; + // last event we already were over MaxPointers + else pointersNumState = PointersNumState.TooMany; } - if (state == GestureState.Began || state == GestureState.Changed) touch.INTERNAL_Retain(); + if (state == GestureState.Began || state == GestureState.Changed) + { + for (var i = 0; i < count; i++) pointers[i].INTERNAL_Retain(); + } - activeTouches.Add(touch); - numTouches = total; - touchBegan(touch); + activePointers.AddRange(pointers); + numPointers = total; + pointersPressed(pointers); } - internal void INTERNAL_TouchMoved(TouchPoint touch) + internal void INTERNAL_PointersUpdated(IList pointers) { - touchesNumState = TouchesNumState.InRange; - if (minTouches > 0 && numTouches < minTouches) touchesNumState = TouchesNumState.TooFew; - if (maxTouches > 0 && touchesNumState == TouchesNumState.InRange && numTouches > maxTouches) touchesNumState = TouchesNumState.TooMany; - touchMoved(touch); + pointersNumState = PointersNumState.InRange; + if (minPointers > 0 && numPointers < minPointers) pointersNumState = PointersNumState.TooFew; + if (maxPointers > 0 && pointersNumState == PointersNumState.InRange && numPointers > maxPointers) pointersNumState = PointersNumState.TooMany; + pointersUpdated(pointers); } - internal void INTERNAL_TouchEnded(TouchPoint touch) + internal void INTERNAL_PointersReleased(IList pointers) { - var total = numTouches - 1; - touchesNumState = TouchesNumState.InRange; + var count = pointers.Count; + var total = numPointers - count; + pointersNumState = PointersNumState.InRange; - if (minTouches <= 0) + if (minPointers <= 0) { - // have no touches - if (total == 0) touchesNumState = TouchesNumState.PassedMinThreshold; + // have no pointers + if (total == 0) pointersNumState = PointersNumState.PassedMinThreshold; } else { - if (numTouches >= minTouches) - { - // had >= minTouches, got < minTouches - if (total < minTouches) touchesNumState = TouchesNumState.PassedMinThreshold; - } - // last event we already were under minTouches - else touchesNumState = TouchesNumState.TooFew; - } - - if (maxTouches > 0) - { - if (numTouches > maxTouches) + if (numPointers >= minPointers) { - if (total <= maxTouches) - { - // this event we crossed both minTouches and maxTouches - if (touchesNumState == TouchesNumState.PassedMinThreshold) touchesNumState = TouchesNumState.PassedMinMaxThreshold; - // this event we crossed maxTouches - else touchesNumState = TouchesNumState.PassedMaxThreshold; - } - // last event we already were over maxTouches - else touchesNumState = TouchesNumState.TooMany; + // had >= MinPointers, got < MinPointers + if (total < minPointers) pointersNumState = PointersNumState.PassedMinThreshold; } + // last event we already were under MinPointers + else pointersNumState = PointersNumState.TooFew; } - activeTouches.Remove(touch); - numTouches = total; - - if (combineTouches) + if (maxPointers > 0) { - touchSequence.Add(touch); - - if (NumTouches == 0) + if (numPointers > maxPointers) { - // Checking which points were removed in clusterExistenceTime seconds to set their centroid as cached screen position - var cluster = touchSequence.FindElementsLaterThan(Time.time - combineTouchesInterval, - shouldCacheTouchPosition); - cachedScreenPosition = ClusterUtils.Get2DCenterPosition(cluster); - cachedPreviousScreenPosition = ClusterUtils.GetPrevious2DCenterPosition(cluster); - } - } - else - { - if (NumTouches == 0) - { - if (shouldCacheTouchPosition(touch)) - { - cachedScreenPosition = touch.Position; - cachedPreviousScreenPosition = touch.PreviousPosition; - } - else + if (total <= maxPointers) { - cachedScreenPosition = TouchManager.INVALID_POSITION; - cachedPreviousScreenPosition = TouchManager.INVALID_POSITION; + // this event we crossed both MinPointers and MaxPointers + if (pointersNumState == PointersNumState.PassedMinThreshold) pointersNumState = PointersNumState.PassedMinMaxThreshold; + // this event we crossed MaxPointers + else pointersNumState = PointersNumState.PassedMaxThreshold; } + // last event we already were over MaxPointers + else pointersNumState = PointersNumState.TooMany; } } - touchEnded(touch); + for (var i = 0; i < count; i++) activePointers.Remove(pointers[i]); + numPointers = total; + + if (NumPointers == 0) + { + var lastPoint = pointers[count - 1]; + if (shouldCachePointerPosition(lastPoint)) + { + cachedScreenPosition = lastPoint.Position; + cachedPreviousScreenPosition = lastPoint.PreviousPosition; + } + else + { + cachedScreenPosition = TouchManager.INVALID_POSITION; + cachedPreviousScreenPosition = TouchManager.INVALID_POSITION; + } + } + + pointersReleased(pointers); } - internal void INTERNAL_TouchCancelled(TouchPoint touch) + internal void INTERNAL_PointersCancelled(IList pointers) { - var total = numTouches - 1; - touchesNumState = TouchesNumState.InRange; + var count = pointers.Count; + var total = numPointers - count; + pointersNumState = PointersNumState.InRange; - if (minTouches <= 0) + if (minPointers <= 0) { - // have no touches - if (total == 0) touchesNumState = TouchesNumState.PassedMinThreshold; + // have no pointers + if (total == 0) pointersNumState = PointersNumState.PassedMinThreshold; } else { - if (numTouches >= minTouches) + if (numPointers >= minPointers) { - // had >= minTouches, got < minTouches - if (total < minTouches) touchesNumState = TouchesNumState.PassedMinThreshold; + // had >= MinPointers, got < MinPointers + if (total < minPointers) pointersNumState = PointersNumState.PassedMinThreshold; } - // last event we already were under minTouches - else touchesNumState = TouchesNumState.TooFew; + // last event we already were under MinPointers + else pointersNumState = PointersNumState.TooFew; } - if (maxTouches > 0) + if (maxPointers > 0) { - if (numTouches > maxTouches) + if (numPointers > maxPointers) { - if (total <= maxTouches) + if (total <= maxPointers) { - // this event we crossed both minTouches and maxTouches - if (touchesNumState == TouchesNumState.PassedMinThreshold) touchesNumState = TouchesNumState.PassedMinMaxThreshold; - // this event we crossed maxTouches - else touchesNumState = TouchesNumState.PassedMaxThreshold; + // this event we crossed both MinPointers and MaxPointers + if (pointersNumState == PointersNumState.PassedMinThreshold) pointersNumState = PointersNumState.PassedMinMaxThreshold; + // this event we crossed MaxPointers + else pointersNumState = PointersNumState.PassedMaxThreshold; } - // last event we already were over maxTouches - else touchesNumState = TouchesNumState.TooMany; + // last event we already were over MaxPointers + else pointersNumState = PointersNumState.TooMany; } } - activeTouches.Remove(touch); - numTouches = total; - touchCancelled(touch); + for (var i = 0; i < count; i++) activePointers.Remove(pointers[i]); + numPointers = total; + pointersCancelled(pointers); } internal virtual void INTERNAL_RemoveFriendlyGesture(Gesture gesture) @@ -898,11 +877,11 @@ internal virtual void INTERNAL_RemoveFriendlyGesture(Gesture gesture) #region Protected methods /// - /// Should the gesture cache this touch to use it later in calculation of . + /// Should the gesture cache this pointers to use it later in calculation of . /// - /// Touch to cache. - /// true if touch should be cached; false otherwise. - protected virtual bool shouldCacheTouchPosition(TouchPoint value) + /// Pointer to cache. + /// true if pointers should be cached; false otherwise. + protected virtual bool shouldCachePointerPosition(Pointer value) { return true; } @@ -915,7 +894,6 @@ protected virtual bool shouldCacheTouchPosition(TouchPoint value) protected bool setState(GestureState value) { if (gestureManagerInstance == null) return false; - if (!enabled && value != GestureState.Failed) return false; if (requireGestureToFail != null) { switch (value) @@ -928,10 +906,11 @@ protected bool setState(GestureState value) return false; } break; + case GestureState.Idle: case GestureState.Possible: case GestureState.Failed: case GestureState.Cancelled: - delayedStateChange = GestureState.Possible; + delayedStateChange = GestureState.Idle; break; } } @@ -947,30 +926,30 @@ protected bool setState(GestureState value) #region Callbacks /// - /// Called when a touch is added. + /// Called when new pointers appear. /// - /// The touch. - protected virtual void touchBegan(TouchPoint touch) {} + /// The pointers. + protected virtual void pointersPressed(IList pointers) {} /// - /// Called when a touch is moved. + /// Called for moved pointers. /// - /// The touch. - protected virtual void touchMoved(TouchPoint touch) {} + /// The pointers. + protected virtual void pointersUpdated(IList pointers) {} /// - /// Called when a touch is removed. + /// Called if pointers are removed. /// - /// The touch. - protected virtual void touchEnded(TouchPoint touch) {} + /// The pointers. + protected virtual void pointersReleased(IList pointers) {} /// - /// Called when a touch is cancelled. + /// Called when pointers are cancelled. /// - /// The touch. - protected virtual void touchCancelled(TouchPoint touch) + /// The pointers. + protected virtual void pointersCancelled(IList pointers) { - if (touchesNumState == TouchesNumState.PassedMinThreshold) + if (pointersNumState == PointersNumState.PassedMinThreshold) { // moved below the threshold switch (state) @@ -989,11 +968,15 @@ protected virtual void touchCancelled(TouchPoint touch) /// protected virtual void reset() { - layer = null; cachedScreenPosition = TouchManager.INVALID_POSITION; cachedPreviousScreenPosition = TouchManager.INVALID_POSITION; } + /// + /// Called when state is changed to Idle. + /// + protected virtual void onIdle() {} + /// /// Called when state is changed to Possible. /// @@ -1033,19 +1016,19 @@ protected virtual void onCancelled() #region Private functions - private void retainTouches() + private void retainPointers() { - var total = NumTouches; - for (var i = 0; i < total; i++) activeTouches[i].INTERNAL_Retain(); + var total = NumPointers; + for (var i = 0; i < total; i++) activePointers[i].INTERNAL_Retain(); } - private void releaseTouches(bool cancel) + private void releasePointers(bool cancel) { - var total = NumTouches; + var total = NumPointers; for (var i = 0; i < total; i++) { - var touch = activeTouches[i]; - if (touch.INTERNAL_Release() == 0 && cancel) touchManager.CancelTouch(touch.Id, true); + var pointer = activePointers[i]; + if (pointer.INTERNAL_Release() == 0 && cancel) touchManager.CancelPointer(pointer.Id, true); } } @@ -1074,7 +1057,7 @@ private void requiredToFailGestureStateChangedHandler(object sender, GestureStat { case GestureState.Failed: requiredGestureFailed = true; - if (delayedStateChange != GestureState.Possible) + if (delayedStateChange != GestureState.Idle) { setState(delayedStateChange); } @@ -1091,7 +1074,7 @@ private void requiredToFailGestureStateChangedHandler(object sender, GestureStat } /// - /// Event arguments for Gesture events + /// Event arguments for Gesture state change events. /// public class GestureStateChangeEventArgs : EventArgs { @@ -1105,15 +1088,26 @@ public class GestureStateChangeEventArgs : EventArgs /// public Gesture.GestureState State { get; private set; } + private static GestureStateChangeEventArgs instance; + /// /// Initializes a new instance of the class. /// + public GestureStateChangeEventArgs() {} + + /// + /// Returns cached instance of EventArgs. + /// This cached EventArgs is reused throughout the library not to alocate new ones on every call. + /// /// Current gesture state. /// Previous gesture state. - public GestureStateChangeEventArgs(Gesture.GestureState state, Gesture.GestureState previousState) + /// Cached EventArgs object. + public static GestureStateChangeEventArgs GetCachedEventArgs(Gesture.GestureState state, Gesture.GestureState previousState) { - State = state; - PreviousState = previousState; + if (instance == null) instance = new GestureStateChangeEventArgs(); + instance.State = state; + instance.PreviousState = previousState; + return instance; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/IGestureDelegate.cs b/Source/Assets/TouchScript/Scripts/Gestures/IGestureDelegate.cs index f75e00cbe..319b67ff0 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/IGestureDelegate.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/IGestureDelegate.cs @@ -3,6 +3,7 @@ */ using TouchScript.Gestures; +using TouchScript.Pointers; namespace TouchScript { @@ -14,13 +15,13 @@ namespace TouchScript public interface IGestureDelegate { /// - /// Returns whether a gesture should receive a touch. + /// Returns whether a gesture should receive a pointer. /// /// The gesture. - /// The touch. + /// The pointer. /// true if it should; false otherwise. - /// Can be used to restrict what touches a gesture can receive and ignore the ones it shouldn't. - bool ShouldReceiveTouch(Gesture gesture, TouchPoint touch); + /// Can be used to restrict what pointers a gesture can receive and ignore the ones it shouldn't. + bool ShouldReceivePointer(Gesture gesture, Pointer pointer); /// /// Returns whether a gesture can now begin. diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ITransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/ITransformGesture.cs deleted file mode 100644 index 842bdde17..000000000 --- a/Source/Assets/TouchScript/Scripts/Gestures/ITransformGesture.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using UnityEngine; - -namespace TouchScript.Gestures -{ - /// - /// Gesture which performs some kind of transformation in 3d space, i.e. translation, rotation, scaling or a combination of these. - /// - public interface ITransformGesture - { - /// - /// Occurs when gesture starts. - /// - event EventHandler TransformStarted; - - /// - /// Occurs when gesture data updates. - /// - event EventHandler Transformed; - - /// - /// Occurs when gesture finishes. - /// - event EventHandler TransformCompleted; - - /// - /// Applies gesture's transform for this frame to target Transform. - /// - /// Object to transform. - void ApplyTransform(Transform target); - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs index 69b1b19c8..ff6bbb047 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs @@ -4,9 +4,12 @@ using System; using System.Collections; +using System.Collections.Generic; using TouchScript.Utils; using TouchScript.Utils.Attributes; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -14,7 +17,7 @@ namespace TouchScript.Gestures /// Gesture which recognizes a point cluster which didn't move for specified time since it appeared. /// [AddComponentMenu("TouchScript/Gestures/Long Press Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_LongPressGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_LongPressGesture.htm")] public class LongPressGesture : Gesture { #region Constants @@ -40,12 +43,17 @@ public event EventHandler LongPressed // Needed to overcome iOS AOT limitations private EventHandler longPressedInvoker; + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnLongPress = new GestureEvent(); + #endregion #region Public properties /// - /// Gets or sets total time in seconds required to hold touches still. + /// Gets or sets total time in seconds required to hold pointers still. /// /// Time in seconds. public float TimeToPress @@ -55,7 +63,7 @@ public float TimeToPress } /// - /// Gets or sets maximum distance in cm touch points can move before gesture fails. + /// Gets or sets maximum distance in cm pointers can move before gesture fails. /// /// Distance in cm. public float DistanceLimit @@ -83,10 +91,24 @@ public float DistanceLimit private Vector2 totalMovement; +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + #endregion #region Unity methods + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Long Press Gesture"); +#endif + } + /// protected override void OnEnable() { @@ -95,47 +117,78 @@ protected override void OnEnable() distanceLimitInPixelsSquared = Mathf.Pow(distanceLimit * touchManager.DotsPerCentimeter, 2); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif - if (touchesNumState == TouchesNumState.PassedMaxThreshold || - touchesNumState == TouchesNumState.PassedMinMaxThreshold) + base.pointersPressed(pointers); + + if (pointersNumState == PointersNumState.PassedMaxThreshold || + pointersNumState == PointersNumState.PassedMinMaxThreshold) { setState(GestureState.Failed); } - else if (touchesNumState == TouchesNumState.PassedMinThreshold) + else if (pointersNumState == PointersNumState.PassedMinThreshold) { + setState(GestureState.Possible); StartCoroutine("wait"); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { - base.touchMoved(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersUpdated(pointers); if (distanceLimit < float.PositiveInfinity) { totalMovement += ScreenPosition - PreviousScreenPosition; if (totalMovement.sqrMagnitude > distanceLimitInPixelsSquared) setState(GestureState.Failed); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif - if (touchesNumState == TouchesNumState.PassedMinThreshold) + base.pointersReleased(pointers); + + if (pointersNumState == PointersNumState.PassedMinThreshold) { setState(GestureState.Failed); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// @@ -144,6 +197,7 @@ protected override void onRecognized() base.onRecognized(); if (longPressedInvoker != null) longPressedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(LONG_PRESS_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (UseUnityEvents) OnLongPress.Invoke(this); } /// @@ -167,14 +221,11 @@ private IEnumerator wait() if (State == GestureState.Possible) { - if (base.GetTargetHitResult()) - { - setState(GestureState.Recognized); - } - else - { + var data = GetScreenPositionHitData(); + if (data.Target == null || !data.Target.IsChildOf(cachedTransform)) setState(GestureState.Failed); - } + else + setState(GestureState.Recognized); } } diff --git a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs.meta index c1f653b58..7308eb3e0 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs index faa25ea5f..62192912e 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs @@ -3,130 +3,225 @@ */ using System; +using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { /// - /// Converts touch events for target object into separate events to be used somewhere else. + /// Converts Pointer events for target object into separate events to be used somewhere else. /// [AddComponentMenu("TouchScript/Gestures/Meta Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_MetaGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_MetaGesture.htm")] public sealed class MetaGesture : Gesture { #region Constants /// - /// Message dispatched when a touch begins. + /// Message dispatched when a pointer begins. /// - public const string TOUCH_BEGAN_MESSAGE = "OnTouchBegan"; + public const string POINTER_PRESSED_MESSAGE = "OnPointerPressed"; /// - /// Message dispatched when a touch moves. + /// Message dispatched when a pointer moves. /// - public const string TOUCH_MOVED_MESSAGE = "OnTouchMoved"; + public const string POINTER_MOVED_MESSAGE = "OnPointerMoved"; /// - /// Message dispatched when a touch ends. + /// Message dispatched when a pointer ends. /// - public const string TOUCH_ENDED_MESSAGE = "OnTouchEnded"; + public const string POINTER_RELEASED_MESSAGE = "OnPointerReleased"; /// - /// Message dispatched when a touch is cancelled. + /// Message dispatched when a pointer is cancelled. /// - public const string TOUCH_CANCELLED_MESSAGE = "OnTouchCancelled"; + public const string POINTER_CANCELLED_MESSAGE = "OnPointerCancelled"; #endregion #region Events /// - /// Occurs when a touch point is added. + /// Occurs when a pointer is added. /// - public event EventHandler TouchBegan + public event EventHandler PointerPressed { - add { touchBeganInvoker += value; } - remove { touchBeganInvoker -= value; } + add { pointerPressedInvoker += value; } + remove { pointerPressedInvoker -= value; } } /// - /// Occurs when a touch point is updated. + /// Occurs when a pointer is updated. /// - public event EventHandler TouchMoved + public event EventHandler PointerUpdated { - add { touchMovedInvoker += value; } - remove { touchMovedInvoker -= value; } + add { pointerUpdatedInvoker += value; } + remove { pointerUpdatedInvoker -= value; } } /// - /// Occurs when a touch point is removed. + /// Occurs when a pointer is removed. /// - public event EventHandler TouchEnded + public event EventHandler PointerReleased { - add { touchEndedInvoker += value; } - remove { touchEndedInvoker -= value; } + add { pointerReleasedInvoker += value; } + remove { pointerReleasedInvoker -= value; } } /// - /// Occurs when a touch point is cancelled. + /// Occurs when a pointer is cancelled. /// - public event EventHandler TouchCancelled + public event EventHandler PointerCancelled { - add { touchCancelledInvoker += value; } - remove { touchCancelledInvoker -= value; } + add { pointerCancelledInvoker += value; } + remove { pointerCancelledInvoker -= value; } } // Needed to overcome iOS AOT limitations - private EventHandler touchBeganInvoker, - touchMovedInvoker, - touchEndedInvoker, - touchCancelledInvoker; + private EventHandler pointerPressedInvoker, + pointerUpdatedInvoker, + pointerReleasedInvoker, + pointerCancelledInvoker; - #endregion + #endregion - #region Gesture callbacks + #region Private variables - /// - protected override void touchBegan(TouchPoint touch) - { - base.touchBegan(touch); +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Unity + + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Meta Gesture"); +#endif + } - if (State == GestureState.Possible) setState(GestureState.Began); + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } - if (touchBeganInvoker != null) touchBeganInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch)); - if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TOUCH_BEGAN_MESSAGE, touch, SendMessageOptions.DontRequireReceiver); + #endregion + + #region Gesture callbacks + + /// + protected override void pointersPressed(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); + + if (State == GestureState.Idle) setState(GestureState.Began); + + var length = pointers.Count; + if (pointerPressedInvoker != null) + { + for (var i = 0; i < length; i++) + pointerPressedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(pointers[i])); + } + if (UseSendMessage && SendMessageTarget != null) + { + for (var i = 0; i < length; i++) SendMessageTarget.SendMessage(POINTER_PRESSED_MESSAGE, pointers[i], SendMessageOptions.DontRequireReceiver); + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { - base.touchMoved(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersUpdated(pointers); if (State == GestureState.Began || State == GestureState.Changed) setState(GestureState.Changed); - if (touchMovedInvoker != null) touchMovedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch)); - if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TOUCH_MOVED_MESSAGE, touch, SendMessageOptions.DontRequireReceiver); + var length = pointers.Count; + if (pointerUpdatedInvoker != null) + { + for (var i = 0; i < length; i++) + pointerUpdatedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(pointers[i])); + } + if (UseSendMessage && SendMessageTarget != null) + { + for (var i = 0; i < length; i++) SendMessageTarget.SendMessage(POINTER_MOVED_MESSAGE, pointers[i], SendMessageOptions.DontRequireReceiver); + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); - - if ((State == GestureState.Began || State == GestureState.Changed) && NumTouches == 0) setState(GestureState.Ended); - - if (touchEndedInvoker != null) touchEndedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch)); - if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TOUCH_ENDED_MESSAGE, touch, SendMessageOptions.DontRequireReceiver); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); + + if ((State == GestureState.Began || State == GestureState.Changed) && NumPointers == 0) setState(GestureState.Ended); + + var length = pointers.Count; + if (pointerReleasedInvoker != null) + { + for (var i = 0; i < length; i++) + pointerReleasedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(pointers[i])); + } + if (UseSendMessage && SendMessageTarget != null) + { + for (var i = 0; i < length; i++) SendMessageTarget.SendMessage(POINTER_RELEASED_MESSAGE, pointers[i], SendMessageOptions.DontRequireReceiver); + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchCancelled(TouchPoint touch) + protected override void pointersCancelled(IList pointers) { - base.touchCancelled(touch); - - if (touchCancelledInvoker != null) touchCancelledInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch)); - if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TOUCH_CANCELLED_MESSAGE, touch, SendMessageOptions.DontRequireReceiver); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersCancelled(pointers); + + var length = pointers.Count; + if (pointerCancelledInvoker != null) + { + for (var i = 0; i < length; i++) + pointerCancelledInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(pointers[i])); + } + if (UseSendMessage && SendMessageTarget != null) + { + for (var i = 0; i < length; i++) SendMessageTarget.SendMessage(POINTER_CANCELLED_MESSAGE, pointers[i], SendMessageOptions.DontRequireReceiver); + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } #endregion @@ -138,17 +233,17 @@ protected override void touchCancelled(TouchPoint touch) public class MetaGestureEventArgs : EventArgs { /// - /// Current touch point. + /// Current pointer. /// - public TouchPoint Touch { get; private set; } + public Pointer Pointer { get; private set; } /// /// Initializes a new instance of the class. /// - /// Touch point the event is for. - public MetaGestureEventArgs(TouchPoint touch) + /// Pointer the event is for. + public MetaGestureEventArgs(Pointer pointer) { - Touch = touch; + Pointer = pointer; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs.meta index 04efca14c..99c5bd78a 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs deleted file mode 100644 index cabdeceea..000000000 --- a/Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs +++ /dev/null @@ -1,368 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using TouchScript.Gestures.Base; -using TouchScript.Layers; -using TouchScript.Utils.Geom; -#if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.Debug; -#endif -using UnityEngine; - -namespace TouchScript.Gestures -{ - /// - /// Recognizes a transform gesture around center of the object, i.e. one finger rotation, scaling or a combination of these. - /// - [AddComponentMenu("TouchScript/Gestures/Pinned Transform Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_PinnedTransformGesture.htm")] - public class PinnedTransformGesture : PinnedTrasformGestureBase, ITransformGesture - { - #region Constants - - /// - /// Transform's projection type. - /// - public enum ProjectionType - { - /// - /// Use a plane with normal vector defined by layer. - /// - Layer, - - /// - /// Use a plane with certain normal vector in local coordinates. - /// - Object, - - /// - /// Use a plane with certain normal vector in global coordinates. - /// - Global - } - - #endregion - - #region Public properties - - /// - /// Gets or sets transform's projection type. - /// - /// Projection type. - public ProjectionType Projection - { - get { return projection; } - set - { - if (projection == value) return; - projection = value; - if (Application.isPlaying) updateProjectionPlane(); - } - } - - /// - /// Gets or sets transform's projection plane normal. - /// - /// Projection plane normal. - public Vector3 ProjectionPlaneNormal - { - get - { - if (projection == ProjectionType.Layer) return projectionLayer.WorldProjectionNormal; - return projectionPlaneNormal; - } - set - { - if (projection == ProjectionType.Layer) projection = ProjectionType.Object; - value.Normalize(); - if (projectionPlaneNormal == value) return; - projectionPlaneNormal = value; - if (Application.isPlaying) updateProjectionPlane(); - } - } - - /// - /// Plane where transformation occured. - /// - public Plane TransformPlane - { - get { return transformPlane; } - } - - /// - /// Gets rotation axis of the gesture in world coordinates. - /// - /// Rotation axis of the gesture in world coordinates. - public Vector3 RotationAxis - { - get { return transformPlane.normal; } - } - - #endregion - - #region Private variables - - [SerializeField] - private ProjectionType projection = ProjectionType.Layer; - - [SerializeField] - private Vector3 projectionPlaneNormal = Vector3.forward; - - private TouchLayer projectionLayer; - private Plane transformPlane; - - #endregion - - #region Public methods - - /// - public void ApplyTransform(Transform target) - { - if (!Mathf.Approximately(DeltaRotation, 0f)) - target.rotation = Quaternion.AngleAxis(DeltaRotation, RotationAxis) * target.rotation; - if (!Mathf.Approximately(DeltaScale, 1f)) target.localScale *= DeltaScale; - } - - #endregion - - #region Unity methods - - /// - protected override void Awake() - { - base.Awake(); - transformPlane = new Plane(); - } - - /// - protected override void OnEnable() - { - base.OnEnable(); - - updateProjectionPlane(); - TouchManager.Instance.FrameFinished += frameFinishedHandler; - } - - /// - protected override void OnDisable() - { - base.OnDisable(); - - if (TouchManager.Instance != null) TouchManager.Instance.FrameFinished -= frameFinishedHandler; - } - - #endregion - - #region Gesture callbacks - - /// - protected override void touchBegan(TouchPoint touch) - { - base.touchBegan(touch); - - if (State != GestureState.Possible) return; - if (NumTouches == 1) - { - projectionLayer = activeTouches[0].Layer; - updateProjectionPlane(); - -#if TOUCHSCRIPT_DEBUG - drawDebug(activeTouches[0].ProjectionParams.ProjectFrom(cachedTransform.position), activeTouches[0].Position); -#endif - } - } - - /// - protected override void touchMoved(TouchPoint touch) - { - base.touchMoved(touch); - - movedTouches.Add(touch); - } - -#if TOUCHSCRIPT_DEBUG - /// - protected override void touchEnded(TouchPoint touch) - { - base.touchEnded(touch); - - if (NumTouches == 0) return; - drawDebug(activeTouches[0].ProjectionParams.ProjectFrom(cachedTransform.position), activeTouches[0].Position); - } -#endif - - #endregion - - #region Protected methods - -#if TOUCHSCRIPT_DEBUG - protected override void clearDebug() - { - base.clearDebug(); - - GLDebug.RemoveFigure(debugID + 3); - } - - protected override void drawDebug(Vector2 point1, Vector2 point2) - { - base.drawDebug(point1, point2); - - GLDebug.DrawPlaneWithNormal(debugID + 3, cachedTransform.position, RotationAxis, 1f, GLDebug.MULTIPLY, float.PositiveInfinity); - } -#endif - - #endregion - - #region Private functions - - private float doRotation(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, - ProjectionParams projectionParams) - { - var newVector = projectionParams.ProjectTo(newScreenPos, TransformPlane) - center; - var oldVector = projectionParams.ProjectTo(oldScreenPos, TransformPlane) - center; - var angle = Vector3.Angle(oldVector, newVector); - if (Vector3.Dot(Vector3.Cross(oldVector, newVector), TransformPlane.normal) < 0) - angle = -angle; - return angle; - } - - private float doScaling(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, - ProjectionParams projectionParams) - { - var newVector = projectionParams.ProjectTo(newScreenPos, TransformPlane) - center; - var oldVector = projectionParams.ProjectTo(oldScreenPos, TransformPlane) - center; - return newVector.magnitude / oldVector.magnitude; - } - - private void updateProjectionPlane() - { - if (!Application.isPlaying) return; - - switch (projection) - { - case ProjectionType.Layer: - if (projectionLayer == null) - transformPlane = new Plane(cachedTransform.TransformDirection(Vector3.forward), - cachedTransform.position); - else transformPlane = new Plane(projectionLayer.WorldProjectionNormal, cachedTransform.position); - break; - case ProjectionType.Object: - transformPlane = new Plane(cachedTransform.TransformDirection(projectionPlaneNormal), - cachedTransform.position); - break; - case ProjectionType.Global: - transformPlane = new Plane(projectionPlaneNormal, cachedTransform.position); - break; - } - } - - private void updateMoved() - { -#if TOUCHSCRIPT_DEBUG - var worldCenter = cachedTransform.position; - var screenCenter = projectionParams.ProjectFrom(worldCenter); - var newScreenPos = getPointScreenPosition(); - drawDebug(screenCenter, newScreenPos); -#endif - - if (NumTouches == 0) return; - - var rotationEnabled = (Type & TransformType.Rotation) == TransformType.Rotation; - var scalingEnabled = (Type & TransformType.Scaling) == TransformType.Scaling; - if (!rotationEnabled && !scalingEnabled) return; - if (!relevantTouches()) return; - - var dR = deltaRotation = 0; - var dS = deltaScale = 1f; - -#if !TOUCHSCRIPT_DEBUG - var theTouch = activeTouches[0]; - var worldCenter = cachedTransform.position; - var screenCenter = projectionParams.ProjectFrom(worldCenter); - var newScreenPos = theTouch.Position; -#endif - - // Here we can't reuse last frame screen positions because points 0 and 1 can change. - // For example if the first of 3 fingers is lifted off. - var oldScreenPos = getPointPreviousScreenPosition(); - - if (rotationEnabled) - { - if (isTransforming) - { - dR = doRotation(worldCenter, oldScreenPos, newScreenPos, projectionParams); - } - else - { - // Find how much we moved perpendicular to the line (center, oldScreenPos) - screenPixelRotationBuffer += TwoD.PointToLineDistance(screenCenter, oldScreenPos, newScreenPos); - angleBuffer += doRotation(worldCenter, oldScreenPos, newScreenPos, projectionParams); - - if (screenPixelRotationBuffer * screenPixelRotationBuffer >= - screenTransformPixelThresholdSquared) - { - isTransforming = true; - dR = angleBuffer; - } - } - } - - if (scalingEnabled) - { - if (isTransforming) - { - dS *= doScaling(worldCenter, oldScreenPos, newScreenPos, projectionParams); - } - else - { - screenPixelScalingBuffer += (newScreenPos - screenCenter).magnitude - - (oldScreenPos - screenCenter).magnitude; - scaleBuffer *= doScaling(worldCenter, oldScreenPos, newScreenPos, projectionParams); - - if (screenPixelScalingBuffer * screenPixelScalingBuffer >= - screenTransformPixelThresholdSquared) - { - isTransforming = true; - dS = scaleBuffer; - } - } - } - - if (dR != 0 || dS != 1) - { - if (State == GestureState.Possible) - { - if (touchesNumState == TouchesNumState.InRange) setState(GestureState.Began); - else - { - // Wrong number of touches! - setState(GestureState.Failed); - return; - } - } - switch (State) - { - case GestureState.Began: - case GestureState.Changed: - deltaRotation = dR; - deltaScale = dS; - setState(GestureState.Changed); - break; - } - } - } - - private void frameFinishedHandler(object sender, EventArgs eventArgs) - { - if (movedTouches.Count > 0) - { - updateMoved(); - movedTouches.Clear(); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs index 8b3efc396..35ef5f821 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs @@ -3,18 +3,26 @@ */ using System; +using System.Collections.Generic; using TouchScript.Utils; using TouchScript.Utils.Attributes; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { /// - /// Recognizes when an object is touched. - /// Works with any gesture unless a Delegate is set. + /// Recognizes when an object is touched. Works with any gesture unless a Delegate is set. /// + /// + /// PressGesture fires immediately and would ultimately kill every other non-friendly gesture. So one would have to manually make it friendly with everything in a general use-case. That's why it's made friendly with everyone by default. + /// But there are cases when one would like to determine if parent container was pressed or its child. In current implementation both PressGestures will fire. + /// One approach would be to somehow make parent's PressGesture not friendly with child's one. But looking at how gesture recognition works we can see that this won't work. Since we would like child's gesture to fail parent's gesture. When child's PressGesture is recognized the system asks it if it can prevent parent's gesture, and it obviously can't because it's friendly with everything. And it doesn't matter that parent's gesture can be prevented by child's one... because child's one can't prevent parent's gesture and this is asked first. + /// This is basically what is for. It makes parent's PressGesture only listen for TouchPoints which lend directly on it. + /// [AddComponentMenu("TouchScript/Gestures/Press Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_PressGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_PressGesture.htm")] public class PressGesture : Gesture { #region Constants @@ -40,6 +48,11 @@ public event EventHandler Pressed // Needed to overcome iOS AOT limitations private EventHandler pressedInvoker; + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnPress = new GestureEvent(); + #endregion #region Public properties @@ -62,17 +75,41 @@ public bool IgnoreChildren [ToggleLeft] private bool ignoreChildren = false; +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Unity + + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Press Gesture"); +#endif + } + + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks /// - public override bool ShouldReceiveTouch(TouchPoint touch) + public override bool ShouldReceivePointer(Pointer pointer) { - if (!IgnoreChildren) return base.ShouldReceiveTouch(touch); - if (!base.ShouldReceiveTouch(touch)) return false; + if (!IgnoreChildren) return base.ShouldReceivePointer(pointer); + if (!base.ShouldReceivePointer(pointer)) return false; - if (touch.Target != cachedTransform) return false; + if (pointer.GetPressData().Target != cachedTransform) return false; return true; } @@ -91,11 +128,34 @@ public override bool CanBePreventedByGesture(Gesture gesture) } /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); - - if (touchesNumState == TouchesNumState.PassedMinThreshold) setState(GestureState.Recognized); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); + + if (pointersNumState == PointersNumState.PassedMinThreshold) + { + setState(GestureState.Recognized); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + return; + } + if (pointersNumState == PointersNumState.PassedMinMaxThreshold) + { + setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + return; + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// @@ -105,6 +165,7 @@ protected override void onRecognized() if (pressedInvoker != null) pressedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(PRESS_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (UseUnityEvents) OnPress.Invoke(this); } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs.meta index 5595e47f7..b0c69b2e0 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs index 907ae7c62..1cd64faf0 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs @@ -3,18 +3,21 @@ */ using System; +using System.Collections.Generic; using TouchScript.Utils; using TouchScript.Utils.Attributes; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { /// - /// Recognizes when last touch is released from target. - /// Works with any gesture unless a Delegate is set. + /// Recognizes when last pointer is released from target. Works with any gesture unless a Delegate is set. /// + /// [AddComponentMenu("TouchScript/Gestures/Release Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_ReleaseGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_ReleaseGesture.htm")] public class ReleaseGesture : Gesture { #region Constants @@ -40,6 +43,11 @@ public event EventHandler Released // Needed to overcome iOS AOT limitations private EventHandler releasedInvoker; + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnRelease = new GestureEvent(); + #endregion #region Public properties @@ -62,17 +70,41 @@ public bool IgnoreChildren [ToggleLeft] private bool ignoreChildren = false; - #endregion +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif - #region Gesture callbacks + #endregion - /// - public override bool ShouldReceiveTouch(TouchPoint touch) + #region Unity + + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Release Gesture"); +#endif + } + + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + + #endregion + + #region Gesture callbacks + + /// + public override bool ShouldReceivePointer(Pointer pointer) { - if (!IgnoreChildren) return base.ShouldReceiveTouch(touch); - if (!base.ShouldReceiveTouch(touch)) return false; + if (!IgnoreChildren) return base.ShouldReceivePointer(pointer); + if (!base.ShouldReceivePointer(pointer)) return false; - if (touch.Target != cachedTransform) return false; + if (pointer.GetPressData().Target != cachedTransform) return false; return true; } @@ -91,11 +123,50 @@ public override bool CanBePreventedByGesture(Gesture gesture) } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersPressed(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); + + if (pointersNumState == PointersNumState.PassedMinThreshold) + { + if (State == GestureState.Idle) setState(GestureState.Possible); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + return; + } + if (pointersNumState == PointersNumState.PassedMinMaxThreshold) + { + setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + return; + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + /// + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); + + if (pointersNumState == PointersNumState.PassedMinThreshold) setState(GestureState.Recognized); - if (touchesNumState == TouchesNumState.PassedMinThreshold) setState(GestureState.Recognized); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// @@ -104,6 +175,7 @@ protected override void onRecognized() base.onRecognized(); if (releasedInvoker != null) releasedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(RELEASE_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (UseUnityEvents) OnRelease.Invoke(this); } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs.meta index 1986da9c6..1437d8983 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs index 4217fbc4b..be6ed2749 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs @@ -4,9 +4,12 @@ using System; using System.Collections; +using System.Collections.Generic; using TouchScript.Utils; using TouchScript.Utils.Attributes; +using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -14,7 +17,7 @@ namespace TouchScript.Gestures /// Recognizes a tap. /// [AddComponentMenu("TouchScript/Gestures/Tap Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_TapGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TapGesture.htm")] public class TapGesture : Gesture { #region Constants @@ -40,6 +43,11 @@ public event EventHandler Tapped // Needed to overcome iOS AOT limitations private EventHandler tappedInvoker; + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnTap = new GestureEvent(); + #endregion #region Public properties @@ -69,9 +77,9 @@ public float TimeLimit } /// - /// Gets or sets maximum distance for touch cluster must move for the gesture to fail. + /// Gets or sets maximum distance for point cluster must move for the gesture to fail. /// - /// Distance in cm touches must move before gesture fails. + /// Distance in cm pointers must move before gesture fails. public float DistanceLimit { get { return distanceLimit; } @@ -82,6 +90,29 @@ public float DistanceLimit } } + /// + /// Gets or sets the flag if pointers should be treated as a cluster. + /// + /// true if pointers should be treated as a cluster; otherwise, false. + /// + /// At the end of a gesture when pointers are lifted off due to the fact that computers are faster than humans the very last pointer's position will be gesture's after that. This flag is used to combine several pointers which from the point of a user were lifted off simultaneously and set their centroid as gesture's . + /// + public bool CombinePointers + { + get { return combinePointers; } + set { combinePointers = value; } + } + + /// + /// Gets or sets time interval before gesture is recognized to combine all lifted pointers into a cluster to use its center as . + /// + /// Time in seconds to treat pointers lifted off during this interval as a single gesture. + public float CombinePointersInterval + { + get { return combinePointersInterval; } + set { combinePointersInterval = value; } + } + #endregion #region Private variables @@ -91,25 +122,60 @@ public float DistanceLimit [SerializeField] [NullToggle(NullFloatValue = float.PositiveInfinity)] - private float timeLimit = - float.PositiveInfinity; + private float timeLimit = float.PositiveInfinity; [SerializeField] [NullToggle(NullFloatValue = float.PositiveInfinity)] - private float distanceLimit = - float.PositiveInfinity; + private float distanceLimit = float.PositiveInfinity; + + [SerializeField] + [ToggleLeft] + private bool combinePointers = false; + + [SerializeField] + private float combinePointersInterval = .3f; private float distanceLimitInPixelsSquared; + // isActive works in a tap cycle (i.e. when double/tripple tap is being recognized) + // State -> Possible happens when the first pointer is detected private bool isActive = false; private int tapsDone; private Vector2 startPosition; private Vector2 totalMovement; + private TimedSequence pointerSequence = new TimedSequence(); + +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Public methods + + /// + public override bool ShouldReceivePointer(Pointer pointer) + { + if (!base.ShouldReceivePointer(pointer)) return false; + // Ignore redispatched pointers — they come from 2+ pointer gestures when one is left with 1 pointer. + // In this state it means that the user doesn't have an intention to tap the object. + return (pointer.Flags & Pointer.FLAG_RETURNED) == 0; + } #endregion #region Unity methods + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Tap Gesture"); +#endif + } + /// protected override void OnEnable() { @@ -118,95 +184,153 @@ protected override void OnEnable() distanceLimitInPixelsSquared = Mathf.Pow(distanceLimit * touchManager.DotsPerCentimeter, 2); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); - if (touchesNumState == TouchesNumState.PassedMaxThreshold || - touchesNumState == TouchesNumState.PassedMinMaxThreshold) + if (pointersNumState == PointersNumState.PassedMaxThreshold || + pointersNumState == PointersNumState.PassedMinMaxThreshold) { setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif return; } - if (NumTouches == 1) + if (NumPointers == pointers.Count) { - // the first ever touch + // the first ever pointer if (tapsDone == 0) { - startPosition = touch.Position; + startPosition = pointers[0].Position; if (timeLimit < float.PositiveInfinity) StartCoroutine("wait"); } else if (tapsDone >= numberOfTapsRequired) // Might be delayed and retapped while waiting { - setState(GestureState.Possible); reset(); - startPosition = touch.Position; + startPosition = pointers[0].Position; if (timeLimit < float.PositiveInfinity) StartCoroutine("wait"); } else { if (distanceLimit < float.PositiveInfinity) { - if ((touch.Position - startPosition).sqrMagnitude > distanceLimitInPixelsSquared) + if ((pointers[0].Position - startPosition).sqrMagnitude > distanceLimitInPixelsSquared) { setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif return; } } } } - if (touchesNumState == TouchesNumState.PassedMinThreshold) + if (pointersNumState == PointersNumState.PassedMinThreshold) { // Starting the gesture when it is already active? => we released one finger and pressed again if (isActive) setState(GestureState.Failed); - else isActive = true; + else + { + if (State == GestureState.Idle) setState(GestureState.Possible); + isActive = true; + } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { - base.touchMoved(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersUpdated(pointers); if (distanceLimit < float.PositiveInfinity) { - totalMovement += touch.Position - touch.PreviousPosition; + totalMovement += pointers[0].Position - pointers[0].PreviousPosition; if (totalMovement.sqrMagnitude > distanceLimitInPixelsSquared) setState(GestureState.Failed); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); - if (NumTouches == 0) + if (combinePointers) { - if (!isActive) - { - setState(GestureState.Failed); - return; - } + var count = pointers.Count; + for (var i = 0; i < count; i++) pointerSequence.Add(pointers[i]); - // touches outside of gesture target are ignored in shouldCacheTouchPosition() - // if all touches are outside ScreenPosition will be invalid - if (TouchManager.IsInvalidPosition(ScreenPosition)) + if (NumPointers == 0) { - setState(GestureState.Failed); + // Checking which points were removed in clusterExistenceTime seconds to set their centroid as cached screen position + var cluster = pointerSequence.FindElementsLaterThan(Time.unscaledTime - combinePointersInterval, shouldCachePointerPosition); + cachedScreenPosition = ClusterUtils.Get2DCenterPosition(cluster); + cachedPreviousScreenPosition = ClusterUtils.GetPrevious2DCenterPosition(cluster); } - else + } + else + { + if (NumPointers == 0) { - tapsDone++; - isActive = false; - if (tapsDone >= numberOfTapsRequired) setState(GestureState.Recognized); + if (!isActive) + { + setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + return; + } + + // pointers outside of gesture target are ignored in shouldCachePointerPosition() + // if all pointers are outside ScreenPosition will be invalid + if (TouchManager.IsInvalidPosition(ScreenPosition)) + { + setState(GestureState.Failed); + } + else + { + tapsDone++; + isActive = false; + if (tapsDone >= numberOfTapsRequired) setState(GestureState.Recognized); + } } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// @@ -217,6 +341,7 @@ protected override void onRecognized() StopCoroutine("wait"); if (tappedInvoker != null) tappedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TAP_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (UseUnityEvents) OnTap.Invoke(this); } /// @@ -231,10 +356,10 @@ protected override void reset() } /// - protected override bool shouldCacheTouchPosition(TouchPoint value) + protected override bool shouldCachePointerPosition(Pointer value) { // Points must be over target when released - return GetTargetHitResult(value.Position); + return PointerUtils.IsPointerOnTarget(value, cachedTransform); } #endregion @@ -247,7 +372,7 @@ private IEnumerator wait() var targetTime = Time.unscaledTime + TimeLimit; while (targetTime > Time.unscaledTime) yield return null; - if (State == GestureState.Possible) setState(GestureState.Failed); + if (State == GestureState.Idle || State == GestureState.Possible) setState(GestureState.Failed); } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs.meta index cf20a7e9f..09c3bafdb 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures.meta new file mode 100644 index 000000000..0afe2b9f2 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 01caabc0c3e0848afa70ede89294233e +folderAsset: yes +timeCreated: 1477921285 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Base.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Gestures/Base.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base.meta diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs new file mode 100644 index 000000000..40abbf73a --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs @@ -0,0 +1,322 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Collections.Generic; +using TouchScript.Layers; +using TouchScript.Pointers; +using TouchScript.Utils.Geom; +using UnityEngine; + +#if TOUCHSCRIPT_DEBUG +using System.Collections; +using TouchScript.Debugging.GL; +#endif + +namespace TouchScript.Gestures.TransformGestures.Base +{ + /// + /// Abstract base class for Pinned Transform Gestures. + /// + public abstract class OnePointTrasformGestureBase : TransformGestureBase + { + #region Constants + + #endregion + + #region Events + + #endregion + + #region Public properties + + /// + public override Vector2 ScreenPosition + { + get + { + if (NumPointers == 0) return TouchManager.INVALID_POSITION; + return activePointers[0].Position; + } + } + + /// + public override Vector2 PreviousScreenPosition + { + get + { + if (NumPointers == 0) return TouchManager.INVALID_POSITION; + return activePointers[0].PreviousPosition; + } + } + + #endregion + + #region Private variables + + /// + /// Translation buffer. + /// + protected Vector2 screenPixelTranslationBuffer; + + /// + /// Rotation buffer. + /// + protected float screenPixelRotationBuffer; + + /// + /// Angle buffer. + /// + protected float angleBuffer; + + /// + /// Screen space scaling buffer. + /// + protected float screenPixelScalingBuffer; + + /// + /// Scaling buffer. + /// + protected float scaleBuffer; + + #endregion + + #region Unity methods + +#if TOUCHSCRIPT_DEBUG + /// + protected override void Awake() + { + base.Awake(); + + debugID = DebugHelper.GetDebugId(this); + debugPointerSize = Vector2.one * TouchManager.Instance.DotsPerCentimeter * 1.1f; + } +#endif + + #endregion + + #region Gesture callbacks + + /// + protected override void pointersUpdated(IList pointers) + { + base.pointersUpdated(pointers); + + var projectionParams = activePointers[0].ProjectionParams; + var dR = deltaRotation = 0; + var dS = deltaScale = 1f; + +#if TOUCHSCRIPT_DEBUG + var worldCenter = cachedTransform.position; + var screenCenter = projectionParams.ProjectFrom(worldCenter); + var newScreenPos = getPointScreenPosition(); + drawDebug(screenCenter, newScreenPos); +#endif + + if (pointersNumState != PointersNumState.InRange) return; + + var rotationEnabled = (Type & TransformGesture.TransformType.Rotation) == TransformGesture.TransformType.Rotation; + var scalingEnabled = (Type & TransformGesture.TransformType.Scaling) == TransformGesture.TransformType.Scaling; + if (!rotationEnabled && !scalingEnabled) return; + if (!relevantPointers(pointers)) return; + +#if !TOUCHSCRIPT_DEBUG + var thePointer = activePointers[0]; + var worldCenter = cachedTransform.position; + var screenCenter = projectionParams.ProjectFrom(worldCenter); + var newScreenPos = thePointer.Position; +#endif + + // Here we can't reuse last frame screen positions because points 0 and 1 can change. + // For example if the first of 3 fingers is lifted off. + var oldScreenPos = getPointPreviousScreenPosition(); + + if (rotationEnabled) + { + if (isTransforming) + { + dR = doRotation(worldCenter, oldScreenPos, newScreenPos, projectionParams); + } + else + { + // Find how much we moved perpendicular to the line (center, oldScreenPos) + screenPixelRotationBuffer += TwoD.PointToLineDistance(screenCenter, oldScreenPos, newScreenPos); + angleBuffer += doRotation(worldCenter, oldScreenPos, newScreenPos, projectionParams); + + if (screenPixelRotationBuffer * screenPixelRotationBuffer >= + screenTransformPixelThresholdSquared) + { + isTransforming = true; + dR = angleBuffer; + } + } + } + + if (scalingEnabled) + { + if (isTransforming) + { + dS *= doScaling(worldCenter, oldScreenPos, newScreenPos, projectionParams); + } + else + { + screenPixelScalingBuffer += (newScreenPos - screenCenter).magnitude - + (oldScreenPos - screenCenter).magnitude; + scaleBuffer *= doScaling(worldCenter, oldScreenPos, newScreenPos, projectionParams); + + if (screenPixelScalingBuffer * screenPixelScalingBuffer >= + screenTransformPixelThresholdSquared) + { + isTransforming = true; + dS = scaleBuffer; + } + } + } + + if (dR != 0) transformMask |= TransformGesture.TransformType.Rotation; + if (dS != 1) transformMask |= TransformGesture.TransformType.Scaling; + + if (transformMask != 0) + { + if (State == GestureState.Possible) setState(GestureState.Began); + switch (State) + { + case GestureState.Began: + case GestureState.Changed: + deltaRotation = dR; + deltaScale = dS; + setState(GestureState.Changed); + resetValues(); + break; + } + } + } + + /// + protected override void reset() + { + base.reset(); + + screenPixelTranslationBuffer = Vector2.zero; + screenPixelRotationBuffer = 0f; + angleBuffer = 0; + screenPixelScalingBuffer = 0f; + scaleBuffer = 1f; + +#if TOUCHSCRIPT_DEBUG + clearDebug(); +#endif + } + + #endregion + + #region Protected methods + + /// + /// Calculates rotation. + /// + /// Center screen position. + /// Pointer old screen position. + /// Pointer new screen position. + /// Layer projection parameters. + /// Angle in degrees. + protected virtual float doRotation(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, + ProjectionParams projectionParams) + { + return 0; + } + + /// + /// Calculates scaling. + /// + /// Center screen position. + /// Pointer old screen position. + /// Pointer new screen position. + /// Layer projection parameters. + /// Multiplicative delta scaling. + protected virtual float doScaling(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, + ProjectionParams projectionParams) + { + return 1; + } + + /// + /// Checks if there are pointers in the list which matter for the gesture. + /// + /// List of pointers + /// true if there are relevant pointers; false otherwise. + protected virtual bool relevantPointers(IList pointers) + { + // We care only about the first pointer + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + if (pointers[i] == activePointers[0]) return true; + } + return false; + } + + /// + /// Returns screen position of a point with index 0. + /// + protected virtual Vector2 getPointScreenPosition() + { + return activePointers[0].Position; + } + + /// + /// Returns previous screen position of a point with index 0. + /// + protected virtual Vector2 getPointPreviousScreenPosition() + { + return activePointers[0].PreviousPosition; + } + + /// + protected override void updateType() + { + type = type & ~TransformGesture.TransformType.Translation; + } + +#if TOUCHSCRIPT_DEBUG + protected virtual void clearDebug() + { + GLDebug.RemoveFigure(debugID); + GLDebug.RemoveFigure(debugID + 1); + GLDebug.RemoveFigure(debugID + 2); + + if (debugCoroutine != null) StopCoroutine(debugCoroutine); + debugCoroutine = null; + } + + protected void drawDebugDelayed(Vector2 point1, Vector2 point2) + { + if (debugCoroutine != null) StopCoroutine(debugCoroutine); + debugCoroutine = StartCoroutine(doDrawDebug(point1, point2)); + } + + protected virtual void drawDebug(Vector2 point1, Vector2 point2) + { + if (!DebugMode) return; + + var color = State == GestureState.Possible ? Color.red : Color.green; + GLDebug.DrawSquareScreenSpace(debugID + 1, point2, 0f, debugPointerSize, color, float.PositiveInfinity); + GLDebug.DrawLineScreenSpace(debugID + 2, point1, point2, color, float.PositiveInfinity); + } + + private IEnumerator doDrawDebug(Vector2 point1, Vector2 point2) + { + yield return new WaitForEndOfFrame(); + + drawDebug(point1, point2); + } +#endif + + #endregion + + #region Private functions + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Base/PinnedTransformGestureBase.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Gestures/Base/PinnedTransformGestureBase.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Base/PinnedTransformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs similarity index 55% rename from Source/Assets/TouchScript/Scripts/Gestures/Base/PinnedTransformGestureBase.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs index c8c0ad943..13acb87bc 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Base/PinnedTransformGestureBase.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs @@ -4,41 +4,26 @@ using System; using System.Collections.Generic; -using TouchScript.Layers; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; #if TOUCHSCRIPT_DEBUG -using System.Collections; -using TouchScript.Utils.Debug; +using TouchScript.Debugging.GL; #endif -namespace TouchScript.Gestures.Base +namespace TouchScript.Gestures.TransformGestures.Base { /// - /// Abstract base class for Pinned Transform Gestures. + /// Abstract base class for Transform Gestures. /// - public abstract class PinnedTrasformGestureBase : Gesture + /// + /// Relationship with component requires that if current object position is not exactly the one acquired by transformation events from this gesture (i.e. when smoothing is applied current transform is lagging a bit behind target transform), the gesture has to know about this to calculate translation properly. This is where method comes into play. has to call it after every transform event. + /// + public abstract class TransformGestureBase : Gesture, ITransformGesture { #region Constants - /// - /// Types of transformation. - /// - [Flags] - public enum TransformType - { - /// - /// Rotation. - /// - Rotation = 0x2, - - /// - /// Scaling. - /// - Scaling = 0x4 - } - /// /// Message name when gesture starts /// @@ -82,6 +67,21 @@ public event EventHandler TransformCompleted // Needed to overcome iOS AOT limitations private EventHandler transformStartedInvoker, transformedInvoker, transformCompletedInvoker; + /// + /// Unity event, occurs when the gesture starts. + /// + public GestureEvent OnTransformStart = new GestureEvent(); + + /// + /// Unity event, occurs when the gesture is updated. + /// + public GestureEvent OnTransform = new GestureEvent(); + + /// + /// Unity event, occurs when the gesture ends. + /// + public GestureEvent OnTransformComplete = new GestureEvent(); + #endregion #region Public properties @@ -90,14 +90,18 @@ public event EventHandler TransformCompleted /// Gets or sets types of transformation this gesture supports. /// /// Type flags. - public TransformType Type + public TransformGesture.TransformType Type { get { return type; } - set { type = value; } + set + { + type = value; + updateType(); + } } /// - /// Gets or sets minimum distance in cm for touch points to move for gesture to begin. + /// Gets or sets minimum distance in cm for pointers to move for gesture to begin. /// /// Minimum value in cm user must move their fingers to start this gesture. public float ScreenTransformThreshold @@ -110,41 +114,34 @@ public float ScreenTransformThreshold } } - /// - /// Gets delta rotation between this frame and last frame in degrees. - /// - public float DeltaRotation + /// + public TransformGesture.TransformType TransformMask { - get { return deltaRotation; } + get { return transformMask; } } - /// - /// Contains local delta scale when gesture is recognized. - /// Value is between 0 and +infinity, where 1 is no scale, 0.5 is scaled in half, 2 scaled twice. - /// - public float DeltaScale + /// + public Vector3 DeltaPosition { - get { return deltaScale; } + get { return deltaPosition; } + } + + /// + public float DeltaRotation + { + get { return deltaRotation; } } /// - public override Vector2 ScreenPosition + public float DeltaScale { - get - { - if (NumTouches == 0) return TouchManager.INVALID_POSITION; - return activeTouches[0].Position; - } + get { return deltaScale; } } /// - public override Vector2 PreviousScreenPosition + public Vector3 RotationAxis { - get - { - if (NumTouches == 0) return TouchManager.INVALID_POSITION; - return activeTouches[0].PreviousPosition; - } + get { return rotationAxis; } } #endregion @@ -162,9 +159,14 @@ public override Vector2 PreviousScreenPosition protected float screenTransformPixelThresholdSquared; /// - /// The cached collider. + /// The bit mask of what transform operations happened this frame. + /// + protected TransformGesture.TransformType transformMask; + + /// + /// Calculated delta position. /// - protected Collider cachedCollider; + protected Vector3 deltaPosition; /// /// Calculated delta rotation. @@ -177,63 +179,62 @@ public override Vector2 PreviousScreenPosition protected float deltaScale; /// - /// Translation buffer. + /// Rotation axis to use with deltaRotation. /// - protected Vector2 screenPixelTranslationBuffer; + protected Vector3 rotationAxis = new Vector3(0, 0, 1); /// - /// Rotation buffer. - /// - protected float screenPixelRotationBuffer; - - /// - /// Angle buffer. - /// - protected float angleBuffer; - - /// - /// Screen space scaling buffer. + /// Indicates whether transformation started; /// - protected float screenPixelScalingBuffer; + protected bool isTransforming = false; /// - /// Scaling buffer. + /// Indicates if current position is being overridden for the next frame. . /// - protected float scaleBuffer; + protected bool targetPositionOverridden = false; - /// - /// Indicates whether transformation started; - /// - protected bool isTransforming = false; /// - /// Touches moved this frame. + /// Target overridden position. . /// - protected List movedTouches = new List(5); + protected Vector3 targetPosition; /// - /// Layer projection parameters. + /// The type of the transforms this gesture can dispatch. /// - protected ProjectionParams projectionParams; - [SerializeField] - private TransformType type = TransformType.Scaling | TransformType.Rotation; + protected TransformGesture.TransformType type = TransformGesture.TransformType.Translation | TransformGesture.TransformType.Scaling | + TransformGesture.TransformType.Rotation; [SerializeField] private float screenTransformThreshold = 0.1f; #endregion + #region Public methods + + /// + /// Overrides the target position used in calculations this frame. If used, has to be set after every transform event. . + /// + /// Target position. + public void OverrideTargetPosition(Vector3 position) + { + targetPositionOverridden = true; + targetPosition = position; + } + + #endregion + #region Unity methods #if TOUCHSCRIPT_DEBUG - /// + /// protected override void Awake() { base.Awake(); debugID = DebugHelper.GetDebugId(this); - debugTouchSize = Vector2.one * TouchManager.Instance.DotsPerCentimeter * 1.1f; + debugPointerSize = Vector2.one*TouchManager.Instance.DotsPerCentimeter*1.1f; } #endif @@ -241,9 +242,8 @@ protected override void Awake() protected override void OnEnable() { base.OnEnable(); - - cachedCollider = GetComponent(); updateScreenTransformThreshold(); + updateType(); } #endregion @@ -251,14 +251,12 @@ protected override void OnEnable() #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); + base.pointersPressed(pointers); - if (activeTouches.Count == 1) projectionParams = activeTouches[0].ProjectionParams; - - if (touchesNumState == TouchesNumState.PassedMaxThreshold || - touchesNumState == TouchesNumState.PassedMinMaxThreshold) + if (pointersNumState == PointersNumState.PassedMaxThreshold || + pointersNumState == PointersNumState.PassedMinMaxThreshold) { switch (State) { @@ -267,15 +265,18 @@ protected override void touchBegan(TouchPoint touch) setState(GestureState.Ended); break; } + } else if (pointersNumState == PointersNumState.PassedMinThreshold) + { + setState(GestureState.Possible); } } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - base.touchEnded(touch); + base.pointersReleased(pointers); - if (touchesNumState == TouchesNumState.PassedMinThreshold) + if (pointersNumState == PointersNumState.PassedMinThreshold) { switch (State) { @@ -283,6 +284,9 @@ protected override void touchEnded(TouchPoint touch) case GestureState.Changed: setState(GestureState.Ended); break; + case GestureState.Possible: + setState(GestureState.Idle); + break; } } } @@ -293,18 +297,21 @@ protected override void onBegan() base.onBegan(); if (transformStartedInvoker != null) transformStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) - { SendMessageTarget.SendMessage(TRANSFORM_START_MESSAGE, this, SendMessageOptions.DontRequireReceiver); - } + if (UseUnityEvents) OnTransformStart.Invoke(this); } /// protected override void onChanged() { base.onChanged(); + + targetPositionOverridden = false; + if (transformedInvoker != null) transformedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TRANSFORM_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (UseUnityEvents) OnTransform.Invoke(this); } /// @@ -312,29 +319,11 @@ protected override void onRecognized() { base.onRecognized(); - // need to clear moved touches updateMoved() wouldn't fire in a wrong state - // yes, if moved and released the same frame movement data will be lost - movedTouches.Clear(); if (transformCompletedInvoker != null) transformCompletedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); if (UseSendMessage && SendMessageTarget != null) SendMessageTarget.SendMessage(TRANSFORM_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver); - } - - /// - protected override void onFailed() - { - base.onFailed(); - - movedTouches.Clear(); - } - - /// - protected override void onCancelled() - { - base.onCancelled(); - - movedTouches.Clear(); + if (UseUnityEvents) OnTransformComplete.Invoke(this); } /// @@ -342,21 +331,8 @@ protected override void reset() { base.reset(); - deltaRotation = 0f; - deltaScale = 1f; - - screenPixelTranslationBuffer = Vector2.zero; - screenPixelRotationBuffer = 0f; - angleBuffer = 0; - screenPixelScalingBuffer = 0f; - scaleBuffer = 1f; - - movedTouches.Clear(); + resetValues(); isTransforming = false; - -#if TOUCHSCRIPT_DEBUG - clearDebug(); -#endif } #endregion @@ -364,70 +340,25 @@ protected override void reset() #region Protected methods /// - /// Checks if there are touch points in moved list which matter for the gesture. - /// - /// true if there are relevant touch points; false otherwise. - protected virtual bool relevantTouches() - { - // We care only about the first touch point - var count = movedTouches.Count; - for (var i = 0; i < count; i++) - { - if (movedTouches[i] == activeTouches[0]) return true; - } - return false; - } - - /// - /// Returns screen position of a point with index 0. + /// Updates the type of the gesture. /// - protected virtual Vector2 getPointScreenPosition() - { - return activeTouches[0].Position; - } + protected virtual void updateType() {} /// - /// Returns previous screen position of a point with index 0. + /// Resets the frame delta values. /// - protected virtual Vector2 getPointPreviousScreenPosition() - { - return activeTouches[0].PreviousPosition; - } + protected void resetValues() + { + deltaPosition = Vector3.zero; + deltaRotation = 0f; + deltaScale = 1f; + transformMask = 0; + } #if TOUCHSCRIPT_DEBUG protected int debugID; protected Coroutine debugCoroutine; - protected Vector2 debugTouchSize; - - protected virtual void clearDebug() - { - GLDebug.RemoveFigure(debugID); - GLDebug.RemoveFigure(debugID + 1); - GLDebug.RemoveFigure(debugID + 2); - - if (debugCoroutine != null) StopCoroutine(debugCoroutine); - debugCoroutine = null; - } - - protected void drawDebugDelayed(Vector2 point1, Vector2 point2) - { - if (debugCoroutine != null) StopCoroutine(debugCoroutine); - debugCoroutine = StartCoroutine(doDrawDebug(point1, point2)); - } - - protected virtual void drawDebug(Vector2 point1, Vector2 point2) - { - var color = State == GestureState.Possible ? Color.red : Color.green; - GLDebug.DrawSquareScreenSpace(debugID + 1, point2, 0f, debugTouchSize, color, float.PositiveInfinity); - GLDebug.DrawLineScreenSpace(debugID + 2, point1, point2, color, float.PositiveInfinity); - } - - private IEnumerator doDrawDebug(Vector2 point1, Vector2 point2) - { - yield return new WaitForEndOfFrame(); - - drawDebug(point1, point2); - } + protected Vector2 debugPointerSize; #endif #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Base/TransformGestureBase.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Gestures/Base/TransformGestureBase.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Base/TransformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs similarity index 51% rename from Source/Assets/TouchScript/Scripts/Gestures/Base/TransformGestureBase.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs index a8a900608..1f7884624 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Base/TransformGestureBase.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs @@ -2,106 +2,34 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using System; using System.Collections.Generic; using TouchScript.Layers; -using TouchScript.Utils; using TouchScript.Utils.Geom; +using TouchScript.Pointers; using UnityEngine; #if TOUCHSCRIPT_DEBUG using System.Collections; -using TouchScript.Utils.Debug; +using TouchScript.Debugging.GL; #endif -namespace TouchScript.Gestures.Base +namespace TouchScript.Gestures.TransformGestures.Base { /// - /// Abstract base class for Transform Gestures. + /// Abstract base classfor two-point transform gestures. /// - public abstract class TransformGestureBase : Gesture + public abstract class TwoPointTransformGestureBase : TransformGestureBase { #region Constants - /// - /// Types of transformation. - /// - [Flags] - public enum TransformType - { - /// - /// Translation. - /// - Translation = 0x1, - - /// - /// Rotation. - /// - Rotation = 0x2, - - /// - /// Scaling. - /// - Scaling = 0x4 - } - - /// - /// Message name when gesture starts - /// - public const string TRANSFORM_START_MESSAGE = "OnTransformStart"; - - /// - /// Message name when gesture updates - /// - public const string TRANSFORM_MESSAGE = "OnTransform"; - - /// - /// Message name when gesture ends - /// - public const string TRANSFORM_COMPLETE_MESSAGE = "OnTransformComplete"; - #endregion #region Events - /// - public event EventHandler TransformStarted - { - add { transformStartedInvoker += value; } - remove { transformStartedInvoker -= value; } - } - - /// - public event EventHandler Transformed - { - add { transformedInvoker += value; } - remove { transformedInvoker -= value; } - } - - /// - public event EventHandler TransformCompleted - { - add { transformCompletedInvoker += value; } - remove { transformCompletedInvoker -= value; } - } - - // Needed to overcome iOS AOT limitations - private EventHandler transformStartedInvoker, transformedInvoker, transformCompletedInvoker; - #endregion #region Public properties - /// - /// Gets or sets types of transformation this gesture supports. - /// - /// Type flags. - public TransformType Type - { - get { return type; } - set { type = value; } - } - /// /// Gets or sets minimum distance between 2 points in cm for gesture to begin. /// @@ -116,67 +44,6 @@ public virtual float MinScreenPointsDistance } } - /// - /// Gets or sets minimum distance in cm for touch points to move for gesture to begin. - /// - /// Minimum value in cm user must move their fingers to start this gesture. - public float ScreenTransformThreshold - { - get { return screenTransformThreshold; } - set - { - screenTransformThreshold = value; - updateScreenTransformThreshold(); - } - } - - /// - /// Gets delta position between this frame and the last frame in world coordinates. - /// - public Vector3 DeltaPosition - { - get { return deltaPosition; } - } - - /// - /// Gets delta rotation between this frame and last frame in degrees. - /// - public float DeltaRotation - { - get { return deltaRotation; } - } - - /// - /// Contains local delta scale when gesture is recognized. - /// Value is between 0 and +infinity, where 1 is no scale, 0.5 is scaled in half, 2 scaled twice. - /// - public float DeltaScale - { - get { return deltaScale; } - } - - /// - public override Vector2 ScreenPosition - { - get - { - if (NumTouches == 0) return TouchManager.INVALID_POSITION; - if (NumTouches == 1) return activeTouches[0].Position; - return (getPointScreenPosition(0) + getPointScreenPosition(1)) * .5f; - } - } - - /// - public override Vector2 PreviousScreenPosition - { - get - { - if (NumTouches == 0) return TouchManager.INVALID_POSITION; - if (NumTouches == 1) return activeTouches[0].PreviousPosition; - return (getPointPreviousScreenPosition(0) + getPointPreviousScreenPosition(1)) * .5f; - } - } - #endregion #region Private variables @@ -191,31 +58,6 @@ public override Vector2 PreviousScreenPosition /// protected float minScreenPointsPixelDistanceSquared; - /// - /// in pixels. - /// - protected float screenTransformPixelThreshold; - - /// - /// in pixels squared. - /// - protected float screenTransformPixelThresholdSquared; - - /// - /// Calculated delta position. - /// - protected Vector3 deltaPosition; - - /// - /// Calculated delta rotation. - /// - protected float deltaRotation; - - /// - /// Calculated delta scale. - /// - protected float deltaScale; - /// /// Translation buffer. /// @@ -241,169 +83,161 @@ public override Vector2 PreviousScreenPosition /// protected float scaleBuffer; - /// - /// Indicates whether transformation started; - /// - protected bool isTransforming = false; - - /// - /// Touches moved this frame. - /// - protected List movedTouches = new List(5); - - /// - /// Layer projection parameters. - /// - protected ProjectionParams projectionParams; - - [SerializeField] - private TransformType type = TransformType.Translation | TransformType.Scaling | - TransformType.Rotation; - [SerializeField] private float minScreenPointsDistance = 0.5f; - [SerializeField] - private float screenTransformThreshold = 0.1f; - #endregion #region Unity methods -#if TOUCHSCRIPT_DEBUG - /// - protected override void Awake() - { - base.Awake(); - - debugID = DebugHelper.GetDebugId(this); - debugTouchSize = Vector2.one*TouchManager.Instance.DotsPerCentimeter*1.1f; - } -#endif - /// protected override void OnEnable() { base.OnEnable(); - updateMinScreenPointsDistance(); - updateScreenTransformThreshold(); - - TouchManager.Instance.FrameFinished += frameFinishedHandler; - } - - /// - protected override void OnDisable() - { - base.OnDisable(); - - if (TouchManager.Instance != null) TouchManager.Instance.FrameFinished -= frameFinishedHandler; } #endregion #region Gesture callbacks - /// - protected override void touchBegan(TouchPoint touch) - { - base.touchBegan(touch); - - if (NumTouches == 1) projectionParams = activeTouches[0].ProjectionParams; - - if (touchesNumState == TouchesNumState.PassedMaxThreshold || - touchesNumState == TouchesNumState.PassedMinMaxThreshold) - { - switch (State) - { - case GestureState.Began: - case GestureState.Changed: - setState(GestureState.Ended); - break; - } - } #if TOUCHSCRIPT_DEBUG - else drawDebugDelayed(getNumPoints()); -#endif - } - /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchMoved(touch); + base.pointersPressed(pointers); - movedTouches.Add(touch); + if (!(pointersNumState == PointersNumState.PassedMaxThreshold || + pointersNumState == PointersNumState.PassedMinMaxThreshold)) + drawDebugDelayed(getNumPoints()); } +#endif /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { - base.touchEnded(touch); + base.pointersUpdated(pointers); - if (touchesNumState == TouchesNumState.PassedMinThreshold) - { - switch (State) - { - case GestureState.Began: - case GestureState.Changed: - setState(GestureState.Ended); - break; - } - } + var projectionParams = activePointers[0].ProjectionParams; + var dP = deltaPosition = Vector3.zero; + var dR = deltaRotation = 0; + var dS = deltaScale = 1f; #if TOUCHSCRIPT_DEBUG - else drawDebugDelayed(getNumPoints()); + drawDebugDelayed(getNumPoints()); #endif - } - /// - protected override void onBegan() - { - base.onBegan(); - if (transformStartedInvoker != null) transformStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); - if (UseSendMessage && SendMessageTarget != null) + if (pointersNumState != PointersNumState.InRange) return; + + var translationEnabled = (Type & TransformGesture.TransformType.Translation) == TransformGesture.TransformType.Translation; + var rotationEnabled = (Type & TransformGesture.TransformType.Rotation) == TransformGesture.TransformType.Rotation; + var scalingEnabled = (Type & TransformGesture.TransformType.Scaling) == TransformGesture.TransformType.Scaling; + + // one pointer or one cluster (points might be too close to each other for 2 clusters) + if (getNumPoints() == 1 || (!rotationEnabled && !scalingEnabled)) { - SendMessageTarget.SendMessage(TRANSFORM_START_MESSAGE, this, SendMessageOptions.DontRequireReceiver); + if (!translationEnabled) return; // don't look for translates + if (!relevantPointers1(pointers)) return; + + // translate using one point + dP = doOnePointTranslation(getPointPreviousScreenPosition(0), getPointScreenPosition(0), projectionParams); } - } + else + { + // Make sure that we actually care about the pointers moved. + if (!relevantPointers2(pointers)) return; - /// - protected override void onChanged() - { - base.onChanged(); - if (transformedInvoker != null) transformedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); - if (UseSendMessage && SendMessageTarget != null) - SendMessageTarget.SendMessage(TRANSFORM_MESSAGE, this, SendMessageOptions.DontRequireReceiver); - } + var newScreenPos1 = getPointScreenPosition(0); + var newScreenPos2 = getPointScreenPosition(1); - /// - protected override void onRecognized() - { - base.onRecognized(); - - // need to clear moved touches updateMoved() wouldn't fire in a wrong state - // if moved and released the same frame movement data will be lost - movedTouches.Clear(); - if (transformCompletedInvoker != null) - transformCompletedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); - if (UseSendMessage && SendMessageTarget != null) - SendMessageTarget.SendMessage(TRANSFORM_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver); - } + // Here we can't reuse last frame screen positions because points 0 and 1 can change. + // For example if the first of 3 fingers is lifted off. + var oldScreenPos1 = getPointPreviousScreenPosition(0); + var oldScreenPos2 = getPointPreviousScreenPosition(1); - /// - protected override void onFailed() - { - base.onFailed(); + var newScreenDelta = newScreenPos2 - newScreenPos1; + if (newScreenDelta.sqrMagnitude > minScreenPointsPixelDistanceSquared) + { + if (rotationEnabled) + { + if (isTransforming) + { + dR = doRotation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); + } + else + { + float d1, d2; + // Find how much we moved perpendicular to the line (oldScreenPos1, oldScreenPos2) + TwoD.PointToLineDistance2(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, + out d1, out d2); + screenPixelRotationBuffer += (d1 - d2); + angleBuffer += doRotation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); - movedTouches.Clear(); - } + if (screenPixelRotationBuffer * screenPixelRotationBuffer >= + screenTransformPixelThresholdSquared) + { + isTransforming = true; + dR = angleBuffer; + } + } + } - /// - protected override void onCancelled() - { - base.onCancelled(); + if (scalingEnabled) + { + if (isTransforming) + { + dS *= doScaling(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); + } + else + { + var oldScreenDelta = oldScreenPos2 - oldScreenPos1; + var newDistance = newScreenDelta.magnitude; + var oldDistance = oldScreenDelta.magnitude; + screenPixelScalingBuffer += newDistance - oldDistance; + scaleBuffer *= doScaling(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); + + if (screenPixelScalingBuffer * screenPixelScalingBuffer >= + screenTransformPixelThresholdSquared) + { + isTransforming = true; + dS = scaleBuffer; + } + } + } + + if (translationEnabled) + { + if (dR == 0 && dS == 1) dP = doOnePointTranslation(oldScreenPos1, newScreenPos1, projectionParams); + else + dP = doTwoPointTranslation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, dR, dS, projectionParams); + } + } + else if (translationEnabled) + { + // points are too close, translate using one point + dP = doOnePointTranslation(oldScreenPos1, newScreenPos1, projectionParams); + } + } - movedTouches.Clear(); + if (dP != Vector3.zero) transformMask |= TransformGesture.TransformType.Translation; + if (dR != 0) transformMask |= TransformGesture.TransformType.Rotation; + if (dS != 1) transformMask |= TransformGesture.TransformType.Scaling; + + if (transformMask != 0) + { + if (State == GestureState.Possible) setState(GestureState.Began); + switch (State) + { + case GestureState.Began: + case GestureState.Changed: + deltaPosition = dP; + deltaRotation = dR; + deltaScale = dS; + setState(GestureState.Changed); + resetValues(); + break; + } + } } /// @@ -411,19 +245,12 @@ protected override void reset() { base.reset(); - deltaPosition = Vector3.zero; - deltaRotation = 0f; - deltaScale = 1f; - screenPixelTranslationBuffer = Vector2.zero; screenPixelRotationBuffer = 0f; angleBuffer = 0; screenPixelScalingBuffer = 0f; scaleBuffer = 1f; - movedTouches.Clear(); - isTransforming = false; - #if TOUCHSCRIPT_DEBUG clearDebug(); #endif @@ -499,36 +326,38 @@ protected virtual Vector3 doTwoPointTranslation(Vector2 oldScreenPos1, Vector2 o /// Number of points. protected virtual int getNumPoints() { - return NumTouches; + return NumPointers; } /// - /// Checks if there are touch points in moved list which matter for the gesture. + /// Checks if there are pointers in the list which matter for the gesture. /// - /// true if there are relevant touch points; false otherwise. - protected virtual bool relevantTouches1() + /// List of pointers. + /// true if there are relevant pointers; false otherwise. + protected virtual bool relevantPointers1(IList pointers) { - // We care only about the first touch point - var count = movedTouches.Count; + // We care only about the first pointer + var count = pointers.Count; for (var i = 0; i < count; i++) { - if (movedTouches[i] == activeTouches[0]) return true; + if (pointers[i] == activePointers[0]) return true; } return false; } /// - /// Checks if there are touch points in moved list which matter for the gesture. + /// Checks if there are pointers in the list which matter for the gesture. /// - /// true if there are relevant touch points; false otherwise. - protected virtual bool relevantTouches2() + /// List of pointers. + /// true if there are relevant pointers; false otherwise. + protected virtual bool relevantPointers2(IList pointers) { - // We care only about the first and the second touch points - var count = movedTouches.Count; + // We care only about the first and the second pointers + var count = pointers.Count; for (var i = 0; i < count; i++) { - var touch = movedTouches[i]; - if (touch == activeTouches[0] || touch == activeTouches[1]) return true; + var pointer = pointers[i]; + if (pointer == activePointers[0] || pointer == activePointers[1]) return true; } return false; } @@ -539,7 +368,7 @@ protected virtual bool relevantTouches2() /// The index. protected virtual Vector2 getPointScreenPosition(int index) { - return activeTouches[index].Position; + return activePointers[index].Position; } /// @@ -548,14 +377,10 @@ protected virtual Vector2 getPointScreenPosition(int index) /// The index. protected virtual Vector2 getPointPreviousScreenPosition(int index) { - return activeTouches[index].PreviousPosition; + return activePointers[index].PreviousPosition; } #if TOUCHSCRIPT_DEBUG - protected int debugID; - protected Coroutine debugCoroutine; - protected Vector2 debugTouchSize; - protected virtual void clearDebug() { GLDebug.RemoveFigure(debugID); @@ -580,7 +405,7 @@ protected virtual void drawDebug(int touchPoints) switch (touchPoints) { case 1: - GLDebug.DrawSquareScreenSpace(debugID, getPointScreenPosition(0), 0f, debugTouchSize, color, + GLDebug.DrawSquareScreenSpace(debugID, getPointScreenPosition(0), 0f, debugPointerSize, color, float.PositiveInfinity); GLDebug.RemoveFigure(debugID + 1); GLDebug.RemoveFigure(debugID + 2); @@ -588,12 +413,12 @@ protected virtual void drawDebug(int touchPoints) default: var newScreenPos1 = getPointScreenPosition(0); var newScreenPos2 = getPointScreenPosition(1); - GLDebug.DrawSquareScreenSpace(debugID, newScreenPos1, 0f, debugTouchSize, color, + GLDebug.DrawSquareScreenSpace(debugID, newScreenPos1, 0f, debugPointerSize, color, float.PositiveInfinity); - GLDebug.DrawSquareScreenSpace(debugID + 1, newScreenPos2, 0f, debugTouchSize, color, + GLDebug.DrawSquareScreenSpace(debugID + 1, newScreenPos2, 0f, debugPointerSize, color, float.PositiveInfinity); GLDebug.DrawLineWithCrossScreenSpace(debugID + 2, newScreenPos1, newScreenPos2, .5f, - debugTouchSize * .3f, color, float.PositiveInfinity); + debugPointerSize * .3f, color, float.PositiveInfinity); break; } } @@ -610,156 +435,12 @@ private IEnumerator doDrawDebug(int touchPoints) #region Private functions - private void updateMoved() - { -#if TOUCHSCRIPT_DEBUG - drawDebugDelayed(getNumPoints()); -#endif - - var numPoints = getNumPoints(); - if (numPoints == 0) return; - - var translationEnabled = (Type & TransformType.Translation) == TransformType.Translation; - var rotationEnabled = (Type & TransformType.Rotation) == TransformType.Rotation; - var scalingEnabled = (Type & TransformType.Scaling) == TransformType.Scaling; - - var dP = deltaPosition = Vector3.zero; - var dR = deltaRotation = 0; - var dS = deltaScale = 1f; - - // one touch or one cluster (points might be too close to each other for 2 clusters) - - if (numPoints == 1 || (!rotationEnabled && !scalingEnabled)) - { - if (!translationEnabled) return; // don't look for translates - if (!relevantTouches1()) return; - - // translate using one point - dP = doOnePointTranslation(getPointPreviousScreenPosition(0), getPointScreenPosition(0), projectionParams); - } - else if (numPoints >= 2) - { - // Make sure that we actually care about the touch moved. - if (!relevantTouches2()) return; - - var newScreenPos1 = getPointScreenPosition(0); - var newScreenPos2 = getPointScreenPosition(1); - - // Here we can't reuse last frame screen positions because points 0 and 1 can change. - // For example if the first of 3 fingers is lifted off. - var oldScreenPos1 = getPointPreviousScreenPosition(0); - var oldScreenPos2 = getPointPreviousScreenPosition(1); - - var newScreenDelta = newScreenPos2 - newScreenPos1; - if (newScreenDelta.sqrMagnitude > minScreenPointsPixelDistanceSquared) - { - if (rotationEnabled) - { - if (isTransforming) - { - dR = doRotation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); - } - else - { - float d1, d2; - // Find how much we moved perpendicular to the line (oldScreenPos1, oldScreenPos2) - TwoD.PointToLineDistance2(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, - out d1, out d2); - screenPixelRotationBuffer += (d1 - d2); - angleBuffer += doRotation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); - - if (screenPixelRotationBuffer * screenPixelRotationBuffer >= - screenTransformPixelThresholdSquared) - { - isTransforming = true; - dR = angleBuffer; - } - } - } - - if (scalingEnabled) - { - if (isTransforming) - { - dS *= doScaling(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); - } - else - { - var oldScreenDelta = oldScreenPos2 - oldScreenPos1; - var newDistance = newScreenDelta.magnitude; - var oldDistance = oldScreenDelta.magnitude; - screenPixelScalingBuffer += newDistance - oldDistance; - scaleBuffer *= doScaling(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, projectionParams); - - if (screenPixelScalingBuffer * screenPixelScalingBuffer >= - screenTransformPixelThresholdSquared) - { - isTransforming = true; - dS = scaleBuffer; - } - } - } - - if (translationEnabled) - { - if (dR == 0 && dS == 1) dP = doOnePointTranslation(oldScreenPos1, newScreenPos1, projectionParams); - else - dP = doTwoPointTranslation(oldScreenPos1, oldScreenPos2, newScreenPos1, newScreenPos2, dR, dS, projectionParams); - } - } - else if (translationEnabled) - { - // points are too close, translate using one point - dP = doOnePointTranslation(oldScreenPos1, newScreenPos1, projectionParams); - } - } - - if (dP != Vector3.zero || dR != 0 || dS != 1) - { - if (State == GestureState.Possible) - { - if (touchesNumState == TouchesNumState.InRange) setState(GestureState.Began); - else - { - // Wrong number of touches! - setState(GestureState.Failed); - return; - } - } - switch (State) - { - case GestureState.Began: - case GestureState.Changed: - deltaPosition = dP; - deltaRotation = dR; - deltaScale = dS; - setState(GestureState.Changed); - break; - } - } - } - private void updateMinScreenPointsDistance() { minScreenPointsPixelDistance = minScreenPointsDistance * touchManager.DotsPerCentimeter; minScreenPointsPixelDistanceSquared = minScreenPointsPixelDistance * minScreenPointsPixelDistance; } - private void updateScreenTransformThreshold() - { - screenTransformPixelThreshold = screenTransformThreshold * touchManager.DotsPerCentimeter; - screenTransformPixelThresholdSquared = screenTransformPixelThreshold * screenTransformPixelThreshold; - } - - private void frameFinishedHandler(object sender, EventArgs eventArgs) - { - if (movedTouches.Count > 0) - { - updateMoved(); - movedTouches.Clear(); - } - } - #endregion } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs.meta new file mode 100644 index 000000000..d70fd5673 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f8c5d5231ca8e465ab5739f62d26e8fa +timeCreated: 1477866827 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered.meta diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs similarity index 59% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs index 915a732fe..863058e5b 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs @@ -2,23 +2,25 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; -namespace TouchScript.Gestures.Clustered +namespace TouchScript.Gestures.TransformGestures.Clustered { /// - /// ScreenTransformGesture which works with centroid of all touches instead of with just the first touch. + /// PinnedTransformGesture which works with centroid of all pointers instead of with just the first one. /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Pinned Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_Clustered_ClusteredPinnedTransformGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_Clustered_ClusteredPinnedTransformGesture.htm")] public class ClusteredPinnedTransformGesture : PinnedTransformGesture { #region Protected methods /// - protected override bool relevantTouches() + protected override bool relevantPointers(IList pointers) { return true; } @@ -26,13 +28,13 @@ protected override bool relevantTouches() /// protected override Vector2 getPointScreenPosition() { - return ClusterUtils.Get2DCenterPosition(activeTouches); + return ClusterUtils.Get2DCenterPosition(activePointers); } /// protected override Vector2 getPointPreviousScreenPosition() { - return ClusterUtils.GetPrevious2DCenterPosition(activeTouches); + return ClusterUtils.GetPrevious2DCenterPosition(activePointers); } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs.meta index c89441338..dc28d9407 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredPinnedTransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs similarity index 61% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs index c4f8acfc0..9f34c1787 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs @@ -2,49 +2,51 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; -namespace TouchScript.Gestures.Clustered +namespace TouchScript.Gestures.TransformGestures.Clustered { /// - /// ScreenTransformGesture which splits all touch points into 2 clusters and works with them. + /// ScreenTransformGesture which splits all pointers into 2 clusters and works with them. /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Screen Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_Clustered_ClusteredScreenTransformGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_Clustered_ClusteredScreenTransformGesture.htm")] public class ClusteredScreenTransformGesture : ScreenTransformGesture { #region Private variables - private Clusters.Clusters clusters = new Clusters.Clusters(); + private Clusters.Clusters2D clusters = new Clusters.Clusters2D(); #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - clusters.AddPoint(touch); + clusters.AddPoints(pointers); - base.touchBegan(touch); + base.pointersPressed(pointers); } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { clusters.Invalidate(); - base.touchMoved(touch); + base.pointersUpdated(pointers); } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - clusters.RemovePoint(touch); + clusters.RemovePoints(pointers); - base.touchEnded(touch); + base.pointersReleased(pointers); } /// @@ -63,18 +65,18 @@ protected override void reset() protected override int getNumPoints() { if (clusters.HasClusters) return 2; - if (NumTouches > 0) return 1; + if (NumPointers > 0) return 1; return 0; } /// - protected override bool relevantTouches1() + protected override bool relevantPointers1(IList pointers) { return true; } /// - protected override bool relevantTouches2() + protected override bool relevantPointers2(IList pointers) { return true; } @@ -82,7 +84,7 @@ protected override bool relevantTouches2() /// protected override Vector2 getPointScreenPosition(int index) { - if (!clusters.HasClusters) return ClusterUtils.Get2DCenterPosition(activeTouches); + if (!clusters.HasClusters) return ClusterUtils.Get2DCenterPosition(activePointers); return clusters.GetCenterPosition(index); } @@ -90,7 +92,7 @@ protected override Vector2 getPointScreenPosition(int index) /// protected override Vector2 getPointPreviousScreenPosition(int index) { - if (!clusters.HasClusters) return ClusterUtils.GetPrevious2DCenterPosition(activeTouches); + if (!clusters.HasClusters) return ClusterUtils.GetPrevious2DCenterPosition(activePointers); return clusters.GetPreviousCenterPosition(index); } diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs.meta index addbcced0..2994ee866 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredScreenTransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs similarity index 61% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs index 23bbec529..cbd15f599 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs @@ -2,49 +2,51 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using System.Collections.Generic; using TouchScript.Utils; +using TouchScript.Pointers; using UnityEngine; -namespace TouchScript.Gestures.Clustered +namespace TouchScript.Gestures.TransformGestures.Clustered { /// - /// TransformGesture which splits all touch points into 2 clusters and works with them. + /// TransformGesture which splits all pointers into 2 clusters and works with them. /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_Clustered_ClusteredTransformGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_Clustered_ClusteredTransformGesture.htm")] public class ClusteredTransformGesture : TransformGesture { #region Private variables - private Clusters.Clusters clusters = new Clusters.Clusters(); + private Clusters.Clusters2D clusters = new Clusters.Clusters2D(); #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - clusters.AddPoint(touch); + clusters.AddPoints(pointers); - base.touchBegan(touch); + base.pointersPressed(pointers); } /// - protected override void touchMoved(TouchPoint touch) + protected override void pointersUpdated(IList pointers) { clusters.Invalidate(); - base.touchMoved(touch); + base.pointersUpdated(pointers); } /// - protected override void touchEnded(TouchPoint touch) + protected override void pointersReleased(IList pointers) { - clusters.RemovePoint(touch); + clusters.RemovePoints(pointers); - base.touchEnded(touch); + base.pointersReleased(pointers); } /// @@ -63,18 +65,18 @@ protected override void reset() protected override int getNumPoints() { if (clusters.HasClusters) return 2; - if (NumTouches > 0) return 1; + if (NumPointers > 0) return 1; return 0; } /// - protected override bool relevantTouches1() + protected override bool relevantPointers1(IList pointers) { return true; } /// - protected override bool relevantTouches2() + protected override bool relevantPointers2(IList pointers) { return true; } @@ -82,7 +84,7 @@ protected override bool relevantTouches2() /// protected override Vector2 getPointScreenPosition(int index) { - if (!clusters.HasClusters) return ClusterUtils.Get2DCenterPosition(activeTouches); + if (!clusters.HasClusters) return ClusterUtils.Get2DCenterPosition(activePointers); return clusters.GetCenterPosition(index); } @@ -90,7 +92,7 @@ protected override Vector2 getPointScreenPosition(int index) /// protected override Vector2 getPointPreviousScreenPosition(int index) { - if (!clusters.HasClusters) return ClusterUtils.GetPrevious2DCenterPosition(activeTouches); + if (!clusters.HasClusters) return ClusterUtils.GetPrevious2DCenterPosition(activePointers); return clusters.GetPreviousCenterPosition(index); } diff --git a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs.meta index 6e8f83d6b..a7df18aad 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Clustered/ClusteredTransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs new file mode 100644 index 000000000..98cf79937 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs @@ -0,0 +1,61 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using UnityEngine; + +namespace TouchScript.Gestures.TransformGestures +{ + /// + /// Gesture which performs some kind of transformation in 3d space, i.e. translation, rotation, scaling or a combination of these. + /// + public interface ITransformGesture + { + + /// + /// Occurs when gesture starts. + /// + event EventHandler TransformStarted; + + /// + /// Occurs when gesture data updates. + /// + event EventHandler Transformed; + + /// + /// Occurs when gesture finishes. + /// + event EventHandler TransformCompleted; + + /// + /// Contains transform operations which happened this frame. + /// + TransformGesture.TransformType TransformMask { get; } + + /// + /// Gets delta position between this frame and the last frame in world coordinates. + /// This value is only available during or events. + /// + Vector3 DeltaPosition { get; } + + /// + /// Gets delta rotation between this frame and last frame in degrees. + /// This value is only available during or events. + /// + float DeltaRotation { get; } + + /// + /// Contains local delta scale when gesture is recognized. + /// Value is between 0 and +infinity, where 1 is no scale, 0.5 is scaled in half, 2 scaled twice. + /// This value is only available during or events. + /// + float DeltaScale { get; } + + /// + /// Gets rotation axis of the gesture in world coordinates. + /// + /// Rotation axis of the gesture in world coordinates. + Vector3 RotationAxis { get; } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ITransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Gestures/ITransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs new file mode 100644 index 000000000..b7a992b78 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs @@ -0,0 +1,259 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Collections.Generic; +using TouchScript.Gestures.TransformGestures.Base; +using TouchScript.Layers; +using TouchScript.Utils.Geom; +using TouchScript.Pointers; +using UnityEngine.Profiling; + +#if TOUCHSCRIPT_DEBUG +using TouchScript.Debugging.GL; +#endif +using UnityEngine; + +namespace TouchScript.Gestures.TransformGestures +{ + /// + /// Recognizes a transform gesture around center of the object, i.e. one finger rotation, scaling or a combination of these. + /// + [AddComponentMenu("TouchScript/Gestures/Pinned Transform Gesture")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_PinnedTransformGesture.htm")] + public class PinnedTransformGesture : OnePointTrasformGestureBase + { + #region Constants + + #endregion + + #region Public properties + + /// + /// Gets or sets transform's projection type. + /// + /// Projection type. + public TransformGesture.ProjectionType Projection + { + get { return projection; } + set + { + if (projection == value) return; + projection = value; + if (Application.isPlaying) updateProjectionPlane(); + } + } + + /// + /// Gets or sets transform's projection plane normal. + /// + /// Projection plane normal. + public Vector3 ProjectionPlaneNormal + { + get + { + if (projection == TransformGesture.ProjectionType.Layer) return projectionLayer.WorldProjectionNormal; + return projectionPlaneNormal; + } + set + { + if (projection == TransformGesture.ProjectionType.Layer) projection = TransformGesture.ProjectionType.Object; + value.Normalize(); + if (projectionPlaneNormal == value) return; + projectionPlaneNormal = value; + if (Application.isPlaying) updateProjectionPlane(); + } + } + + /// + /// Plane where transformation occured. + /// + public Plane TransformPlane + { + get { return transformPlane; } + } + + #endregion + + #region Private variables + + [SerializeField] + private bool projectionProps; // Used in the custom inspector + + [SerializeField] + private TransformGesture.ProjectionType projection = TransformGesture.ProjectionType.Layer; + + [SerializeField] + private Vector3 projectionPlaneNormal = Vector3.forward; + + private TouchLayer projectionLayer; + private Plane transformPlane; + +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Public methods + + #endregion + + #region Unity methods + + /// + protected override void Awake() + { + base.Awake(); + + transformPlane = new Plane(); +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Pinned Transform Gesture"); +#endif + } + + /// + protected override void OnEnable() + { + base.OnEnable(); + + updateProjectionPlane(); + } + + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + + #endregion + + #region Gesture callbacks + + /// + protected override void pointersPressed(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); + + if (NumPointers == pointers.Count) + { + projectionLayer = activePointers[0].GetPressData().Layer; + updateProjectionPlane(); + +#if TOUCHSCRIPT_DEBUG + drawDebug(activePointers[0].ProjectionParams.ProjectFrom(cachedTransform.position), activePointers[0].Position); +#endif + } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + +#if UNITY_5_6_OR_NEWER + /// + protected override void pointersUpdated(IList pointers) + { + gestureSampler.Begin(); + + base.pointersUpdated(pointers); + + gestureSampler.End(); + } +#endif + + /// + protected override void pointersReleased(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); + +#if TOUCHSCRIPT_DEBUG + if (NumPointers == 0) clearDebug(); + else drawDebug(activePointers[0].ProjectionParams.ProjectFrom(cachedTransform.position), activePointers[0].Position); +#endif +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + #endregion + + #region Protected methods + + /// + protected override float doRotation(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, + ProjectionParams projectionParams) + { + var newVector = projectionParams.ProjectTo(newScreenPos, TransformPlane) - center; + var oldVector = projectionParams.ProjectTo(oldScreenPos, TransformPlane) - center; + var angle = Vector3.Angle(oldVector, newVector); + if (Vector3.Dot(Vector3.Cross(oldVector, newVector), TransformPlane.normal) < 0) + angle = -angle; + return angle; + } + + /// + protected override float doScaling(Vector3 center, Vector2 oldScreenPos, Vector2 newScreenPos, + ProjectionParams projectionParams) + { + var newVector = projectionParams.ProjectTo(newScreenPos, TransformPlane) - center; + var oldVector = projectionParams.ProjectTo(oldScreenPos, TransformPlane) - center; + return newVector.magnitude / oldVector.magnitude; + } + +#if TOUCHSCRIPT_DEBUG + protected override void clearDebug() + { + base.clearDebug(); + + GLDebug.RemoveFigure(debugID + 3); + } + + protected override void drawDebug(Vector2 point1, Vector2 point2) + { + base.drawDebug(point1, point2); + + if (!DebugMode) return; + GLDebug.DrawPlaneWithNormal(debugID + 3, cachedTransform.position, RotationAxis, 1f, GLDebug.MULTIPLY, float.PositiveInfinity); + } +#endif + + #endregion + + #region Private functions + + private void updateProjectionPlane() + { + if (!Application.isPlaying) return; + + switch (projection) + { + case TransformGesture.ProjectionType.Layer: + if (projectionLayer == null) + transformPlane = new Plane(cachedTransform.TransformDirection(Vector3.forward), + cachedTransform.position); + else transformPlane = new Plane(projectionLayer.WorldProjectionNormal, cachedTransform.position); + break; + case TransformGesture.ProjectionType.Object: + transformPlane = new Plane(cachedTransform.TransformDirection(projectionPlaneNormal), + cachedTransform.position); + break; + case TransformGesture.ProjectionType.Global: + transformPlane = new Plane(projectionPlaneNormal, cachedTransform.position); + break; + } + + rotationAxis = transformPlane.normal; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs.meta index f1dd73cfc..f934b7a13 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/PinnedTransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs similarity index 69% rename from Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs index ee6010cfa..16fb17847 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs @@ -2,29 +2,93 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Gestures.Base; +using TouchScript.Gestures.TransformGestures.Base; using TouchScript.Layers; using TouchScript.Utils.Geom; using UnityEngine; +using UnityEngine.Profiling; +using System.Collections.Generic; +using TouchScript.Pointers; -namespace TouchScript.Gestures +namespace TouchScript.Gestures.TransformGestures { /// /// Recognizes a transform gesture in screen space, i.e. translation, rotation, scaling or a combination of these. /// [AddComponentMenu("TouchScript/Gestures/Screen Transform Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_ScreenTransformGesture.htm")] - public class ScreenTransformGesture : TransformGestureBase, ITransformGesture + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_ScreenTransformGesture.htm")] + public class ScreenTransformGesture : TwoPointTransformGestureBase { - #region Public methods + + #region Private variables + +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + + #endregion + + #region Unity + + /// + protected override void Awake() + { + base.Awake(); + +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Screen Transform Gesture"); +#endif + } + + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + + #endregion + + #region Gesture callbacks + +#if UNITY_5_6_OR_NEWER + /// + protected override void pointersPressed(IList pointers) + { + gestureSampler.Begin(); + + base.pointersPressed(pointers); + + gestureSampler.End(); + } + + /// + protected override void pointersUpdated(IList pointers) + { + gestureSampler.Begin(); + + base.pointersUpdated(pointers); + + gestureSampler.End(); + } +#endif /// - public void ApplyTransform(Transform target) + protected override void pointersReleased(IList pointers) { - if (DeltaPosition != Vector3.zero) target.position += DeltaPosition; - if (!Mathf.Approximately(DeltaRotation, 0f)) - target.rotation = Quaternion.Euler(0, 0, DeltaRotation) * target.rotation; - if (!Mathf.Approximately(DeltaScale, 1f)) target.localScale *= DeltaScale; +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); + +#if TOUCHSCRIPT_DEBUG + if (getNumPoints() == 0) clearDebug(); + else drawDebugDelayed(getNumPoints()); +#endif + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs.meta index 4948188d7..c7436c8d8 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/ScreenTransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs similarity index 75% rename from Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs index 7658fb6f8..827792c94 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs @@ -1,26 +1,58 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Gestures.Base; +using System; +using System.Collections.Generic; +using TouchScript.Gestures.TransformGestures.Base; using TouchScript.Layers; using TouchScript.Utils; +using TouchScript.Pointers; +using UnityEngine.Profiling; + #if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.Debug; +using TouchScript.Debugging.GL; #endif using UnityEngine; -namespace TouchScript.Gestures +namespace TouchScript.Gestures.TransformGestures { /// /// Recognizes a transform gesture, i.e. translation, rotation, scaling or a combination of these. /// [AddComponentMenu("TouchScript/Gestures/Transform Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_TransformGesture.htm")] - public class TransformGesture : TransformGestureBase, ITransformGesture + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_TransformGesture.htm")] + public class TransformGesture : TwoPointTransformGestureBase { #region Constants + /// + /// Types of transformation. + /// + [Flags] + public enum TransformType + { + /// + /// No transform. + /// + None = 0, + + /// + /// Translation. + /// + Translation = 0x1, + + /// + /// Rotation. + /// + Rotation = 0x2, + + /// + /// Scaling. + /// + Scaling = 0x4 + } + /// /// Transform's projection type. /// @@ -99,19 +131,13 @@ public Vector3 LocalDeltaPosition get { return TransformUtils.GlobalToLocalVector(cachedTransform, DeltaPosition); } } - /// - /// Gets rotation axis of the gesture in world coordinates. - /// - /// Rotation axis of the gesture in world coordinates. - public Vector3 RotationAxis - { - get { return transformPlane.normal; } - } - #endregion #region Private variables + [SerializeField] + private bool projectionProps; // Used in the custom inspector + [SerializeField] private ProjectionType projection = ProjectionType.Layer; @@ -121,18 +147,14 @@ public Vector3 RotationAxis private TouchLayer projectionLayer; private Plane transformPlane; +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + #endregion #region Public methods - /// - public void ApplyTransform(Transform target) - { - if (!Mathf.Approximately(DeltaScale, 1f)) target.localScale *= DeltaScale; - if (!Mathf.Approximately(DeltaRotation, 0f)) target.rotation = Quaternion.AngleAxis(DeltaRotation, RotationAxis) * target.rotation; - if (DeltaPosition != Vector3.zero) target.position += DeltaPosition; - } - #endregion #region Unity methods @@ -141,37 +163,104 @@ public void ApplyTransform(Transform target) protected override void Awake() { base.Awake(); + transformPlane = new Plane(); +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Transform Gesture"); +#endif } /// protected override void OnEnable() { base.OnEnable(); + updateProjectionPlane(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks /// - protected override void touchBegan(TouchPoint touch) + protected override void pointersPressed(IList pointers) { - base.touchBegan(touch); +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersPressed(pointers); - if (State != GestureState.Possible) return; - if (NumTouches == 1) + if (NumPointers == pointers.Count) { - projectionLayer = activeTouches[0].Layer; + projectionLayer = activePointers[0].GetPressData().Layer; updateProjectionPlane(); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } +#if UNITY_5_6_OR_NEWER + /// + protected override void pointersUpdated(IList pointers) + { + gestureSampler.Begin(); + + base.pointersUpdated(pointers); + + gestureSampler.End(); + } +#endif + + /// + protected override void pointersReleased(IList pointers) + { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + + base.pointersReleased(pointers); + +#if TOUCHSCRIPT_DEBUG + if (getNumPoints() == 0) clearDebug(); + else drawDebugDelayed(getNumPoints()); +#endif + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif + } + + #endregion #region Protected methods + /// + /// Projects the point which was scaled and rotated. + /// + /// The point. + /// Delta rotation. + /// Delta scale. + /// The projection parameters. + /// + protected Vector3 projectScaledRotated(Vector2 point, float dR, float dS, ProjectionParams projectionParams) + { + var center = targetPositionOverridden ? targetPosition : cachedTransform.position; + var delta = projectionParams.ProjectTo(point, transformPlane) - center; + if (dR != 0) delta = Quaternion.AngleAxis(dR, RotationAxis) * delta; + if (dS != 0) delta = delta * dS; + return center + delta; + } + /// protected override float doRotation(Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, ProjectionParams projectionParams) @@ -238,15 +327,6 @@ protected override Vector3 doTwoPointTranslation(Vector2 oldScreenPos1, Vector2 return Vector3.zero; } - /// - private Vector3 projectScaledRotated(Vector2 point, float dR, float dS, ProjectionParams projectionParams) - { - var delta = projectionParams.ProjectTo(point, TransformPlane) - cachedTransform.position; - if (dR != 0) delta = Quaternion.AngleAxis(dR, RotationAxis) * delta; - if (dS != 0) delta = delta * dS; - return cachedTransform.position + delta; - } - #if TOUCHSCRIPT_DEBUG protected override void clearDebug() { @@ -255,12 +335,12 @@ protected override void clearDebug() GLDebug.RemoveFigure(debugID + 3); } - protected override void drawDebug(int touchPoints) + protected override void drawDebug(int pointers) { - base.drawDebug(touchPoints); + base.drawDebug(pointers); if (!DebugMode) return; - switch (touchPoints) + switch (pointers) { case 1: if (projection == ProjectionType.Global || projection == ProjectionType.Object) @@ -303,6 +383,8 @@ private void updateProjectionPlane() transformPlane = new Plane(projectionPlaneNormal, cachedTransform.position); break; } + + rotationAxis = transformPlane.normal; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs.meta rename to Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs.meta index 161fb15e1..1c3c80e0d 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGesture.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs deleted file mode 100644 index 7524ea5d7..000000000 --- a/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs +++ /dev/null @@ -1,196 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Utils; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace TouchScript.Gestures.UI -{ - /// - /// Gesture which receives touch input from TouchScript and routes it to Unity UI components on the same GameObject. - /// Mostly needed for UI buttons to work with . - /// - [AddComponentMenu("TouchScript/Gestures/UI Gesture")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Gestures_UI_UIGesture.htm")] - public class UIGesture : Gesture - { - #region Protected variables - - /// - /// Touch id -> pointer data. - /// - protected Dictionary pointerData = new Dictionary(); - - #endregion - - #region Gesture callbacks - - /// - public override bool CanPreventGesture(Gesture gesture) - { - if (Delegate == null) return false; - return !Delegate.ShouldRecognizeSimultaneously(this, gesture); - } - - /// - public override bool CanBePreventedByGesture(Gesture gesture) - { - if (Delegate == null) return false; - return !Delegate.ShouldRecognizeSimultaneously(this, gesture); - } - - /// - protected override void touchBegan(TouchPoint touch) - { - base.touchBegan(touch); - - if (NumTouches == 1) setState(GestureState.Began); - - var data = getPointerData(touch); - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerEnterHandler); - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerDownHandler); - } - - /// - protected override void touchMoved(TouchPoint touch) - { - base.touchMoved(touch); - - var data = getPointerData(touch); - if (TouchUtils.IsTouchOnTarget(touch, cachedTransform)) - { - if (!data.OnTarget) - { - data.OnTarget = true; - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerEnterHandler); - } - } - else - { - if (data.OnTarget) - { - data.OnTarget = false; - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerExitHandler); - } - } - setPointerData(touch, data); - } - - /// - protected override void touchEnded(TouchPoint touch) - { - base.touchEnded(touch); - - TouchData onTarget = new TouchData(); - var data = getPointerData(touch); - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerUpHandler); - if (data.OnTarget) onTarget = data; - removePointerData(touch); - - // One of the touches was released ontop of the target - if (onTarget.OnTarget) ExecuteEvents.Execute(gameObject, onTarget.Data, ExecuteEvents.pointerClickHandler); - - if (activeTouches.Count == 0) setState(GestureState.Ended); - } - - /// - protected override void touchCancelled(TouchPoint touch) - { - base.touchCancelled(touch); - - var data = getPointerData(touch); - ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerUpHandler); - removePointerData(touch); - - if (activeTouches.Count == 0) setState(GestureState.Ended); - } - - #endregion - - #region Protected methods - - /// - /// Gets or creates pointer data for touch. - /// - /// The touch. - /// Pointer data. - protected virtual TouchData getPointerData(TouchPoint touch) - { - TouchData data; - if (!pointerData.TryGetValue(touch.Id, out data)) - { - data = new TouchData - { - OnTarget = true, - Data = new PointerEventData(EventSystem.current) - { - pointerId = touch.Id, - pointerEnter = gameObject, - pointerPress = gameObject, - eligibleForClick = true, - delta = Vector2.zero, - dragging = false, - useDragThreshold = true, - position = touch.Position, - pressPosition = touch.Position, - pointerPressRaycast = touch.Hit.RaycastResult, - pointerCurrentRaycast = touch.Hit.RaycastResult - } - }; - pointerData.Add(touch.Id, data); - } - return data; - } - - /// - /// Sets pointer data for touch. - /// - /// The touch. - /// The data. - protected virtual void setPointerData(TouchPoint touch, TouchData data) - { - if (pointerData.ContainsKey(touch.Id)) pointerData[touch.Id] = data; - } - - /// - /// Removes pointer data for touch. - /// - /// The touch. - protected virtual void removePointerData(TouchPoint touch) - { - pointerData.Remove(touch.Id); - } - - #endregion - - /// - /// Touch pointer data value object. - /// - protected struct TouchData - { - /// - /// Is the object over the target it first hit? - /// - public bool OnTarget; - - /// - /// Pointer data for UI. - /// - public PointerEventData Data; - - /// - /// Initializes a new instance of the struct. - /// - /// if set to true touch is on target. - /// The data. - public TouchData(bool onTarget = false, PointerEventData data = null) - { - OnTarget = onTarget; - Data = data; - } - } - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs.meta deleted file mode 100644 index 068f87982..000000000 --- a/Source/Assets/TouchScript/Scripts/Gestures/UI/UIGesture.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c34dc6093a49a481db532b87b45132a4 -timeCreated: 1447582131 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Hit/HitData.cs b/Source/Assets/TouchScript/Scripts/Hit/HitData.cs new file mode 100644 index 000000000..a94e36171 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Hit/HitData.cs @@ -0,0 +1,318 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using TouchScript.Layers; +using UnityEngine; + +namespace TouchScript.Hit +{ + /// + /// An object representing a point hit by a pointer in 3D, 2D or UI space. + /// + public struct HitData + { + #region Consts + + /// + /// Type of hit + /// + [Flags] + public enum HitType + { + /// + /// An unknown hit. + /// + Unknown, + + /// + /// Nothing hit, but some object grabbed the pointer. + /// + Screen, + + /// + /// 3D hit. + /// + World3D, + + /// + /// 2D hit. + /// + World2D, + + /// + /// UI hit. + /// + UI + } + + #endregion + + #region Public properties + + /// + /// Gets the type of the hit. + /// + /// The type. + public HitType Type + { + get { return type; } + } + + /// + /// Gets target Target the hit. + /// + /// Hit Target. + public Transform Target + { + get { return target; } + } + + /// + /// Gets the layer which detected the hit. + /// + /// Hit layer. + public TouchLayer Layer + { + get { return layer; } + } + + /// + /// Gets raycast hit object for a 3D hit. + /// + /// Raycast hit object. + public RaycastHit RaycastHit + { + get { return raycastHit; } + } + + /// + /// Gets 2D raycast hit object for a 2D hit. + /// + /// 2D raycast hit object. + public RaycastHit2D RaycastHit2D + { + get { return raycastHit2D; } + } + + /// + /// Gets raycast hit for a UI hit. + /// + /// UI raycast hit object. + public RaycastHitUI RaycastHitUI + { + get { return raycastHitUI; } + } + + /// + /// Indicates if this is a Screen Space hit. + /// + public bool ScreenSpace + { + get { return screenSpace; } + } + + /// + /// Gets the point in 3D where raycast hit the object. + /// + /// Point in 3D. + public Vector3 Point + { + get + { + switch (type) + { + case HitType.World3D: + return raycastHit.point; + case HitType.World2D: + return raycastHit2D.point; + case HitType.UI: + return raycastHitUI.WorldPosition; + } + return Vector3.zero; + } + } + + /// + /// Gets the normal at the point in 3D wher eraycast hit the object. + /// + /// Normal vector. + public Vector3 Normal + { + get + { + switch (type) + { + case HitType.World3D: + return raycastHit.normal; + case HitType.World2D: + return raycastHit2D.normal; + case HitType.UI: + return raycastHitUI.WorldNormal; + } + return Vector3.forward; + } + } + + /// + /// Distance to the hit point. + /// + public float Distance + { + get + { + switch (type) + { + case HitType.World3D: + return raycastHit.distance; + case HitType.World2D: + return raycastHit2D.distance; + case HitType.UI: + return raycastHitUI.Distance; + } + return 0f; + } + } + + /// + /// Sorting layer of the hit target. + /// + public int SortingLayer + { + get + { + switch (type) + { + case HitType.World3D: + return 0; + case HitType.World2D: + if (sortingLayer == -1) updateSortingValues(); + return sortingLayer; + case HitType.UI: + return raycastHitUI.SortingLayer; + } + return 0; + } + } + + /// + /// Sorting order of the hit target. + /// + public int SortingOrder + { + get + { + switch (type) + { + case HitType.World3D: + return 0; + case HitType.World2D: + if (sortingLayer == -1) updateSortingValues(); + return sortingOrder; + case HitType.UI: + return raycastHitUI.SortingOrder; + } + return 0; + } + } + + #endregion + + #region Private variables + + private HitType type; + private Transform target; + private bool screenSpace; + private TouchLayer layer; + private RaycastHit raycastHit; + private RaycastHit2D raycastHit2D; + private RaycastHitUI raycastHitUI; + + private int sortingLayer; + private int sortingOrder; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the struct. + /// + /// Target Target. + /// Touch layer this hit came from. + /// If the hit is screenspace UI. + public HitData(Transform target, TouchLayer layer, bool screenSpace = false) + { + this.target = target; + this.layer = layer; + this.screenSpace = screenSpace; + + sortingLayer = -1; + sortingOrder = -1; + raycastHit = default(RaycastHit); + raycastHit2D = default(RaycastHit2D); + raycastHitUI = default(RaycastHitUI); + type = HitType.Screen; + } + + /// + /// Initializes a new instance of the struct from a 3D raycast. + /// + /// 3D raycast value. + /// Touch layer this hit came from. + /// If the hit is screenspace UI. + public HitData(RaycastHit value, TouchLayer layer, bool screenSpace = false) : this(value.collider.transform, layer, screenSpace) + { + raycastHit = value; + type = HitType.World3D; + } + + /// + /// Initializes a new instance of the struct from a 2D raycast. + /// + /// 2D raycast value. + /// Touch layer this hit came from. + /// If the hit is screenspace UI. + public HitData(RaycastHit2D value, TouchLayer layer, bool screenSpace = false) : + this(value.collider.transform, layer, screenSpace) + { + raycastHit2D = value; + type = HitType.World2D; + } + + /// + /// Initializes a new instance of the struct from a UI raycast. + /// + /// UI raycast value. + /// Touch layer this hit came from. + /// If the hit is screenspace UI. + public HitData(RaycastHitUI value, TouchLayer layer, bool screenSpace = false) : + this(value.Target, layer, screenSpace) + { + raycastHitUI = value; + type = HitType.UI; + } + + #endregion + + #region Private functions + + private void updateSortingValues() + { + var sprite = target.GetComponent(); + if (sprite == null) + { + sortingLayer = 0; + sortingOrder = 0; + } + else + { + sortingLayer = sprite.sortingLayerID; + sortingOrder = sprite.sortingOrder; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Hit/TouchHit.cs.meta b/Source/Assets/TouchScript/Scripts/Hit/HitData.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Hit/TouchHit.cs.meta rename to Source/Assets/TouchScript/Scripts/Hit/HitData.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs b/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs index 0c6981762..b9092dea7 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs +++ b/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs @@ -2,55 +2,50 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Hit { + /// - /// Base class for all hit test handlers. + /// Result of a check to find if a hit object should recieve this pointer or not. /// - public abstract class HitTest : MonoBehaviour + public enum HitResult { - #region Constants - /// - /// Result of a check to find if a hit object should recieve this touch or not. + /// This is a hit, object should recieve pointer. /// - public enum ObjectHitResult - { - /// - /// Something happened. - /// - Error = 0, + Hit = 1, - /// - /// This is a hit, object should recieve touch. - /// - Hit = 1, - - /// - /// Object should not recieve touch. - /// - Miss = 2, + /// + /// Object should not recieve pointer. + /// + Miss = 2, - /// - /// Object should not recieve touch and this touch should be discarded and not tested with any other object. - /// - Discard = 3 - } + /// + /// Object should not recieve pointer and this pointer should be discarded and not tested with any other object. + /// + Discard = 3 + } - #endregion + /// + /// Base class for all hit test handlers. + /// + public abstract class HitTest : MonoBehaviour + { #region Public methods /// - /// Determines whether a touch point hit the object. + /// Determines whether a pointer hit the object. /// + /// Pointer to raycast. /// Data from a raycast. - /// if touch point hits the object, if it doesn't, if it doesn't and this touch must be ignored, Error otherwise. - public virtual ObjectHitResult IsHit(TouchHit hit) + /// if pointer hits the object, if it doesn't, if it doesn't and this pointer must be ignored, Error otherwise. + public virtual HitResult IsHit(IPointer pointer, HitData hit) { - return ObjectHitResult.Hit; + return HitResult.Hit; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs new file mode 100644 index 000000000..970e8a532 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs @@ -0,0 +1,25 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +namespace TouchScript.Hit +{ + /// + public struct RaycastHitUI + { + public Transform Target; + public BaseRaycaster Raycaster; + public int GraphicIndex; + public int Depth; + public int SortingLayer; + public int SortingOrder; + public Graphic Graphic; + public Vector3 WorldPosition; + public Vector3 WorldNormal; + public float Distance; + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs.meta b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs.meta new file mode 100644 index 000000000..398052d5e --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3342b71bedf9249f3bd60e73830ed1bf +timeCreated: 1470754412 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Hit/TouchHit.cs b/Source/Assets/TouchScript/Scripts/Hit/TouchHit.cs deleted file mode 100644 index 7b8e85584..000000000 --- a/Source/Assets/TouchScript/Scripts/Hit/TouchHit.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using UnityEngine; -using UnityEngine.EventSystems; - -namespace TouchScript.Hit -{ - /// - /// An object representing a point hit by a touch in 3D, 2D or UI space. - /// - public struct TouchHit - { - #region Consts - - /// - /// Type of hit - /// - public enum TouchHitType - { - /// - /// 3D hit. - /// - Hit3D, - - /// - /// 2D hit. - /// - Hit2D, - - /// - /// UI hit. - /// - HitUI - } - - #endregion - - #region Public properties - - /// - /// Gets the type of the hit. - /// - /// The type. - public TouchHitType Type - { - get { return type; } - } - - /// - /// Gets target transform the touch hit. - /// - /// Transform the touch hit. - public Transform Transform - { - get { return transform; } - } - - /// - /// Gets raycast hit object for a 3D hit. - /// - /// Raycast hit object. - public RaycastHit RaycastHit - { - get { return raycastHit; } - } - - /// - /// Gets 2D raycast hit object for a 2D hit. - /// - /// 2D raycast hit object. - public RaycastHit2D RaycastHit2D - { - get { return raycastHit2D; } - } - - /// - /// Gets raycast hit for a UI hit. - /// - /// UI raycast hit object. - public RaycastResult RaycastResult - { - get { return raycastResult; } - } - - /// - /// Gets the point in 3D where raycast hit the object. - /// - /// Point in 3D. - public Vector3 Point - { - get - { - switch (type) - { - case TouchHitType.Hit3D: - return RaycastHit.point; - case TouchHitType.Hit2D: - return RaycastHit2D.point; - case TouchHitType.HitUI: - return RaycastResult.worldPosition; - } - return Vector3.zero; - } - } - - /// - /// Gets the normal at the point in 3D wher eraycast hit the object. - /// - /// Normal vector. - public Vector3 Normal - { - get - { - switch (type) - { - case TouchHitType.Hit3D: - return RaycastHit.normal; - case TouchHitType.Hit2D: - return RaycastHit2D.normal; - case TouchHitType.HitUI: - return RaycastResult.worldNormal; - } - return Vector3.forward; - } - } - - #endregion - - #region Private variables - - private TouchHitType type; - private Transform transform; - private RaycastHit raycastHit; - private RaycastHit2D raycastHit2D; - private RaycastResult raycastResult; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the struct. - /// - /// Target transform. - public TouchHit(Transform transform) - { - this.transform = transform; - raycastHit = default(RaycastHit); - raycastHit2D = default(RaycastHit2D); - raycastResult = default(RaycastResult); - type = TouchHitType.Hit3D; - } - - /// - /// Initializes a new instance of the struct from a 3D raycast. - /// - /// 3D raycast value. - public TouchHit(RaycastHit value) : this(value.collider.transform) - { - raycastHit = value; - type = TouchHitType.Hit3D; - } - - /// - /// Initializes a new instance of the struct from a 2D raycast. - /// - /// 2D raycast value. - public TouchHit(RaycastHit2D value) : - this(value.collider.transform) - { - raycastHit2D = value; - type = TouchHitType.Hit2D; - } - - /// - /// Initializes a new instance of the struct from a UI raycast. - /// - /// UI raycast value. - public TouchHit(RaycastResult value) : - this(value.gameObject.transform) - { - raycastResult = value; - type = TouchHitType.HitUI; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs b/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs index 89cfb1b67..dcb0c1a30 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs +++ b/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs @@ -2,33 +2,34 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Hit { /// - /// Makes an object it is attached to untouchable, i.e. it completely ignores all touch points landing on it. + /// Makes an object it is attached to untouchable, i.e. it completely ignores all pointers landing on it. /// [AddComponentMenu("TouchScript/Behaviors/Untouchable")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Hit_Untouchable.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Hit_Untouchable.htm")] public class Untouchable : HitTest { #region Public properties /// - /// Indicates if instead of not reacting to touches the object should completely discard them making it impossible for other gestures to receive them. + /// Indicates if instead of not reacting to pointers the object should completely discard them making it impossible for other gestures to receive them. /// - /// If true touch points are not only prevented but discarded making it impossible for other gestures to receive them. - public bool DiscardTouch = false; + /// If true pointers are not only prevented but discarded making it impossible for other gestures to receive them. + public bool DiscardPointer = false; #endregion #region Public methods /// - public override ObjectHitResult IsHit(TouchHit hit) + public override HitResult IsHit(IPointer pointer, HitData hit) { - return DiscardTouch ? ObjectHitResult.Discard : ObjectHitResult.Miss; + return DiscardPointer ? HitResult.Discard : HitResult.Miss; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs.meta b/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs.meta index 5b7d65a9a..b398265ad 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Hit/Untouchable.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/IDebuggable.cs b/Source/Assets/TouchScript/Scripts/IDebuggable.cs index 01ace2044..d8d126fa4 100644 --- a/Source/Assets/TouchScript/Scripts/IDebuggable.cs +++ b/Source/Assets/TouchScript/Scripts/IDebuggable.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ diff --git a/Source/Assets/TouchScript/Scripts/ILayerManager.cs b/Source/Assets/TouchScript/Scripts/ILayerManager.cs new file mode 100644 index 000000000..cf9b50b5c --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/ILayerManager.cs @@ -0,0 +1,107 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using TouchScript.Hit; +using TouchScript.Layers; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript +{ + /// + /// Core manager which controls TouchLayers. + /// + public interface ILayerManager + { + /// + /// Gets the list of . + /// + /// A sorted list of currently active layers. + IList Layers { get; } + + /// + /// Gets the number of active layers. + /// + /// The number of active layers. + int LayerCount { get; } + + /// + /// Indicates whether there are currently any exclusive transforms. + /// + /// + /// true if any exclusive transforms are registered; otherwise, false. + /// + /// + /// + bool HasExclusive { get; } + + /// + /// Adds a layer in a specific position. + /// + /// The layer to add. + /// Layer index to add the layer to or -1 to add to the end of the list. + /// if set to true move the layer to another index if it is already added; don't move otherwise. + /// + /// True if the layer was added. + /// + bool AddLayer(TouchLayer layer, int index = -1, bool addIfExists = true); + + /// + /// Removes a layer. + /// + /// The layer to remove. + /// True if the layer was removed. + bool RemoveLayer(TouchLayer layer); + + /// + /// Swaps layers. + /// + /// Layer index 1. + /// Layer index 2. + void ChangeLayerIndex(int at, int to); + + /// + /// Executes an action over all layers in order. + /// + /// The action to execute. If it returns true, execution stops. + void ForEach(Func action); + + /// + /// Detects if the pointer hits any object in the scene. + /// + /// The pointer. + /// Hit structure to fill on success. + /// True if any object is hit. + bool GetHitTarget(IPointer pointer, out HitData hit); + + /// + /// Sets the exclusive transform. Only exclusive transforms will be able to receive pointers. + /// + /// The exclusive transform. + /// if set to true target's children will also be added. + void SetExclusive(Transform target, bool includeChildren = false); + + /// + /// Sets the exclusive transforms. Only exclusive transforms will be able to receive pointers. + /// + /// The exclusive transforms to set. + void SetExclusive(IEnumerable targets); + + /// + /// Determines whether the specified target is exclusive. + /// + /// The target. + /// + /// true if the specified target is exclusive; otherwise, false. + /// + bool IsExclusive(Transform target); + + /// + /// Clears the exclusive transforms list. + /// + void ClearExclusive(); + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/ILayerManager.cs.meta b/Source/Assets/TouchScript/Scripts/ILayerManager.cs.meta new file mode 100644 index 000000000..c13ed3987 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/ILayerManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2be5f17d5476d2e4a98d02449616ff1e +timeCreated: 1500755913 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/ITouchManager.cs b/Source/Assets/TouchScript/Scripts/ITouchManager.cs index 30fcfc174..375a859c4 100644 --- a/Source/Assets/TouchScript/Scripts/ITouchManager.cs +++ b/Source/Assets/TouchScript/Scripts/ITouchManager.cs @@ -5,35 +5,38 @@ using System; using System.Collections.Generic; using TouchScript.Devices.Display; -using TouchScript.Hit; using TouchScript.InputSources; using TouchScript.Layers; -using UnityEngine; +using TouchScript.Pointers; namespace TouchScript { /// - /// Core manager of all touch input in TouchScript. It is responsible for assigning unique touch ids and keeping the list of active touches. Controls touch frames and dispatches touch events. + /// Core manager of all pointer input in TouchScript. It is responsible for assigning unique pointer ids and keeping the list of active pointers. Controls pointer frames and dispatches pointer events. /// /// - /// Every frame touch events are dispatched in this order: + /// Every frame pointer events are dispatched in this order: /// /// FrameStarted - /// TouchBegan - /// TouchMoved - /// TouchEnded - /// TouchCancelled + /// PointersAdded + /// PointersUpdated + /// PointersPressed + /// PointersReleased + /// PointersRemoved + /// PointersCancelled /// FrameFinished /// - /// FrameStarted and FrameFinished events mark the start and the end of current touch frame and allow to implement specific logic at these moments. + /// FrameStarted and FrameFinished events mark the start and the end of current pointer frame and allow to implement specific logic at these moments. /// Current instance of an active object implementing can be obtained via . /// - /// + /// /// - /// This sample shows how to get Touch Manager instance and subscribe to events. + /// This sample shows how to get TouchManager instance and subscribe to events. /// - /// TouchManager.Instance.TouchBegan += (sender, args) => { Debug.Log("Began: " + args.Touch.Id); }; - /// TouchManager.Instance.TouchEnded += (sender, args) => { Debug.Log("Ended: " + args.Touch.Id); }; + /// TouchManager.Instance.PointersPressed += + /// (sender, args) => { foreach (var pointer in args.Pointers) Debug.Log("Pressed: " + pointer.Id); }; + /// TouchManager.Instance.PointersReleased += + /// (sender, args) => { foreach (var pointer in args.Pointers) Debug.Log("Released: " + pointer.Id); }; /// /// public interface ITouchManager @@ -49,24 +52,34 @@ public interface ITouchManager event EventHandler FrameFinished; /// - /// Occurs when new touch points are added. + /// Occurs when new hovering pointers are added. /// - event EventHandler TouchBegan; + event EventHandler PointersAdded; /// - /// Occurs when touch points are updated. + /// Occurs when pointers are updated. /// - event EventHandler TouchMoved; + event EventHandler PointersUpdated; /// - /// Occurs when touch points are removed. + /// Occurs when pointers touch the surface. /// - event EventHandler TouchEnded; + event EventHandler PointersPressed; /// - /// Occurs when touch points are cancelled. + /// Occurs when pointers are released. /// - event EventHandler TouchCancelled; + event EventHandler PointersReleased; + + /// + /// Occurs when pointers are removed from the system. + /// + event EventHandler PointersRemoved; + + /// + /// Occurs when pointers are cancelled. + /// + event EventHandler PointersCancelled; /// /// Gets or sets current display device. @@ -81,10 +94,10 @@ public interface ITouchManager float DPI { get; } /// - /// Indicates if TouchScript should create a for you if no layers present in a scene. + /// Indicates if TouchScript should create a for you if no layers present in a scene. /// /// true if a CameraLayer should be created on startup; otherwise, false. - /// This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get touch input from some device. + /// This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get pointer input from some device. bool ShouldCreateCameraLayer { get; set; } /// @@ -94,12 +107,6 @@ public interface ITouchManager /// This is usually a desired behavior but sometimes you would want to turn this off. bool ShouldCreateStandardInput { get; set; } - /// - /// Gets the list of . - /// - /// A sorted list of currently active touch layers. - IList Layers { get; } - /// /// Gets the list of /// @@ -112,47 +119,34 @@ public interface ITouchManager float DotsPerCentimeter { get; } /// - /// Gets number of active touches. + /// Gets number of pointers in the system. /// - int NumberOfTouches { get; } + int PointersCount { get; } /// - /// Gets the list of active touches. + /// Gets the number of pressed pointer in the system. /// - /// An unsorted list of all touches which began but have not ended yet. - IList ActiveTouches { get; } + int PressedPointersCount { get; } /// - /// Adds a touch layer. + /// Gets the list of pointers. /// - /// The layer to add. - /// True if the layer was added. - bool AddLayer(TouchLayer layer); + /// An unsorted list of all pointers. + IList Pointers { get; } /// - /// Adds a touch layer in a specific position. + /// Gets the list of pressed pointers. /// - /// The layer to add. - /// Layer index to add the layer to. - /// if set to true move the layer to another index if it is already added; don't move otherwise. - /// - /// True if the layer was added. - /// - bool AddLayer(TouchLayer layer, int index, bool addIfExists = true); + /// An unsorted list of all pointers which were pressed but not released yet. + IList PressedPointers { get; } /// - /// Removes a touch layer. + /// Indicates that execution is currently inside a TouchScript Pointer Frame, i.e. before and after events. /// - /// The layer to remove. - /// True if the layer was removed. - bool RemoveLayer(TouchLayer layer); - - /// - /// Swaps layers. - /// - /// Layer index 1. - /// Layer index 2. - void ChangeLayerIndex(int at, int to); + /// + /// true if execution is inside a TouchScript Pointer Frame; otherwise, false. + /// + bool IsInsidePointerFrame { get; } /// /// Adds an input source. @@ -169,74 +163,52 @@ public interface ITouchManager bool RemoveInput(IInputSource input); /// - /// Checks if a touch hits anything. - /// - /// Screen position of the touch. - /// Transform which has been hit or null otherwise. - Transform GetHitTarget(Vector2 position); - - /// - /// Checks if a touch hits anything. - /// - /// - /// Screen position of the touch. - /// An object which represents hit information. - /// True if the touch hits any Transform. - bool GetHitTarget(Vector2 position, out TouchHit hit); - - /// - /// Checks if a touch hits anything. - /// - /// + /// Cancels a pointer and returns it to the system of need. /// - /// Screen position of the touch. - /// An object which represents hit information. - /// A layer which was hit. - /// True if the touch hits any Transform. - bool GetHitTarget(Vector2 position, out TouchHit hit, out TouchLayer layer); + /// Pointer id to cancel. + /// If the pointer should be redispatched to the system. + void CancelPointer(int id, bool shouldReturn); /// - /// Cancels a touch and returns it to the system of need. + /// Cancels a pointer. /// - /// Touch id to cancel. - /// Should the touch be returned to the system. - void CancelTouch(int id, bool @return); + /// Pointer id to cancel. + void CancelPointer(int id); /// - /// Cancels a touch. + /// Tells TouchScript to update internal state after a resolution change. /// - /// Touch id to cancel. - void CancelTouch(int id); + void UpdateResolution(); } /// - /// Arguments dispatched with Touch Manager events. + /// Arguments dispatched with TouchManager events. /// - public class TouchEventArgs : EventArgs + public class PointerEventArgs : EventArgs { /// - /// Gets the touch participating in the event. + /// Gets list of pointers participating in the event. /// - /// The touch added, changed or removed this frame. - public TouchPoint Touch { get; private set; } + /// List of pointers added, changed or removed this frame. + public IList Pointers { get; private set; } - private static TouchEventArgs instance; + private static PointerEventArgs instance; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - private TouchEventArgs() {} + private PointerEventArgs() {} /// /// Returns cached instance of EventArgs. /// This cached EventArgs is reused throughout the library not to alocate new ones on every call. /// - /// Touch for the event. + /// A list of pointers for event. /// Cached EventArgs object. - public static TouchEventArgs GetCachedEventArgs(TouchPoint touch) + public static PointerEventArgs GetCachedEventArgs(IList pointers) { - if (instance == null) instance = new TouchEventArgs(); - instance.Touch = touch; + if (instance == null) instance = new PointerEventArgs(); + instance.Pointers = pointers; return instance; } } diff --git a/Source/Assets/TouchScript/Scripts/InputSources/ICoordinatesRemapper.cs b/Source/Assets/TouchScript/Scripts/InputSources/ICoordinatesRemapper.cs index 4412191d7..2317d4bba 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/ICoordinatesRemapper.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/ICoordinatesRemapper.cs @@ -7,15 +7,15 @@ namespace TouchScript.InputSources { /// - /// An object which changes touch coordinates coming from an input source. + /// An object which changes pointer coordinates coming from an input source. /// /// - /// If your input device is not fully aligned with display device you can use a remapper to carefully retarget touch positions to "calibrate" input with image. + /// If your input device is not fully aligned with display device you can use a remapper to carefully retarget pointer positions to "calibrate" input with image. /// public interface ICoordinatesRemapper { /// - /// Remaps touch input. + /// Remaps pointer input. /// /// Original coordinates. /// Changed coordinates. diff --git a/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs b/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs index 9a4514a79..2f60e4b6d 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs @@ -2,33 +2,55 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Core; +using TouchScript.Pointers; + namespace TouchScript.InputSources { /// /// An object which represents an input source. /// /// - /// In TouchScript all touch points () come from input sources. - /// If you want to feed the library with touches the best way to do it is to create a custom input source. + /// In TouchScript all pointer points () come from input sources. + /// If you want to feed pointers to the library the best way to do it is to create a custom input source. /// - public interface IInputSource + public interface IInputSource : INTERNAL_IInputSource { /// /// Gets or sets current coordinates remapper. /// - /// An object used to change coordinates of touch points coming from this input source. + /// An object used to change coordinates of pointer points coming from this input source. ICoordinatesRemapper CoordinatesRemapper { get; set; } /// - /// This method is called by to synchronously update the input. + /// This method is called by to synchronously update the input. + /// + bool UpdateInput(); + + /// + /// Forces the input to update its state when resolution changes. /// - void UpdateInput(); + void UpdateResolution(); /// - /// Cancels the touch. + /// Cancels the pointer. + /// + /// The pointer. + /// if set to true returns the pointer back to the system with different id. + /// True if the pointer belongs to this Input and was successfully cancelled; false otherwise. + bool CancelPointer(Pointer pointer, bool shouldReturn); + } + + /// + /// Internal methods for . DO NOT USE ANY OF THEM! + /// + public interface INTERNAL_IInputSource + { + /// + /// Used by to return a pointer to input source. + /// DO NOT CALL IT DIRECTLY FROM YOUR CODE! /// - /// The touch. - /// if set to true returns the touch back to the system with different id. - void CancelTouch(TouchPoint touch, bool @return); + /// The pointer. + void INTERNAL_DiscardPointer(Pointer pointer); } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs index 7801f3538..9410a5d95 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs @@ -1,8 +1,10 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ using System; +using TouchScript.Pointers; +using TouchScript.Utils; using UnityEngine; namespace TouchScript.InputSources.InputHandlers @@ -10,18 +12,72 @@ namespace TouchScript.InputSources.InputHandlers /// /// Unity mouse handling implementation which can be embedded and controlled from other (input) classes. /// - public class MouseHandler : IDisposable + public class MouseHandler : IInputSource, IDisposable { + #region Consts + + private enum State + { + /// + /// Only mouse pointer is active + /// + Mouse, + + /// + /// ALT is pressed but mouse isn't + /// + WaitingForFake, + + /// + /// Mouse and fake pointers are moving together after ALT+PRESS + /// + MouseAndFake, + + /// + /// After ALT+RELEASE fake pointer is stationary while mouse can move freely + /// + StationaryFake + } + + #endregion + + #region Public properties + + /// + public ICoordinatesRemapper CoordinatesRemapper { get; set; } + + /// + /// Gets or sets a value indicating whether second pointer emulation using ALT+CLICK should be enabled. + /// + /// + /// true if second pointer emulation is enabled; otherwise, false. + /// + public bool EmulateSecondMousePointer + { + get { return emulateSecondMousePointer; } + set + { + emulateSecondMousePointer = value; + if (fakeMousePointer != null) CancelPointer(fakeMousePointer, false); + } + } + + #endregion + #region Private variables - private Func beginTouch; - private Action moveTouch; - private Action endTouch; - private Action cancelTouch; + private bool emulateSecondMousePointer = true; + + private PointerDelegate addPointer; + private PointerDelegate updatePointer; + private PointerDelegate pressPointer; + private PointerDelegate releasePointer; + private PointerDelegate removePointer; + private PointerDelegate cancelPointer; - private Tags tags; - private int mousePointId = -1; - private int fakeMousePointId = -1; + private State state; + private ObjectPool mousePool; + private MousePointer mousePointer, fakeMousePointer; private Vector3 mousePointPos = Vector3.zero; #endregion @@ -29,123 +85,359 @@ public class MouseHandler : IDisposable /// /// Initializes a new instance of the class. /// - /// Tags to add to touches. - /// A function called when a new touch is detected. As this function must accept a Vector2 position of the new touch and return an instance of . - /// A function called when a touch is moved. As this function must accept an int id and a Vector2 position. - /// A function called when a touch is lifted off. As this function must accept an int id. - /// A function called when a touch is cancelled. As this function must accept an int id. - public MouseHandler(Tags tags, Func beginTouch, Action moveTouch, Action endTouch, Action cancelTouch) + /// A function called when a new pointer is detected. + /// A function called when a pointer is moved or its parameter is updated. + /// A function called when a pointer touches the surface. + /// A function called when a pointer is lifted off. + /// A function called when a pointer is removed. + /// A function called when a pointer is cancelled. + public MouseHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer) { - this.tags = tags; - this.beginTouch = beginTouch; - this.moveTouch = moveTouch; - this.endTouch = endTouch; - this.cancelTouch = cancelTouch; + this.addPointer = addPointer; + this.updatePointer = updatePointer; + this.pressPointer = pressPointer; + this.releasePointer = releasePointer; + this.removePointer = removePointer; + this.cancelPointer = cancelPointer; + + mousePool = new ObjectPool(4, () => new MousePointer(this), null, resetPointer); + + mousePointPos = Input.mousePosition; + mousePointer = internalAddPointer(remapCoordinates(mousePointPos)); - mousePointId = -1; - fakeMousePointId = -1; + stateMouse(); } #region Public methods /// - /// Immediately ends all touches. + /// Cancels the mouse pointer. /// - public void EndTouches() + public void CancelMousePointer() { - if (mousePointId != -1) + if (mousePointer != null) { - endTouch(mousePointId); - mousePointId = -1; - } - if (fakeMousePointId != -1) - { - endTouch(fakeMousePointId); - fakeMousePointId = -1; + cancelPointer(mousePointer); + mousePointer = null; } } - /// - /// Updates this instance. - /// - public void Update() + /// + public bool UpdateInput() { - // If mouse button was pressed and released during the same frame, - // we need to figure out what happened first. - var upHandled = false; - if (Input.GetMouseButtonUp(0)) + var pos = Input.mousePosition; + Vector2 remappedPos = new Vector2(0, 0); + bool updated = false; + + if (mousePointPos != pos) { - // Release happened first? - if (mousePointId != -1) + remappedPos = remapCoordinates(new Vector2(pos.x, pos.y)); + + if (mousePointer == null) { - endTouch(mousePointId); - mousePointId = -1; - upHandled = true; + mousePointer = internalAddPointer(remappedPos); } + else + { + mousePointer.Position = remappedPos; + updatePointer(mousePointer); + } + updated = true; } - // Need to end fake pointer - if (fakeMousePointId > -1 && !(Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))) + if (mousePointer == null) return false; + + var buttons = state == State.MouseAndFake ? fakeMousePointer.Buttons : mousePointer.Buttons; + var newButtons = getMouseButtons(); + var scroll = Input.mouseScrollDelta; + if (!Mathf.Approximately(scroll.sqrMagnitude, 0.0f)) { - endTouch(fakeMousePointId); - fakeMousePointId = -1; + mousePointer.ScrollDelta = scroll; + updatePointer(mousePointer); } - - if (Input.GetMouseButtonDown(0)) + else { - var pos = Input.mousePosition; - if ((Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)) && fakeMousePointId == -1) - fakeMousePointId = beginTouch(new Vector2(pos.x, pos.y), tags, true).Id; - else if (mousePointId == -1) mousePointId = beginTouch(new Vector2(pos.x, pos.y), tags, true).Id; + mousePointer.ScrollDelta = Vector2.zero; } - else if (Input.GetMouseButton(0)) + + if (emulateSecondMousePointer) { - var pos = Input.mousePosition; - if (mousePointPos != pos) + switch (state) { - mousePointPos = pos; - if (fakeMousePointId != -1) - { - if (mousePointId == -1) moveTouch(fakeMousePointId, new Vector2(pos.x, pos.y)); - else moveTouch(mousePointId, new Vector2(pos.x, pos.y)); - } - else if (mousePointId != -1) moveTouch(mousePointId, new Vector2(pos.x, pos.y)); + case State.Mouse: + if (Input.GetKeyDown(KeyCode.LeftAlt) && !Input.GetKeyUp(KeyCode.LeftAlt) + && ((newButtons & Pointer.PointerButtonState.AnyButtonPressed) == 0)) + { + stateWaitingForFake(); + } + else + { + if (buttons != newButtons) updateButtons(buttons, newButtons); + } + break; + case State.WaitingForFake: + if (Input.GetKey(KeyCode.LeftAlt)) + { + if ((newButtons & Pointer.PointerButtonState.AnyButtonDown) != 0) + { + // A button is down while holding Alt + fakeMousePointer = internalAddPointer(pos, newButtons, mousePointer.Flags | Pointer.FLAG_ARTIFICIAL); + pressPointer(fakeMousePointer); + stateMouseAndFake(); + } + } + else + { + stateMouse(); + } + break; + case State.MouseAndFake: + if (fakeTouchReleased()) + { + stateMouse(); + } + else + { + if (mousePointPos != pos) + { + fakeMousePointer.Position = remappedPos; + updatePointer(fakeMousePointer); + } + if ((newButtons & Pointer.PointerButtonState.AnyButtonPressed) == 0) + { + // All buttons are released, Alt is still holding + stateStationaryFake(); + } + else if (buttons != newButtons) + { + fakeMousePointer.Buttons = newButtons; + updatePointer(fakeMousePointer); + } + } + break; + case State.StationaryFake: + if (buttons != newButtons) updateButtons(buttons, newButtons); + if (fakeTouchReleased()) + { + stateMouse(); + } + break; } } - - // Release mouse if we haven't done it yet - if (Input.GetMouseButtonUp(0) && !upHandled && mousePointId != -1) + else { - endTouch(mousePointId); - mousePointId = -1; + if (buttons != newButtons) + { + updateButtons(buttons, newButtons); + updated = true; + } } + + mousePointPos = pos; + return updated; } /// - public bool CancelTouch(TouchPoint touch, bool @return) + public void UpdateResolution() { - if (touch.Id == mousePointId) + TouchManager.Instance.CancelPointer(mousePointer.Id); + } + + /// + public bool CancelPointer(Pointer pointer, bool shouldReturn) + { + if (pointer.Equals(mousePointer)) { - cancelTouch(mousePointId); - if (@return) mousePointId = beginTouch(touch.Position, tags, false).Id; - else mousePointId = -1; + cancelPointer(mousePointer); + if (shouldReturn) mousePointer = internalReturnPointer(mousePointer); + else mousePointer = internalAddPointer(mousePointer.Position); // can't totally cancel mouse pointer return true; } - if (touch.Id == fakeMousePointId) + if (pointer.Equals(fakeMousePointer)) { - cancelTouch(fakeMousePointId); - if (@return) fakeMousePointId = beginTouch(touch.Position, tags, false).Id; - else fakeMousePointId = -1; + cancelPointer(fakeMousePointer); + if (shouldReturn) fakeMousePointer = internalReturnPointer(fakeMousePointer); + else fakeMousePointer = null; return true; } return false; } - /// + /// + /// Releases resources. + /// public void Dispose() { - if (mousePointId != -1) cancelTouch(mousePointId); - if (fakeMousePointId != -1) cancelTouch(fakeMousePointId); + if (mousePointer != null) + { + cancelPointer(mousePointer); + mousePointer = null; + } + if (fakeMousePointer != null) + { + cancelPointer(fakeMousePointer); + fakeMousePointer = null; + } + } + + #endregion + + #region Internal methods + + /// + public void INTERNAL_DiscardPointer(Pointer pointer) + { + var p = pointer as MousePointer; + if (p == null) return; + + mousePool.Release(p); + } + + #endregion + + #region Private functions + + private Pointer.PointerButtonState getMouseButtons() + { + Pointer.PointerButtonState buttons = Pointer.PointerButtonState.Nothing; + + if (Input.GetMouseButton(0)) buttons |= Pointer.PointerButtonState.FirstButtonPressed; + if (Input.GetMouseButtonDown(0)) buttons |= Pointer.PointerButtonState.FirstButtonDown; + if (Input.GetMouseButtonUp(0)) buttons |= Pointer.PointerButtonState.FirstButtonUp; + + if (Input.GetMouseButton(1)) buttons |= Pointer.PointerButtonState.SecondButtonPressed; + if (Input.GetMouseButtonDown(1)) buttons |= Pointer.PointerButtonState.SecondButtonDown; + if (Input.GetMouseButtonUp(1)) buttons |= Pointer.PointerButtonState.SecondButtonUp; + + if (Input.GetMouseButton(2)) buttons |= Pointer.PointerButtonState.ThirdButtonPressed; + if (Input.GetMouseButtonDown(2)) buttons |= Pointer.PointerButtonState.ThirdButtonDown; + if (Input.GetMouseButtonUp(2)) buttons |= Pointer.PointerButtonState.ThirdButtonUp; + + return buttons; + } + + private void updateButtons(Pointer.PointerButtonState oldButtons, Pointer.PointerButtonState newButtons) + { + // pressed something + if (oldButtons == Pointer.PointerButtonState.Nothing) + { + // pressed and released this frame + if ((newButtons & Pointer.PointerButtonState.AnyButtonPressed) == 0) + { + // Add pressed buttons for processing + mousePointer.Buttons = PointerUtils.PressDownButtons(newButtons); + pressPointer(mousePointer); + internalReleaseMousePointer(newButtons); + } + // pressed this frame + else + { + mousePointer.Buttons = newButtons; + pressPointer(mousePointer); + } + } + // released or button state changed + else + { + // released this frame + if ((newButtons & Pointer.PointerButtonState.AnyButtonPressed) == 0) + { + mousePointer.Buttons = newButtons; + internalReleaseMousePointer(newButtons); + } + // button state changed this frame + else + { + mousePointer.Buttons = newButtons; + updatePointer(mousePointer); + } + } + } + + private bool fakeTouchReleased() + { + if (!Input.GetKey(KeyCode.LeftAlt)) + { + // Alt is released, need to kill the fake touch + fakeMousePointer.Buttons = PointerUtils.UpPressedButtons(fakeMousePointer.Buttons); // Convert current pressed buttons to UP + releasePointer(fakeMousePointer); + removePointer(fakeMousePointer); + fakeMousePointer = null; // Will be returned to the pool by INTERNAL_DiscardPointer + return true; + } + return false; + } + + private MousePointer internalAddPointer(Vector2 position, Pointer.PointerButtonState buttons = Pointer.PointerButtonState.Nothing, uint flags = 0) + { + var pointer = mousePool.Get(); + pointer.Position = position; + pointer.Buttons |= buttons; + pointer.Flags |= flags; + addPointer(pointer); + updatePointer(pointer); + return pointer; + } + + private void internalReleaseMousePointer(Pointer.PointerButtonState buttons) + { + mousePointer.Flags &= ~Pointer.FLAG_RETURNED; + releasePointer(mousePointer); + } + + private MousePointer internalReturnPointer(MousePointer pointer) + { + var newPointer = mousePool.Get(); + newPointer.CopyFrom(pointer); + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) + { + // Adding down state this frame + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); + pressPointer(newPointer); + } + return newPointer; + } + + private Vector2 remapCoordinates(Vector2 position) + { + if (CoordinatesRemapper != null) return CoordinatesRemapper.Remap(position); + return position; + } + + private void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } + + #endregion + + #region State logic + + private void stateMouse() + { + setState(State.Mouse); + } + + private void stateWaitingForFake() + { + setState(State.WaitingForFake); + } + + private void stateMouseAndFake() + { + setState(State.MouseAndFake); + } + + private void stateStationaryFake() + { + setState(State.StationaryFake); + } + + private void setState(State newState) + { + state = newState; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs index 2f10c832a..d492b6637 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs @@ -1,69 +1,93 @@ -/* +/* * @author Michael Holub * @author Valentin Simonov / http://va.lent.in/ */ using System; using System.Collections.Generic; +using TouchScript.Pointers; +using TouchScript.Utils; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.InputSources.InputHandlers { /// /// Unity touch handling implementation which can be embedded and controlled from other (input) classes. /// - public class TouchHandler : IDisposable + public class TouchHandler : IInputSource, IDisposable { #region Public properties + /// + public ICoordinatesRemapper CoordinatesRemapper { get; set; } + /// - /// Gets a value indicating whether there any active touches. + /// Gets a value indicating whether there any active pointers. /// - /// true if this instance has active touches; otherwise, false. - public bool HasTouches + /// true if this instance has active pointers; otherwise, false. + public bool HasPointers { - get { return touchesNum > 0; } + get { return pointersNum > 0; } } #endregion #region Private variables - private Func beginTouch; - private Action moveTouch; - private Action endTouch; - private Action cancelTouch; + private PointerDelegate addPointer; + private PointerDelegate updatePointer; + private PointerDelegate pressPointer; + private PointerDelegate releasePointer; + private PointerDelegate removePointer; + private PointerDelegate cancelPointer; + + private ObjectPool touchPool; + // Unity fingerId -> TouchScript touch info + private Dictionary systemToInternalId = new Dictionary(10); + private int pointersNum; - private Tags tags; - private Dictionary systemToInternalId = new Dictionary(); - private int touchesNum; +#if UNITY_5_6_OR_NEWER + private CustomSampler updateSampler; +#endif #endregion /// /// Initializes a new instance of the class. /// - /// Tags to add to touches. - /// A function called when a new touch is detected. As this function must accept a Vector2 position of the new touch and return an instance of . - /// A function called when a touch is moved. As this function must accept an int id and a Vector2 position. - /// A function called when a touch is lifted off. As this function must accept an int id. - /// A function called when a touch is cancelled. As this function must accept an int id. - public TouchHandler(Tags tags, Func beginTouch, Action moveTouch, Action endTouch, Action cancelTouch) + /// A function called when a new pointer is detected. + /// A function called when a pointer is moved or its parameter is updated. + /// A function called when a pointer touches the surface. + /// A function called when a pointer is lifted off. + /// A function called when a pointer is removed. + /// A function called when a pointer is cancelled. + public TouchHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer) { - this.tags = tags; - this.beginTouch = beginTouch; - this.moveTouch = moveTouch; - this.endTouch = endTouch; - this.cancelTouch = cancelTouch; + this.addPointer = addPointer; + this.updatePointer = updatePointer; + this.pressPointer = pressPointer; + this.releasePointer = releasePointer; + this.removePointer = removePointer; + this.cancelPointer = cancelPointer; + + touchPool = new ObjectPool(10, () => new TouchPointer(this), null, resetPointer); + touchPool.Name = "Touch"; + +#if UNITY_5_6_OR_NEWER + updateSampler = CustomSampler.Create("[TouchScript] Update touch"); +#endif } #region Public methods - /// - /// Updates this instance. - /// - public void Update() + /// + public bool UpdateInput() { +#if UNITY_5_6_OR_NEWER + updateSampler.Begin(); +#endif + for (var i = 0; i < Input.touchCount; ++i) { var t = Input.GetTouch(i); @@ -75,47 +99,55 @@ public void Update() if (systemToInternalId.TryGetValue(t.fingerId, out touchState) && touchState.Phase != TouchPhase.Canceled) { // Ending previous touch (missed a frame) - internalEndTouch(touchState.Id); - systemToInternalId[t.fingerId] = new TouchState(internalBeginTouch(t.position).Id); + internalRemovePointer(touchState.Pointer); + systemToInternalId[t.fingerId] = new TouchState(internalAddPointer(t.position)); } else { - systemToInternalId.Add(t.fingerId, new TouchState(internalBeginTouch(t.position).Id)); + systemToInternalId.Add(t.fingerId, new TouchState(internalAddPointer(t.position))); } break; case TouchPhase.Moved: - if (systemToInternalId.TryGetValue(t.fingerId, out touchState) && touchState.Phase != TouchPhase.Canceled) + if (systemToInternalId.TryGetValue(t.fingerId, out touchState)) { - moveTouch(touchState.Id, t.position); + if (touchState.Phase != TouchPhase.Canceled) + { + touchState.Pointer.Position = t.position; + updatePointer(touchState.Pointer); + } } else { // Missed began phase - systemToInternalId.Add(t.fingerId, new TouchState(internalBeginTouch(t.position).Id)); + systemToInternalId.Add(t.fingerId, new TouchState(internalAddPointer(t.position))); } break; + // NOTE: Unity touch on Windows reports Cancelled as Ended + // when a touch goes out of display boundary case TouchPhase.Ended: if (systemToInternalId.TryGetValue(t.fingerId, out touchState)) { systemToInternalId.Remove(t.fingerId); - if (touchState.Phase != TouchPhase.Canceled) internalEndTouch(touchState.Id); + if (touchState.Phase != TouchPhase.Canceled) internalRemovePointer(touchState.Pointer); } else { // Missed one finger begin-end transition - internalEndTouch(internalBeginTouch(t.position).Id); + var pointer = internalAddPointer(t.position); + internalRemovePointer(pointer); } break; case TouchPhase.Canceled: if (systemToInternalId.TryGetValue(t.fingerId, out touchState)) { systemToInternalId.Remove(t.fingerId); - if (touchState.Phase != TouchPhase.Canceled) internalCancelTouch(touchState.Id); + if (touchState.Phase != TouchPhase.Canceled) internalCancelPointer(touchState.Pointer); } else { // Missed one finger begin-end transition - internalCancelTouch(internalBeginTouch(t.position).Id); + var pointer = internalAddPointer(t.position); + internalCancelPointer(pointer); } break; case TouchPhase.Stationary: @@ -123,20 +155,32 @@ public void Update() else { // Missed begin phase - systemToInternalId.Add(t.fingerId, new TouchState(internalBeginTouch(t.position).Id)); + systemToInternalId.Add(t.fingerId, new TouchState(internalAddPointer(t.position))); } break; } } + +#if UNITY_5_6_OR_NEWER + updateSampler.End(); +#endif + + return Input.touchCount > 0; } /// - public bool CancelTouch(TouchPoint touch, bool @return) + public void UpdateResolution() {} + + /// + public bool CancelPointer(Pointer pointer, bool shouldReturn) { + var touch = pointer as TouchPointer; + if (touch == null) return false; + int fingerId = -1; foreach (var touchState in systemToInternalId) { - if (touchState.Value.Id == touch.Id && touchState.Value.Phase != TouchPhase.Canceled) + if (touchState.Value.Pointer == touch && touchState.Value.Phase != TouchPhase.Canceled) { fingerId = touchState.Key; break; @@ -144,67 +188,104 @@ public bool CancelTouch(TouchPoint touch, bool @return) } if (fingerId > -1) { - if (@return) - { - cancelTouch(touch.Id); - systemToInternalId[fingerId] = new TouchState(beginTouch(touch.Position, touch.Tags, false).Id); - } - else - { - systemToInternalId[fingerId] = new TouchState(touch.Id, TouchPhase.Canceled); - internalCancelTouch(touch.Id); - } + internalCancelPointer(touch); + if (shouldReturn) systemToInternalId[fingerId] = new TouchState(internalReturnPointer(touch)); + else systemToInternalId[fingerId] = new TouchState(touch, TouchPhase.Canceled); return true; } return false; } - /// + /// + /// Releases resources. + /// public void Dispose() { foreach (var touchState in systemToInternalId) { - if (touchState.Value.Phase != TouchPhase.Canceled) internalCancelTouch(touchState.Value.Id); + if (touchState.Value.Phase != TouchPhase.Canceled) internalCancelPointer(touchState.Value.Pointer); } systemToInternalId.Clear(); } #endregion + #region Internal methods + + /// + public void INTERNAL_DiscardPointer(Pointer pointer) + { + var p = pointer as TouchPointer; + if (p == null) return; + + touchPool.Release(p); + } + + #endregion + #region Private functions - private TouchPoint internalBeginTouch(Vector2 position) + private Pointer internalAddPointer(Vector2 position) { - touchesNum++; - return beginTouch(position, tags, true); + pointersNum++; + var pointer = touchPool.Get(); + pointer.Position = remapCoordinates(position); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + addPointer(pointer); + pressPointer(pointer); + return pointer; } - private void internalEndTouch(int id) + private TouchPointer internalReturnPointer(TouchPointer pointer) { - touchesNum--; - endTouch(id); + pointersNum++; + var newPointer = touchPool.Get(); + newPointer.CopyFrom(pointer); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + pressPointer(newPointer); + return newPointer; } - private void internalCancelTouch(int id) + private void internalRemovePointer(Pointer pointer) { - touchesNum--; - cancelTouch(id); + pointersNum--; + pointer.Buttons &= ~Pointer.PointerButtonState.FirstButtonPressed; + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonUp; + releasePointer(pointer); + removePointer(pointer); + } + + private void internalCancelPointer(Pointer pointer) + { + pointersNum--; + cancelPointer(pointer); + } + + private Vector2 remapCoordinates(Vector2 position) + { + if (CoordinatesRemapper != null) return CoordinatesRemapper.Remap(position); + return position; + } + + private void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); } #endregion private struct TouchState { - public int Id; + public Pointer Pointer; public TouchPhase Phase; - public TouchState(int id, TouchPhase phase = TouchPhase.Began) + public TouchState(Pointer pointer, TouchPhase phase = TouchPhase.Began) { - Id = id; + Pointer = pointer; Phase = phase; } - } - } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs new file mode 100644 index 000000000..d8485ca56 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs @@ -0,0 +1,750 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + * @author Valentin Frolov + * @author Andrew David Griffiths + */ + +#if UNITY_STANDALONE_WIN + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using TouchScript.Pointers; +using TouchScript.Utils; +using TouchScript.Utils.Platform; +using UnityEngine; + +namespace TouchScript.InputSources.InputHandlers +{ + /// + /// Windows 8 pointer handling implementation which can be embedded to other (input) classes. Uses WindowsTouch.dll to query native touches with WM_TOUCH or WM_POINTER APIs. + /// + public class Windows8PointerHandler : WindowsPointerHandler + { + #region Public properties + + /// + /// Should the primary pointer also dispatch a mouse pointer. + /// + public bool MouseInPointer + { + get { return mouseInPointer; } + set + { + WindowsUtils.EnableMouseInPointer(value); + mouseInPointer = value; + if (mouseInPointer) + { + if (mousePointer == null) mousePointer = internalAddMousePointer(Vector3.zero); + } + else + { + if (mousePointer != null) + { + if ((mousePointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) + { + mousePointer.Buttons = PointerUtils.UpPressedButtons(mousePointer.Buttons); + releasePointer(mousePointer); + } + removePointer(mousePointer); + } + } + } + } + + #endregion + + #region Private variables + + private bool mouseInPointer = true; + + #endregion + + #region Constructor + + /// + public Windows8PointerHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer) : base(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer) + { + mousePool = new ObjectPool(4, () => new MousePointer(this), null, resetPointer); + penPool = new ObjectPool(2, () => new PenPointer(this), null, resetPointer); + + mousePointer = internalAddMousePointer(Vector3.zero); + + init(TOUCH_API.WIN8); + } + + #endregion + + #region Public methods + + /// + public override bool UpdateInput() + { + base.UpdateInput(); + return true; + } + + /// + public override bool CancelPointer(Pointer pointer, bool shouldReturn) + { + if (pointer.Equals(mousePointer)) + { + cancelPointer(mousePointer); + if (shouldReturn) mousePointer = internalReturnMousePointer(mousePointer); + else mousePointer = internalAddMousePointer(pointer.Position); // can't totally cancel mouse pointer + return true; + } + if (pointer.Equals(penPointer)) + { + cancelPointer(penPointer); + if (shouldReturn) penPointer = internalReturnPenPointer(penPointer); + return true; + } + return base.CancelPointer(pointer, shouldReturn); + } + + /// + public override void Dispose() + { + if (mousePointer != null) + { + cancelPointer(mousePointer); + mousePointer = null; + } + if (penPointer != null) + { + cancelPointer(penPointer); + penPointer = null; + } + + WindowsUtils.EnableMouseInPointer(false); + + base.Dispose(); + } + + #endregion + + #region Internal methods + + /// + public override void INTERNAL_DiscardPointer(Pointer pointer) + { + if (pointer is MousePointer) mousePool.Release(pointer as MousePointer); + else if (pointer is PenPointer) penPool.Release(pointer as PenPointer); + else base.INTERNAL_DiscardPointer(pointer); + } + + #endregion + } + + public class Windows7PointerHandler : WindowsPointerHandler + { + /// + public Windows7PointerHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer) : base(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer) + { + init(TOUCH_API.WIN7); + } + + #region Public methods + + /// + public override bool UpdateInput() + { + base.UpdateInput(); + return winTouchToInternalId.Count > 0; + } + + #endregion + } + + /// + /// Base class for Windows 8 and Windows 7 input handlers. + /// + public abstract class WindowsPointerHandler : IInputSource, IDisposable + { + #region Consts + + /// + /// Windows constant to turn off press and hold visual effect. + /// + public const string PRESS_AND_HOLD_ATOM = "MicrosoftTabletPenServiceProperty"; + + /// + /// The method delegate used to pass data from the native DLL. + /// + /// Pointer id. + /// Current event. + /// Pointer type. + /// Pointer position. + /// Pointer data. + protected delegate void NativePointerDelegate(int id, PointerEvent evt, PointerType type, Vector2 position, PointerData data); + + /// + /// The method delegate used to pass log messages from the native DLL. + /// + /// The log message. + protected delegate void NativeLog([MarshalAs(UnmanagedType.BStr)] string log); + + #endregion + + #region Public properties + + /// + public ICoordinatesRemapper CoordinatesRemapper { get; set; } + + #endregion + + #region Private variables + + private NativePointerDelegate nativePointerDelegate; + private NativeLog nativeLogDelegate; + + protected PointerDelegate addPointer; + protected PointerDelegate updatePointer; + protected PointerDelegate pressPointer; + protected PointerDelegate releasePointer; + protected PointerDelegate removePointer; + protected PointerDelegate cancelPointer; + + protected IntPtr hMainWindow; + protected ushort pressAndHoldAtomID; + protected Dictionary winTouchToInternalId = new Dictionary(10); + + protected ObjectPool touchPool; + protected ObjectPool mousePool; + protected ObjectPool penPool; + protected MousePointer mousePointer; + protected PenPointer penPointer; + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + /// A function called when a new pointer is detected. + /// A function called when a pointer is moved or its parameter is updated. + /// A function called when a pointer touches the surface. + /// A function called when a pointer is lifted off. + /// A function called when a pointer is removed. + /// A function called when a pointer is cancelled. + public WindowsPointerHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer) + { + this.addPointer = addPointer; + this.updatePointer = updatePointer; + this.pressPointer = pressPointer; + this.releasePointer = releasePointer; + this.removePointer = removePointer; + this.cancelPointer = cancelPointer; + + nativeLogDelegate = nativeLog; + nativePointerDelegate = nativePointer; + + touchPool = new ObjectPool(10, () => new TouchPointer(this), null, resetPointer); + + hMainWindow = WindowsUtils.GetActiveWindow(); + disablePressAndHold(); + setScaling(); + } + + #endregion + + #region Public methods + + /// + public virtual bool UpdateInput() + { + return false; + } + + /// + public virtual void UpdateResolution() + { + setScaling(); + if (mousePointer != null) TouchManager.Instance.CancelPointer(mousePointer.Id); + } + + /// + public virtual bool CancelPointer(Pointer pointer, bool shouldReturn) + { + var touch = pointer as TouchPointer; + if (touch == null) return false; + + int internalTouchId = -1; + foreach (var t in winTouchToInternalId) + { + if (t.Value == touch) + { + internalTouchId = t.Key; + break; + } + } + if (internalTouchId > -1) + { + cancelPointer(touch); + winTouchToInternalId.Remove(internalTouchId); + if (shouldReturn) winTouchToInternalId[internalTouchId] = internalReturnTouchPointer(touch); + return true; + } + return false; + } + + /// + /// Releases resources. + /// + public virtual void Dispose() + { + foreach (var i in winTouchToInternalId) cancelPointer(i.Value); + winTouchToInternalId.Clear(); + + enablePressAndHold(); + DisposePlugin(); + } + + #endregion + + #region Internal methods + + /// + public virtual void INTERNAL_DiscardPointer(Pointer pointer) + { + var p = pointer as TouchPointer; + if (p == null) return; + + touchPool.Release(p); + } + + #endregion + + #region Protected methods + + protected TouchPointer internalAddTouchPointer(Vector2 position) + { + var pointer = touchPool.Get(); + pointer.Position = remapCoordinates(position); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + addPointer(pointer); + pressPointer(pointer); + return pointer; + } + + protected TouchPointer internalReturnTouchPointer(TouchPointer pointer) + { + var newPointer = touchPool.Get(); + newPointer.CopyFrom(pointer); + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + pressPointer(newPointer); + return newPointer; + } + + protected void internalRemoveTouchPointer(TouchPointer pointer) + { + pointer.Buttons &= ~Pointer.PointerButtonState.FirstButtonPressed; + pointer.Buttons |= Pointer.PointerButtonState.FirstButtonUp; + releasePointer(pointer); + removePointer(pointer); + } + + protected MousePointer internalAddMousePointer(Vector2 position) + { + var pointer = mousePool.Get(); + pointer.Position = remapCoordinates(position); + addPointer(pointer); + return pointer; + } + + protected MousePointer internalReturnMousePointer(MousePointer pointer) + { + var newPointer = mousePool.Get(); + newPointer.CopyFrom(pointer); + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) + { + // Adding down state this frame + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); + pressPointer(newPointer); + } + return newPointer; + } + + protected PenPointer internalAddPenPointer(Vector2 position) + { + if (penPointer != null) throw new InvalidOperationException("One pen pointer is already registered! Trying to add another one."); + var pointer = penPool.Get(); + pointer.Position = remapCoordinates(position); + addPointer(pointer); + return pointer; + } + + protected void internalRemovePenPointer(PenPointer pointer) + { + removePointer(pointer); + penPointer = null; + } + + protected PenPointer internalReturnPenPointer(PenPointer pointer) + { + var newPointer = penPool.Get(); + newPointer.CopyFrom(pointer); + newPointer.Flags |= Pointer.FLAG_RETURNED; + addPointer(newPointer); + if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) + { + // Adding down state this frame + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); + pressPointer(newPointer); + } + return newPointer; + } + + protected void init(TOUCH_API api) + { + Init(api, nativeLogDelegate, nativePointerDelegate); + } + + protected Vector2 remapCoordinates(Vector2 position) + { + if (CoordinatesRemapper != null) return CoordinatesRemapper.Remap(position); + return position; + } + + protected void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } + + #endregion + + #region Private functions + + private void disablePressAndHold() + { + // https://msdn.microsoft.com/en-us/library/bb969148(v=vs.85).aspx + pressAndHoldAtomID = WindowsUtils.GlobalAddAtom(PRESS_AND_HOLD_ATOM); + WindowsUtils.SetProp(hMainWindow, PRESS_AND_HOLD_ATOM, + WindowsUtils.TABLET_DISABLE_PRESSANDHOLD | // disables press and hold (right-click) gesture + WindowsUtils.TABLET_DISABLE_PENTAPFEEDBACK | // disables UI feedback on pen up (waves) + WindowsUtils.TABLET_DISABLE_PENBARRELFEEDBACK | // disables UI feedback on pen button down (circle) + WindowsUtils.TABLET_DISABLE_FLICKS // disables pen flicks (back, forward, drag down, drag up); + ); + } + + private void enablePressAndHold() + { + if (pressAndHoldAtomID != 0) + { + WindowsUtils.RemoveProp(hMainWindow, PRESS_AND_HOLD_ATOM); + WindowsUtils.GlobalDeleteAtom(pressAndHoldAtomID); + } + } + + private void setScaling() + { + var screenWidth = Screen.width; + var screenHeight = Screen.height; + + if (!Screen.fullScreen) + { + SetScreenParams(screenWidth, screenHeight, 0, 0, 1, 1); + return; + } + + int width, height; + WindowsUtils.GetNativeMonitorResolution(out width, out height); + float scale = Mathf.Max(screenWidth / ((float) width), screenHeight / ((float) height)); + SetScreenParams(screenWidth, screenHeight, (width - screenWidth / scale) * .5f, (height - screenHeight / scale) * .5f, scale, scale); + } + + #endregion + + #region Pointer callbacks + + private void nativeLog(string log) + { + Debug.Log("[WindowsTouch.dll]: " + log); + } + + private void nativePointer(int id, PointerEvent evt, PointerType type, Vector2 position, PointerData data) + { + switch (type) + { + case PointerType.Mouse: + switch (evt) + { + // Enter and Exit are not used - mouse is always present + // TODO: how does it work with 2+ mice? + case PointerEvent.Enter: + throw new NotImplementedException("This is not supposed to be called o.O"); + case PointerEvent.Leave: + break; + case PointerEvent.Down: + mousePointer.Buttons = updateButtons(mousePointer.Buttons, data.PointerFlags, data.ChangedButtons); + pressPointer(mousePointer); + break; + case PointerEvent.Up: + mousePointer.Buttons = updateButtons(mousePointer.Buttons, data.PointerFlags, data.ChangedButtons); + releasePointer(mousePointer); + break; + case PointerEvent.Update: + mousePointer.Position = position; + mousePointer.Buttons = updateButtons(mousePointer.Buttons, data.PointerFlags, data.ChangedButtons); + updatePointer(mousePointer); + break; + case PointerEvent.Cancelled: + cancelPointer(mousePointer); + // can't cancel the mouse pointer, it is always present + mousePointer = internalAddMousePointer(mousePointer.Position); + break; + } + break; + case PointerType.Touch: + TouchPointer touchPointer; + switch (evt) + { + case PointerEvent.Enter: + break; + case PointerEvent.Leave: + // Sometimes Windows might not send Up, so have to execute touch release logic here. + // Has been working fine on test devices so far. + if (winTouchToInternalId.TryGetValue(id, out touchPointer)) + { + winTouchToInternalId.Remove(id); + internalRemoveTouchPointer(touchPointer); + } + break; + case PointerEvent.Down: + touchPointer = internalAddTouchPointer(position); + touchPointer.Rotation = getTouchRotation(ref data); + touchPointer.Pressure = getTouchPressure(ref data); + winTouchToInternalId.Add(id, touchPointer); + break; + case PointerEvent.Up: + break; + case PointerEvent.Update: + if (!winTouchToInternalId.TryGetValue(id, out touchPointer)) return; + touchPointer.Position = position; + touchPointer.Rotation = getTouchRotation(ref data); + touchPointer.Pressure = getTouchPressure(ref data); + updatePointer(touchPointer); + break; + case PointerEvent.Cancelled: + if (winTouchToInternalId.TryGetValue(id, out touchPointer)) + { + winTouchToInternalId.Remove(id); + cancelPointer(touchPointer); + } + break; + } + break; + case PointerType.Pen: + switch (evt) + { + case PointerEvent.Enter: + penPointer = internalAddPenPointer(position); + penPointer.Pressure = getPenPressure(ref data); + penPointer.Rotation = getPenRotation(ref data); + break; + case PointerEvent.Leave: + if (penPointer == null) break; + internalRemovePenPointer(penPointer); + break; + case PointerEvent.Down: + if (penPointer == null) break; + penPointer.Buttons = updateButtons(penPointer.Buttons, data.PointerFlags, data.ChangedButtons); + penPointer.Pressure = getPenPressure(ref data); + penPointer.Rotation = getPenRotation(ref data); + pressPointer(penPointer); + break; + case PointerEvent.Up: + if (penPointer == null) break; + mousePointer.Buttons = updateButtons(penPointer.Buttons, data.PointerFlags, data.ChangedButtons); + releasePointer(penPointer); + break; + case PointerEvent.Update: + if (penPointer == null) break; + penPointer.Position = position; + penPointer.Pressure = getPenPressure(ref data); + penPointer.Rotation = getPenRotation(ref data); + penPointer.Buttons = updateButtons(penPointer.Buttons, data.PointerFlags, data.ChangedButtons); + updatePointer(penPointer); + break; + case PointerEvent.Cancelled: + if (penPointer == null) break; + cancelPointer(penPointer); + break; + } + break; + } + } + + private Pointer.PointerButtonState updateButtons(Pointer.PointerButtonState current, PointerFlags flags, ButtonChangeType change) + { + var currentUpDown = ((uint) current) & 0xFFFFFC00; + var pressed = ((uint) flags >> 4) & 0x1F; + var newUpDown = 0U; + if (change != ButtonChangeType.None) newUpDown = 1U << (10 + (int) change); + var combined = (Pointer.PointerButtonState) (pressed | newUpDown | currentUpDown); + return combined; + } + + private float getTouchPressure(ref PointerData data) + { + var reliable = (data.Mask & (uint) TouchMask.Pressure) > 0; + if (reliable) return data.Pressure / 1024f; + return TouchPointer.DEFAULT_PRESSURE; + } + + private float getTouchRotation(ref PointerData data) + { + var reliable = (data.Mask & (uint) TouchMask.Orientation) > 0; + if (reliable) return data.Rotation / 180f * Mathf.PI; + return TouchPointer.DEFAULT_ROTATION; + } + + private float getPenPressure(ref PointerData data) + { + var reliable = (data.Mask & (uint) PenMask.Pressure) > 0; + if (reliable) return data.Pressure / 1024f; + return PenPointer.DEFAULT_PRESSURE; + } + + private float getPenRotation(ref PointerData data) + { + var reliable = (data.Mask & (uint) PenMask.Rotation) > 0; + if (reliable) return data.Rotation / 180f * Mathf.PI; + return PenPointer.DEFAULT_ROTATION; + } + + #endregion + + #region p/invoke + + protected enum TOUCH_API + { + WIN7, + WIN8 + } + + protected enum PointerEvent : uint + { + Enter = 0x0249, + Leave = 0x024A, + Update = 0x0245, + Down = 0x0246, + Up = 0x0247, + Cancelled = 0x1000 + } + + protected enum PointerType + { + Pointer = 0x00000001, + Touch = 0x00000002, + Pen = 0x00000003, + Mouse = 0x00000004, + TouchPad = 0x00000005 + } + + [Flags] + protected enum PointerFlags + { + None = 0x00000000, + New = 0x00000001, + InRange = 0x00000002, + InContact = 0x00000004, + FirstButton = 0x00000010, + SecondButton = 0x00000020, + ThirdButton = 0x00000040, + FourthButton = 0x00000080, + FifthButton = 0x00000100, + Primary = 0x00002000, + Confidence = 0x00004000, + Canceled = 0x00008000, + Down = 0x00010000, + Update = 0x00020000, + Up = 0x00040000, + Wheel = 0x00080000, + HWheel = 0x00100000, + CaptureChanged = 0x00200000, + HasTransform = 0x00400000 + } + + protected enum ButtonChangeType + { + None, + FirstDown, + FirstUp, + SecondDown, + SecondUp, + ThirdDown, + ThirdUp, + FourthDown, + FourthUp, + FifthDown, + FifthUp + } + + [Flags] + protected enum TouchFlags + { + None = 0x00000000 + } + + [Flags] + protected enum TouchMask + { + None = 0x00000000, + ContactArea = 0x00000001, + Orientation = 0x00000002, + Pressure = 0x00000004 + } + + [Flags] + protected enum PenFlags + { + None = 0x00000000, + Barrel = 0x00000001, + Inverted = 0x00000002, + Eraser = 0x00000004 + } + + [Flags] + protected enum PenMask + { + None = 0x00000000, + Pressure = 0x00000001, + Rotation = 0x00000002, + TiltX = 0x00000004, + TiltY = 0x00000008 + } + + [StructLayout(LayoutKind.Sequential)] + protected struct PointerData + { + public PointerFlags PointerFlags; + public uint Flags; + public uint Mask; + public ButtonChangeType ChangedButtons; + public uint Rotation; + public uint Pressure; + public int TiltX; + public int TiltY; + } + + [DllImport("WindowsTouch", CallingConvention = CallingConvention.StdCall)] + private static extern void Init(TOUCH_API api, NativeLog log, NativePointerDelegate pointerDelegate); + + [DllImport("WindowsTouch", EntryPoint = "Dispose", CallingConvention = CallingConvention.StdCall)] + private static extern void DisposePlugin(); + + [DllImport("WindowsTouch", CallingConvention = CallingConvention.StdCall)] + private static extern void SetScreenParams(int width, int height, float offsetX, float offsetY, float scaleX, float scaleY); + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsTouchHandlers.cs.meta b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsTouchHandlers.cs.meta rename to Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsTouchHandlers.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsTouchHandlers.cs deleted file mode 100644 index 777567b78..000000000 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsTouchHandlers.cs +++ /dev/null @@ -1,602 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - * @author Valentin Frolov - * @author Andrew David Griffiths - */ - -#if UNITY_STANDALONE_WIN - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace TouchScript.InputSources.InputHandlers -{ - /// - /// Windows 8 touch handling implementation which can be embedded to other (input) classes. - /// - public class Windows8TouchHandler : WindowsTouchHandler - { - - private Tags mouseTags, touchTags, penTags; - - /// - public Windows8TouchHandler(Tags touchTags, Tags mouseTags, Tags penTags, Func beginTouch, Action moveTouch, Action endTouch, Action cancelTouch) : base(touchTags, beginTouch, moveTouch, endTouch, cancelTouch) - { - this.mouseTags = mouseTags; - this.touchTags = touchTags; - this.penTags = penTags; - registerWindowProc(wndProcWin8); - } - - private IntPtr wndProcWin8(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) - { - switch (msg) - { - case WM_POINTERDOWN: - case WM_POINTERUP: - case WM_POINTERUPDATE: - decodeWin8Touches(msg, wParam, lParam); - break; - case WM_CLOSE: - SetWindowLongPtr(hWnd, -4, oldWndProcPtr); - Application.Quit(); - return IntPtr.Zero; - } - return CallWindowProc(oldWndProcPtr, hWnd, msg, wParam, lParam); - } - - private void decodeWin8Touches(uint msg, IntPtr wParam, IntPtr lParam) - { - int pointerId = LOWORD(wParam.ToInt32()); - - POINTER_INFO pointerInfo = new POINTER_INFO(); - if (!GetPointerInfo(pointerId, ref pointerInfo)) - { - return; - } - - POINT p = new POINT(); - p.X = pointerInfo.ptPixelLocation.X; - p.Y = pointerInfo.ptPixelLocation.Y; - ScreenToClient(hMainWindow, ref p); - - int existingId; - - switch (msg) - { - case WM_POINTERDOWN: - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELLED) == POINTER_FLAG_CANCELLED) break; - Tags tags = null; - switch (pointerInfo.pointerType) - { - case POINTER_INPUT_TYPE.PT_MOUSE: - tags = mouseTags; - break; - case POINTER_INPUT_TYPE.PT_TOUCH: - tags = touchTags; - break; - case POINTER_INPUT_TYPE.PT_PEN: - tags = penTags; - break; - } - winToInternalId.Add(pointerId, beginTouch(new Vector2((p.X - offsetX) * scaleX, Screen.height - (p.Y - offsetY) * scaleY), tags, true).Id); - break; - case WM_POINTERUP: - if (winToInternalId.TryGetValue(pointerId, out existingId)) - { - winToInternalId.Remove(pointerId); - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELLED) == POINTER_FLAG_CANCELLED) - cancelTouch(existingId); - else endTouch(existingId); - } - break; - case WM_POINTERUPDATE: - if (winToInternalId.TryGetValue(pointerId, out existingId)) - { - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELLED) == POINTER_FLAG_CANCELLED) - { - winToInternalId.Remove(pointerId); - cancelTouch(existingId); - } - else - { - moveTouch(existingId, - new Vector2((p.X - offsetX)*scaleX, Screen.height - (p.Y - offsetY)*scaleY)); - } - } - break; - } - } - } - - public class Windows7TouchHandler : WindowsTouchHandler - { - private int touchInputSize; - - /// - public Windows7TouchHandler(Tags tags, Func beginTouch, Action moveTouch, Action endTouch, Action cancelTouch) : base(tags, beginTouch, moveTouch, endTouch, cancelTouch) - { - touchInputSize = Marshal.SizeOf(typeof (TOUCHINPUT)); - RegisterTouchWindow(hMainWindow, 0); - registerWindowProc(wndProcWin7); - } - - /// - public override void Dispose() - { - UnregisterTouchWindow(hMainWindow); - - base.Dispose(); - } - - private IntPtr wndProcWin7(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) - { - // TODO: Add mouse support to Windows 7 - switch (msg) - { - case WM_TOUCH: - decodeWin7Touches(wParam, lParam); - break; - case WM_CLOSE: - UnregisterTouchWindow(hWnd); - SetWindowLongPtr(hWnd, -4, oldWndProcPtr); - Application.Quit(); - return IntPtr.Zero; - } - return CallWindowProc(oldWndProcPtr, hWnd, msg, wParam, lParam); - } - - private void decodeWin7Touches(IntPtr wParam, IntPtr lParam) - { - int inputCount = LOWORD(wParam.ToInt32()); - TOUCHINPUT[] inputs = new TOUCHINPUT[inputCount]; - - if (!GetTouchInputInfo(lParam, inputCount, inputs, touchInputSize)) - { - return; - } - - for (int i = 0; i < inputCount; i++) - { - TOUCHINPUT touch = inputs[i]; - - if ((touch.dwFlags & (int) TOUCH_EVENT.TOUCHEVENTF_DOWN) != 0) - { - POINT p = new POINT(); - p.X = touch.x/100; - p.Y = touch.y/100; - ScreenToClient(hMainWindow, ref p); - - winToInternalId.Add(touch.dwID, beginTouch(new Vector2((p.X - offsetX)*scaleX, Screen.height - (p.Y - offsetY)*scaleY), tags, true).Id); - } - else if ((touch.dwFlags & (int) TOUCH_EVENT.TOUCHEVENTF_UP) != 0) - { - int existingId; - if (winToInternalId.TryGetValue(touch.dwID, out existingId)) - { - winToInternalId.Remove(touch.dwID); - endTouch(existingId); - } - } - else if ((touch.dwFlags & (int) TOUCH_EVENT.TOUCHEVENTF_MOVE) != 0) - { - int existingId; - if (winToInternalId.TryGetValue(touch.dwID, out existingId)) - { - POINT p = new POINT(); - p.X = touch.x/100; - p.Y = touch.y/100; - ScreenToClient(hMainWindow, ref p); - - moveTouch(existingId, - new Vector2((p.X - offsetX)*scaleX, Screen.height - (p.Y - offsetY)*scaleY)); - } - } - } - - CloseTouchInputHandle(lParam); - } - } - - public abstract class WindowsTouchHandler : IDisposable - { - /// - /// Source of touch input. - /// - public enum TouchSource - { - Touch, - Pen, - Mouse - } - - /// - /// Windows constant to turn off press and hold visual effect. - /// - public const string PRESS_AND_HOLD_ATOM = "MicrosoftTabletPenServiceProperty"; - - public delegate IntPtr WndProcDelegate(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); - - protected Func beginTouch; - protected Action moveTouch; - protected Action endTouch; - protected Action cancelTouch; - - protected Tags tags; - protected IntPtr hMainWindow; - protected IntPtr oldWndProcPtr; - protected IntPtr newWndProcPtr; - protected WndProcDelegate newWndProc; - protected ushort pressAndHoldAtomID; - protected Dictionary winToInternalId = new Dictionary(); - - protected float offsetX, offsetY, scaleX, scaleY; - - /// - /// Initializes a new instance of the class. - /// - /// A function called when a new touch is detected. As this function must accept a Vector2 position of the new touch and return an instance of . - /// A function called when a touch is moved. As this function must accept an int id and a Vector2 position. - /// A function called when a touch is lifted off. As this function must accept an int id. - /// A function called when a touch is cancelled. As this function must accept an int id. - public WindowsTouchHandler(Tags tags, Func beginTouch, Action moveTouch, Action endTouch, Action cancelTouch) - { - this.tags = tags; - this.beginTouch = beginTouch; - this.moveTouch = moveTouch; - this.endTouch = endTouch; - this.cancelTouch = cancelTouch; - - hMainWindow = GetActiveWindow(); - disablePressAndHold(); - initScaling(); - } - - /// - public bool CancelTouch(TouchPoint touch, bool @return) - { - int internalId = -1; - foreach (var t in winToInternalId) - { - if (t.Value == touch.Id) - { - internalId = t.Key; - break; - } - } - if (internalId > -1) - { - cancelTouch(touch.Id); - if (@return) winToInternalId[internalId] = beginTouch(touch.Position, touch.Tags, false).Id; - return true; - } - return false; - } - - /// - public virtual void Dispose() - { - foreach (var i in winToInternalId) cancelTouch(i.Value); - - enablePressAndHold(); - unregisterWindowProc(); - } - - protected void registerWindowProc(WndProcDelegate windowProc) - { - newWndProc = windowProc; - newWndProcPtr = Marshal.GetFunctionPointerForDelegate(newWndProc); - oldWndProcPtr = SetWindowLongPtr(hMainWindow, -4, newWndProcPtr); - } - - protected void unregisterWindowProc() - { - SetWindowLongPtr(hMainWindow, -4, oldWndProcPtr); - hMainWindow = IntPtr.Zero; - oldWndProcPtr = IntPtr.Zero; - newWndProcPtr = IntPtr.Zero; - - newWndProc = null; - } - - protected void disablePressAndHold() - { - // https://msdn.microsoft.com/en-us/library/bb969148(v=vs.85).aspx - pressAndHoldAtomID = GlobalAddAtom(PRESS_AND_HOLD_ATOM); - SetProp(hMainWindow, PRESS_AND_HOLD_ATOM, - TABLET_DISABLE_PRESSANDHOLD | // disables press and hold (right-click) gesture - TABLET_DISABLE_PENTAPFEEDBACK | // disables UI feedback on pen up (waves) - TABLET_DISABLE_PENBARRELFEEDBACK | // disables UI feedback on pen button down (circle) - TABLET_DISABLE_FLICKS // disables pen flicks (back, forward, drag down, drag up); - ); - } - - protected void enablePressAndHold() - { - if (pressAndHoldAtomID != 0) - { - RemoveProp(hMainWindow, PRESS_AND_HOLD_ATOM); - GlobalDeleteAtom(pressAndHoldAtomID); - } - } - - protected void initScaling() - { - if (!Screen.fullScreen) - { - offsetX = offsetY = 0; - scaleX = scaleY = 1; - return; - } - - int width, height; - getNativeMonitorResolution(out width, out height); - float scale = Mathf.Max(Screen.width/((float) width), Screen.height/((float) height)); - offsetX = (width - Screen.width/scale)*.5f; - offsetY = (height - Screen.height/scale)*.5f; - scaleX = scale; - scaleY = scale; - } - - private void getNativeMonitorResolution(out int width, out int height) - { - var monitor = MonitorFromWindow(GetActiveWindow(), MONITOR_DEFAULTTONEAREST); - MONITORINFO monitorInfo = new MONITORINFO(); - monitorInfo.cbSize = Marshal.SizeOf(monitorInfo); - if (!GetMonitorInfo(monitor, ref monitorInfo)) - { - width = Screen.width; - height = Screen.height; - } - else - { - width = monitorInfo.rcMonitor.Width; - height = monitorInfo.rcMonitor.Height; - } - } - - #region p/invoke - - public const int WM_CLOSE = 0x0010; - public const int WM_TOUCH = 0x0240; - public const int WM_POINTERDOWN = 0x0246; - public const int WM_POINTERUP = 0x0247; - public const int WM_POINTERUPDATE = 0x0245; - - public const int POINTER_FLAG_CANCELLED = 0x00008000; - - public const int TABLET_DISABLE_PRESSANDHOLD = 0x00000001; - public const int TABLET_DISABLE_PENTAPFEEDBACK = 0x00000008; - public const int TABLET_DISABLE_PENBARRELFEEDBACK = 0x00000010; - public const int TABLET_DISABLE_FLICKS = 0x00010000; - - public const int MONITOR_DEFAULTTONEAREST = 2; - - [StructLayout(LayoutKind.Sequential)] - public struct MONITORINFO - { - public int cbSize; - public RECT rcMonitor; - public RECT rcWork; - public uint dwFlags; - } - - [StructLayout(LayoutKind.Sequential)] - public struct RECT - { - public int Left, Top, Right, Bottom; - - public RECT(int left, int top, int right, int bottom) - { - Left = left; - Top = top; - Right = right; - Bottom = bottom; - } - - public int X - { - get { return Left; } - set - { - Right -= (Left - value); - Left = value; - } - } - - public int Y - { - get { return Top; } - set - { - Bottom -= (Top - value); - Top = value; - } - } - - public int Height - { - get { return Bottom - Top; } - set { Bottom = value + Top; } - } - - public int Width - { - get { return Right - Left; } - set { Right = value + Left; } - } - } - - public enum TOUCH_EVENT : int - { - TOUCHEVENTF_MOVE = 0x0001, - TOUCHEVENTF_DOWN = 0x0002, - TOUCHEVENTF_UP = 0x0004, - TOUCHEVENTF_INRANGE = 0x0008, - TOUCHEVENTF_PRIMARY = 0x0010, - TOUCHEVENTF_NOCOALESCE = 0x0020, - TOUCHEVENTF_PEN = 0x0040 - } - - [StructLayout(LayoutKind.Sequential)] - public struct TOUCHINPUT - { - public int x; - public int y; - public IntPtr hSource; - public int dwID; - public int dwFlags; - public int dwMask; - public int dwTime; - public IntPtr dwExtraInfo; - public int cxContact; - public int cyContact; - } - - public enum POINTER_INPUT_TYPE - { - PT_POINTER = 0x00000001, - PT_TOUCH = 0x00000002, - PT_PEN = 0x00000003, - PT_MOUSE = 0x00000004, - } - - public enum POINTER_BUTTON_CHANGE_TYPE - { - POINTER_CHANGE_NONE, - POINTER_CHANGE_FIRSTBUTTON_DOWN, - POINTER_CHANGE_FIRSTBUTTON_UP, - POINTER_CHANGE_SECONDBUTTON_DOWN, - POINTER_CHANGE_SECONDBUTTON_UP, - POINTER_CHANGE_THIRDBUTTON_DOWN, - POINTER_CHANGE_THIRDBUTTON_UP, - POINTER_CHANGE_FOURTHBUTTON_DOWN, - POINTER_CHANGE_FOURTHBUTTON_UP, - POINTER_CHANGE_FIFTHBUTTON_DOWN, - POINTER_CHANGE_FIFTHBUTTON_UP, - } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct POINTER_INFO - { - public POINTER_INPUT_TYPE pointerType; - public UInt32 pointerId; - public UInt32 frameId; - public UInt32 pointerFlags; - public IntPtr sourceDevice; - public IntPtr hwndTarget; - public POINT ptPixelLocation; - public POINT ptHimetricLocation; - public POINT ptPixelLocationRaw; - public POINT ptHimetricLocationRaw; - public UInt32 dwTime; - public UInt32 historyCount; - public Int32 inputData; - public UInt32 dwKeyStates; - public UInt64 PerformanceCount; - public POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; - } - - [StructLayout(LayoutKind.Sequential)] - public struct POINT - { - public int X; - public int Y; - } - - public static int LOWORD(int value) - { - return value & 0xffff; - } - - public static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong) - { - if (IntPtr.Size == 8) return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); - return new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32())); - } - - [DllImport("user32.dll")] - public static extern IntPtr GetActiveWindow(); - - [DllImport("user32.dll")] - public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); - - [DllImport("user32.dll")] - public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi); - - [DllImport("user32.dll", EntryPoint = "SetWindowLong")] - public static extern int SetWindowLong32(IntPtr hWnd, int nIndex, int dwNewLong); - - [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")] - public static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong); - - [DllImport("user32.dll")] - public static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint msg, IntPtr wParam, - IntPtr lParam); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool RegisterTouchWindow(IntPtr hWnd, uint ulFlags); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool UnregisterTouchWindow(IntPtr hWnd); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetTouchInputInfo(IntPtr hTouchInput, int cInputs, [Out] TOUCHINPUT[] pInputs, - int cbSize); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern void CloseTouchInputHandle(IntPtr lParam); - - [DllImport("user32.dll")] - public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetPointerInfo(int pointerID, ref POINTER_INFO pPointerInfo); - - [DllImport("Kernel32.dll")] - public static extern ushort GlobalAddAtom(string lpString); - - [DllImport("Kernel32.dll")] - public static extern ushort GlobalDeleteAtom(ushort nAtom); - - [DllImport("user32.dll")] - public static extern int SetProp(IntPtr hWnd, string lpString, int hData); - - [DllImport("user32.dll")] - public static extern int RemoveProp(IntPtr hWnd, string lpString); - - #endregion - } - - /// - /// A class which turns on mouse to WM_POINTER events redirection on Windows 8. - /// - public class Windows8MouseHandler : IDisposable - { - /// - /// Initializes a new instance of the class. - /// - public Windows8MouseHandler() - { - EnableMouseInPointer(true); - } - - /// - public void Dispose() - { - EnableMouseInPointer(false); - } - - [DllImport("user32.dll")] - private static extern IntPtr EnableMouseInPointer(bool value); - } -} - -#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs index 1a01d613d..bd6d5d065 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs @@ -3,12 +3,21 @@ */ using System; +using TouchScript.Core; +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.InputSources { + + #region Consts + + public delegate void PointerDelegate(Pointer pointer); + + #endregion + /// - /// Base class for all touch input sources. + /// Base class for all pointer input sources. /// public abstract class InputSource : MonoBehaviour, IInputSource { @@ -18,16 +27,27 @@ public abstract class InputSource : MonoBehaviour, IInputSource /// Gets or sets current remapper. /// /// Optional remapper to use to change screen coordinates which go into the TouchManager. - public ICoordinatesRemapper CoordinatesRemapper { get; set; } + public ICoordinatesRemapper CoordinatesRemapper + { + get { return coordinatesRemapper; } + set + { + if (coordinatesRemapper == value) return; + coordinatesRemapper = value; + updateCoordinatesRemapper(value); + } + } #endregion #region Private variables + /// [SerializeField] [HideInInspector] - private bool advancedProps; // is used to save whether advanced properties are opened or closed + protected bool basicEditor = true; + private ICoordinatesRemapper coordinatesRemapper; private TouchManagerInstance manager; #endregion @@ -35,10 +55,26 @@ public abstract class InputSource : MonoBehaviour, IInputSource #region Public methods /// - public virtual void UpdateInput() {} + public virtual bool UpdateInput() + { + return false; + } + + /// + public virtual void UpdateResolution() {} + + /// + public virtual bool CancelPointer(Pointer pointer, bool shouldReturn) + { + return false; + } + + #endregion + + #region Internal methods /// - public virtual void CancelTouch(TouchPoint touch, bool @return) {} + public virtual void INTERNAL_DiscardPointer(Pointer pointer) {} #endregion @@ -71,57 +107,80 @@ protected virtual void OnDisable() #region Protected methods /// - /// Begin touch in given screen position. + /// Adds the pointer to the system. /// - /// Screen position. - /// Initial tags. - /// if set to true a can be used on provided coordinates. - /// Internal touch id. - protected virtual TouchPoint beginTouch(Vector2 position, Tags tags, bool canRemap = true) + /// The pointer to add. + protected virtual void addPointer(Pointer pointer) { - if (CoordinatesRemapper != null && canRemap) position = CoordinatesRemapper.Remap(position); - return manager.INTERNAL_BeginTouch(position, this, tags); + manager.INTERNAL_AddPointer(pointer); } /// - /// Mark touch as updated. + /// Mark pointer as updated. /// - /// Touch id. - protected virtual void updateTouch(int id) + /// The pointer to update. + protected virtual void updatePointer(Pointer pointer) { - manager.INTERNAL_UpdateTouch(id); + if (pointer == null) return; + manager.INTERNAL_UpdatePointer(pointer.Id); } /// - /// Mark touch as moved. + /// Mark the pointer as touching the surface. /// - /// Touch id. - /// Screen position. - protected virtual void moveTouch(int id, Vector2 position) + /// The pointer. + protected virtual void pressPointer(Pointer pointer) { - if (CoordinatesRemapper != null) - { - position = CoordinatesRemapper.Remap(position); - } - manager.INTERNAL_MoveTouch(id, position); + if (pointer == null) return; + manager.INTERNAL_PressPointer(pointer.Id); + } + + /// + /// Mark the pointer as no longer touching the surface. + /// + /// The pointer. + protected virtual void releasePointer(Pointer pointer) + { + if (pointer == null) return; + pointer.Buttons &= ~Pointer.PointerButtonState.AnyButtonPressed; + manager.INTERNAL_ReleasePointer(pointer.Id); } /// - /// End touch with id. + /// Removes the pointer. /// - /// Touch point id. - protected virtual void endTouch(int id) + /// The pointer. + protected virtual void removePointer(Pointer pointer) { - manager.INTERNAL_EndTouch(id); + if (pointer == null) return; + manager.INTERNAL_RemovePointer(pointer.Id); } /// - /// Cancel touch with id. + /// Cancels the pointer. + /// + /// The pointer. + protected virtual void cancelPointer(Pointer pointer) + { + if (pointer == null) return; + manager.INTERNAL_CancelPointer(pointer.Id); + } + + /// + /// Called from setter to update touch handlers with the new value. + /// + /// The new remapper. + protected virtual void updateCoordinatesRemapper(ICoordinatesRemapper remapper) {} + + /// + /// Remaps the coordinates using the if it is set. /// - /// Touch id. - protected virtual void cancelTouch(int id) + /// The position. + /// Remapped position if is set; the value of position argument otherwise. + protected virtual Vector2 remapCoordinates(Vector2 position) { - manager.INTERNAL_CancelTouch(id); + if (coordinatesRemapper != null) return coordinatesRemapper.Remap(position); + return position; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs b/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs deleted file mode 100644 index be3d89c9f..000000000 --- a/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @author Michael Holub - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Utils.Attributes; -using UnityEngine; -using TouchScript.InputSources.InputHandlers; - -namespace TouchScript.InputSources -{ - /// - /// Mobile Input Source. Gathers touch input from built-in Unity's Input.Touches API. Though, should be used on mobile devices. - /// - [System.Obsolete("MobileInput is deprecated! Please use StandardInput instead.")] - public sealed class MobileInput : InputSource - { - #region Public properties - - /// - /// Indicates if this input source should be disabled on platforms which don't support touch input with Input.Touches. - /// - [ToggleLeft] - public bool DisableOnNonTouchPlatforms = true; - - /// - /// Tags added to touches coming from this input. - /// - public Tags Tags = new Tags(Tags.INPUT_TOUCH); - - #endregion - - #region Private variables - - private TouchHandler touchHandler; - - #endregion - - #region Public methods - - /// - public override void UpdateInput() - { - base.UpdateInput(); - - if (touchHandler != null) touchHandler.Update(); - } - - /// - public override void CancelTouch(TouchPoint touch, bool @return) - { - base.CancelTouch(touch, @return); - - if (touchHandler != null) touchHandler.CancelTouch(touch, @return); - } - - #endregion - - #region Unity methods - - /// - protected override void OnEnable() - { - Debug.LogWarning("[TouchScript] MobileInput is deprecated! Please use StandardInput instead."); - - if (DisableOnNonTouchPlatforms) - { - switch (Application.platform) - { - case RuntimePlatform.Android: - case RuntimePlatform.IPhonePlayer: - case RuntimePlatform.MetroPlayerARM: - case RuntimePlatform.MetroPlayerX64: - case RuntimePlatform.MetroPlayerX86: - case RuntimePlatform.WP8Player: - case RuntimePlatform.BlackBerryPlayer: - break; - default: - // don't need mobile touch here - enabled = false; - return; - } - } - - touchHandler = new TouchHandler(Tags, beginTouch, moveTouch, endTouch, cancelTouch); - - base.OnEnable(); - } - - /// - protected override void OnDisable() - { - if (touchHandler != null) - { - touchHandler.Dispose(); - touchHandler = null; - } - - base.OnDisable(); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs.meta b/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs.meta deleted file mode 100644 index 5ee21e83d..000000000 --- a/Source/Assets/TouchScript/Scripts/InputSources/MobileInput.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 33cbf52dea18b40649d742b0c6f96d3c -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs b/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs deleted file mode 100644 index f674f6426..000000000 --- a/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Utils.Attributes; -using UnityEngine; -using TouchScript.InputSources.InputHandlers; - -namespace TouchScript.InputSources -{ - /// - /// Input source which transfers mouse clicks to touches. - /// - [System.Obsolete("MouseInput is deprecated! Please use StandardInput instead.")] - public sealed class MouseInput : InputSource - { - #region Public properties - - /// - /// Indicates if this input source should be disabled on mobile platforms. - /// - /// - /// Operation Systems which support touch input send first touches as mouse clicks which may result in duplicated touch points in exactly the same coordinates. This affects clusters and multitouch gestures. - /// - [ToggleLeft] - public bool DisableOnMobilePlatforms = true; - - /// - /// Tags added to touches coming from this input. - /// - public Tags Tags = new Tags(Tags.INPUT_MOUSE); - - #endregion - - #region Private variables - - private MouseHandler mouseHandler; - - #endregion - - #region Public methods - - /// - public override void UpdateInput() - { - base.UpdateInput(); - - mouseHandler.Update(); - } - - /// - public override void CancelTouch(TouchPoint touch, bool @return) - { - base.CancelTouch(touch, @return); - - if (mouseHandler != null) mouseHandler.CancelTouch(touch, @return); - } - - #endregion - - #region Unity methods - - /// - protected override void OnEnable() - { - base.OnEnable(); - - Debug.LogWarning("[TouchScript] MouseInput is deprecated! Please use StandardInput instead."); - - if (DisableOnMobilePlatforms) - { - switch (Application.platform) - { - case RuntimePlatform.Android: - case RuntimePlatform.IPhonePlayer: - case RuntimePlatform.WP8Player: - case RuntimePlatform.MetroPlayerARM: - case RuntimePlatform.MetroPlayerX64: - case RuntimePlatform.MetroPlayerX86: - case RuntimePlatform.TizenPlayer: - case RuntimePlatform.BlackBerryPlayer: - // don't need mouse here - enabled = false; - return; - } - } - - mouseHandler = new MouseHandler(Tags, beginTouch, moveTouch, endTouch, cancelTouch); - } - - /// - protected override void OnDisable() - { - mouseHandler.Dispose(); - mouseHandler = null; - - base.OnDisable(); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs.meta b/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs.meta deleted file mode 100644 index e01a1e26f..000000000 --- a/Source/Assets/TouchScript/Scripts/InputSources/MouseInput.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 17fdf02507df2433595874500f6eef4c -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs b/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs index cbfe97827..64e38e5f2 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -6,24 +6,26 @@ using System; #endif using TouchScript.InputSources.InputHandlers; +using TouchScript.Pointers; +using TouchScript.Utils.Attributes; using UnityEngine; namespace TouchScript.InputSources { /// - /// Processes standard input events (mouse, touch, pen) on all platforms. + /// Processes standard input events (mouse, pointer, pen) on all platforms. /// Initializes proper inputs automatically. Replaces old Mobile and Mouse inputs. /// [AddComponentMenu("TouchScript/Input Sources/Standard Input")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_InputSources_StandardInput.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_InputSources_StandardInput.htm")] public sealed class StandardInput : InputSource { #region Constants /// - /// Touch API to use on Windows 8 and later OS versions. + /// Pointer API to use on Windows 8 and later OS versions. /// - public enum Windows8TouchAPIType + public enum Windows8APIType { /// /// Windows 8 WM_POINTER API. @@ -41,15 +43,15 @@ public enum Windows8TouchAPIType Unity, /// - /// Don't initialize touch input at all. + /// Don't initialize pointer input at all. /// None } /// - /// Touch API to use on Windows 7. + /// Pointer API to use on Windows 7. /// - public enum Windows7TouchAPIType + public enum Windows7APIType { /// /// Windows 7 WM_TOUCH API. @@ -62,7 +64,7 @@ public enum Windows7TouchAPIType Unity, /// - /// Don't initialize touch input at all. + /// Don't initialize pointer input at all. /// None } @@ -77,65 +79,119 @@ public enum Windows7TouchAPIType #region Public properties /// - /// Tags added to touches coming from this input. + /// Pointer API to use on Windows 8. /// - public Tags TouchTags = new Tags(Tags.INPUT_TOUCH); - - /// - /// Tags added to mouse touches coming from this input. - /// - public Tags MouseTags = new Tags(Tags.INPUT_MOUSE); - - /// - /// Tags added to pen touches coming from this input. - /// - public Tags PenTags = new Tags(Tags.INPUT_PEN); - - /// - /// Touch API to use on Windows 8. - /// - public Windows8TouchAPIType Windows8Touch = Windows8TouchAPIType.Windows8; - - /// - /// Touch API to use on Windows 7. - /// - public Windows7TouchAPIType Windows7Touch = Windows7TouchAPIType.Windows7; + public Windows8APIType Windows8API + { + get { return windows8API; } + } /// - /// Initialize touch input in WebPlayer or not. + /// Pointer API to use on Windows 7. /// - public bool WebPlayerTouch = true; + public Windows7APIType Windows7API + { + get { return windows7API; } + } /// /// Initialize touch input in WebGL or not. /// - public bool WebGLTouch = true; + public bool WebGLTouch + { + get { return webGLTouch; } + } /// /// Initialize mouse input on Windows 8+ or not. /// - public bool Windows8Mouse = true; + public bool Windows8Mouse + { + get { return windows8Mouse; } + } /// /// Initialize mouse input on Windows 7 or not. /// - public bool Windows7Mouse = true; + public bool Windows7Mouse + { + get { return windows7Mouse; } + } /// /// Initialize mouse input on UWP or not. /// - public bool UniversalWindowsMouse = true; + public bool UniversalWindowsMouse + { + get { return universalWindowsMouse; } + } + + /// + /// Use emulated second mouse pointer with ALT or not. + /// + public bool EmulateSecondMousePointer + { + get { return emulateSecondMousePointer; } + set + { + emulateSecondMousePointer = value; + if (mouseHandler != null) mouseHandler.EmulateSecondMousePointer = value; + } + } #endregion #region Private variables + private static StandardInput instance; + +#pragma warning disable CS0414 + + [SerializeField] + [HideInInspector] + private bool generalProps; // Used in the custom inspector + + [SerializeField] + [HideInInspector] + private bool windowsProps; // Used in the custom inspector + + [SerializeField] + [HideInInspector] + private bool webglProps; // Used in the custom inspector + +#pragma warning restore CS0414 + + [SerializeField] + private Windows8APIType windows8API = Windows8APIType.Windows8; + + [SerializeField] + private Windows7APIType windows7API = Windows7APIType.Windows7; + + [ToggleLeft] + [SerializeField] + private bool webGLTouch = true; + + [ToggleLeft] + [SerializeField] + private bool windows8Mouse = true; + + [ToggleLeft] + [SerializeField] + private bool windows7Mouse = true; + + [ToggleLeft] + [SerializeField] + private bool universalWindowsMouse = true; + + [ToggleLeft] + [SerializeField] + private bool emulateSecondMousePointer = true; + private MouseHandler mouseHandler; private TouchHandler touchHandler; #if UNITY_STANDALONE_WIN && !UNITY_EDITOR - private Windows8MouseHandler windows8MouseHandler; - private Windows8TouchHandler windows8TouchHandler; - private Windows7TouchHandler windows7TouchHandler; + private Windows8PointerHandler windows8PointerHandler; + private Windows7PointerHandler windows7PointerHandler; #endif #endregion @@ -143,36 +199,65 @@ public enum Windows7TouchAPIType #region Public methods /// - public override void UpdateInput() + public override bool UpdateInput() { - base.UpdateInput(); + if (base.UpdateInput()) return true; - if (touchHandler != null) + var handled = false; +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + if (windows8PointerHandler != null) { - touchHandler.Update(); - // Unity adds mouse events from touches resulting in duplicated pointers. - // Don't update mouse if touch input is present. - if (mouseHandler != null) + handled = windows8PointerHandler.UpdateInput(); + } + else + { + if (windows7PointerHandler != null) { - if (touchHandler.HasTouches) mouseHandler.EndTouches(); - else mouseHandler.Update(); + handled = windows7PointerHandler.UpdateInput(); } + else +#endif + if (touchHandler != null) + { + handled = touchHandler.UpdateInput(); + } + if (mouseHandler != null) + { + if (handled) mouseHandler.CancelMousePointer(); + else handled = mouseHandler.UpdateInput(); } - else if (mouseHandler != null) mouseHandler.Update(); + +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + } +#endif + return handled; } /// - public override void CancelTouch(TouchPoint touch, bool @return) + public override void UpdateResolution() { - base.CancelTouch(touch, @return); +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + if (windows8PointerHandler != null) windows8PointerHandler.UpdateResolution(); + else if (windows7PointerHandler != null) windows7PointerHandler.UpdateResolution(); +#endif + if (touchHandler != null) touchHandler.UpdateResolution(); + if (mouseHandler != null) mouseHandler.UpdateResolution(); + } + + /// + public override bool CancelPointer(Pointer pointer, bool shouldReturn) + { + base.CancelPointer(pointer, shouldReturn); var handled = false; - if (touchHandler != null) handled = touchHandler.CancelTouch(touch, @return); - if (mouseHandler != null && !handled) handled = mouseHandler.CancelTouch(touch, @return); + if (touchHandler != null) handled = touchHandler.CancelPointer(pointer, shouldReturn); + if (mouseHandler != null && !handled) handled = mouseHandler.CancelPointer(pointer, shouldReturn); #if UNITY_STANDALONE_WIN && !UNITY_EDITOR - if (windows7TouchHandler != null && !handled) handled = windows7TouchHandler.CancelTouch(touch, @return); - if (windows8TouchHandler != null && !handled) windows8TouchHandler.CancelTouch(touch, @return); + if (windows7PointerHandler != null && !handled) handled = windows7PointerHandler.CancelPointer(pointer, shouldReturn); + if (windows8PointerHandler != null && !handled) handled = windows8PointerHandler.CancelPointer(pointer, shouldReturn); #endif + + return handled; } #endregion @@ -182,8 +267,13 @@ public override void CancelTouch(TouchPoint touch, bool @return) /// protected override void OnEnable() { + if (instance != null) Destroy(instance); + instance = this; + base.OnEnable(); + Input.simulateMouseWithTouches = false; + #if UNITY_EDITOR enableTouch(); enableMouse(); @@ -196,21 +286,20 @@ protected override void OnEnable() if (Environment.OSVersion.Version >= WIN8_VERSION) { // Windows 8+ - switch (Windows8Touch) + switch (Windows8API) { - case Windows8TouchAPIType.Windows8: + case Windows8APIType.Windows8: enableWindows8Touch(); - if (Windows8Mouse) enableWindows8Mouse(); break; - case Windows8TouchAPIType.Windows7: + case Windows8APIType.Windows7: enableWindows7Touch(); if (Windows8Mouse) enableMouse(); break; - case Windows8TouchAPIType.Unity: + case Windows8APIType.Unity: enableTouch(); if (Windows8Mouse) enableMouse(); break; - case Windows8TouchAPIType.None: + case Windows8APIType.None: enableMouse(); break; } @@ -218,17 +307,17 @@ protected override void OnEnable() else if (Environment.OSVersion.Version >= WIN7_VERSION) { // Windows 7 - switch (Windows7Touch) + switch (Windows7API) { - case Windows7TouchAPIType.Windows7: + case Windows7APIType.Windows7: enableWindows7Touch(); if (Windows7Mouse) enableMouse(); break; - case Windows7TouchAPIType.Unity: + case Windows7APIType.Unity: enableTouch(); if (Windows7Mouse) enableMouse(); break; - case Windows7TouchAPIType.None: + case Windows7APIType.None: enableMouse(); break; } @@ -244,9 +333,6 @@ protected override void OnEnable() // Some other earlier Windows enableMouse(); } -#elif UNITY_WEBPLAYER - if (WebPlayerTouch) enableTouch(); - enableMouse(); #elif UNITY_WEBGL if (WebGLTouch) enableTouch(); enableMouse(); @@ -259,6 +345,7 @@ protected override void OnEnable() enableTouch(); #endif #endif + if (CoordinatesRemapper != null) updateCoordinatesRemapper(CoordinatesRemapper); } /// @@ -267,7 +354,6 @@ protected override void OnDisable() disableMouse(); disableTouch(); #if UNITY_STANDALONE_WIN && !UNITY_EDITOR - disableWindows8Mouse(); disableWindows7Touch(); disableWindows8Touch(); #endif @@ -275,13 +361,36 @@ protected override void OnDisable() base.OnDisable(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + + #endregion + + #region Protected methods + + /// + protected override void updateCoordinatesRemapper(ICoordinatesRemapper remapper) + { + base.updateCoordinatesRemapper(remapper); + if (mouseHandler != null) mouseHandler.CoordinatesRemapper = remapper; + if (touchHandler != null) touchHandler.CoordinatesRemapper = remapper; +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + if (windows7PointerHandler != null) windows7PointerHandler.CoordinatesRemapper = remapper; + if (windows8PointerHandler != null) windows8PointerHandler.CoordinatesRemapper = remapper; +#endif + } + #endregion #region Private functions private void enableMouse() { - mouseHandler = new MouseHandler(MouseTags, beginTouch, moveTouch, endTouch, cancelTouch); + mouseHandler = new MouseHandler(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer); + mouseHandler.EmulateSecondMousePointer = emulateSecondMousePointer; Debug.Log("[TouchScript] Initialized Unity mouse input."); } @@ -296,7 +405,7 @@ private void disableMouse() private void enableTouch() { - touchHandler = new TouchHandler(TouchTags, beginTouch, moveTouch, endTouch, cancelTouch); + touchHandler = new TouchHandler(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer); Debug.Log("[TouchScript] Initialized Unity touch input."); } @@ -310,48 +419,34 @@ private void disableTouch() } #if UNITY_STANDALONE_WIN && !UNITY_EDITOR - private void enableWindows8Mouse() - { - windows8MouseHandler = new Windows8MouseHandler(); - Debug.Log("[TouchScript] Initialized Windows 8 mouse input."); - } - - private void disableWindows8Mouse() - { - if (windows8MouseHandler != null) - { - windows8MouseHandler.Dispose(); - windows8MouseHandler = null; - } - } - private void enableWindows7Touch() { - windows7TouchHandler = new Windows7TouchHandler(TouchTags, beginTouch, moveTouch, endTouch, cancelTouch); - Debug.Log("[TouchScript] Initialized Windows 7 touch input."); + windows7PointerHandler = new Windows7PointerHandler(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer); + Debug.Log("[TouchScript] Initialized Windows 7 pointer input."); } private void disableWindows7Touch() { - if (windows7TouchHandler != null) + if (windows7PointerHandler != null) { - windows7TouchHandler.Dispose(); - windows7TouchHandler = null; + windows7PointerHandler.Dispose(); + windows7PointerHandler = null; } } private void enableWindows8Touch() { - windows8TouchHandler = new Windows8TouchHandler(TouchTags, MouseTags, PenTags, beginTouch, moveTouch, endTouch, cancelTouch); - Debug.Log("[TouchScript] Initialized Windows 8 touch input."); + windows8PointerHandler = new Windows8PointerHandler(addPointer, updatePointer, pressPointer, releasePointer, removePointer, cancelPointer); + windows8PointerHandler.MouseInPointer = windows8Mouse; + Debug.Log("[TouchScript] Initialized Windows 8 pointer input."); } private void disableWindows8Touch() { - if (windows8TouchHandler != null) + if (windows8PointerHandler != null) { - windows8TouchHandler.Dispose(); - windows8TouchHandler = null; + windows8PointerHandler.Dispose(); + windows8PointerHandler = null; } } #endif diff --git a/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs.meta b/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs.meta index f7502cd26..30c22b5dc 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs.meta +++ b/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/LayerManager.cs b/Source/Assets/TouchScript/Scripts/LayerManager.cs new file mode 100644 index 000000000..15a489a43 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/LayerManager.cs @@ -0,0 +1,24 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Core; +using UnityEngine; + +namespace TouchScript +{ + /// + /// Facade for current instance of . + /// + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_LayerManager.htm")] + public sealed class LayerManager : MonoBehaviour + { + /// + /// Gets the LayerManager instance. + /// + public static ILayerManager Instance + { + get { return LayerManagerInstance.Instance; } + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/LayerManager.cs.meta b/Source/Assets/TouchScript/Scripts/LayerManager.cs.meta new file mode 100644 index 000000000..fd683f038 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/LayerManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3e8fcbff26c96d94ab9865ea8a8607d4 +timeCreated: 1500755913 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs deleted file mode 100644 index 8d186a3e0..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Hit; -using UnityEngine; - -namespace TouchScript.Layers -{ - /// - /// Touch layer which represents a 3d camera looking into the world. Determines which objects may be hit in the view of a camera attached to parent GameObject. - /// - [AddComponentMenu("TouchScript/Layers/Camera Layer")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Layers_CameraLayer.htm")] - public class CameraLayer : CameraLayerBase - { - #region Private variables - - private List sortedHits = new List(20); - private Transform cachedTransform; - private List tmpHitTestList = new List(10); - - #endregion - - #region Unity methods - - /// - protected override void Awake() - { - base.Awake(); - if (!Application.isPlaying) return; - - cachedTransform = GetComponent(); - } - - #endregion - - #region Protected functions - - /// - protected override LayerHitResult castRay(Ray ray, out TouchHit hit) - { - hit = default(TouchHit); - var raycastHits = Physics.RaycastAll(ray, float.PositiveInfinity, LayerMask); - - if (raycastHits.Length == 0) return LayerHitResult.Miss; - if (raycastHits.Length > 1) - { - sortHits(raycastHits); - - RaycastHit raycastHit = default(RaycastHit); - var i = 0; - while (i < sortedHits.Count) - { - raycastHit = sortedHits[i]; - switch (doHit(raycastHit, out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Discard: - return LayerHitResult.Miss; - } - i++; - } - } - else - { - switch (doHit(raycastHits[0], out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Error: - return LayerHitResult.Error; - default: - return LayerHitResult.Miss; - } - } - - return LayerHitResult.Miss; - } - - private HitTest.ObjectHitResult doHit(RaycastHit raycastHit, out TouchHit hit) - { - hit = new TouchHit(raycastHit); - raycastHit.transform.GetComponents(tmpHitTestList); - var count = tmpHitTestList.Count; - if (count == 0) return HitTest.ObjectHitResult.Hit; - - var hitResult = HitTest.ObjectHitResult.Hit; - for (var i = 0; i < count; i++) - { - var test = tmpHitTestList[i]; - if (!test.enabled) continue; - hitResult = test.IsHit(hit); - if (hitResult == HitTest.ObjectHitResult.Miss || hitResult == HitTest.ObjectHitResult.Discard) break; - } - - return hitResult; - } - - private void sortHits(RaycastHit[] hits) - { - var cameraPos = cachedTransform.position; - sortedHits.Clear(); - sortedHits.AddRange(hits); - sortedHits.Sort((a, b) => - { - if (a.collider.transform == b.collider.transform) return 0; - var distA = (a.point - cameraPos).sqrMagnitude; - var distB = (b.point - cameraPos).sqrMagnitude; - return distA < distB ? -1 : 1; - }); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs.meta deleted file mode 100644 index c5644f73c..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4c21776f7e73345948c045618b3fad6f -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs b/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs deleted file mode 100644 index 1225010a0..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Hit; -using UnityEngine; - -namespace TouchScript.Layers -{ - /// - /// Touch layer which works with Unity 4.3+ 2d physics. Can pick 2d objects hit by touches in right order. - /// - [AddComponentMenu("TouchScript/Layers/Camera Layer 2D")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Layers_CameraLayer2D.htm")] - public class CameraLayer2D : CameraLayerBase - { - #region Private variables - - [SerializeField] - [HideInInspector] - private int[] layerIds = new int[0]; - - private Dictionary layerById = new Dictionary(); - private List sortedHits = new List(20); - private List tmpHitTestList = new List(10); - - #endregion - - #region Unity methods - - /// - /// Unity OnEnable callback. - /// - protected virtual void OnEnable() - { - if (!Application.isPlaying) return; - - layerById.Clear(); - for (var i = 0; i < layerIds.Length; i++) - { - var value = layerIds[i]; - if (layerById.ContainsKey(value)) continue; - layerById.Add(value, i); - } - } - - #endregion - - #region Protected functions - - /// - protected override LayerHitResult castRay(Ray ray, out TouchHit hit) - { - hit = default(TouchHit); - var raycastHits = Physics2D.GetRayIntersectionAll(ray, float.PositiveInfinity, LayerMask); - - if (raycastHits.Length == 0) return LayerHitResult.Miss; - if (raycastHits.Length > 1) - { - sortHits(raycastHits); - - RaycastHit2D raycastHit = default(RaycastHit2D); - var i = 0; - while (i < sortedHits.Count) - { - raycastHit = sortedHits[i]; - switch (doHit(raycastHit, out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Discard: - return LayerHitResult.Miss; - } - i++; - } - } - else - { - switch (doHit(raycastHits[0], out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Error: - return LayerHitResult.Error; - default: - return LayerHitResult.Miss; - } - } - - return LayerHitResult.Miss; - } - - private HitTest.ObjectHitResult doHit(RaycastHit2D raycastHit, out TouchHit hit) - { - hit = new TouchHit(raycastHit); - raycastHit.transform.GetComponents(tmpHitTestList); - var count = tmpHitTestList.Count; - if (count == 0) return HitTest.ObjectHitResult.Hit; - - - var hitResult = HitTest.ObjectHitResult.Hit; - for (var i = 0; i < count; i++) - { - var test = tmpHitTestList[i]; - if (!test.enabled) continue; - hitResult = test.IsHit(hit); - if (hitResult == HitTest.ObjectHitResult.Miss || hitResult == HitTest.ObjectHitResult.Discard) break; - } - - return hitResult; - } - - private void sortHits(RaycastHit2D[] hits) - { - sortedHits.Clear(); - sortedHits.AddRange(hits); - sortedHits.Sort((a, b) => - { - if (a.collider.transform == b.collider.transform) return 0; - - var sprite1 = a.transform.GetComponent(); - var sprite2 = b.transform.GetComponent(); - if (sprite1 != null && sprite2 != null) - { - int s1Id, s2Id; - if (!layerById.TryGetValue(sprite1.sortingLayerID, out s1Id)) s1Id = 0; - if (!layerById.TryGetValue(sprite2.sortingLayerID, out s2Id)) s2Id = 0; - if (s1Id < s2Id) return 1; - if (s1Id > s2Id) return -1; - if (sprite1.sortingOrder < sprite2.sortingOrder) return 1; - if (sprite1.sortingOrder > sprite2.sortingOrder) return -1; - } - - var cameraPos = GetComponent().transform.position; - var distA = (a.transform.position - cameraPos).sqrMagnitude; - var distB = (b.transform.position - cameraPos).sqrMagnitude; - return distA < distB ? -1 : 1; - }); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs.meta deleted file mode 100644 index 84ad2e515..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayer2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a2c791a2415314ea3b9f44592097a9d1 -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs b/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs deleted file mode 100644 index 23aca7cab..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using TouchScript.Hit; -using UnityEngine; - -namespace TouchScript.Layers -{ - /// - /// Abstract base class for camera-based layers. - /// - public abstract class CameraLayerBase : TouchLayer - { - #region Public properties - - /// - /// Gets or sets the layer mask which is used to select layers which should be touchable from this layer. - /// - /// A mask to exclude objects from possibly touchable list. - public LayerMask LayerMask - { - get { return layerMask; } - set { layerMask = value; } - } - - /// - public override Vector3 WorldProjectionNormal - { - get - { - if (_camera == null) return Vector3.forward; - return _camera.transform.forward; - } - } - - #endregion - - #region Private variables - - [SerializeField] - private LayerMask layerMask = -1; - - /// - /// Camera. - /// - protected Camera _camera; - - #endregion - - #region Public methods - - /// - public override LayerHitResult Hit(Vector2 position, out TouchHit hit) - { - if (base.Hit(position, out hit) == LayerHitResult.Miss) return LayerHitResult.Miss; - - if (_camera == null) return LayerHitResult.Error; - if (_camera.enabled == false || _camera.gameObject.activeInHierarchy == false) return LayerHitResult.Miss; - if (!_camera.pixelRect.Contains(position)) return LayerHitResult.Miss; - - var ray = _camera.ScreenPointToRay(position); - return castRay(ray, out hit); - } - - #endregion - - #region Unity methods - - /// - protected override void Awake() - { - updateCamera(); - base.Awake(); - } - - #endregion - - #region Protected functions - - /// - protected override void setName() - { - if (String.IsNullOrEmpty(Name) && _camera != null) Name = _camera.name; - } - - /// - protected override ProjectionParams createProjectionParams() - { - return new CameraProjectionParams(_camera); - } - - /// - /// Finds a camera. - /// - protected virtual void updateCamera() - { - _camera = GetComponent(); - if (_camera == null) _camera = Camera.main; - if (_camera != null) return; - Debug.LogError("No Camera found for CameraLayer '" + name + "'."); - enabled = false; - } - - /// - /// Casts a ray from camera position. - /// - /// The ray. - /// Hit information if the ray has hit something. - /// Hit result. - protected abstract LayerHitResult castRay(Ray ray, out TouchHit hit); - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs.meta deleted file mode 100644 index 852f41394..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/CameraLayerBase.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fead2d18a248a4d27b0bbe07cbf3035d -timeCreated: 1447582131 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs index 7f1ec75c5..2fc97c59b 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs @@ -4,15 +4,16 @@ using System.Collections.Generic; using TouchScript.Hit; +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Layers { /// - /// Layer which gets all input from a camera. Should be used instead of a background object getting all the touches which come through. + /// Layer which gets all input from a camera. Should be used instead of a background object getting all the pointers which come through. /// [AddComponentMenu("TouchScript/Layers/Fullscreen Layer")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Layers_FullscreenLayer.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Layers_FullscreenLayer.htm")] public class FullscreenLayer : TouchLayer { #region Constants @@ -23,17 +24,17 @@ public class FullscreenLayer : TouchLayer public enum LayerType { /// - /// Get touches from main camera. + /// Get pointers from main camera. /// MainCamera, /// - /// Get touches from specific camera. + /// Get pointers from specific camera. /// Camera, /// - /// Get all touches on Z=0 plane without a camera. + /// Get all pointers on Z=0 plane without a camera. /// Global } @@ -94,37 +95,29 @@ public override Vector3 WorldProjectionNormal private Camera _camera; private Transform cameraTransform; - private List tmpHitTestList = new List(10); #endregion #region Public methods /// - public override LayerHitResult Hit(Vector2 position, out TouchHit hit) + public override HitResult Hit(IPointer pointer, out HitData hit) { - if (base.Hit(position, out hit) == LayerHitResult.Miss) return LayerHitResult.Miss; + if (base.Hit(pointer, out hit) != HitResult.Hit) return HitResult.Miss; if (_camera != null) { - if (!_camera.pixelRect.Contains(position)) return LayerHitResult.Miss; + if (!_camera.pixelRect.Contains(pointer.Position)) return HitResult.Miss; } - hit = new TouchHit(transform); - transform.GetComponents(tmpHitTestList); - var count = tmpHitTestList.Count; - if (count == 0) return LayerHitResult.Hit; - - for (var i = 0; i < count; i++) + hit = new HitData(transform, this); + var result = checkHitFilters(pointer, hit); + if (result != HitResult.Hit) { - var test = tmpHitTestList[i]; - if (!test.enabled) continue; - var hitResult = test.IsHit(hit); - if (hitResult == HitTest.ObjectHitResult.Miss || hitResult == HitTest.ObjectHitResult.Discard) - return LayerHitResult.Miss; + hit = default(HitData); + return result; } - - return LayerHitResult.Hit; + return HitResult.Hit; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs.meta index 278d84adc..dceb231e4 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Layers/FullscreenLayer.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/ILayerDelegate.cs b/Source/Assets/TouchScript/Scripts/Layers/ILayerDelegate.cs index fed3fed53..a8dfe9ede 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/ILayerDelegate.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/ILayerDelegate.cs @@ -2,6 +2,8 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Pointers; + namespace TouchScript.Layers { /// @@ -12,12 +14,12 @@ public interface ILayerDelegate { /// - /// Returns whether a layer should receive the touch. + /// Returns whether a layer should receive the pointer. /// /// The layer. - /// The touch. + /// The pointer. /// true if it should; false otherwise. - bool ShouldReceiveTouch(TouchLayer layer, TouchPoint touch); + bool ShouldReceivePointer(TouchLayer layer, IPointer pointer); } } diff --git a/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs b/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs index 19e95a805..64ce549eb 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs @@ -1,14 +1,14 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Utils; +using TouchScript.Utils.Geom; using UnityEngine; namespace TouchScript.Layers { /// - /// specific projection parameters. Used by layers to project touches in the world and world coordinates onto layers. + /// specific projection parameters. Used by layers to project pointers in the world and world coordinates onto layers. /// public class ProjectionParams { @@ -69,18 +69,13 @@ public override Vector2 ProjectFrom(Vector3 worldPosition) /// /// Projection parameters for a UI based . /// - public class CanvasProjectionParams : ProjectionParams + public class WorldSpaceCanvasProjectionParams : ProjectionParams { /// /// The canvas. /// protected Canvas canvas; - /// - /// Canvas RectTransform. - /// - protected RectTransform rect; - /// /// Canvas mode. /// @@ -92,35 +87,25 @@ public class CanvasProjectionParams : ProjectionParams protected Camera camera; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The canvas. - public CanvasProjectionParams(Canvas canvas) + public WorldSpaceCanvasProjectionParams(Canvas canvas) { this.canvas = canvas; mode = canvas.renderMode; - - if (mode == RenderMode.ScreenSpaceOverlay) - { - rect = canvas.GetComponent(); - } - else - { - camera = canvas.worldCamera ?? Camera.main; - } + camera = canvas.worldCamera ?? Camera.main; } /// public override Vector3 ProjectTo(Vector2 screenPosition, Plane projectionPlane) { - if (mode == RenderMode.ScreenSpaceOverlay) return base.ProjectTo(screenPosition, projectionPlane); return ProjectionUtils.CameraToPlaneProjection(screenPosition, camera, projectionPlane); } /// public override Vector2 ProjectFrom(Vector3 worldPosition) { - if (mode == RenderMode.ScreenSpaceOverlay) return base.ProjectFrom(worldPosition); return camera.WorldToScreenPoint(worldPosition); } } diff --git a/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs new file mode 100644 index 000000000..59e6bf6e0 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs @@ -0,0 +1,647 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using TouchScript.Hit; +using UnityEngine; +using System.Collections.Generic; +using TouchScript.Layers.UI; +using TouchScript.Pointers; +using UnityEngine.EventSystems; +using UnityEngine.UI; +using System.Collections; +using TouchScript.Utils.Attributes; + +namespace TouchScript.Layers +{ + /// + /// A layer which combines all types of hit recognition into one: UI (Screen Space and World), 3D and 2D. + /// + /// + [AddComponentMenu("TouchScript/Layers/Standard Layer")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Layers_StandardLayer.htm")] + public class StandardLayer : TouchLayer + { + #region Public properties + + /// + /// Indicates that the layer should look for 3D objects in the scene. Set this to false to optimize hit processing. + /// + public bool Hit3DObjects + { + get { return hit3DObjects; } + set + { + hit3DObjects = value; + updateVariants(); + } + } + + /// + /// Indicates that the layer should look for 2D objects in the scene. Set this to false to optimize hit processing. + /// + public bool Hit2DObjects + { + get { return hit2DObjects; } + set + { + hit2DObjects = value; + updateVariants(); + } + } + + /// + /// Indicates that the layer should look for World UI objects in the scene. Set this to false to optimize hit processing. + /// + public bool HitWorldSpaceUI + { + get { return hitWorldSpaceUI; } + set + { + hitWorldSpaceUI = value; + setupInputModule(); + updateVariants(); + } + } + + /// + /// Indicates that the layer should look for Screen Space UI objects in the scene. Set this to false to optimize hit processing. + /// + public bool HitScreenSpaceUI + { + get { return hitScreenSpaceUI; } + set + { + hitScreenSpaceUI = value; + setupInputModule(); + } + } + + /// + /// Indicates that the layer should query for components on target objects. Set this to false to optimize hit processing. + /// + public bool UseHitFilters + { + get { return useHitFilters; } + set { useHitFilters = value; } + } + + /// + /// Gets or sets the layer mask which is used to select layers which should be touchable from this layer. + /// + /// A mask to exclude objects from possibly touchable list. + public LayerMask LayerMask + { + get { return layerMask; } + set { layerMask = value; } + } + + /// + public override Vector3 WorldProjectionNormal + { + get + { + if (_camera == null) return Vector3.forward; + return _camera.transform.forward; + } + } + + #endregion + + #region Private variables + + private static Comparison _raycastHitUIComparerFunc = raycastHitUIComparerFunc; + private static Comparison _raycastHitComparerFunc = raycastHitComparerFunc; + private static Comparison _hitDataComparerFunc = hitDataComparerFunc; + + private static Dictionary projectionParamsCache = new Dictionary(); + private static List raycasters; + + private static List raycastHitUIList = new List(20); + private static List raycastHitList = new List(20); + private static List hitList = new List(20); +#if UNITY_5_3_OR_NEWER + private static RaycastHit[] raycastHits = new RaycastHit[20]; +#endif + private static RaycastHit2D[] raycastHits2D = new RaycastHit2D[20]; + +#pragma warning disable CS0414 + + [SerializeField] + [HideInInspector] + private bool basicEditor = true; + + [SerializeField] + [HideInInspector] + private bool advancedProps; // is used to save if advanced properties are opened or closed + +#pragma warning restore CS0414 + + [SerializeField] + [HideInInspector] + private bool hitProps; + + [SerializeField] + [ToggleLeft] + private bool hit3DObjects = true; + + [SerializeField] + [ToggleLeft] + private bool hit2DObjects = true; + + [SerializeField] + [ToggleLeft] + private bool hitWorldSpaceUI = true; + + [SerializeField] + [ToggleLeft] + private bool hitScreenSpaceUI = true; + + [SerializeField] + private LayerMask layerMask = -1; + + [SerializeField] + [ToggleLeft] + private bool useHitFilters = false; + + private bool lookForCameraObjects = false; + private TouchScriptInputModule inputModule; + + /// + /// Camera. + /// + protected Camera _camera; + + #endregion + + #region Public methods + + /// + public override HitResult Hit(IPointer pointer, out HitData hit) + { + if (base.Hit(pointer, out hit) != HitResult.Hit) return HitResult.Miss; + + var result = HitResult.Miss; + + if (hitScreenSpaceUI) + { + result = performSSUISearch(pointer, out hit); + switch (result) + { + case HitResult.Hit: + return result; + case HitResult.Discard: + hit = default(HitData); + return result; + } + } + + if (lookForCameraObjects) + { + result = performWorldSearch(pointer, out hit); + switch (result) + { + case HitResult.Hit: + return result; + case HitResult.Discard: + hit = default(HitData); + return result; + } + } + + return HitResult.Miss; + } + + /// + public override ProjectionParams GetProjectionParams(Pointer pointer) + { + var press = pointer.GetPressData(); + if ((press.Type == HitData.HitType.World2D) || + (press.Type == HitData.HitType.World3D)) + return layerProjectionParams; + + var graphic = press.RaycastHitUI.Graphic; + if (graphic == null) return layerProjectionParams; + var canvas = graphic.canvas; + if (canvas == null) return layerProjectionParams; + + ProjectionParams pp; + if (!projectionParamsCache.TryGetValue(canvas.GetInstanceID(), out pp)) + { + // TODO: memory leak + pp = new WorldSpaceCanvasProjectionParams(canvas); + projectionParamsCache.Add(canvas.GetInstanceID(), pp); + } + return pp; + } + + #endregion + + #region Unity methods + + /// + protected override void Awake() + { + updateCamera(); + updateVariants(); + base.Awake(); + } + + private void OnEnable() + { + if (!Application.isPlaying) return; + TouchManager.Instance.FrameStarted += frameStartedHandler; + StartCoroutine(lateEnable()); + } + + private IEnumerator lateEnable() + { + // Need to wait while EventSystem initializes + yield return new WaitForEndOfFrame(); + setupInputModule(); + } + + private void OnDisable() + { + if (!Application.isPlaying) return; + if (inputModule != null) inputModule.INTERNAL_Release(); + if (TouchManager.Instance != null) TouchManager.Instance.FrameStarted -= frameStartedHandler; + } + + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + + #endregion + + #region Protected functions + + /// + /// Finds a camera. + /// + protected virtual void updateCamera() + { + _camera = GetComponent(); + } + + /// + protected override ProjectionParams createProjectionParams() + { + return new CameraProjectionParams(_camera); + } + + /// + protected override void setName() + { + if (string.IsNullOrEmpty(Name)) + if (_camera != null) Name = _camera.name; + else Name = "Layer"; + } + + #endregion + + #region Private functions + + private void setupInputModule() + { + if (inputModule == null) + { + if (!hitWorldSpaceUI && !hitScreenSpaceUI) return; + inputModule = TouchScriptInputModule.Instance; + if (inputModule != null) TouchScriptInputModule.Instance.INTERNAL_Retain(); + } + else + { + if (hitWorldSpaceUI || hitScreenSpaceUI) return; + inputModule.INTERNAL_Release(); + inputModule = null; + } + } + + private HitResult performWorldSearch(IPointer pointer, out HitData hit) + { + hit = default(HitData); + + if (_camera == null) return HitResult.Miss; + if ((_camera.enabled == false) || (_camera.gameObject.activeInHierarchy == false)) return HitResult.Miss; + var position = pointer.Position; + if (!_camera.pixelRect.Contains(position)) return HitResult.Miss; + + hitList.Clear(); + var ray = _camera.ScreenPointToRay(position); + + int count; + bool exclusiveSet = manager.HasExclusive; + + if (hit3DObjects) + { +#if UNITY_5_3_OR_NEWER + count = Physics.RaycastNonAlloc(ray, raycastHits, float.PositiveInfinity, layerMask); +#else + var raycastHits = Physics.RaycastAll(ray, float.PositiveInfinity, layerMask); + var count = raycastHits.Length; +#endif + + // Try to do some optimizations if 2D and WS UI are not required + if (!hit2DObjects && !hitWorldSpaceUI) + { + RaycastHit raycast; + + if (count == 0) return HitResult.Miss; + if (count > 1) + { + raycastHitList.Clear(); + for (var i = 0; i < count; i++) + { + raycast = raycastHits[i]; + if (exclusiveSet && !manager.IsExclusive(raycast.transform)) continue; + raycastHitList.Add(raycast); + } + if (raycastHitList.Count == 0) return HitResult.Miss; + + raycastHitList.Sort(_raycastHitComparerFunc); + if (useHitFilters) + { + for (var i = 0; i < count; i++) + { + var result = doHit(pointer, raycastHitList[i], out hit); + if (result != HitResult.Miss) return result; + } + return HitResult.Miss; + } + hit = new HitData(raycastHitList[0], this); + return HitResult.Hit; + } + + raycast = raycastHits[0]; + if (exclusiveSet && !manager.IsExclusive(raycast.transform)) return HitResult.Miss; + if (useHitFilters) return doHit(pointer, raycast, out hit); + hit = new HitData(raycast, this); + return HitResult.Hit; + } + for (var i = 0; i < count; i++) + { + var raycast = raycastHits[i]; + if (exclusiveSet && !manager.IsExclusive(raycast.transform)) continue; + hitList.Add(new HitData(raycastHits[i], this)); + } + } + + if (hit2DObjects) + { + count = Physics2D.GetRayIntersectionNonAlloc(ray, raycastHits2D, float.MaxValue, layerMask); + for (var i = 0; i < count; i++) + { + var raycast = raycastHits2D[i]; + if (exclusiveSet && !manager.IsExclusive(raycast.transform)) continue; + hitList.Add(new HitData(raycast, this)); + } + } + + if (hitWorldSpaceUI) + { + raycastHitUIList.Clear(); + if (raycasters == null) raycasters = TouchScriptInputModule.Instance.GetRaycasters(); + count = raycasters.Count; + + for (var i = 0; i < count; i++) + { + var raycaster = raycasters[i] as GraphicRaycaster; + if (raycaster == null) continue; + var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); + if ((canvas == null) || (canvas.renderMode == RenderMode.ScreenSpaceOverlay) || (canvas.worldCamera != _camera)) continue; + performUISearchForCanvas(pointer, canvas, raycaster, _camera, float.MaxValue, ray); + } + + count = raycastHitUIList.Count; + for (var i = 0; i < count; i++) hitList.Add(new HitData(raycastHitUIList[i], this)); + } + + count = hitList.Count; + if (hitList.Count == 0) return HitResult.Miss; + if (count > 1) + { + hitList.Sort(_hitDataComparerFunc); + if (useHitFilters) + { + for (var i = 0; i < count; ++i) + { + hit = hitList[i]; + var result = checkHitFilters(pointer, hit); + if (result != HitResult.Miss) return result; + } + return HitResult.Miss; + } + else + { + hit = hitList[0]; + return HitResult.Hit; + } + } + hit = hitList[0]; + if (useHitFilters) return checkHitFilters(pointer, hit); + return HitResult.Hit; + } + + private HitResult performSSUISearch(IPointer pointer, out HitData hit) + { + hit = default(HitData); + raycastHitUIList.Clear(); + + if (raycasters == null) raycasters = TouchScriptInputModule.Instance.GetRaycasters(); + var count = raycasters.Count; + + for (var i = 0; i < count; i++) + { + var raycaster = raycasters[i] as GraphicRaycaster; + if (raycaster == null) continue; + var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); + if ((canvas == null) || (canvas.renderMode != RenderMode.ScreenSpaceOverlay)) continue; + performUISearchForCanvas(pointer, canvas, raycaster); + } + + count = raycastHitUIList.Count; + if (count == 0) return HitResult.Miss; + if (count > 1) + { + raycastHitUIList.Sort(_raycastHitUIComparerFunc); + if (useHitFilters) + { + for (var i = 0; i < count; ++i) + { + var result = doHit(pointer, raycastHitUIList[i], out hit); + if (result != HitResult.Miss) return result; + } + return HitResult.Miss; + } + + hit = new HitData(raycastHitUIList[0], this, true); + return HitResult.Hit; + } + + if (useHitFilters) return doHit(pointer, raycastHitUIList[0], out hit); + hit = new HitData(raycastHitUIList[0], this, true); + return HitResult.Hit; + } + + private void performUISearchForCanvas(IPointer pointer, Canvas canvas, GraphicRaycaster raycaster, Camera eventCamera = null, float maxDistance = float.MaxValue, Ray ray = default(Ray)) + { + var position = pointer.Position; + var foundGraphics = GraphicRegistry.GetGraphicsForCanvas(canvas); + var count = foundGraphics.Count; + var exclusiveSet = manager.HasExclusive; + + for (var i = 0; i < count; i++) + { + var graphic = foundGraphics[i]; + var t = graphic.transform; + + if (exclusiveSet && !manager.IsExclusive(t)) continue; + + if ((layerMask.value != -1) && ((layerMask.value & (1 << graphic.gameObject.layer)) == 0)) continue; + + // -1 means it hasn't been processed by the canvas, which means it isn't actually drawn + if ((graphic.depth == -1) || !graphic.raycastTarget) + continue; + + if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, position, eventCamera)) + continue; + + if (graphic.Raycast(position, eventCamera)) + { + if (raycaster.ignoreReversedGraphics) + if (eventCamera == null) + { + // If we dont have a camera we know that we should always be facing forward + var dir = t.rotation * Vector3.forward; + if (Vector3.Dot(Vector3.forward, dir) <= 0) continue; + } + else + { + // If we have a camera compare the direction against the cameras forward. + var cameraFoward = eventCamera.transform.rotation * Vector3.forward; + var dir = t.rotation * Vector3.forward; + if (Vector3.Dot(cameraFoward, dir) <= 0) continue; + } + + float distance = 0; + + if ((eventCamera == null) || (canvas.renderMode == RenderMode.ScreenSpaceOverlay)) {} + else + { + var transForward = t.forward; + // http://geomalgorithms.com/a06-_intersect-2.html + distance = Vector3.Dot(transForward, t.position - ray.origin) / Vector3.Dot(transForward, ray.direction); + + // Check to see if the go is behind the camera. + if (distance < 0) continue; + if (distance >= maxDistance) continue; + } + + raycastHitUIList.Add( + new RaycastHitUI() + { + Target = graphic.transform, + Raycaster = raycaster, + Graphic = graphic, + GraphicIndex = raycastHitUIList.Count, + Depth = graphic.depth, + SortingLayer = canvas.sortingLayerID, + SortingOrder = canvas.sortingOrder, + Distance = distance + }); + } + } + } + + private HitResult doHit(IPointer pointer, RaycastHitUI raycastHit, out HitData hit) + { + hit = new HitData(raycastHit, this, true); + return checkHitFilters(pointer, hit); + } + + private HitResult doHit(IPointer pointer, RaycastHit raycastHit, out HitData hit) + { + hit = new HitData(raycastHit, this); + return checkHitFilters(pointer, hit); + } + + private void updateVariants() + { + lookForCameraObjects = _camera != null && (hit3DObjects || hit2DObjects || hitWorldSpaceUI); + } + + #endregion + + #region Compare functions + + private static int raycastHitUIComparerFunc(RaycastHitUI lhs, RaycastHitUI rhs) + { + if (lhs.SortingLayer != rhs.SortingLayer) + { + // Uses the layer value to properly compare the relative order of the layers. + var rid = SortingLayer.GetLayerValueFromID(rhs.SortingLayer); + var lid = SortingLayer.GetLayerValueFromID(lhs.SortingLayer); + return rid.CompareTo(lid); + } + + if (lhs.SortingOrder != rhs.SortingOrder) + return rhs.SortingOrder.CompareTo(lhs.SortingOrder); + + if (lhs.Depth != rhs.Depth) + return rhs.Depth.CompareTo(lhs.Depth); + + if (!Mathf.Approximately(lhs.Distance, rhs.Distance)) + return lhs.Distance.CompareTo(rhs.Distance); + + return lhs.GraphicIndex.CompareTo(rhs.GraphicIndex); + } + + private static int raycastHitComparerFunc(RaycastHit lhs, RaycastHit rhs) + { + return lhs.distance < rhs.distance ? -1 : 1; + } + + private static int hitDataComparerFunc(HitData lhs, HitData rhs) + { + if (lhs.SortingLayer != rhs.SortingLayer) + { + // Uses the layer value to properly compare the relative order of the layers. + var rid = SortingLayer.GetLayerValueFromID(rhs.SortingLayer); + var lid = SortingLayer.GetLayerValueFromID(lhs.SortingLayer); + return rid.CompareTo(lid); + } + + if (lhs.SortingOrder != rhs.SortingOrder) + return rhs.SortingOrder.CompareTo(lhs.SortingOrder); + + if ((lhs.Type == HitData.HitType.UI) && (rhs.Type == HitData.HitType.UI)) + { + if (lhs.RaycastHitUI.Depth != rhs.RaycastHitUI.Depth) + return rhs.RaycastHitUI.Depth.CompareTo(lhs.RaycastHitUI.Depth); + + if (!Mathf.Approximately(lhs.Distance, rhs.Distance)) + return lhs.Distance.CompareTo(rhs.Distance); + + if (lhs.RaycastHitUI.GraphicIndex != rhs.RaycastHitUI.GraphicIndex) + return rhs.RaycastHitUI.GraphicIndex.CompareTo(lhs.RaycastHitUI.GraphicIndex); + } + + return lhs.Distance < rhs.Distance ? -1 : 1; + } + + #endregion + + #region Event handlers + + private void frameStartedHandler(object sender, EventArgs eventArgs) + { + raycasters = null; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs.meta new file mode 100644 index 000000000..fff9e3d94 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7e5768c36d1bb4acea50bd233372843a +timeCreated: 1470775898 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs index f0065d9ba..286cd98c3 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs @@ -6,69 +6,47 @@ using TouchScript.Hit; using TouchScript.Utils; using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using TouchScript.Pointers; namespace TouchScript.Layers { /// - /// Base class for all touch layers. Used to check if some object is hit by a touch point. + /// Base class for all pointer layers. Used to check if some object is hit by a pointer. /// - /// - /// + /// + /// /// /// - /// In TouchScript it's a layer's job to determine if a touch on the screen hits anything in Unity's 3d/2d world. - /// keeps a sorted list of all layers in which it queries when a new touch appears. It's a layer's job to return if this touch hits an object. Layers can even be used to "hit" objects outside of Unity's 3d world, for example Scaleform integration is implemented this way. + /// In TouchScript it's a layer's job to determine if a pointer on the screen hits anything in Unity's 3d/2d world. + /// keeps a sorted list of all layers in which it queries when a new pointer appears. It's a layer's job to return if this pointer hits an object. Layers can even be used to "hit" objects outside of Unity's 3d world, for example Scaleform integration is implemented this way. /// Layers can be configured in a scene using or from code using API. - /// If you want to route touches and manually control which objects they should "touch" it's better to create a new layer extending . + /// If you want to route pointers and manually control which objects they should "pointer" it's better to create a new layer extending . /// [ExecuteInEditMode] public abstract class TouchLayer : MonoBehaviour { - #region Constants - - /// - /// Result of a touch's hit test with a layer. - /// - public enum LayerHitResult - { - /// - /// Something wrong happened. - /// - Error = 0, - - /// - /// Touch hit an object. - /// - Hit = 1, - - /// - /// Touch didn't hit any object. - /// - Miss = 2 - } - - #endregion - #region Events /// - /// Occurs when layer determines that a touch has hit something. + /// Occurs when layer determines that a pointer has hit something. /// - public event EventHandler TouchBegan + public event EventHandler PointerBegan { - add { touchBeganInvoker += value; } - remove { touchBeganInvoker -= value; } + add { pointerPressInvoker += value; } + remove { pointerPressInvoker -= value; } } // Needed to overcome iOS AOT limitations - private EventHandler touchBeganInvoker; + private EventHandler pointerPressInvoker; #endregion #region Public properties /// - /// Touch layer's name. + /// Pointer layer's name. /// public string Name; @@ -88,14 +66,34 @@ public virtual Vector3 WorldProjectionNormal #endregion + #region Private variables + + /// + /// The layer projection parameters. + /// + protected ProjectionParams layerProjectionParams; + + /// + /// Layer manager. + /// + protected ILayerManager manager; + + #endregion + + #region Temporary variables + + private List tmpHitTestList = new List(10); + + #endregion + #region Public methods /// - /// Gets the projection parameters of this layer which might depend on a specific touch data. + /// Gets the projection parameters of this layer which might depend on a specific pointer data. /// - /// Touch to retrieve projection parameters for. + /// Pointer to retrieve projection parameters for. /// - public virtual ProjectionParams GetProjectionParams(TouchPoint touch) + public virtual ProjectionParams GetProjectionParams(Pointer pointer) { return layerProjectionParams; } @@ -103,27 +101,23 @@ public virtual ProjectionParams GetProjectionParams(TouchPoint touch) /// /// Checks if a point in screen coordinates hits something in this layer. /// - /// Position in screen coordinates. + /// Pointer. /// Hit result. - /// , if an object is hit, or otherwise. - public virtual LayerHitResult Hit(Vector2 position, out TouchHit hit) + /// true, if an object is hit, ; false otherwise. + public virtual HitResult Hit(IPointer pointer, out HitData hit) { - hit = default(TouchHit); - if (enabled == false || gameObject.activeInHierarchy == false) return LayerHitResult.Miss; - return LayerHitResult.Error; + hit = default(HitData); + if (enabled == false || gameObject.activeInHierarchy == false) return HitResult.Miss; + if (Delegate != null) + { + if (Delegate.ShouldReceivePointer(this, pointer)) return HitResult.Hit; + return HitResult.Miss; + } + return HitResult.Hit; } #endregion - #region Private variables - - /// - /// The layer projection parameters. - /// - protected ProjectionParams layerProjectionParams; - - #endregion - #region Unity methods /// @@ -134,52 +128,67 @@ protected virtual void Awake() setName(); if (!Application.isPlaying) return; + manager = LayerManager.Instance; layerProjectionParams = createProjectionParams(); - TouchManager.Instance.AddLayer(this, 0, false); + StartCoroutine(lateAwake()); } + private IEnumerator lateAwake() + { + yield return null; + + // Add ourselves after TouchManager finished adding layers in order + manager.AddLayer(this, -1, false); + } + + // To be able to turn layers off + private void Start() {} + /// /// Unity OnDestroy callback. /// protected virtual void OnDestroy() { - if (Application.isPlaying && TouchManager.Instance != null) TouchManager.Instance.RemoveLayer(this); + if (!Application.isPlaying || TouchManager.Instance == null) return; + + StopAllCoroutines(); + manager.RemoveLayer(this); } #endregion #region Internal methods - internal bool INTERNAL_BeginTouch(TouchPoint touch) + internal void INTERNAL_AddPointer(Pointer pointer) { - TouchHit hit; - if (Delegate != null && Delegate.ShouldReceiveTouch(this, touch) == false) return false; - var result = beginTouch(touch, out hit); - if (result == LayerHitResult.Hit) - { - touch.Layer = this; - touch.Hit = hit; - if (hit.Transform != null) touch.Target = hit.Transform; - if (touchBeganInvoker != null) - touchBeganInvoker.InvokeHandleExceptions(this, new TouchLayerEventArgs(touch)); - return true; - } - return false; + addPointer(pointer); + } + + internal void INTERNAL_UpdatePointer(Pointer pointer) + { + updatePointer(pointer); + } + + internal bool INTERNAL_PressPointer(Pointer pointer) + { + pressPointer(pointer); + if (pointerPressInvoker != null) pointerPressInvoker.InvokeHandleExceptions(this, new TouchLayerEventArgs(pointer)); + return true; } - internal void INTERNAL_UpdateTouch(TouchPoint touch) + internal void INTERNAL_ReleasePointer(Pointer pointer) { - updateTouch(touch); + releasePointer(pointer); } - internal void INTERNAL_EndTouch(TouchPoint touch) + internal void INTERNAL_RemovePointer(Pointer pointer) { - endTouch(touch); + removePointer(pointer); } - internal void INTERNAL_CancelTouch(TouchPoint touch) + internal void INTERNAL_CancelPointer(Pointer pointer) { - cancelTouch(touch); + cancelPointer(pointer); } #endregion @@ -187,7 +196,31 @@ internal void INTERNAL_CancelTouch(TouchPoint touch) #region Protected functions /// - /// Updates touch layers's name. + /// Checks the hit filters. + /// + /// The pointer. + /// HitData for the pointer. + /// + protected HitResult checkHitFilters(IPointer pointer, HitData hit) + { + hit.Target.GetComponents(tmpHitTestList); + var count = tmpHitTestList.Count; + if (count == 0) return HitResult.Hit; + + var hitResult = HitResult.Hit; + for (var i = 0; i < count; i++) + { + var test = tmpHitTestList[i]; + if (!test.enabled) continue; + hitResult = test.IsHit(pointer, hit); + if (hitResult != HitResult.Hit) break; + } + + return hitResult; + } + + /// + /// Updates pointer layers's name. /// protected virtual void setName() { @@ -195,38 +228,46 @@ protected virtual void setName() } /// - /// Called when a layer is touched to query the layer if this touch hits something. + /// Called when a pointer is added. /// - /// Touch. - /// Hit result. - /// , if an object is hit, or otherwise. + /// Pointer. /// This method may also be used to update some internal state or resend this event somewhere. - protected virtual LayerHitResult beginTouch(TouchPoint touch, out TouchHit hit) - { - var result = Hit(touch.Position, out hit); - return result; - } + protected virtual void addPointer(Pointer pointer) {} + + /// + /// Called when a layer is pressed over an object detected by this layer. + /// + /// Pointer. + /// This method may also be used to update some internal state or resend this event somewhere. + protected virtual void pressPointer(Pointer pointer) {} + + /// + /// Called when a pointer is moved. + /// + /// Pointer. + /// This method may also be used to update some internal state or resend this event somewhere. + protected virtual void updatePointer(Pointer pointer) {} /// - /// Called when a touch is moved. + /// Called when a pointer is released. /// - /// Touch. + /// Pointer. /// This method may also be used to update some internal state or resend this event somewhere. - protected virtual void updateTouch(TouchPoint touch) {} + protected virtual void releasePointer(Pointer pointer) {} /// - /// Called when a touch ends. + /// Called when a pointer is removed. /// - /// Touch. + /// Pointer. /// This method may also be used to update some internal state or resend this event somewhere. - protected virtual void endTouch(TouchPoint touch) {} + protected virtual void removePointer(Pointer pointer) {} /// - /// Called when a touch is cancelled. + /// Called when a pointer is cancelled. /// - /// Touch. + /// Pointer. /// This method may also be used to update some internal state or resend this event somewhere. - protected virtual void cancelTouch(TouchPoint touch) {} + protected virtual void cancelPointer(Pointer pointer) {} /// /// Creates projection parameters. @@ -246,18 +287,18 @@ protected virtual ProjectionParams createProjectionParams() public class TouchLayerEventArgs : EventArgs { /// - /// Gets the touch associated with the event. + /// Gets the pointer associated with the event. /// - public TouchPoint Touch { get; private set; } + public Pointer Pointer { get; private set; } /// /// Initializes a new instance of the class. /// - /// The touch associated with the event. - public TouchLayerEventArgs(TouchPoint touch) + /// The pointer associated with the event. + public TouchLayerEventArgs(Pointer pointer) : base() { - Touch = touch; + Pointer = pointer; } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/UI.meta b/Source/Assets/TouchScript/Scripts/Layers/UI.meta new file mode 100644 index 000000000..846098d55 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Layers/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 98bf3eb5cb0e24a748a370189ec5829e +folderAsset: yes +timeCreated: 1470651932 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs new file mode 100644 index 000000000..9ee625d6f --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs @@ -0,0 +1,780 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using TouchScript.Hit; +using TouchScript.Pointers; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; +using Pointer = TouchScript.Pointers.Pointer; +using UnityEngine.Profiling; + +namespace TouchScript.Layers.UI +{ + /// + /// An implementation of a Unity UI Input Module which lets TouchScript interact with the UI and EventSystem. + /// + internal sealed class TouchScriptInputModule : BaseInputModule + { + #region Public properties + + /// + /// TouchScriptInputModule singleton instance. + /// + public static TouchScriptInputModule Instance + { + get + { + if (shuttingDown) return null; + if (instance == null) + { + var es = EventSystem.current; + if (es == null) + { + es = FindObjectOfType(); + if (es == null) + { + var go = new GameObject("EventSystem"); + es = go.AddComponent(); + } + } + instance = es.GetComponent(); + if (instance == null) instance = es.gameObject.AddComponent(); + } + return instance; + } + } + + public string HorizontalAxis = "Horizontal"; + public string VerticalAxis = "Vertical"; + public string SubmitButton = "Submit"; + public string CancelButton = "Cancel"; + public float InputActionsPerSecond = 10; + public float RepeatDelay = 0.5f; + + #endregion + + #region Private variables + + private static bool shuttingDown = false; + private static TouchScriptInputModule instance; + private static FieldInfo raycastersProp; + private static PropertyInfo canvasProp; + private static Dictionary raycasterCanvasCache = new Dictionary(10); + + private int refCount = 0; + private UIStandardInputModule ui; + + #endregion + + #region Constructor + + private TouchScriptInputModule() + { + if (raycastersProp == null) + { + raycastersProp = Type.GetType(Assembly.CreateQualifiedName("UnityEngine.UI", "UnityEngine.EventSystems.RaycasterManager")). + GetField("s_Raycasters", BindingFlags.NonPublic | BindingFlags.Static); + canvasProp = typeof(GraphicRaycaster).GetProperty("canvas", BindingFlags.NonPublic | BindingFlags.Instance); + } + } + + #endregion + + #region Unity methods + + protected override void OnEnable() + { + base.OnEnable(); + + if (instance == null) instance = this; + else + { + if (instance == this) return; + Destroy(this); + } + } + + protected override void OnDisable() + { + disable(); + if (instance == this) instance = null; + base.OnDisable(); + } + + private void OnApplicationQuit() + { + shuttingDown = true; + } + + #endregion + + #region Public methods + + /// + /// Returns all UI raycasters in the scene. + /// + /// Array of raycasters. + public List GetRaycasters() + { + return raycastersProp.GetValue(null) as List; + } + + /// + /// Returns a Canvas for a raycaster. + /// + /// The raycaster. + /// The Canvas this raycaster is on. + public Canvas GetCanvasForRaycaster(BaseRaycaster raycaster) + { + var id = raycaster.GetInstanceID(); + Canvas canvas; + if (!raycasterCanvasCache.TryGetValue(id, out canvas)) + { + canvas = canvasProp.GetValue(raycaster, null) as Canvas; + raycasterCanvasCache.Add(id, canvas); + } + return canvas; + } + + public override void Process() + { + if (ui != null) ui.Process(); + } + + public override bool IsPointerOverGameObject(int pointerId) + { + if (ui != null) return ui.IsPointerOverGameObject(pointerId); + return false; + } + + public override bool ShouldActivateModule() + { + return true; + } + + public override bool IsModuleSupported() + { + return true; + } + + public override void DeactivateModule() {} + + public override void ActivateModule() {} + + public override void UpdateModule() {} + + #endregion + + #region Internal methods + + /// + /// Marks that this object is used by some other object. + /// + internal void INTERNAL_Retain() + { + refCount++; + if (refCount == 1) enable(); + } + + /// + /// Releases a lock on this object. + /// + /// The number of objects still using this object. + internal int INTERNAL_Release() + { + if (--refCount <= 0) disable(); + return refCount; + } + + #endregion + + #region Private functions + + private void enable() + { + ui = new UIStandardInputModule(this); + TouchManager.Instance.PointersAdded += ui.ProcessAdded; + TouchManager.Instance.PointersUpdated += ui.ProcessUpdated; + TouchManager.Instance.PointersPressed += ui.ProcessPressed; + TouchManager.Instance.PointersReleased += ui.ProcessReleased; + TouchManager.Instance.PointersRemoved += ui.ProcessRemoved; + TouchManager.Instance.PointersCancelled += ui.ProcessCancelled; + } + + private void disable() + { + if (TouchManager.Instance != null && ui != null) + { + TouchManager.Instance.PointersAdded -= ui.ProcessAdded; + TouchManager.Instance.PointersUpdated -= ui.ProcessUpdated; + TouchManager.Instance.PointersPressed -= ui.ProcessPressed; + TouchManager.Instance.PointersReleased -= ui.ProcessReleased; + TouchManager.Instance.PointersRemoved -= ui.ProcessRemoved; + TouchManager.Instance.PointersCancelled -= ui.ProcessCancelled; + } + refCount = 0; + } + + #endregion + + #region Copy-pasted code from UI + + /// + /// Basically, copied code from UI Input Module which handles all UI pointer processing logic. + /// Last update: df1947cd (5.4f3) + /// + private class UIStandardInputModule + { + protected TouchScriptInputModule input; + +#if UNITY_5_6_OR_NEWER + private CustomSampler uiSampler; +#endif + + public UIStandardInputModule(TouchScriptInputModule input) + { + this.input = input; + +#if UNITY_5_6_OR_NEWER + uiSampler = CustomSampler.Create("[TouchScript] Update UI"); +#endif + } + + #region Unchanged from PointerInputModule + + private int m_ConsecutiveMoveCount = 0; + private Vector2 m_LastMoveVector; + private float m_PrevActionTime; + + private Dictionary m_PointerData = new Dictionary(10); + + public bool IsPointerOverGameObject(int pointerId) + { + var lastPointer = GetLastPointerEventData(pointerId); + if (lastPointer != null) + return lastPointer.pointerEnter != null; + return false; + } + + protected bool GetPointerData(int id, out PointerEventData data, bool create) + { + if (!m_PointerData.TryGetValue(id, out data) && create) + { + data = new PointerEventData(input.eventSystem) + { + pointerId = id, + }; + m_PointerData.Add(id, data); + return true; + } + return false; + } + + protected void DeselectIfSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent) + { + // Selection tracking + var selectHandlerGO = ExecuteEvents.GetEventHandler(currentOverGo); + // if we have clicked something new, deselect the old thing + // leave 'selection handling' up to the press event though. + if (selectHandlerGO != input.eventSystem.currentSelectedGameObject) + input.eventSystem.SetSelectedGameObject(null, pointerEvent); + } + + protected PointerEventData GetLastPointerEventData(int id) + { + PointerEventData data; + GetPointerData(id, out data, false); + return data; + } + + private static bool ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold) + { + if (!useDragThreshold) + return true; + + return (pressPos - currentPos).sqrMagnitude >= threshold * threshold; + } + + private bool SendUpdateEventToSelectedObject() + { + if (input.eventSystem.currentSelectedGameObject == null) + return false; + + var data = input.GetBaseEventData(); + ExecuteEvents.Execute(input.eventSystem.currentSelectedGameObject, data, ExecuteEvents.updateSelectedHandler); + return data.used; + } + + private bool SendMoveEventToSelectedObject() + { + float time = Time.unscaledTime; + + Vector2 movement = GetRawMoveVector(); + if (Mathf.Approximately(movement.x, 0f) && Mathf.Approximately(movement.y, 0f)) + { + m_ConsecutiveMoveCount = 0; + return false; + } + + // If user pressed key again, always allow event + bool allow = Input.GetButtonDown(input.HorizontalAxis) || Input.GetButtonDown(input.VerticalAxis); + bool similarDir = (Vector2.Dot(movement, m_LastMoveVector) > 0); + if (!allow) + { + // Otherwise, user held down key or axis. + // If direction didn't change at least 90 degrees, wait for delay before allowing consequtive event. + if (similarDir && m_ConsecutiveMoveCount == 1) + allow = (time > m_PrevActionTime + input.RepeatDelay); + // If direction changed at least 90 degree, or we already had the delay, repeat at repeat rate. + else + allow = (time > m_PrevActionTime + 1f / input.InputActionsPerSecond); + } + if (!allow) + return false; + + // Debug.Log(m_ProcessingEvent.rawType + " axis:" + m_AllowAxisEvents + " value:" + "(" + x + "," + y + ")"); + var axisEventData = input.GetAxisEventData(movement.x, movement.y, 0.6f); + + if (axisEventData.moveDir != MoveDirection.None) + { + ExecuteEvents.Execute(input.eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler); + if (!similarDir) + m_ConsecutiveMoveCount = 0; + m_ConsecutiveMoveCount++; + m_PrevActionTime = time; + m_LastMoveVector = movement; + } + else + { + m_ConsecutiveMoveCount = 0; + } + + return axisEventData.used; + } + + private bool SendSubmitEventToSelectedObject() + { + if (input.eventSystem.currentSelectedGameObject == null) + return false; + + var data = input.GetBaseEventData(); + if (Input.GetButtonDown(input.SubmitButton)) + ExecuteEvents.Execute(input.eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler); + + if (Input.GetButtonDown(input.CancelButton)) + ExecuteEvents.Execute(input.eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler); + return data.used; + } + + private Vector2 GetRawMoveVector() + { + Vector2 move = Vector2.zero; + move.x = Input.GetAxisRaw(input.HorizontalAxis); + move.y = Input.GetAxisRaw(input.VerticalAxis); + + if (Input.GetButtonDown(input.HorizontalAxis)) + { + if (move.x < 0) + move.x = -1f; + if (move.x > 0) + move.x = 1f; + } + if (Input.GetButtonDown(input.VerticalAxis)) + { + if (move.y < 0) + move.y = -1f; + if (move.y > 0) + move.y = 1f; + } + return move; + } + + #endregion + + public void Process() + { + bool usedEvent = SendUpdateEventToSelectedObject(); + + if (input.eventSystem.sendNavigationEvents) + { + if (!usedEvent) + usedEvent |= SendMoveEventToSelectedObject(); + + if (!usedEvent) + SendSubmitEventToSelectedObject(); + } + + // touch needs to take precedence because of the mouse emulation layer + // if (!ProcessTouchEvents() && Input.mousePresent) + // ProcessMouseEvent(); + } + + #region Changed + + protected void RemovePointerData(int id) + { + m_PointerData.Remove(id); + } + + private void convertRaycast(RaycastHitUI old, ref RaycastResult current) + { + current.module = old.Raycaster; + current.gameObject = old.Target == null ? null : old.Target.gameObject; + current.depth = old.Depth; + current.index = old.GraphicIndex; + current.sortingLayer = old.SortingLayer; + current.sortingOrder = old.SortingOrder; + } + + #endregion + + #region Event processors + + public virtual void ProcessAdded(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var raycast = new RaycastResult(); + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + var over = pointer.GetOverData(); + + // Don't update the pointer if it is not over an UI element + if (over.Type != HitData.HitType.UI) continue; + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + data.Reset(); + var target = over.Target; + var currentOverGo = target == null ? null : target.gameObject; + + data.position = pointer.Position; + data.delta = Vector2.zero; + convertRaycast(over.RaycastHitUI, ref raycast); + raycast.screenPosition = data.position; + data.pointerCurrentRaycast = raycast; + + input.HandlePointerExitAndEnter(data, currentOverGo); + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + public virtual void ProcessUpdated(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var raycast = new RaycastResult(); + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + var over = pointer.GetOverData(); + + // Don't update the pointer if it is pressed not over an UI element + if ((pointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) > 0) + { + var press = pointer.GetPressData(); + if (press.Type != HitData.HitType.UI) continue; + } + else + { + // Don't update the pointer if it is not over an UI element + if (over.Type != HitData.HitType.UI) continue; + } + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + data.Reset(); + var target = over.Target; + var currentOverGo = target == null ? null : target.gameObject; + + data.position = pointer.Position; + data.delta = pointer.Position - pointer.PreviousPosition; + convertRaycast(over.RaycastHitUI, ref raycast); + raycast.screenPosition = data.position; + data.pointerCurrentRaycast = raycast; + + input.HandlePointerExitAndEnter(data, currentOverGo); + + bool moving = data.IsPointerMoving(); + + if (moving && data.pointerDrag != null + && !data.dragging + && ShouldStartDrag(data.pressPosition, data.position, input.eventSystem.pixelDragThreshold, data.useDragThreshold)) + { + ExecuteEvents.Execute(data.pointerDrag, data, ExecuteEvents.beginDragHandler); + data.dragging = true; + } + + // Drag notification + if (data.dragging && moving && data.pointerDrag != null) + { + // Before doing drag we should cancel any pointer down state + // And clear selection! + if (data.pointerPress != data.pointerDrag) + { + ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerUpHandler); + + data.eligibleForClick = false; + data.pointerPress = null; + data.rawPointerPress = null; + } + ExecuteEvents.Execute(data.pointerDrag, data, ExecuteEvents.dragHandler); + } + + var mousePointer = pointer as MousePointer; + if (mousePointer != null && !Mathf.Approximately(mousePointer.ScrollDelta.sqrMagnitude, 0.0f)) + { + data.scrollDelta = mousePointer.ScrollDelta; + var scrollHandler = ExecuteEvents.GetEventHandler(currentOverGo); + ExecuteEvents.ExecuteHierarchy(scrollHandler, data, ExecuteEvents.scrollHandler); + } + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + public virtual void ProcessPressed(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + + var over = pointer.GetOverData(); + // Don't update the pointer if it is not over an UI element + if (over.Type != HitData.HitType.UI) continue; + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + var target = over.Target; + var currentOverGo = target == null ? null : target.gameObject; + + data.eligibleForClick = true; + data.delta = Vector2.zero; + data.dragging = false; + data.useDragThreshold = true; + data.position = pointer.Position; + data.pressPosition = pointer.Position; + data.pointerPressRaycast = data.pointerCurrentRaycast; + + DeselectIfSelectionChanged(currentOverGo, data); + + if (data.pointerEnter != currentOverGo) + { + // send a pointer enter to the touched element if it isn't the one to select... + input.HandlePointerExitAndEnter(data, currentOverGo); + data.pointerEnter = currentOverGo; + } + + // search for the control that will receive the press + // if we can't find a press handler set the press + // handler to be what would receive a click. + var newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, data, ExecuteEvents.pointerDownHandler); + + // didnt find a press handler... search for a click handler + if (newPressed == null) + newPressed = ExecuteEvents.GetEventHandler(currentOverGo); + + // Debug.Log("Pressed: " + newPressed); + + float time = Time.unscaledTime; + + if (newPressed == data.lastPress) // ? + { + var diffTime = time - data.clickTime; + if (diffTime < 0.3f) + ++data.clickCount; + else + data.clickCount = 1; + + data.clickTime = time; + } + else + { + data.clickCount = 1; + } + + data.pointerPress = newPressed; + data.rawPointerPress = currentOverGo; + + data.clickTime = time; + + // Save the drag handler as well + data.pointerDrag = ExecuteEvents.GetEventHandler(currentOverGo); + + if (data.pointerDrag != null) + ExecuteEvents.Execute(data.pointerDrag, data, ExecuteEvents.initializePotentialDrag); + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + public virtual void ProcessReleased(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + var press = pointer.GetPressData(); + // Don't update the pointer if it is was not pressed over an UI element + if (press.Type != HitData.HitType.UI) continue; + + var over = pointer.GetOverData(); + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + var target = over.Target; + var currentOverGo = target == null ? null : target.gameObject; + + ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerUpHandler); + var pointerUpHandler = ExecuteEvents.GetEventHandler(currentOverGo); + if (data.pointerPress == pointerUpHandler && data.eligibleForClick) + { + ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerClickHandler); + } + else if (data.pointerDrag != null && data.dragging) + { + ExecuteEvents.ExecuteHierarchy(currentOverGo, data, ExecuteEvents.dropHandler); + } + + data.eligibleForClick = false; + data.pointerPress = null; + data.rawPointerPress = null; + + if (data.pointerDrag != null && data.dragging) + ExecuteEvents.Execute(data.pointerDrag, data, ExecuteEvents.endDragHandler); + + data.dragging = false; + data.pointerDrag = null; + + // send exit events as we need to simulate this on touch up on touch device + ExecuteEvents.ExecuteHierarchy(data.pointerEnter, data, ExecuteEvents.pointerExitHandler); + data.pointerEnter = null; + + // redo pointer enter / exit to refresh state + // so that if we moused over somethign that ignored it before + // due to having pressed on something else + // it now gets it. + if (currentOverGo != data.pointerEnter) + { + input.HandlePointerExitAndEnter(data, null); + input.HandlePointerExitAndEnter(data, currentOverGo); + } + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + public virtual void ProcessCancelled(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + + var over = pointer.GetOverData(); + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + var target = over.Target; + var currentOverGo = target == null ? null : target.gameObject; + + ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerUpHandler); + + if (data.pointerDrag != null && data.dragging) + { + ExecuteEvents.ExecuteHierarchy(currentOverGo, data, ExecuteEvents.dropHandler); + } + + data.eligibleForClick = false; + data.pointerPress = null; + data.rawPointerPress = null; + + if (data.pointerDrag != null && data.dragging) + ExecuteEvents.Execute(data.pointerDrag, data, ExecuteEvents.endDragHandler); + + data.dragging = false; + data.pointerDrag = null; + + // send exit events as we need to simulate this on touch up on touch device + ExecuteEvents.ExecuteHierarchy(data.pointerEnter, data, ExecuteEvents.pointerExitHandler); + data.pointerEnter = null; + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + public virtual void ProcessRemoved(object sender, PointerEventArgs pointerEventArgs) + { +#if UNITY_5_6_OR_NEWER + uiSampler.Begin(); +#endif + + var pointers = pointerEventArgs.Pointers; + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + var pointer = pointers[i]; + + var over = pointer.GetOverData(); + // Don't update the pointer if it is not over an UI element + if (over.Type != HitData.HitType.UI) continue; + + PointerEventData data; + GetPointerData(pointer.Id, out data, true); + + if (data.pointerEnter) ExecuteEvents.ExecuteHierarchy(data.pointerEnter, data, ExecuteEvents.pointerExitHandler); + RemovePointerData(pointer.Id); + } + +#if UNITY_5_6_OR_NEWER + uiSampler.End(); +#endif + } + + #endregion + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs.meta similarity index 55% rename from Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs.meta rename to Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs.meta index 5f2aa4e5a..f0b279514 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/TouchScriptInputModule.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 797eed971a75647609ca044e7924beb7 -timeCreated: 1447582130 +guid: 803d2abe167ae40a0957010be5cfb7d1 +timeCreated: 1470651932 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs b/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs deleted file mode 100644 index bf14a2cee..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using TouchScript.Hit; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.UI; - -namespace TouchScript.Layers -{ - /// - /// Touch layer which handles Unity UI and interface objects in a Canvas. - /// - [AddComponentMenu("TouchScript/Layers/UI Layer")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_Layers_UILayer.htm")] - public class UILayer : TouchLayer - { - #region Public properties - - #endregion - - #region Private variables - - private static UILayer instance; - - [NonSerialized] - private List raycastResultCache = new List(20); - - private List tmpHitTestList = new List(10); - - private PointerEventData pointerDataCache; - private EventSystem eventSystem; - private Dictionary projectionParamsCache = new Dictionary(); - - #endregion - - #region Public methods - - /// - public override LayerHitResult Hit(Vector2 position, out TouchHit hit) - { - if (base.Hit(position, out hit) == LayerHitResult.Miss) return LayerHitResult.Miss; - if (eventSystem == null) return LayerHitResult.Error; - - if (pointerDataCache == null) pointerDataCache = new PointerEventData(eventSystem); - pointerDataCache.position = position; - eventSystem.RaycastAll(pointerDataCache, raycastResultCache); - - var count = raycastResultCache.Count; - if (count == 0) return LayerHitResult.Miss; - if (count > 1) - { - for (var i = 0; i < count; ++i) - { - var raycastHit = raycastResultCache[i]; - switch (doHit(raycastHit, out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Discard: - return LayerHitResult.Miss; - } - } - } - else - { - switch (doHit(raycastResultCache[0], out hit)) - { - case HitTest.ObjectHitResult.Hit: - return LayerHitResult.Hit; - case HitTest.ObjectHitResult.Error: - return LayerHitResult.Error; - default: - return LayerHitResult.Miss; - } - } - - return LayerHitResult.Miss; - } - - /// - public override ProjectionParams GetProjectionParams(TouchPoint touch) - { - var graphic = touch.Target.GetComponent(); - if (graphic == null) return layerProjectionParams; - var canvas = graphic.canvas; - if (canvas == null) return layerProjectionParams; - - ProjectionParams pp; - if (!projectionParamsCache.TryGetValue(canvas, out pp)) - { - // TODO: memory leak - pp = new CanvasProjectionParams(canvas); - projectionParamsCache.Add(canvas, pp); - } - return pp; - } - - #endregion - - #region Unity methods - - /// - protected override void Awake() - { - if (Application.isPlaying) - { - if (instance == null) instance = this; - if (instance != this) - { - Debug.LogWarning("[TouchScript] Only one instance of UILayer should exist in a scene. Destroying."); - Destroy(this); - return; - } - } - - base.Awake(); - if (!Application.isPlaying) return; - - StartCoroutine(lateAwake()); - } - - /// - protected IEnumerator lateAwake() - { - yield return new WaitForEndOfFrame(); - eventSystem = EventSystem.current; - if (eventSystem == null) - { - eventSystem = gameObject.AddComponent(); - eventSystem.hideFlags = HideFlags.DontSave; - } - } - - #endregion - - #region Protected functions - - /// - protected override void setName() - { - Name = "UI Layer"; - } - - #endregion - - #region Private functions - - private HitTest.ObjectHitResult doHit(RaycastResult raycastHit, out TouchHit hit) - { - hit = new TouchHit(raycastHit); - - if (!(raycastHit.module is GraphicRaycaster)) return HitTest.ObjectHitResult.Miss; - var go = raycastHit.gameObject; - if (go == null) return HitTest.ObjectHitResult.Miss; - go.GetComponents(tmpHitTestList); - var count = tmpHitTestList.Count; - if (count == 0) return HitTest.ObjectHitResult.Hit; - - var hitResult = HitTest.ObjectHitResult.Hit; - for (var i = 0; i < count; i++) - { - var test = tmpHitTestList[i]; - if (!test.enabled) continue; - hitResult = test.IsHit(hit); - if (hitResult == HitTest.ObjectHitResult.Miss || hitResult == HitTest.ObjectHitResult.Discard) break; - } - return hitResult; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs.meta deleted file mode 100644 index 0c3d36583..000000000 --- a/Source/Assets/TouchScript/Scripts/Layers/UILayer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 26a72f9b3b6704180978dbce08cf231e -timeCreated: 1447582130 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers.meta b/Source/Assets/TouchScript/Scripts/Pointers.meta new file mode 100644 index 000000000..2c3e39723 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b511f0050fd1e4bdc9acaf7d90868785 +folderAsset: yes +timeCreated: 1467463752 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs new file mode 100644 index 000000000..f78aa06ca --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs @@ -0,0 +1,77 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Hit; +using TouchScript.InputSources; +using UnityEngine; + +namespace TouchScript.Pointers +{ + /// + /// Fake pointer. + /// + /// + public class FakePointer : IPointer + { + #region Public properties + + /// + public int Id { get; private set; } + + /// + public Pointer.PointerType Type { get; private set; } + + /// + public IInputSource InputSource { get; private set; } + + /// + public Vector2 Position { get; set; } + + /// + public uint Flags { get; private set; } + + /// + public Pointer.PointerButtonState Buttons { get; private set; } + + /// + public Vector2 PreviousPosition { get; private set; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The position. + public FakePointer(Vector2 position) : this() + { + Position = position; + } + + /// + /// Initializes a new instance of the class. + /// + public FakePointer() + { + Id = Pointer.INVALID_POINTER; + Type = Pointer.PointerType.Unknown; + Flags = Pointer.FLAG_ARTIFICIAL; + } + + #endregion + + #region Public methods + + /// + public HitData GetOverData(bool forceRecalculate = false) + { + HitData overData; + LayerManager.Instance.GetHitTarget(this, out overData); + return overData; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs.meta new file mode 100644 index 000000000..bbd616fb0 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a59adb6c636064c8496f0078661777f1 +timeCreated: 1470469109 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs new file mode 100644 index 000000000..a9e223cef --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs @@ -0,0 +1,59 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.Hit; +using TouchScript.InputSources; +using UnityEngine; + +namespace TouchScript.Pointers +{ + /// + /// Interface for an abstract pointer. + /// + public interface IPointer + { + /// + /// Internal unique pointer id. + /// + int Id { get; } + + /// + /// Pointer type. See . + /// + Pointer.PointerType Type { get; } + + /// + /// Current buttons state of the pointer. + /// + Pointer.PointerButtonState Buttons { get; } + + /// + /// Original input source which created this pointer. + /// + /// + IInputSource InputSource { get; } + + /// + /// Current position in screen coordinates. + /// + Vector2 Position { get; set; } + + /// + /// Previous position in screen coordinates. + /// + Vector2 PreviousPosition { get; } + + /// + /// Gets or sets pointer flags: + /// Note: setting this property doesn't immediately change its value, the value actually changes during the next TouchManager update phase. + /// + uint Flags { get; } + + /// + /// Returns for current pointer position, i.e. what is right beneath it. Caches the result for the entire frame. + /// + /// if set to true forces to recalculate the value. + HitData GetOverData(bool forceRecalculate = false); + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs.meta new file mode 100644 index 000000000..00898eceb --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c98af71ed8641458f89cd9710017249a +timeCreated: 1470469109 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs new file mode 100644 index 000000000..99f624ba9 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs @@ -0,0 +1,59 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; +using UnityEngine; + +namespace TouchScript.Pointers +{ + /// + /// A pointer of type . + /// + public class MousePointer : Pointer + { + #region Public properties + + /// + /// Mouse scroll delta this frame. + /// + public Vector2 ScrollDelta { get; set; } + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public MousePointer(IInputSource input) : base(input) + { + Type = PointerType.Mouse; + } + + #endregion + + #region Public methods + + /// + public override void CopyFrom(Pointer target) + { + base.CopyFrom(target); + + var mouseTarget = target as MousePointer; + if (mouseTarget == null) return; + ScrollDelta = mouseTarget.ScrollDelta; + } + + #endregion + + #region Internal functions + + //internal override void INTERNAL_Reset() + //{ + // base.INTERNAL_Reset(); + //} + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs.meta new file mode 100644 index 000000000..6e85ae556 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e64c6133ea9544d7a840a578e56d596a +timeCreated: 1467465330 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs new file mode 100644 index 000000000..ed897852f --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs @@ -0,0 +1,106 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; + +namespace TouchScript.Pointers +{ + /// + /// A pointer of type . + /// + public class ObjectPointer : Pointer + { + #region Public consts + + /// + /// Default object id value when device doesn't provide it. + /// + public const int DEFAULT_OBJECT_ID = 0; + + + /// + /// Default width value when device doesn't provide it. + /// + public const float DEFAULT_WIDTH = 1f; + + /// + /// Default height value when device doesn't provide it. + /// + public const float DEFAULT_HEIGHT = 1f; + + /// + /// Default angle value when device doesn't provide it. + /// + public const float DEFAULT_ANGLE = 0f; + + #endregion + + #region Public properties + + /// + /// The Id of the physical object this pointer represents. + /// + public int ObjectId { get; internal set; } + + /// + /// The Width of the physical object this pointer represents. + /// + public float Width { get; internal set; } + + /// + /// The height of the physical object this pointer represents. + /// + public float Height { get; internal set; } + + /// + /// The Rotation of the physical object this pointer represents. + /// + public float Angle { get; internal set; } + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public ObjectPointer(IInputSource input) : base(input) + { + Type = PointerType.Object; + } + + #endregion + + #region Public methods + + /// + public override void CopyFrom(Pointer target) + { + base.CopyFrom(target); + var obj = target as ObjectPointer; + if (obj == null) return; + + ObjectId = obj.ObjectId; + Width = obj.Width; + Height = obj.Height; + Angle = obj.Angle; + } + + #endregion + + #region Internal functions + + /// + internal override void INTERNAL_Reset() + { + base.INTERNAL_Reset(); + ObjectId = DEFAULT_OBJECT_ID; + Width = DEFAULT_WIDTH; + Height = DEFAULT_HEIGHT; + Angle = DEFAULT_ANGLE; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs.meta new file mode 100644 index 000000000..433c71e93 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 64e28c1cdb5fd4afeb8f257057dc4412 +timeCreated: 1467476141 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs new file mode 100644 index 000000000..83ee8ef70 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs @@ -0,0 +1,69 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; + +namespace TouchScript.Pointers +{ + /// + /// A pointer of type . + /// + public class PenPointer : Pointer + { + #region Public consts + + /// + /// Default pressure value when device doesn't provide it. + /// + public const float DEFAULT_PRESSURE = 0.5f; + + /// + /// Default rotation value when device doesn't provide it. + /// + public const float DEFAULT_ROTATION = 0f; + + #endregion + + #region Public properties + + /// + /// Gets or sets the touch's rotation. + /// + /// Rotation in radians. + public float Rotation { get; set; } + + /// + /// Gets or sets the touch's pressure. + /// + /// Pressure in range [0, 1]. + public float Pressure { get; set; } + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public PenPointer(IInputSource input) : base(input) + { + Type = PointerType.Pen; + } + + #endregion + + #region Internal functions + + /// + internal override void INTERNAL_Reset() + { + base.INTERNAL_Reset(); + + Rotation = DEFAULT_ROTATION; + Pressure = DEFAULT_PRESSURE; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs.meta new file mode 100644 index 000000000..3b873ff03 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4056d0c49ca0c4b58b8bc68d14a224cd +timeCreated: 1467465330 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs new file mode 100644 index 000000000..d00db78af --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs @@ -0,0 +1,392 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System; +using System.Text; +using TouchScript.Core; +using TouchScript.Hit; +using TouchScript.InputSources; +using TouchScript.Layers; +using TouchScript.Utils; +using UnityEngine; + +namespace TouchScript.Pointers +{ + /// + /// Representation of a pointer (touch, mouse) within TouchScript. + /// An instance of this class is created when user touches the screen. A unique id is assigned to it which doesn't change throughout its life. + /// Attention! Do not store references to these objects beyond pointer's lifetime (i.e. when target finger is lifted off). These objects may be reused internally. Store unique ids instead. + /// + public class Pointer : IPointer, IEquatable + { + #region Constants + + /// + /// Invalid pointer id. + /// + public const int INVALID_POINTER = -1; + + /// + /// This pointer is generated by script and is not mapped to any device input. + /// + public const uint FLAG_ARTIFICIAL = 1 << 0; + + /// + /// This pointer was returned to the system after it was cancelled. + /// + public const uint FLAG_RETURNED = 1 << 1; + + /// + /// This pointer is internal and shouldn't be shown on screen. + /// + public const uint FLAG_INTERNAL = 1 << 2; + + /// + /// Pointer type. + /// + public enum PointerType + { + /// + /// Unknown. + /// + Unknown, + + /// + /// Touch. + /// + Touch, + + /// + /// Mouse. + /// + Mouse, + + /// + /// Pen. + /// + Pen, + + /// + /// Object. + /// + Object + } + + /// + /// The state of buttons for a pointer. Combines 3 types of button events: Pressed (holding a button), Down (just pressed this frame) and Up (released this frame). + /// + [Flags] + public enum PointerButtonState + { + /// + /// No button is pressed. + /// + Nothing = 0, + + /// + /// Indicates a primary action, analogous to a left mouse button down. + /// A or has this flag set when it is in contact with the digitizer surface. + /// A has this flag set when it is in contact with the digitizer surface with no buttons pressed. + /// A has this flag set when the left mouse button is down. + /// + FirstButtonPressed = 1 << 0, + + /// + /// Indicates a secondary action, analogous to a right mouse button down. + /// A or does not use this flag. + /// A has this flag set when it is in contact with the digitizer surface with the pen barrel button pressed. + /// A has this flag set when the right mouse button is down. + /// + SecondButtonPressed = 1 << 1, + + /// + /// Analogous to a mouse wheel button down. + /// A , or does not use this flag. + /// A has this flag set when the mouse wheel button is down. + /// + ThirdButtonPressed = 1 << 2, + + /// + /// Analogous to the first extended button button down. + /// A , or does not use this flag. + /// A has this flag set when the first extended button is down. + /// + FourthButtonPressed = 1 << 3, + + /// + /// Analogous to the second extended button button down. + /// A , or does not use this flag. + /// A has this flag set when the second extended button is down. + /// + FifthButtonPressed = 1 << 4, + + /// + /// First button pressed this frame. + /// + FirstButtonDown = 1 << 11, + + /// + /// First button released this frame. + /// + FirstButtonUp = 1 << 12, + + /// + /// Second button pressed this frame. + /// + SecondButtonDown = 1 << 13, + + /// + /// Second button released this frame. + /// + SecondButtonUp = 1 << 14, + + /// + /// Third button pressed this frame. + /// + ThirdButtonDown = 1 << 15, + + /// + /// Third button released this frame. + /// + ThirdButtonUp = 1 << 16, + + /// + /// Fourth button pressed this frame. + /// + FourthButtonDown = 1 << 17, + + /// + /// Fourth button released this frame. + /// + FourthButtonUp = 1 << 18, + + /// + /// Fifth button pressed this frame. + /// + FifthButtonDown = 1 << 19, + + /// + /// Fifth button released this frame. + /// + FifthButtonUp = 1 << 20, + + /// + /// Any button is pressed. + /// + AnyButtonPressed = FirstButtonPressed | SecondButtonPressed | ThirdButtonPressed | FourthButtonPressed | FifthButtonPressed, + + /// + /// Any button down this frame. + /// + AnyButtonDown = FirstButtonDown | SecondButtonDown | ThirdButtonDown | FourthButtonDown | FifthButtonDown, + + /// + /// Any button up this frame. + /// + AnyButtonUp = FirstButtonUp | SecondButtonUp | ThirdButtonUp | FourthButtonUp | FifthButtonUp + } + + #endregion + + #region Public properties + + /// + public int Id { get; private set; } + + /// + public PointerType Type { get; protected set; } + + /// + public PointerButtonState Buttons { get; set; } + + /// + public IInputSource InputSource { get; private set; } + + /// + public Vector2 Position + { + get { return position; } + set { newPosition = value; } + } + + /// + public Vector2 PreviousPosition { get; private set; } + + /// + public uint Flags { get; set; } + + /// + /// Projection parameters for the layer which created this pointer. + /// + public ProjectionParams ProjectionParams + { + get + { + if (pressData.Layer == null) return null; + return pressData.Layer.GetProjectionParams(this); + } + } + + #endregion + + #region Private variables + + private static StringBuilder builder; + + private LayerManagerInstance layerManager; + private int refCount = 0; + private Vector2 position, newPosition; + private HitData pressData, overData; + private bool overDataIsDirty = true; + + #endregion + + #region Public methods + + /// + public HitData GetOverData(bool forceRecalculate = false) + { + if (overDataIsDirty || forceRecalculate) + { + layerManager.GetHitTarget(this, out overData); + overDataIsDirty = false; + } + return overData; + } + + /// + /// Returns when the pointer was pressed. If the pointer is not pressed uninitialized is returned. + /// + public HitData GetPressData() + { + return pressData; + } + + /// + /// Copies values from the target. + /// + /// The target pointer to copy values from. + public virtual void CopyFrom(Pointer target) + { + Type = target.Type; + Flags = target.Flags; + Buttons = target.Buttons; + position = target.position; + newPosition = target.newPosition; + PreviousPosition = target.PreviousPosition; + } + + /// + public override bool Equals(object other) + { + return Equals(other as Pointer); + } + + /// + public bool Equals(Pointer other) + { + if (other == null) + return false; + + return Id == other.Id; + } + + /// + public override int GetHashCode() + { + return Id; + } + + /// + public override string ToString() + { + if (builder == null) builder = new StringBuilder(); + builder.Length = 0; + builder.Append("(Pointer type: "); + builder.Append(Type); + builder.Append(", id: "); + builder.Append(Id); + builder.Append(", buttons: "); + PointerUtils.PressedButtonsToString(Buttons, builder); + builder.Append(", flags: "); + BinaryUtils.ToBinaryString(Flags, builder, 8); + builder.Append(", position: "); + builder.Append(Position); + builder.Append(")"); + return builder.ToString(); + } + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public Pointer(IInputSource input) + { + layerManager = LayerManager.Instance as LayerManagerInstance; + Type = PointerType.Unknown; + InputSource = input; + INTERNAL_Reset(); + } + + #endregion + + #region Internal methods + + internal virtual void INTERNAL_Init(int id) + { + Id = id; + PreviousPosition = position = newPosition; + } + + internal virtual void INTERNAL_Reset() + { + Id = INVALID_POINTER; + INTERNAL_ClearPressData(); + position = newPosition = PreviousPosition = Vector2.zero; + Flags = 0; + Buttons = PointerButtonState.Nothing; + overDataIsDirty = true; + } + + internal virtual void INTERNAL_FrameStarted() + { + Buttons &= ~(PointerButtonState.AnyButtonDown | PointerButtonState.AnyButtonUp); + overDataIsDirty = true; + } + + internal virtual void INTERNAL_UpdatePosition() + { + PreviousPosition = position; + position = newPosition; + } + + internal void INTERNAL_Retain() + { + refCount++; + } + + internal int INTERNAL_Release() + { + return --refCount; + } + + internal void INTERNAL_SetPressData(HitData data) + { + pressData = data; + overData = data; + overDataIsDirty = false; + } + + internal void INTERNAL_ClearPressData() + { + pressData = default(HitData); + refCount = 0; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/TouchPoint.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/TouchPoint.cs.meta rename to Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs new file mode 100644 index 000000000..f90184666 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs @@ -0,0 +1,36 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; + +namespace TouchScript.Pointers +{ + /// + /// Static factory to create pointers. + /// + public static class PointerFactory + { + /// + /// Creates a pointer of certain type attached to the input source. + /// + /// Pointer type to create. + /// Input source to attach the pointer to. + /// + public static Pointer Create(Pointer.PointerType type, IInputSource input) + { + switch (type) + { + case Pointer.PointerType.Touch: + return new TouchPointer(input); + case Pointer.PointerType.Mouse: + return new MousePointer(input); + case Pointer.PointerType.Pen: + return new PenPointer(input); + case Pointer.PointerType.Object: + return new ObjectPointer(input); + } + return null; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs.meta new file mode 100644 index 000000000..63674cb8f --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bcdc6ef93ccbe452bbf3f836f03beea3 +timeCreated: 1467501141 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs new file mode 100644 index 000000000..70c72e096 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs @@ -0,0 +1,69 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using TouchScript.InputSources; + +namespace TouchScript.Pointers +{ + /// + /// A pointer of type . + /// + public class TouchPointer : Pointer + { + #region Public consts + + /// + /// Default pressure value when device doesn't provide it. + /// + public const float DEFAULT_PRESSURE = 0.5f; + + /// + /// Default rotation value when device doesn't provide it. + /// + public const float DEFAULT_ROTATION = 0f; + + #endregion + + #region Public properties + + /// + /// Gets or sets the touch's rotation. + /// + /// Rotation in radians. + public float Rotation { get; set; } + + /// + /// Gets or sets the touch's pressure. + /// + /// Pressure in range [0, 1]. + public float Pressure { get; set; } + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public TouchPointer(IInputSource input) : base(input) + { + Type = PointerType.Touch; + } + + #endregion + + #region Internal functions + + /// + internal override void INTERNAL_Reset() + { + base.INTERNAL_Reset(); + + Rotation = DEFAULT_ROTATION; + Pressure = DEFAULT_PRESSURE; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs.meta b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs.meta new file mode 100644 index 000000000..0117edc3b --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e33e0ca5e0fd54fc29f2fe19666744e4 +timeCreated: 1467465330 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Tags.cs b/Source/Assets/TouchScript/Scripts/Tags.cs deleted file mode 100644 index 3495685ce..000000000 --- a/Source/Assets/TouchScript/Scripts/Tags.cs +++ /dev/null @@ -1,232 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Collections.Generic; -using System.Text; -using UnityEngine; - -namespace TouchScript -{ - /// - /// Immutable tag collection for touches. - /// - [Serializable] - public sealed class Tags : ISerializationCallbackReceiver - { - #region Constants - - /// - /// Touch. - /// - public const string INPUT_TOUCH = "Touch"; - - /// - /// Mouse. - /// - public const string INPUT_MOUSE = "Mouse"; - - /// - /// Pen. - /// - public const string INPUT_PEN = "Pen"; - - /// - /// Object. - /// - public const string INPUT_OBJECT = "Object"; - - /// - /// Empty tag list. - /// - public static readonly Tags EMPTY = new Tags(); - - #endregion - - #region Public properties - - #endregion - - #region Private variables - - [SerializeField] - private List tagList = new List(); - - private HashSet tags = new HashSet(); - private string stringValue; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// Tags to copy. - /// Tags to add. - public Tags(Tags tags, IEnumerable add) : this(tags) - { - if (add == null) return; - foreach (var tag in add) - { - if (string.IsNullOrEmpty(tag)) continue; - this.tags.Add(tag); - } -#if UNITY_EDITOR - syncTagList(); -#endif - } - - /// - /// Initializes a new instance of the class. - /// - /// Tags to copy. - /// Tag to add. - public Tags(Tags tags, string add) : this(tags) - { - if (string.IsNullOrEmpty(add)) return; - this.tags.Add(add); - } - - /// - /// Initializes a new instance of the class. - /// - /// Tags to copy. - public Tags(Tags tags) : this() - { - if (tags == null) return; - foreach (var tag in tags.tags) this.tags.Add(tag); -#if UNITY_EDITOR - syncTagList(); -#endif - } - - /// - /// Initializes a new instance of the class. - /// - /// Tags to copy. - public Tags(IEnumerable tags) : this() - { - if (tags == null) return; - foreach (var tag in tags) - { - if (string.IsNullOrEmpty(tag)) continue; - this.tags.Add(tag); - } -#if UNITY_EDITOR - syncTagList(); -#endif - } - - /// - /// Initializes a new instance of the class. - /// - /// Tags to add. - public Tags(params string[] tags) : this() - { - if (tags == null) return; - var count = tags.Length; - for (var i = 0; i < count; i++) - { - var tag = tags[i]; - if (string.IsNullOrEmpty(tag)) continue; - this.tags.Add(tag); - } -#if UNITY_EDITOR - syncTagList(); -#endif - } - - /// - /// Initializes a new instance of the class. - /// - /// Tag to add. - public Tags(string tag) : this() - { - if (string.IsNullOrEmpty(tag)) return; - tags.Add(tag); -#if UNITY_EDITOR - syncTagList(); -#endif - } - - /// - /// Initializes a new instance of the class. - /// - public Tags() {} - - #endregion - - #region Public methods - - /// - /// Checks if this collection contains a tag. - /// - /// Tag. - /// True if tag is in this collection; false otherwise. - public bool HasTag(string tag) - { - return tags.Contains(tag); - } - - - /// - public void OnBeforeSerialize() - { -#if !UNITY_EDITOR - tagList.Clear(); - tagList.AddRange(tags); -#endif - } - - /// - public void OnAfterDeserialize() - { - tags.Clear(); - foreach (var tag in tagList) tags.Add(tag); - } - - /// - public override string ToString() - { - if (stringValue == null) - { - if (tags.Count == 0) - { - stringValue = ""; - } - else if (tags.Count == 1) - { - foreach (var tag in tags) stringValue = tag; // doh!? - } - else - { - var sb = new StringBuilder(100); - foreach (var tag in tags) - { - sb.Append(tag); - sb.Append(", "); - } - stringValue = sb.ToString(0, sb.Length - 2); - } - } - return stringValue; - } - - #endregion - - #region Private functions - -#if UNITY_EDITOR - // When Tags is created in editor as a component's property need to copy all tags to tagList so Unity could serialize them. - private void syncTagList() - { - tagList.Clear(); - tagList.AddRange(tags); - } -#endif - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Tags.cs.meta b/Source/Assets/TouchScript/Scripts/Tags.cs.meta deleted file mode 100644 index 321ff2893..000000000 --- a/Source/Assets/TouchScript/Scripts/Tags.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c7c3e58101ca34da39242009583cad02 -timeCreated: 1447582131 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/TouchManager.cs b/Source/Assets/TouchScript/Scripts/TouchManager.cs index 7c83ca5dc..2d4338d8a 100644 --- a/Source/Assets/TouchScript/Scripts/TouchManager.cs +++ b/Source/Assets/TouchScript/Scripts/TouchManager.cs @@ -4,32 +4,28 @@ using System; using System.Collections.Generic; +using TouchScript.Core; using TouchScript.Devices.Display; using TouchScript.Layers; +using TouchScript.Pointers; using TouchScript.Utils.Attributes; using UnityEngine; +using UnityEngine.Events; using Object = UnityEngine.Object; namespace TouchScript { /// - /// A façade object to configure and hold parameters for an instance of . Contains constants used throughout the library. + /// A facade object to configure and hold parameters for an instance of . Contains constants used throughout the library. /// /// /// /// An instance of may be added to a Unity scene to hold (i.e. serialize them to the scene) parameters needed to configure an instance of used in application. Which can be accessed via static property. /// Though it's not required it is a convenient way to configure TouchScript for your scene. You can use different configuration options for different scenes. /// - /// - /// This sample shows how to get Touch Manager instance and subscribe to events. - /// - /// TouchManager.Instance.TouchBegan += (sender, args) => { Debug.Log("Began: " + args.Touch.Id); }; - /// TouchManager.Instance.TouchEnded += (sender, args) => { Debug.Log("Ended: " + args.Touch.Id); }; - /// - /// [AddComponentMenu("TouchScript/Touch Manager")] - [HelpURL("http://touchscript.github.io/docs/Index.html?topic=html/T_TouchScript_TouchManager.htm")] - public sealed class TouchManager : MonoBehaviour + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_TouchManager.htm")] + public sealed class TouchManager : DebuggableMonoBehaviour { #region Constants @@ -38,6 +34,19 @@ public sealed class TouchManager : MonoBehaviour public const int DEBUG_GL_TOUCH = DEBUG_GL_START; #endif + /// + /// Event implementation in Unity EventSystem for pointer events. + /// + [Serializable] + public class PointerEvent : UnityEvent> {} + + /// + /// Event implementation in Unity EventSystem for frame events. + /// + /// + [Serializable] + public class FrameEvent : UnityEvent {} + /// /// Values of a bit-mask representing which Unity messages an instance of will dispatch. /// @@ -45,34 +54,44 @@ public sealed class TouchManager : MonoBehaviour public enum MessageType { /// - /// Touch frame started. + /// Pointer frame started. /// FrameStarted = 1 << 0, /// - /// Touch frame finished. + /// Pointer frame finished. /// FrameFinished = 1 << 1, /// - /// Some touches have begun during the frame. + /// Some pointers were added during the frame. + /// + PointersAdded = 1 << 2, + + /// + /// Some pointers were updated during the frame. + /// + PointersUpdated = 1 << 3, + + /// + /// Some pointers have touched the surface during the frame. /// - TouchBegan = 1 << 2, + PointersPressed = 1 << 4, /// - /// Some touches have moved during the frame. + /// Some pointers were released during the frame. /// - TouchMoved = 1 << 3, + PointersReleased = 1 << 5, /// - /// Some touches have ended during the frame. + /// Some pointers were removed during the frame. /// - TouchEnded = 1 << 4, + PointersRemoved = 1 << 6, /// - /// Some touches were cancelled during the frame. + /// Some pointers were cancelled during the frame. /// - TouchCancelled = 1 << 5 + PointersCancelled = 1 << 7 } /// @@ -81,34 +100,44 @@ public enum MessageType public enum MessageName { /// - /// Touch frame started. + /// Pointer frame started. + /// + OnFrameStart = MessageType.FrameStarted, + + /// + /// Pointer frame finished. + /// + OnFrameFinish = MessageType.FrameFinished, + + /// + /// Some pointers were added during the frame. /// - OnTouchFrameStarted = MessageType.FrameStarted, + OnPointersAdd = MessageType.PointersAdded, /// - /// Touch frame finished. + /// Some pointers have updated during the frame. /// - OnTouchFrameFinished = MessageType.FrameFinished, + OnPointersUpdate = MessageType.PointersUpdated, /// - /// Some touches have begun during the frame. + /// Some pointers have touched the surface during the frame. /// - OnTouchBegan = MessageType.TouchBegan, + OnPointersPress = MessageType.PointersPressed, /// - /// Some touches have moved during the frame. + /// Some pointers were released during the frame. /// - OnTouchMoved = MessageType.TouchMoved, + OnPointersRelease = MessageType.PointersReleased, /// - /// Some touches have ended during the frame. + /// Some pointers were removed during the frame. /// - OnTouchEnded = MessageType.TouchEnded, + OnPointersRemove = MessageType.PointersRemoved, /// - /// Some touches were cancelled during the frame. + /// Some pointers were cancelled during the frame. /// - OnTouchCancelled = MessageType.TouchCancelled + OnPointersCancel = MessageType.PointersCancelled } /// @@ -129,7 +158,63 @@ public enum MessageName /// /// TouchScript version. /// - public static readonly Version VERSION = new Version(7, 0); + public static readonly Version VERSION = new Version(9, 0); + + /// + /// TouchScript version suffix. + /// + public static readonly string VERSION_SUFFIX = ""; + + #endregion + + #region Events + + /// + /// Occurs when a new frame is started before all other events. + /// + public FrameEvent OnFrameStart = new FrameEvent(); + + /// + /// Occurs when a frame is finished. After all other events. + /// + [SerializeField] + public FrameEvent OnFrameFinish = new FrameEvent(); + + /// + /// Occurs when new hovering pointers are added. + /// + [SerializeField] + public PointerEvent OnPointersAdd = new PointerEvent(); + + /// + /// Occurs when pointers are updated. + /// + [SerializeField] + public PointerEvent OnPointersUpdate = new PointerEvent(); + + /// + /// Occurs when pointers touch the surface. + /// + [SerializeField] + public PointerEvent OnPointersPress = new PointerEvent(); + + /// + /// Occurs when pointers are released. + /// + [SerializeField] + public PointerEvent OnPointersRelease = new PointerEvent(); + + /// + /// Occurs when pointers are removed from the system. + /// + [SerializeField] + public PointerEvent OnPointersRemove = new PointerEvent(); + + /// + /// Occurs when pointers are cancelled. + /// + [SerializeField] + public PointerEvent OnPointersCancel = new PointerEvent(); #endregion @@ -138,7 +223,7 @@ public enum MessageName /// /// Gets the instance of implementation used in the application. /// - /// An instance of which is in charge of global touch input control in the application. + /// An instance of which is in charge of global pointer input control in the application. public static ITouchManager Instance { get { return TouchManagerInstance.Instance; } @@ -171,7 +256,7 @@ public IDisplayDevice DisplayDevice /// Indicates if TouchScript should create a CameraLayer for you if no layers present in a scene. /// /// true if a CameraLayer should be created on startup; otherwise, false. - /// This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get touch input from some device. + /// This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get pointer input from some device. public bool ShouldCreateCameraLayer { get { return shouldCreateCameraLayer; } @@ -201,7 +286,7 @@ public bool UseSendMessage { if (value == useSendMessage) return; useSendMessage = value; - updateSubscription(); + updateSendMessageSubscription(); } } @@ -216,7 +301,7 @@ public MessageType SendMessageEvents { if (sendMessageEvents == value) return; sendMessageEvents = value; - updateSubscription(); + updateSendMessageSubscription(); } } @@ -234,6 +319,38 @@ public GameObject SendMessageTarget } } + /// + /// Gets or sets a value indicating whether Unity Events should be used. + /// + /// + /// true if TouchManager should use Unity Events; otherwise, false. + /// + public bool UseUnityEvents + { + get { return useUnityEvents; } + set + { + if (useUnityEvents == value) return; + useUnityEvents = value; + updateUnityEventsSubscription(); + } + } + +#if TOUCHSCRIPT_DEBUG + + /// + public override bool DebugMode + { + get { return base.DebugMode; } + set + { + base.DebugMode = value; + if (Application.isPlaying) (Instance as TouchManagerInstance).DebugMode = value; + } + } + +#endif + #endregion #region Public methods @@ -245,14 +362,22 @@ public GameObject SendMessageTarget /// true if position is invalid; otherwise, false. public static bool IsInvalidPosition(Vector2 position) { - return position.Equals(INVALID_POSITION); + return position.x == INVALID_POSITION.x && position.y == INVALID_POSITION.y; } #endregion #region Private variables + #pragma warning disable CS0414 + [SerializeField] + [HideInInspector] + private bool basicEditor = true; + + #pragma warning restore CS0414 + + [SerializeField] private Object displayDevice; [SerializeField] @@ -268,12 +393,16 @@ public static bool IsInvalidPosition(Vector2 position) private bool useSendMessage = false; [SerializeField] - private MessageType sendMessageEvents = MessageType.TouchBegan | MessageType.TouchCancelled | - MessageType.TouchEnded | MessageType.TouchMoved; + private MessageType sendMessageEvents = MessageType.PointersPressed | MessageType.PointersCancelled | + MessageType.PointersReleased | MessageType.PointersUpdated | + MessageType.PointersAdded | MessageType.PointersRemoved; [SerializeField] private GameObject sendMessageTarget; + [SerializeField] + private bool useUnityEvents = false; + [SerializeField] private List layers = new List(); @@ -285,97 +414,200 @@ private void Awake() { if (Instance == null) return; +#if TOUCHSCRIPT_DEBUG + if (DebugMode) (Instance as TouchManagerInstance).DebugMode = true; +#endif + Instance.DisplayDevice = displayDevice as IDisplayDevice; Instance.ShouldCreateCameraLayer = ShouldCreateCameraLayer; Instance.ShouldCreateStandardInput = ShouldCreateStandardInput; for (var i = 0; i < layers.Count; i++) { - Instance.AddLayer(layers[i], i); + var layer = layers[i]; + if (layer != null) LayerManager.Instance.AddLayer(layer, i); } } private void OnEnable() { - updateSubscription(); + updateSendMessageSubscription(); + updateUnityEventsSubscription(); } private void OnDisable() { - removeSubscriptions(); + removeSendMessageSubscriptions(); + removeUnityEventsSubscriptions(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Private functions - private void updateSubscription() + private void updateSendMessageSubscription() { if (!Application.isPlaying) return; if (Instance == null) return; if (sendMessageTarget == null) sendMessageTarget = gameObject; - removeSubscriptions(); + removeSendMessageSubscriptions(); if (!useSendMessage) return; - if ((SendMessageEvents & MessageType.FrameStarted) != 0) Instance.FrameStarted += frameStartedHandler; - if ((SendMessageEvents & MessageType.FrameFinished) != 0) Instance.FrameFinished += frameFinishedHandler; - if ((SendMessageEvents & MessageType.TouchBegan) != 0) Instance.TouchBegan += touchBeganHandler; - if ((SendMessageEvents & MessageType.TouchMoved) != 0) Instance.TouchMoved += touchMovedHandler; - if ((SendMessageEvents & MessageType.TouchEnded) != 0) Instance.TouchEnded += touchEndedHandler; - if ((SendMessageEvents & MessageType.TouchCancelled) != 0) Instance.TouchCancelled += touchCancelledHandler; + if ((SendMessageEvents & MessageType.FrameStarted) != 0) Instance.FrameStarted += frameStartedSendMessageHandler; + if ((SendMessageEvents & MessageType.FrameFinished) != 0) Instance.FrameFinished += frameFinishedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersAdded) != 0) Instance.PointersAdded += pointersAddedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersUpdated) != 0) Instance.PointersUpdated += pointersUpdatedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersPressed) != 0) Instance.PointersPressed += pointersPressedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersReleased) != 0) Instance.PointersReleased += pointersReleasedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersRemoved) != 0) Instance.PointersRemoved += pointersRemovedSendMessageHandler; + if ((SendMessageEvents & MessageType.PointersCancelled) != 0) Instance.PointersCancelled += pointersCancelledSendMessageHandler; } - private void removeSubscriptions() + private void removeSendMessageSubscriptions() { if (!Application.isPlaying) return; if (Instance == null) return; - Instance.FrameStarted -= frameStartedHandler; - Instance.FrameFinished -= frameFinishedHandler; - Instance.TouchBegan -= touchBeganHandler; - Instance.TouchMoved -= touchMovedHandler; - Instance.TouchEnded -= touchEndedHandler; - Instance.TouchCancelled -= touchCancelledHandler; + Instance.FrameStarted -= frameStartedSendMessageHandler; + Instance.FrameFinished -= frameFinishedSendMessageHandler; + Instance.PointersAdded -= pointersAddedSendMessageHandler; + Instance.PointersUpdated -= pointersUpdatedSendMessageHandler; + Instance.PointersPressed -= pointersPressedSendMessageHandler; + Instance.PointersReleased -= pointersReleasedSendMessageHandler; + Instance.PointersRemoved -= pointersRemovedSendMessageHandler; + Instance.PointersCancelled -= pointersCancelledSendMessageHandler; + } + + private void pointersAddedSendMessageHandler(object sender, PointerEventArgs e) + { + sendMessageTarget.SendMessage(MessageName.OnPointersAdd.ToString(), e.Pointers, + SendMessageOptions.DontRequireReceiver); + } + + private void pointersUpdatedSendMessageHandler(object sender, PointerEventArgs e) + { + sendMessageTarget.SendMessage(MessageName.OnPointersUpdate.ToString(), e.Pointers, + SendMessageOptions.DontRequireReceiver); } - private void touchBeganHandler(object sender, TouchEventArgs e) + private void pointersPressedSendMessageHandler(object sender, PointerEventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchBegan.ToString(), e.Touch, + sendMessageTarget.SendMessage(MessageName.OnPointersPress.ToString(), e.Pointers, SendMessageOptions.DontRequireReceiver); } - private void touchMovedHandler(object sender, TouchEventArgs e) + private void pointersReleasedSendMessageHandler(object sender, PointerEventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchMoved.ToString(), e.Touch, + sendMessageTarget.SendMessage(MessageName.OnPointersRelease.ToString(), e.Pointers, SendMessageOptions.DontRequireReceiver); } - private void touchEndedHandler(object sender, TouchEventArgs e) + private void pointersRemovedSendMessageHandler(object sender, PointerEventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchEnded.ToString(), e.Touch, + sendMessageTarget.SendMessage(MessageName.OnPointersRemove.ToString(), e.Pointers, SendMessageOptions.DontRequireReceiver); } - private void touchCancelledHandler(object sender, TouchEventArgs e) + private void pointersCancelledSendMessageHandler(object sender, PointerEventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchCancelled.ToString(), e.Touch, + sendMessageTarget.SendMessage(MessageName.OnPointersCancel.ToString(), e.Pointers, SendMessageOptions.DontRequireReceiver); } - private void frameStartedHandler(object sender, EventArgs e) + private void frameStartedSendMessageHandler(object sender, EventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchFrameStarted.ToString(), + sendMessageTarget.SendMessage(MessageName.OnFrameStart.ToString(), SendMessageOptions.DontRequireReceiver); } - private void frameFinishedHandler(object sender, EventArgs e) + private void frameFinishedSendMessageHandler(object sender, EventArgs e) { - sendMessageTarget.SendMessage(MessageName.OnTouchFrameFinished.ToString(), + sendMessageTarget.SendMessage(MessageName.OnFrameFinish.ToString(), SendMessageOptions.DontRequireReceiver); } + private void updateUnityEventsSubscription() + { + if (!Application.isPlaying) return; + if (Instance == null) return; + + removeUnityEventsSubscriptions(); + + if (!useUnityEvents) return; + + Instance.FrameStarted += frameStartedUnityEventsHandler; + Instance.FrameFinished += frameFinishedUnityEventsHandler; + Instance.PointersAdded += pointersAddedUnityEventsHandler; + Instance.PointersUpdated += pointersUpdatedUnityEventsHandler; + Instance.PointersPressed += pointersPressedUnityEventsHandler; + Instance.PointersReleased += pointersReleasedUnityEventsHandler; + Instance.PointersRemoved += pointersRemovedUnityEventsHandler; + Instance.PointersCancelled += pointersCancelledUnityEventsHandler; + } + + private void removeUnityEventsSubscriptions() + { + if (!Application.isPlaying) return; + if (Instance == null) return; + + Instance.FrameStarted -= frameStartedUnityEventsHandler; + Instance.FrameFinished -= frameFinishedUnityEventsHandler; + Instance.PointersAdded -= pointersAddedUnityEventsHandler; + Instance.PointersUpdated -= pointersUpdatedUnityEventsHandler; + Instance.PointersPressed -= pointersPressedUnityEventsHandler; + Instance.PointersReleased -= pointersReleasedUnityEventsHandler; + Instance.PointersRemoved -= pointersRemovedUnityEventsHandler; + Instance.PointersCancelled -= pointersCancelledUnityEventsHandler; + } + + private void pointersAddedUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersAdd.Invoke(e.Pointers); + } + + private void pointersUpdatedUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersUpdate.Invoke(e.Pointers); + } + + private void pointersPressedUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersPress.Invoke(e.Pointers); + } + + private void pointersReleasedUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersRelease.Invoke(e.Pointers); + } + + private void pointersRemovedUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersRemove.Invoke(e.Pointers); + } + + private void pointersCancelledUnityEventsHandler(object sender, PointerEventArgs e) + { + OnPointersCancel.Invoke(e.Pointers); + } + + private void frameStartedUnityEventsHandler(object sender, EventArgs e) + { + OnFrameStart.Invoke(); + } + + private void frameFinishedUnityEventsHandler(object sender, EventArgs e) + { + OnFrameFinish.Invoke(); + } + #endregion } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/TouchManager.cs.meta b/Source/Assets/TouchScript/Scripts/TouchManager.cs.meta index 9a64c9c2d..8331053b7 100644 --- a/Source/Assets/TouchScript/Scripts/TouchManager.cs.meta +++ b/Source/Assets/TouchScript/Scripts/TouchManager.cs.meta @@ -6,7 +6,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs b/Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs deleted file mode 100644 index 6d6cd8e77..000000000 --- a/Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs +++ /dev/null @@ -1,793 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using TouchScript.Devices.Display; -using TouchScript.Hit; -using TouchScript.InputSources; -using TouchScript.Layers; -using TouchScript.Utils; -#if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.Debug; -#endif -using UnityEngine; - -namespace TouchScript -{ - /// - /// Default implementation of . - /// - internal sealed class TouchManagerInstance : DebuggableMonoBehaviour, ITouchManager - { - #region Events - - /// - public event EventHandler FrameStarted - { - add { frameStartedInvoker += value; } - remove { frameStartedInvoker -= value; } - } - - /// - public event EventHandler FrameFinished - { - add { frameFinishedInvoker += value; } - remove { frameFinishedInvoker -= value; } - } - - /// - public event EventHandler TouchBegan - { - add { touchBeganInvoker += value; } - remove { touchBeganInvoker -= value; } - } - - /// - public event EventHandler TouchMoved - { - add { touchMovedInvoker += value; } - remove { touchMovedInvoker -= value; } - } - - /// - public event EventHandler TouchEnded - { - add { touchEndedInvoker += value; } - remove { touchEndedInvoker -= value; } - } - - /// - public event EventHandler TouchCancelled - { - add { touchCancelledInvoker += value; } - remove { touchCancelledInvoker -= value; } - } - - // Needed to overcome iOS AOT limitations - private EventHandler touchBeganInvoker, - touchMovedInvoker, - touchEndedInvoker, - touchCancelledInvoker; - - private EventHandler frameStartedInvoker, frameFinishedInvoker; - - #endregion - - #region Public properties - - /// - public static TouchManagerInstance Instance - { - get - { - if (shuttingDown) return null; - if (instance == null) - { - if (!Application.isPlaying) return null; - var objects = FindObjectsOfType(); - if (objects.Length == 0) - { - var go = new GameObject("TouchManager Instance"); - instance = go.AddComponent(); - } - else if (objects.Length >= 1) - { - instance = objects[0]; - } - } - return instance; - } - } - - /// - public IDisplayDevice DisplayDevice - { - get - { - if (displayDevice == null) - { - displayDevice = ScriptableObject.CreateInstance(); - } - return displayDevice; - } - set - { - if (value == null) - { - displayDevice = ScriptableObject.CreateInstance(); - } - else - { - displayDevice = value; - } - updateDPI(); - } - } - - /// - public float DPI - { - get { return dpi; } - } - - /// - public bool ShouldCreateCameraLayer - { - get { return shouldCreateCameraLayer; } - set { shouldCreateCameraLayer = value; } - } - - /// - public bool ShouldCreateStandardInput - { - get { return shouldCreateStandardInput; } - set { shouldCreateStandardInput = value; } - } - - /// - public IList Layers - { - get { return new List(layers); } - } - - /// - public IList Inputs - { - get { return new List(inputs); } - } - - /// - public float DotsPerCentimeter - { - get { return dotsPerCentimeter; } - } - - /// - public int NumberOfTouches - { - get { return touches.Count; } - } - - /// - public IList ActiveTouches - { - get { return new List(touches); } - } - - #endregion - - #region Private variables - - private static bool shuttingDown = false; - private static TouchManagerInstance instance; - private bool shouldCreateCameraLayer = true; - private bool shouldCreateStandardInput = true; - - private IDisplayDevice displayDevice; - private float dpi = 96; - private float dotsPerCentimeter = TouchManager.CM_TO_INCH * 96; - - private List layers = new List(10); - private int layerCount = 0; - private List inputs = new List(3); - private int inputCount = 0; - - private List touches = new List(30); - private Dictionary idToTouch = new Dictionary(30); - - // Upcoming changes - private List touchesBegan = new List(10); - private HashSet touchesUpdated = new HashSet(); - private HashSet touchesEnded = new HashSet(); - private HashSet touchesCancelled = new HashSet(); - - private static ObjectPool touchPointPool = new ObjectPool(10, null, null, - (t) => t.INTERNAL_Reset()); - - private static ObjectPool> touchPointListPool = new ObjectPool>(2, - () => new List(10), null, (l) => l.Clear()); - - private static ObjectPool> intListPool = new ObjectPool>(3, () => new List(10), null, - (l) => l.Clear()); - - private int nextTouchId = 0; - private object touchLock = new object(); - - #endregion - - #region Public methods - - /// - public bool AddLayer(TouchLayer layer) - { - return AddLayer(layer, 0); - } - - /// - public bool AddLayer(TouchLayer layer, int index, bool addIfExists = true) - { - if (layer == null) return false; - - var i = layers.IndexOf(layer); - if (i != -1) - { - if (!addIfExists) return false; - layers.RemoveAt(i); - layerCount--; - } - if (index <= 0) - { - layers.Insert(0, layer); - layerCount++; - return i == -1; - } - if (index >= layerCount) - { - layers.Add(layer); - layerCount++; - return i == -1; - } - if (i != -1) - { - if (index < i) layers.Insert(index, layer); - else layers.Insert(index - 1, layer); - layerCount++; - return false; - } - layers.Insert(index, layer); - layerCount++; - return true; - } - - /// - public bool RemoveLayer(TouchLayer layer) - { - if (layer == null) return false; - var result = layers.Remove(layer); - if (result) layerCount--; - return result; - } - - /// - public void ChangeLayerIndex(int at, int to) - { - if (at < 0 || at >= layerCount) return; - if (to < 0 || to >= layerCount) return; - var data = layers[at]; - layers.RemoveAt(at); - layers.Insert(to, data); - } - - /// - public bool AddInput(IInputSource input) - { - if (input == null) return false; - if (inputs.Contains(input)) return true; - inputs.Add(input); - inputCount++; - return true; - } - - /// - public bool RemoveInput(IInputSource input) - { - if (input == null) return false; - var result = inputs.Remove(input); - if (result) inputCount--; - return result; - } - - /// - public Transform GetHitTarget(Vector2 position) - { - TouchHit hit; - TouchLayer layer; - if (GetHitTarget(position, out hit, out layer)) return hit.Transform; - return null; - } - - /// - public bool GetHitTarget(Vector2 position, out TouchHit hit) - { - TouchLayer layer; - return GetHitTarget(position, out hit, out layer); - } - - /// - public bool GetHitTarget(Vector2 position, out TouchHit hit, out TouchLayer layer) - { - hit = default(TouchHit); - layer = null; - - for (var i = 0; i < layerCount; i++) - { - var touchLayer = layers[i]; - if (touchLayer == null) continue; - TouchHit _hit; - if (touchLayer.Hit(position, out _hit) == TouchLayer.LayerHitResult.Hit) - { - hit = _hit; - layer = touchLayer; - return true; - } - } - - return false; - } - - /// - public void CancelTouch(int id, bool @return) - { - TouchPoint touch; - if (idToTouch.TryGetValue(id, out touch)) - { - touch.InputSource.CancelTouch(touch, @return); - } - } - - /// - public void CancelTouch(int id) - { - CancelTouch(id, false); - } - - #endregion - - #region Internal methods - - internal TouchPoint INTERNAL_BeginTouch(Vector2 position, IInputSource input) - { - return INTERNAL_BeginTouch(position, input, null); - } - - internal TouchPoint INTERNAL_BeginTouch(Vector2 position, IInputSource input, Tags tags) - { - TouchPoint touch; - lock (touchLock) - { - touch = touchPointPool.Get(); - touch.INTERNAL_Init(nextTouchId++, position, input, tags); - touchesBegan.Add(touch); - } - return touch; - } - - /// - /// Update touch without moving it - /// - /// Touch id - internal void INTERNAL_UpdateTouch(int id) - { - lock (touchLock) - { - if (idToTouch.ContainsKey(id)) - { - if (!touchesUpdated.Contains(id)) touchesUpdated.Add(id); - } -#if TOUCHSCRIPT_DEBUG - else - Debug.LogWarning("TouchScript > Touch with id [" + id + - "] is requested to UPDATE but no touch with such id found."); -#endif - } - } - - internal void INTERNAL_MoveTouch(int id, Vector2 position) - { - lock (touchLock) - { - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { - // This touch was added this frame - touch = touchesBegan.Find((t) => t.Id == id); - // No touch with such id - if (touch == null) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Touch with id [" + id + "] is requested to MOVE to " + position + - " but no touch with such id found."); -#endif - return; - } - } - - touch.INTERNAL_SetPosition(position); - if (!touchesUpdated.Contains(id)) touchesUpdated.Add(id); - } - } - - /// - internal void INTERNAL_EndTouch(int id) - { - lock (touchLock) - { - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { - // This touch was added this frame - touch = touchesBegan.Find((t) => t.Id == id); - // No touch with such id - if (touch == null) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Touch with id [" + id + - "] is requested to END but no touch with such id found."); -#endif - return; - } - } - if (!touchesEnded.Contains(id)) touchesEnded.Add(id); -#if TOUCHSCRIPT_DEBUG - else - Debug.LogWarning("TouchScript > Touch with id [" + id + - "] is requested to END more than once this frame."); -#endif - } - } - - /// - internal void INTERNAL_CancelTouch(int id) - { - lock (touchLock) - { - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { - // This touch was added this frame - touch = touchesBegan.Find((t) => t.Id == id); - // No touch with such id - if (touch == null) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Touch with id [" + id + - "] is requested to CANCEL but no touch with such id found."); -#endif - return; - } - } - if (!touchesCancelled.Contains(id)) touchesCancelled.Add(touch.Id); -#if TOUCHSCRIPT_DEBUG - else - Debug.LogWarning("TouchScript > Touch with id [" + id + - "] is requested to CANCEL more than once this frame."); -#endif - } - } - - #endregion - - #region Unity - - private void Awake() - { - if (instance == null) - { - instance = this; - } - else if (instance != this) - { - Destroy(this); - return; - } - - gameObject.hideFlags = HideFlags.HideInHierarchy; - DontDestroyOnLoad(gameObject); - - updateDPI(); - - StopAllCoroutines(); - StartCoroutine(lateAwake()); - - touchPointListPool.WarmUp(2); - intListPool.WarmUp(3); - -#if TOUCHSCRIPT_DEBUG - DebugMode = true; -#endif - } - - private void OnLevelWasLoaded(int value) - { - StopAllCoroutines(); - StartCoroutine(lateAwake()); - } - - private IEnumerator lateAwake() - { - yield return null; - - updateLayers(); - createCameraLayer(); - createTouchInput(); - } - - private void Update() - { - updateInputs(); - updateTouches(); - } - - private void OnApplicationQuit() - { - shuttingDown = true; - } - - #endregion - - #region Private functions - - private void updateDPI() - { - dpi = DisplayDevice == null ? 96 : DisplayDevice.DPI; - dotsPerCentimeter = TouchManager.CM_TO_INCH * dpi; -#if TOUCHSCRIPT_DEBUG - debugTouchSize = Vector2.one*dotsPerCentimeter; -#endif - } - - private void updateLayers() - { - // filter empty layers - layers = layers.FindAll(l => l != null); - layerCount = layers.Count; - } - - private void createCameraLayer() - { - if (layerCount == 0 && shouldCreateCameraLayer) - { - if (Camera.main != null) - { - if (Application.isEditor) - Debug.Log( - "[TouchScript] No camera layer found, adding CameraLayer for the main camera. (this message is harmless)"); - var layer = Camera.main.gameObject.AddComponent(); - AddLayer(layer); - } - } - } - - private void createTouchInput() - { - if (inputCount == 0 && shouldCreateStandardInput) - { - if (Application.isEditor) - Debug.Log("[TouchScript] No input source found, adding StandardInput. (this message is harmless)"); - GameObject obj = null; - var objects = FindObjectsOfType(); - if (objects.Length == 0) - { - obj = GameObject.Find("TouchScript"); - if (obj == null) obj = new GameObject("TouchScript"); - } - else - { - obj = objects[0].gameObject; - } - obj.AddComponent(); - } - } - - private void updateInputs() - { - for (var i = 0; i < inputCount; i++) inputs[i].UpdateInput(); - } - - private void updateBegan(List points) - { - var count = points.Count; - for (var i = 0; i < count; i++) - { - var touch = points[i]; - touches.Add(touch); - idToTouch.Add(touch.Id, touch); - - for (var j = 0; j < layerCount; j++) - { - var touchLayer = layers[j]; - if (touchLayer == null) continue; - if (touchLayer.INTERNAL_BeginTouch(touch)) break; - } - -#if TOUCHSCRIPT_DEBUG - addDebugFigureForTouch(touch); -#endif - - if (touchBeganInvoker != null) - touchBeganInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(touch)); - } - } - - private void updateUpdated(List points) - { - var updatedCount = points.Count; - // Need to loop through all touches to reset those which did not move - var count = touches.Count; - for (var i = 0; i < count; i++) - { - touches[i].INTERNAL_ResetPosition(); - } - for (var i = 0; i < updatedCount; i++) - { - var id = points[i]; - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Id [" + id + - "] was in UPDATED list but no touch with such id found."); -#endif - continue; - } - if (touch.Layer != null) touch.Layer.INTERNAL_UpdateTouch(touch); - -#if TOUCHSCRIPT_DEBUG - addDebugFigureForTouch(touch); -#endif - - if (touchMovedInvoker != null) - touchMovedInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(touch)); - } - } - - private void updateEnded(List points) - { - var endedCount = points.Count; - for (var i = 0; i < endedCount; i++) - { - var id = points[i]; - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Id [" + id + "] was in ENDED list but no touch with such id found."); -#endif - continue; - } - idToTouch.Remove(id); - touches.Remove(touch); - if (touch.Layer != null) touch.Layer.INTERNAL_EndTouch(touch); - -#if TOUCHSCRIPT_DEBUG - removeDebugFigureForTouch(touch); -#endif - - if (touchEndedInvoker != null) - touchEndedInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(touch)); - touchPointPool.Release(touch); - } - } - - private void updateCancelled(List points) - { - var cancelledCount = points.Count; - for (var i = 0; i < cancelledCount; i++) - { - var id = points[i]; - TouchPoint touch; - if (!idToTouch.TryGetValue(id, out touch)) - { -#if TOUCHSCRIPT_DEBUG - Debug.LogWarning("TouchScript > Id [" + id + - "] was in CANCELLED list but no touch with such id found."); -#endif - continue; - } - idToTouch.Remove(id); - touches.Remove(touch); - if (touch.Layer != null) touch.Layer.INTERNAL_CancelTouch(touch); - -#if TOUCHSCRIPT_DEBUG - removeDebugFigureForTouch(touch); -#endif - - if (touchCancelledInvoker != null) - touchCancelledInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(touch)); - touchPointPool.Release(touch); - } - } - - private void updateTouches() - { - if (frameStartedInvoker != null) frameStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); - - // need to copy buffers since they might get updated during execution - List beganList = null; - List updatedList = null; - List endedList = null; - List cancelledList = null; - lock (touchLock) - { - if (touchesBegan.Count > 0) - { - beganList = touchPointListPool.Get(); - beganList.AddRange(touchesBegan); - touchesBegan.Clear(); - } - if (touchesUpdated.Count > 0) - { - updatedList = intListPool.Get(); - updatedList.AddRange(touchesUpdated); - touchesUpdated.Clear(); - } - if (touchesEnded.Count > 0) - { - endedList = intListPool.Get(); - endedList.AddRange(touchesEnded); - touchesEnded.Clear(); - } - if (touchesCancelled.Count > 0) - { - cancelledList = intListPool.Get(); - cancelledList.AddRange(touchesCancelled); - touchesCancelled.Clear(); - } - } - - if (beganList != null) - { - updateBegan(beganList); - touchPointListPool.Release(beganList); - } - if (updatedList != null) - { - updateUpdated(updatedList); - intListPool.Release(updatedList); - } - if (endedList != null) - { - updateEnded(endedList); - intListPool.Release(endedList); - } - if (cancelledList != null) - { - updateCancelled(cancelledList); - intListPool.Release(cancelledList); - } - - if (frameFinishedInvoker != null) frameFinishedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); - } - -#if TOUCHSCRIPT_DEBUG - private Vector2 debugTouchSize; - - private void removeDebugFigureForTouch(TouchPoint touch) - { - GLDebug.RemoveFigure(TouchManager.DEBUG_GL_TOUCH + touch.Id); - } - - private void addDebugFigureForTouch(TouchPoint touch) - { - GLDebug.DrawSquareScreenSpace(TouchManager.DEBUG_GL_TOUCH + touch.Id, touch.Position, 0, debugTouchSize, - GLDebug.MULTIPLY, float.PositiveInfinity); - } -#endif - - #endregion - - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/TouchPoint.cs b/Source/Assets/TouchScript/Scripts/TouchPoint.cs deleted file mode 100644 index 0bc8641ed..000000000 --- a/Source/Assets/TouchScript/Scripts/TouchPoint.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Hit; -using TouchScript.InputSources; -using TouchScript.Layers; -using UnityEngine; - -namespace TouchScript -{ - /// - /// Representation of a finger within TouchScript. - /// An object implementing this interface is created when user touches the screen. A unique id is assigned to it which doesn't change throughout its life. - /// Attention! Do not store references to these objects beyond touch's lifetime (i.e. when target finger is lifted off). These objects may be reused internally. Store unique ids instead. - /// - public class TouchPoint - { - #region Public properties - - /// - /// Internal unique touch point id. - /// - public int Id { get; private set; } - - /// - /// Original hit target. - /// - public Transform Target { get; internal set; } - - /// - /// Current position in screen coordinates. - /// - public Vector2 Position - { - get { return position; } - } - - /// - /// Previous position (during last frame) in screen coordinates. - /// - public Vector2 PreviousPosition { get; private set; } - - /// - /// Original hit information. - /// - public TouchHit Hit { get; internal set; } - - /// - /// Original layer which registered this touch. - /// - /// - /// - /// - public TouchLayer Layer { get; internal set; } - - /// - /// Original input source which created this touch. - /// - /// - public IInputSource InputSource { get; internal set; } - - /// - /// Projection parameters for the layer which created this touch. - /// - public ProjectionParams ProjectionParams - { - get { return Layer.GetProjectionParams(this); } - } - - /// - /// Tags collection for this touch object. - /// - public Tags Tags { get; private set; } - - /// - /// List of custom properties (key-value pairs) for this touch object. - /// - public Dictionary Properties - { - get { return properties; } - set { properties = value; } - } - - #endregion - - #region Private variables - - private int refCount = 0; - private Vector2 position = Vector2.zero; - private Vector2 newPosition = Vector2.zero; - private Dictionary properties; - - #endregion - - #region Public methods - - /// - public override bool Equals(object other) - { - return Equals(other as TouchPoint); - } - - /// - public bool Equals(TouchPoint other) - { - if (other == null) - return false; - - return Id == other.Id; - } - - /// - public override int GetHashCode() - { - return Id; - } - - #endregion - - /// - /// Initializes a new instance of the class. - /// - public TouchPoint() - { - properties = new Dictionary(); - } - - #region Internal methods - - /// - /// Initializes a new instance of the class. - /// - /// Unique id of the touch. - /// Screen position of the touch. - /// Input source which created this touch. - /// Initial tags. - internal void INTERNAL_Init(int id, Vector2 position, IInputSource input, Tags tags) - { - Id = id; - InputSource = input; - this.position = PreviousPosition = newPosition = position; - Tags = tags ?? Tags.EMPTY; - } - - internal void INTERNAL_Reset() - { - refCount = 0; - Hit = default(TouchHit); - Target = null; - Layer = null; - Tags = null; - properties.Clear(); - } - - internal void INTERNAL_ResetPosition() - { - PreviousPosition = position; - position = newPosition; - newPosition = position; - } - - internal void INTERNAL_SetPosition(Vector2 value) - { - newPosition = value; - } - - internal void INTERNAL_Retain() - { - refCount++; - } - - internal int INTERNAL_Release() - { - return --refCount; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs new file mode 100644 index 000000000..b47049acb --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs @@ -0,0 +1,62 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Collections.Generic; +using System.Text; + +namespace TouchScript.Utils +{ + /// + /// Utility methods to deal with binary data. + /// + public static class BinaryUtils + { + /// + /// Formats an integer value to a binary string. + /// + /// The integer value. + /// The string builder to use. + /// The number of digits to include in the string. + public static void ToBinaryString(uint value, StringBuilder builder, int digits = 32) + { + int i = digits - 1; + + while (i >= 0) + { + builder.Append((value & (1 << i)) == 0 ? 0 : 1); + i--; + } + } + + /// + /// Formats an integer value to a binary string. + /// + /// The integer value. + /// The number of digits to include in the string. + /// A binary string. + public static string ToBinaryString(uint value, int digits = 32) + { + var sb = new StringBuilder(digits); + ToBinaryString(value, sb, digits); + return sb.ToString(); + } + + /// + /// Converts a collection of bool values to a bit mask. + /// + /// The collection of bool values. + /// Binary mask. + public static uint ToBinaryMask(IEnumerable collection) + { + uint mask = 0; + var count = 0; + foreach (bool value in collection) + { + if (value) mask |= (uint) (1 << count); + if (++count >= 32) break; + } + return mask; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs.meta b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs.meta new file mode 100644 index 000000000..5811728d3 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3b405a870ebaf43898b07b1b373e55b8 +timeCreated: 1470559674 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Utils/ClusterUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/ClusterUtils.cs index 47d0e63e4..0daf363a7 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/ClusterUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/ClusterUtils.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text; +using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Utils @@ -16,49 +17,49 @@ public static class ClusterUtils private static StringBuilder hashString = new StringBuilder(); /// - /// Calculates the centroid of touch positions. + /// Calculates the centroid of pointers' positions. /// - /// List of touch points. - /// Centroid of touch points' positions or if cluster contains no points. - public static Vector2 Get2DCenterPosition(IList touches) + /// List of pointers. + /// Centroid of pointers' positions or if cluster contains no points. + public static Vector2 Get2DCenterPosition(IList pointers) { - var count = touches.Count; + var count = pointers.Count; if (count == 0) return TouchManager.INVALID_POSITION; - if (count == 1) return touches[0].Position; + if (count == 1) return pointers[0].Position; var position = new Vector2(); - for (var i = 0; i < count; i++) position += touches[i].Position; + for (var i = 0; i < count; i++) position += pointers[i].Position; return position / count; } /// - /// Calculates the centroid of previous touch positions. + /// Calculates the centroid of pointers' previous positions. /// - /// List of touch points. - /// Centroid of previous touch point's positions or if cluster contains no points. - public static Vector2 GetPrevious2DCenterPosition(IList touches) + /// List of pointers. + /// Centroid of pointers' previous positions or if cluster contains no points. + public static Vector2 GetPrevious2DCenterPosition(IList pointers) { - var count = touches.Count; + var count = pointers.Count; if (count == 0) return TouchManager.INVALID_POSITION; - if (count == 1) return touches[0].PreviousPosition; + if (count == 1) return pointers[0].PreviousPosition; var position = new Vector2(); - for (var i = 0; i < count; i++) position += touches[i].PreviousPosition; + for (var i = 0; i < count; i++) position += pointers[i].PreviousPosition; return position / count; } /// - /// Computes a unique hash for a list of touches. + /// Computes a unique hash for a list of pointers. /// - /// List of touch points. - /// A unique string for a list of touches. - public static string GetPointsHash(IList touches) + /// List of pointers. + /// A unique string for a list of pointers. + public static string GetPointsHash(IList pointers) { hashString.Remove(0, hashString.Length); - for (var i = 0; i < touches.Count; i++) + for (var i = 0; i < pointers.Count; i++) { hashString.Append("#"); - hashString.Append(touches[i].Id); + hashString.Append(pointers[i].Id); } return hashString.ToString(); } diff --git a/Source/Assets/TouchScript/Scripts/Utils/EventHandlerExtensions.cs b/Source/Assets/TouchScript/Scripts/Utils/EventHandlerExtensions.cs index 13b631fba..e5e931c1d 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/EventHandlerExtensions.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/EventHandlerExtensions.cs @@ -1,9 +1,10 @@ -/* +/* * @author DenizPiri / denizpiri@hotmail.com * @author Valentin Simonov / http://va.lent.in/ */ using System; +using UnityEngine; namespace TouchScript.Utils { @@ -29,7 +30,7 @@ public static Exception InvokeHandleExceptions(this EventHandler handler, } catch (Exception ex) { - UnityEngine.Debug.LogException(ex); + Debug.LogException(ex); return ex; } return null; @@ -50,7 +51,7 @@ public static Exception InvokeHandleExceptions(this EventHandler handler, object } catch (Exception ex) { - UnityEngine.Debug.LogException(ex); + Debug.LogException(ex); return ex; } return null; diff --git a/Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs similarity index 97% rename from Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs rename to Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs index dafa8d329..3acb24629 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs @@ -2,10 +2,9 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Layers; using UnityEngine; -namespace TouchScript.Utils +namespace TouchScript.Utils.Geom { /// /// Projection utils. diff --git a/Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs.meta b/Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs.meta rename to Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Utils/Geom/TwoD.cs b/Source/Assets/TouchScript/Scripts/Utils/Geom/TwoD.cs index da426d43b..1c74320ea 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/Geom/TwoD.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/Geom/TwoD.cs @@ -7,7 +7,7 @@ namespace TouchScript.Utils.Geom { /// - /// A class with 2D herlper functions. + /// A class with 2D helper functions. /// public static class TwoD { diff --git a/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs b/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs index 354db7198..5b7cf1f92 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs @@ -1,15 +1,21 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ * Source code copied from UnityEngine.UI.ObjectPool: * https://bitbucket.org/Unity-Technologies/ui/src/ccb946ecc23815d1a7099aee0ed77b0cde7ff278/UnityEngine.UI/UI/Core/Utility/ObjectPool.cs?at=5.1 */ +using System; using System.Collections.Generic; using UnityEngine.Events; +#if OBJECTPOOL_DEBUG +using UnityEngine; +#endif + namespace TouchScript.Utils { - internal class ObjectPool where T : new() + /// + public class ObjectPool where T : class { public delegate T0 UnityFunc(); @@ -18,6 +24,8 @@ namespace TouchScript.Utils private readonly UnityAction onRelease; private readonly UnityFunc onNew; + public string Name { get; set; } + public int CountAll { get; private set; } public int CountActive @@ -30,22 +38,22 @@ public int CountInactive get { return stack.Count; } } - public ObjectPool(int capacity, UnityFunc actionNew, UnityAction actionOnGet, - UnityAction actionOnRelease) + public ObjectPool(int capacity, UnityFunc actionNew, UnityAction actionOnGet = null, + UnityAction actionOnRelease = null, string name = null) { + if (actionNew == null) throw new ArgumentException("New action can't be null!"); stack = new Stack(capacity); onNew = actionNew; onGet = actionOnGet; onRelease = actionOnRelease; + Name = name; } public void WarmUp(int count) { for (var i = 0; i < count; i++) { - T element; - if (onNew != null) element = onNew(); - else element = new T(); + var element = onNew(); CountAll++; stack.Push(element); } @@ -53,29 +61,68 @@ public void WarmUp(int count) public T Get() { +#if OBJECTPOOL_DEBUG + var created = false; +#endif T element; if (stack.Count == 0) { - if (onNew != null) element = onNew(); - else element = new T(); +#if OBJECTPOOL_DEBUG + created = true; + logWarning("Created an object."); +#endif + element = onNew(); CountAll++; } else { element = stack.Pop(); } - if (onGet != null) - onGet(element); + if (onGet != null) onGet(element); +#if OBJECTPOOL_DEBUG + log(string.Format("Getting object from pool. New: {0}, count: {1}, left: {2}", created, CountAll, stack.Count)); +#endif return element; } public void Release(T element) { +#if OBJECTPOOL_DEBUG if (stack.Count > 0 && ReferenceEquals(stack.Peek(), element)) - UnityEngine.Debug.LogError("Internal error. Trying to destroy object that is already released to pool."); - if (onRelease != null) - onRelease(element); + logError("Internal error. Trying to destroy object that is already released to pool."); +#endif + if (onRelease != null) onRelease(element); stack.Push(element); +#if OBJECTPOOL_DEBUG + log(string.Format("Returned object to pool. Left: {0}", stack.Count)); +#endif + } + + public void Release(object element) + { + var obj = (T) element; + if (obj == null) return; + Release(obj); + } + +#if OBJECTPOOL_DEBUG + private void log(string message) + { + if (string.IsNullOrEmpty(Name)) return; + UnityEngine.Debug.LogFormat("[{0}] ObjectPool ({1}): {2}", DateTime.Now.ToString("hh:mm:ss.fff"), Name, message); + } + + private void logWarning(string message) + { + if (string.IsNullOrEmpty(Name)) return; + UnityEngine.Debug.LogWarningFormat("[{0}] ObjectPool ({1}): {2}", DateTime.Now.ToString("hh:mm:ss.fff"), Name, message); + } + + private void logError(string message) + { + if (string.IsNullOrEmpty(Name)) return; + UnityEngine.Debug.LogErrorFormat("[{0}] ObjectPool ({1}): {2}", DateTime.Now.ToString("hh:mm:ss.fff"), Name, message); } +#endif } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/Platform.meta b/Source/Assets/TouchScript/Scripts/Utils/Platform.meta new file mode 100644 index 000000000..0b9109615 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/Platform.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e3045b87ade623e42ade0bb0df4f6d5c +folderAsset: yes +timeCreated: 1500666269 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs new file mode 100644 index 000000000..776f448e6 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs @@ -0,0 +1,112 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +#if UNITY_STANDALONE_WIN + +using System; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace TouchScript.Utils.Platform +{ + /// + /// Utility methods on Windows. + /// + public static class WindowsUtils + { + // disables press and hold (right-click) gesture + public const int TABLET_DISABLE_PRESSANDHOLD = 0x00000001; + // disables UI feedback on pen up (waves) + public const int TABLET_DISABLE_PENTAPFEEDBACK = 0x00000008; + // disables UI feedback on pen button down (circle) + public const int TABLET_DISABLE_PENBARRELFEEDBACK = 0x00000010; + // disables pen flicks (back, forward, drag down, drag up); + public const int TABLET_DISABLE_FLICKS = 0x00010000; + + public const int MONITOR_DEFAULTTONEAREST = 2; + + /// + /// Retrieves the native monitor resolution. + /// + /// Output width. + /// Output height. + public static void GetNativeMonitorResolution(out int width, out int height) + { + var monitor = MonitorFromWindow(GetActiveWindow(), MONITOR_DEFAULTTONEAREST); + MONITORINFO monitorInfo = new MONITORINFO(); + monitorInfo.cbSize = Marshal.SizeOf(monitorInfo); + if (!GetMonitorInfo(monitor, ref monitorInfo)) + { + width = Screen.width; + height = Screen.height; + } + else + { + width = monitorInfo.rcMonitor.Width; + height = monitorInfo.rcMonitor.Height; + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int Left, Top, Right, Bottom; + + public RECT(int left, int top, int right, int bottom) + { + Left = left; + Top = top; + Right = right; + Bottom = bottom; + } + + public int Height + { + get { return Bottom - Top; } + set { Bottom = value + Top; } + } + + public int Width + { + get { return Right - Left; } + set { Right = value + Left; } + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct MONITORINFO + { + public int cbSize; + public RECT rcMonitor; + public RECT rcWork; + public uint dwFlags; + } + + [DllImport("user32.dll")] + public static extern IntPtr GetActiveWindow(); + + [DllImport("user32.dll")] + public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); + + [DllImport("user32.dll")] + public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi); + + [DllImport("Kernel32.dll")] + public static extern ushort GlobalAddAtom(string lpString); + + [DllImport("Kernel32.dll")] + public static extern ushort GlobalDeleteAtom(ushort nAtom); + + [DllImport("user32.dll")] + public static extern int SetProp(IntPtr hWnd, string lpString, int hData); + + [DllImport("user32.dll")] + public static extern int RemoveProp(IntPtr hWnd, string lpString); + + [DllImport("user32.dll")] + public static extern IntPtr EnableMouseInPointer(bool value); + } +} + +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs.meta b/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs.meta new file mode 100644 index 000000000..bab1f5aa5 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/Platform/WindowsUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 553858766c518794ea00a0d9f11b20e0 +timeCreated: 1500666524 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs new file mode 100644 index 000000000..785072a30 --- /dev/null +++ b/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs @@ -0,0 +1,203 @@ +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using System.Text; +using TouchScript.Hit; +using TouchScript.Pointers; +using UnityEngine; + +namespace TouchScript.Utils +{ + /// + /// Utility methods to work with Pointers. + /// + public static class PointerUtils + { + private static StringBuilder sb; + + /// + /// Determines whether the pointer is over its target GameObject. + /// + /// The pointer. + /// true if the pointer is over the GameObject; false otherwise. + public static bool IsPointerOnTarget(Pointer pointer) + { + if (pointer == null) return false; + return IsPointerOnTarget(pointer, pointer.GetPressData().Target); + } + + /// + /// Determines whether the pointer is over a specific GameObject. + /// + /// The pointer. + /// The target. + /// true if the pointer is over the GameObject; false otherwise. + public static bool IsPointerOnTarget(IPointer pointer, Transform target) + { + HitData hit; + return IsPointerOnTarget(pointer, target, out hit); + } + + /// + /// Determines whether the pointer is over a specific GameObject. + /// + /// The pointer. + /// The target. + /// The hit. + /// true if the pointer is over the GameObject; false otherwise. + public static bool IsPointerOnTarget(IPointer pointer, Transform target, out HitData hit) + { + hit = default(HitData); + if (pointer == null || target == null) return false; + hit = pointer.GetOverData(); + if (hit.Target == null) return false; + return hit.Target.IsChildOf(target); + } + + /// + /// Formats currently pressed buttons as a string. + /// + /// The buttons state. + /// Formatted string of currently pressed buttons. + public static string PressedButtonsToString(Pointer.PointerButtonState buttons) + { + initStringBuilder(); + + PressedButtonsToString(buttons, sb); + return sb.ToString(); + } + + /// + /// Formats currently pressed buttons as a string. + /// + /// The buttons state. + /// The string builder to use. + public static void PressedButtonsToString(Pointer.PointerButtonState buttons, StringBuilder builder) + { + if ((buttons & Pointer.PointerButtonState.FirstButtonPressed) != 0) builder.Append("1"); + else builder.Append("_"); + if ((buttons & Pointer.PointerButtonState.SecondButtonPressed) != 0) builder.Append("2"); + else builder.Append("_"); + if ((buttons & Pointer.PointerButtonState.ThirdButtonPressed) != 0) builder.Append("3"); + else builder.Append("_"); + if ((buttons & Pointer.PointerButtonState.FourthButtonPressed) != 0) builder.Append("4"); + else builder.Append("_"); + if ((buttons & Pointer.PointerButtonState.FifthButtonPressed) != 0) builder.Append("5"); + else builder.Append("_"); + } + + /// + /// Formats the state of buttons as a string. + /// + /// The buttons state. + /// Formatted string of the buttons state. + public static string ButtonsToString(Pointer.PointerButtonState buttons) + { + initStringBuilder(); + + ButtonsToString(buttons, sb); + return sb.ToString(); + } + + /// + /// Formats the state of buttons as a string. + /// + /// The buttons state. + /// The string builder to use. + public static void ButtonsToString(Pointer.PointerButtonState buttons, StringBuilder builder) + { + if ((buttons & Pointer.PointerButtonState.FirstButtonDown) != 0) builder.Append("v"); + else if ((buttons & Pointer.PointerButtonState.FirstButtonUp) != 0) builder.Append("^"); + else if ((buttons & Pointer.PointerButtonState.FirstButtonPressed) != 0) builder.Append("1"); + else builder.Append("_"); + + if ((buttons & Pointer.PointerButtonState.SecondButtonDown) != 0) builder.Append("v"); + else if ((buttons & Pointer.PointerButtonState.SecondButtonUp) != 0) builder.Append("^"); + else if ((buttons & Pointer.PointerButtonState.SecondButtonPressed) != 0) builder.Append("2"); + else builder.Append("_"); + + if ((buttons & Pointer.PointerButtonState.ThirdButtonDown) != 0) builder.Append("v"); + else if ((buttons & Pointer.PointerButtonState.ThirdButtonUp) != 0) builder.Append("^"); + else if ((buttons & Pointer.PointerButtonState.ThirdButtonPressed) != 0) builder.Append("3"); + else builder.Append("_"); + + if ((buttons & Pointer.PointerButtonState.FourthButtonDown) != 0) builder.Append("v"); + else if ((buttons & Pointer.PointerButtonState.FourthButtonUp) != 0) builder.Append("^"); + else if ((buttons & Pointer.PointerButtonState.FourthButtonPressed) != 0) builder.Append("4"); + else builder.Append("_"); + + if ((buttons & Pointer.PointerButtonState.FifthButtonDown) != 0) builder.Append("v"); + else if ((buttons & Pointer.PointerButtonState.FifthButtonUp) != 0) builder.Append("^"); + else if ((buttons & Pointer.PointerButtonState.FifthButtonPressed) != 0) builder.Append("5"); + else builder.Append("_"); + } + + /// + /// Adds pressed state to downed buttons. + /// + /// The buttons state. + /// Changed buttons state. + public static Pointer.PointerButtonState DownPressedButtons(Pointer.PointerButtonState buttons) + { + if ((buttons & Pointer.PointerButtonState.FirstButtonPressed) != 0) + buttons |= Pointer.PointerButtonState.FirstButtonDown; + if ((buttons & Pointer.PointerButtonState.SecondButtonPressed) != 0) + buttons |= Pointer.PointerButtonState.SecondButtonDown; + if ((buttons & Pointer.PointerButtonState.ThirdButtonPressed) != 0) + buttons |= Pointer.PointerButtonState.ThirdButtonDown; + if ((buttons & Pointer.PointerButtonState.FourthButtonPressed) != 0) + buttons |= Pointer.PointerButtonState.FourthButtonDown; + if ((buttons & Pointer.PointerButtonState.FifthButtonPressed) != 0) + buttons |= Pointer.PointerButtonState.FifthButtonDown; + return buttons; + } + + /// + /// Adds downed state to pressed buttons. + /// + /// The buttons state. + /// Changed buttons state. + public static Pointer.PointerButtonState PressDownButtons(Pointer.PointerButtonState buttons) + { + if ((buttons & Pointer.PointerButtonState.FirstButtonDown) != 0) + buttons |= Pointer.PointerButtonState.FirstButtonPressed; + if ((buttons & Pointer.PointerButtonState.SecondButtonDown) != 0) + buttons |= Pointer.PointerButtonState.SecondButtonPressed; + if ((buttons & Pointer.PointerButtonState.ThirdButtonDown) != 0) + buttons |= Pointer.PointerButtonState.ThirdButtonPressed; + if ((buttons & Pointer.PointerButtonState.FourthButtonDown) != 0) + buttons |= Pointer.PointerButtonState.FourthButtonPressed; + if ((buttons & Pointer.PointerButtonState.FifthButtonDown) != 0) + buttons |= Pointer.PointerButtonState.FifthButtonPressed; + return buttons; + } + + /// + /// Converts pressed buttons to up state. + /// + /// The buttons state. + /// Changed buttons state. + public static Pointer.PointerButtonState UpPressedButtons(Pointer.PointerButtonState buttons) + { + var btns = Pointer.PointerButtonState.Nothing; + if ((buttons & Pointer.PointerButtonState.FirstButtonPressed) != 0) + btns |= Pointer.PointerButtonState.FirstButtonUp; + if ((buttons & Pointer.PointerButtonState.SecondButtonPressed) != 0) + btns |= Pointer.PointerButtonState.SecondButtonUp; + if ((buttons & Pointer.PointerButtonState.ThirdButtonPressed) != 0) + btns |= Pointer.PointerButtonState.ThirdButtonUp; + if ((buttons & Pointer.PointerButtonState.FourthButtonPressed) != 0) + btns |= Pointer.PointerButtonState.FourthButtonUp; + if ((buttons & Pointer.PointerButtonState.FifthButtonPressed) != 0) + btns |= Pointer.PointerButtonState.FifthButtonUp; + return btns; + } + + private static void initStringBuilder() + { + if (sb == null) sb = new StringBuilder(); + sb.Length = 0; + } + } +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/TouchUtils.cs.meta b/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/TouchUtils.cs.meta rename to Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Utils/TimedSequence.cs b/Source/Assets/TouchScript/Scripts/Utils/TimedSequence.cs index aaf95c7ec..09e036c41 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/TimedSequence.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/TimedSequence.cs @@ -15,7 +15,7 @@ internal sealed class TimedSequence public void Add(T element) { - Add(element, Time.time); + Add(element, Time.unscaledTime); } public void Add(T element, float time) diff --git a/Source/Assets/TouchScript/Scripts/Utils/TouchUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/TouchUtils.cs deleted file mode 100644 index 9d0f25289..000000000 --- a/Source/Assets/TouchScript/Scripts/Utils/TouchUtils.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Hit; -using TouchScript.Layers; -using UnityEngine; - -namespace TouchScript.Utils -{ - /// - /// Touch utils. - /// - public static class TouchUtils - { - /// - /// Determines whether the touch is over a specific GameObject. - /// - /// The touch. - /// The target. - /// true if the touch is over the GameObject; false otherwise. - public static bool IsTouchOnTarget(TouchPoint touch, Transform target) - { - if (touch == null || touch.Layer == null || target == null) return false; - TouchHit hit; - if ((touch.Layer.Hit(touch.Position, out hit) == TouchLayer.LayerHitResult.Hit) && - (target == hit.Transform || hit.Transform.IsChildOf(target))) - return true; - return false; - } - - /// - /// Determines whether the touch is over its target GameObject. - /// - /// The touch. - /// true if the touch is over the GameObject; false otherwise. - public static bool IsTouchOnTarget(TouchPoint touch) - { - if (touch == null) return false; - return IsTouchOnTarget(touch, touch.Target); - } - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Utils/TransformUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/TransformUtils.cs index cd76b87d2..60f04c59b 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/TransformUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/TransformUtils.cs @@ -2,24 +2,48 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using System.Text; using UnityEngine; namespace TouchScript.Utils { - internal static class TransformUtils + /// + /// Utility methods to work with Transforms. + /// + public static class TransformUtils { + private static StringBuilder sb; + + /// + /// Converts a global position of a transform to local position in its parent's coordinate system. + /// + /// The transform. + /// The global position. + /// Local position in transform parent's coordinate system. public static Vector3 GlobalToLocalPosition(Transform transform, Vector3 global) { if (transform.parent == null) return global; return transform.parent.InverseTransformPoint(global); } + /// + /// Converts a global direction of a transform to local direction in its parent's coordinate system. + /// + /// The transform. + /// The global direction. + /// Local direction in transform parent's coordinate system. public static Vector3 GlobalToLocalDirection(Transform transform, Vector3 global) { if (transform.parent == null) return global; return transform.parent.InverseTransformDirection(global); } + /// + /// Converts a global vector of a transform to local vector in its parent's coordinate system. The difference from is that this vector has length. + /// + /// The transform. + /// The global vector. + /// Local vector in transform parent's coordinate system. public static Vector3 GlobalToLocalVector(Transform transform, Vector3 global) { var parent = transform.parent; @@ -34,5 +58,31 @@ public static Vector3 GlobalToLocalVector(Transform transform, Vector3 global) return vector; } + + /// + /// Returns the string path of the transform in the hierarchy, i.g. "GameObject/ChildGameObject". + /// + /// The transform. + /// The path in the hierarchy. + public static string GetHeirarchyPath(Transform transform) + { + initStringBuilder(); + + if (transform == null) return null; + + while (transform != null) + { + sb.Insert(0, transform.name); + sb.Insert(0, "/"); + transform = transform.parent; + } + return sb.ToString(); + } + + private static void initStringBuilder() + { + if (sb == null) sb = new StringBuilder(); + sb.Length = 0; + } } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Shaders/Cursor.shader b/Source/Assets/TouchScript/Shaders/Cursor.shader new file mode 100644 index 000000000..2e29950fc --- /dev/null +++ b/Source/Assets/TouchScript/Shaders/Cursor.shader @@ -0,0 +1,52 @@ +Shader "TouchScript/Cursor" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + Tags { "Queue"="Transparent" "RenderType" = "Transparent" } + Blend SrcAlpha OneMinusSrcAlpha + ZTest Always + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float2 uv = float2(length(i.uv - float2(.5, .5)) * 2, 0.5); + fixed4 col = tex2D(_MainTex, uv); + return col; + } + ENDCG + } + } +} diff --git a/Source/Assets/TouchScript/Shaders/Cursor.shader.meta b/Source/Assets/TouchScript/Shaders/Cursor.shader.meta new file mode 100644 index 000000000..768cb5d3e --- /dev/null +++ b/Source/Assets/TouchScript/Shaders/Cursor.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2af36406130024644b499213db069f78 +timeCreated: 1500210432 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Textures.meta b/Source/Assets/TouchScript/Textures.meta deleted file mode 100644 index d1da8e99d..000000000 --- a/Source/Assets/TouchScript/Textures.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 70849dd78e6c598468ae02cc30525a37 diff --git a/Source/Assets/TouchScript/Textures/Touch.png b/Source/Assets/TouchScript/Textures/Touch.png deleted file mode 100644 index da8ee9160..000000000 Binary files a/Source/Assets/TouchScript/Textures/Touch.png and /dev/null differ diff --git a/Source/Assets/TouchScript/license.txt b/Source/Assets/TouchScript/license.txt index b8dbae775..1294daf8e 100644 --- a/Source/Assets/TouchScript/license.txt +++ b/Source/Assets/TouchScript/license.txt @@ -25,4 +25,5 @@ Assets used in examples: 2. Planet Earth Free (https://www.assetstore.unity3d.com/en/#!/content/23399) 3. Wooden Table and Chair (https://www.assetstore.unity3d.com/en/#!/content/18996) 4. Touch gesture illustrations provided by GestureWorks® (www.gestureworks.com) -5. Cat images are just random images from Google search. \ No newline at end of file +5. Cartoon UI elements (http://opengameart.org/content/free-game-gui) +6. Cat images are just random images from Google search. \ No newline at end of file diff --git a/Source/ProjectSettings/ClusterInputManager.asset b/Source/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 000000000..e7886b266 --- /dev/null +++ b/Source/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/Source/ProjectSettings/EditorBuildSettings.asset b/Source/ProjectSettings/EditorBuildSettings.asset index 008f9cfe3..8a88d13f0 100644 --- a/Source/ProjectSettings/EditorBuildSettings.asset +++ b/Source/ProjectSettings/EditorBuildSettings.asset @@ -7,21 +7,34 @@ EditorBuildSettings: m_Scenes: - enabled: 1 path: Assets/TouchScript/Examples/Examples.unity + guid: 7cba6bf72365a4167930fec2f6f39b74 + - enabled: 1 + path: Assets/TouchScript/Examples/RawInput/RawInput.unity + guid: 9ee061879a6b743808a9f9056a52d885 - enabled: 1 path: Assets/TouchScript/Examples/Taps/Taps.unity + guid: 5013fa58cea314376b273bd8905581f4 - enabled: 1 path: Assets/TouchScript/Examples/Camera/Camera.unity - - enabled: 1 - path: Assets/TouchScript/Examples/Checkers/Checkers.unity + guid: 9bc4a96ba8ead427ab54f883160abc15 - enabled: 1 path: Assets/TouchScript/Examples/Photos/Photos.unity + guid: e43bdd4f3bf144b74b4726208781dd66 - enabled: 1 - path: Assets/TouchScript/Examples/Multiuser/Multiuser.unity - - enabled: 1 - path: Assets/TouchScript/Examples/Cube/Cube.unity + path: Assets/TouchScript/Examples/Checkers/Checkers.unity + guid: 6ba58961df0a14cad91763f92bda13b9 - enabled: 1 path: Assets/TouchScript/Examples/Portal/Portal.unity + guid: 20ddca9320eeb4eb28b7ce5fcb289923 - enabled: 1 path: Assets/TouchScript/Examples/Colors/Colors.unity + guid: c56b29ea5ec5a4713b65552d4a8bd9ac - enabled: 1 - path: Assets/TouchScript/Examples/RawInput/RawInput.unity + path: Assets/TouchScript/Examples/Cube/Cube.unity + guid: 179bea80bb29f49ab9d5761fc9d3738b + - enabled: 1 + path: Assets/TouchScript/Examples/Multiuser/Multiuser.unity + guid: 3b34d0a4b336446dd98f5f9951fe6480 + - enabled: 1 + path: Assets/TouchScript/Examples/Pull/Pull.unity + guid: 6696ec8da4feb4725bf860ab58fa830f diff --git a/Source/ProjectSettings/GraphicsSettings.asset b/Source/ProjectSettings/GraphicsSettings.asset index 151b43f77..5a96ca8a8 100644 --- a/Source/ProjectSettings/GraphicsSettings.asset +++ b/Source/ProjectSettings/GraphicsSettings.asset @@ -3,7 +3,7 @@ --- !u!30 &1 GraphicsSettings: m_ObjectHideFlags: 0 - serializedVersion: 4 + serializedVersion: 5 m_Deferred: m_Mode: 1 m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} @@ -21,14 +21,17 @@ GraphicsSettings: - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] + m_ShaderSettings: + useScreenSpaceShadows: 1 + m_BuildTargetShaderSettings: [] m_LightmapStripping: 0 + m_FogStripping: 0 m_LightmapKeepPlain: 1 m_LightmapKeepDirCombined: 1 m_LightmapKeepDirSeparate: 1 m_LightmapKeepDynamicPlain: 1 m_LightmapKeepDynamicDirCombined: 1 m_LightmapKeepDynamicDirSeparate: 1 - m_FogStripping: 0 m_FogKeepLinear: 1 m_FogKeepExp: 1 m_FogKeepExp2: 1 diff --git a/Source/ProjectSettings/ProjectSettings.asset b/Source/ProjectSettings/ProjectSettings.asset index 592e3872c..68627b0a0 100644 --- a/Source/ProjectSettings/ProjectSettings.asset +++ b/Source/ProjectSettings/ProjectSettings.asset @@ -3,30 +3,57 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 11 + productGUID: 0b2aa2b1c24cbc74ca2d27d2f6d0b8b4 AndroidProfiler: 0 defaultScreenOrientation: 3 targetDevice: 2 - targetResolution: 0 useOnDemandResources: 0 accelerometerFrequency: 60 companyName: valyard productName: TouchScript Examples defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1} m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_SplashScreenBackgroundLandscape: {fileID: 0} + m_SplashScreenBackgroundPortrait: {fileID: 0} + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} defaultScreenWidth: 1024 defaultScreenHeight: 768 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 - m_RenderingPath: 1 - m_MobileRenderingPath: 1 + m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 m_MobileMTRendering: 0 - m_Stereoscopic3D: 0 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 + tizenShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 1 displayResolutionDialog: 1 iosAllowHTTPDownload: 1 @@ -41,7 +68,7 @@ PlayerSettings: defaultIsNativeResolution: 1 runInBackground: 1 captureSingleScreen: 0 - Override IPod Music: 0 + muteOtherAudioSources: 0 Prepare IOS For Recording: 0 submitAnalytics: 1 usePlayerLog: 1 @@ -49,24 +76,31 @@ PlayerSettings: forceSingleInstance: 0 resizableWindow: 0 useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games gpuSkinning: 1 + graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 xboxEnableKinectAutoTracking: 0 xboxEnableFitness: 0 visibleInBackground: 0 + allowFullscreenSwitch: 1 + graphicsJobMode: 0 macFullscreenMode: 2 d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 n3dsDisableStereoscopicView: 0 n3dsEnableSharedListOpt: 1 n3dsEnableVSync: 0 + ignoreAlphaClear: 0 xboxOneResolution: 0 - ps3SplashScreen: {fileID: 0} + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -85,36 +119,56 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleIdentifier: ru.valyard.touchscript bundleVersion: 1.0 preloadedAssets: [] - metroEnableIndependentInputSource: 0 - metroEnableLowLatencyPresentationAPI: 0 + metroInputSource: 0 + m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 - virtualRealitySupported: 0 - productGUID: 0b2aa2b1c24cbc74ca2d27d2f6d0b8b4 + xboxOneEnable7thCore: 0 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + hololens: + depthFormat: 1 + protectGraphicsMemory: 0 + useHDRDisplay: 0 + applicationIdentifier: + Android: ru.valyard.touchscript + Standalone: unity.valyard.TouchScript Examples + Tizen: ru.valyard.touchscript + iOS: ru.valyard.touchscript + tvOS: ru.valyard.touchscript + buildNumber: + iOS: 0 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 9 + AndroidMinSdkVersion: 16 + AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: - apiCompatibilityLevel: 2 stripEngineCode: 1 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 1 - iPhoneBuildNumber: 0 ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 APKExpansionFiles: 0 - preloadShaders: 0 + keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 0 VertexChannelCompressionMask: serializedVersion: 2 m_Bits: 238 iPhoneSdkVersion: 988 - iPhoneTargetOSVersion: 28 + iOSTargetOSVersionString: 8.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 1 uIStatusBarStyle: 0 @@ -128,6 +182,11 @@ PlayerSettings: iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} + appleTVSplashScreen: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSLargeIconLayers: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -146,6 +205,16 @@ PlayerSettings: iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 0 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 1 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + appleEnableAutomaticSigning: 0 AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -175,6 +244,9 @@ PlayerSettings: - m_BuildTarget: AndroidPlayer m_APIs: 08000000 m_Automatic: 0 + m_BuildTargetVRSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 webPlayerTemplate: APPLICATION:Default m_TemplateCustomTags: {} wiiUTitleID: 0005000011000000 @@ -193,40 +265,123 @@ PlayerSettings: wiiUSystemHeapSize: 128 wiiUTVStartupScreen: {fileID: 0} wiiUGamePadStartupScreen: {fileID: 0} + wiiUDrcBufferDisabled: 0 wiiUProfilerLibPath: + playModeTestRunnerEnabled: 0 actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 + cameraUsageDescription: locationUsageDescription: - XboxTitleId: - XboxImageXexPath: - XboxSpaPath: - XboxGenerateSpa: 0 - XboxDeployKinectResources: 0 - XboxSplashScreen: {fileID: 0} - xboxEnableSpeech: 0 - xboxAdditionalTitleMemorySize: 0 - xboxDeployKinectHeadOrientation: 0 - xboxDeployKinectHeadPosition: 0 - ps3TitleConfigPath: - ps3DLCConfigPath: - ps3ThumbnailPath: - ps3BackgroundPath: - ps3SoundPath: - ps3NPAgeRating: 12 - ps3TrophyCommId: - ps3NpCommunicationPassphrase: - ps3TrophyPackagePath: - ps3BootCheckMaxSaveGameSizeKB: 128 - ps3TrophyCommSig: - ps3SaveGameSlots: 1 - ps3TrialMode: 0 - ps3VideoMemoryForAudio: 0 - ps3EnableVerboseMemoryStats: 0 - ps3UseSPUForUmbra: 0 - ps3EnableMoveSupport: 1 - ps3DisableDolbyEncoding: 0 + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchDataLossConfirmation: 0 + switchSupportedNpadStyles: 3 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -238,7 +393,9 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -252,6 +409,7 @@ PlayerSettings: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 ps4EnterButtonAssignment: 1 ps4ApplicationParam1: 0 ps4ApplicationParam2: 0 @@ -259,19 +417,35 @@ PlayerSettings: ps4ApplicationParam4: 0 ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 ps4Passcode: 5xr84P2R391UXaLHbavJvFZGfO47XWS2 + ps4UseDebugIl2cppLibs: 0 ps4pnSessions: 1 ps4pnPresence: 1 ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 3 ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 ps4attribUserManagement: 0 ps4attribMoveSupport: 0 ps4attrib3DSupport: 0 ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] monoEnv: psp2Splashimage: {fileID: 0} @@ -320,16 +494,42 @@ PlayerSettings: psp2UseLibLocation: 0 psp2InfoBarOnStartup: 0 psp2InfoBarColor: 0 + psp2UseDebugIl2cppLibs: 0 psmSplashimage: {fileID: 0} + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLUseWasm: 0 + webGLCompressionFormat: 1 scriptingDefineSymbols: 1: 4: + platformArchitecture: + iOS: 0 + scriptingBackend: + Android: 0 + Metro: 2 + Standalone: 0 + WP8: 2 + WebGL: 1 + iOS: 0 + incrementalIl2cppBuild: + iOS: 0 + additionalIl2CppArgs: + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 metroPackageName: General Examples - metroPackageLogo: - metroPackageLogo140: - metroPackageLogo180: - metroPackageLogo240: metroPackageVersion: metroCertificatePath: metroCertificatePassword: @@ -337,44 +537,7 @@ PlayerSettings: metroCertificateIssuer: metroCertificateNotAfter: 0000000000000000 metroApplicationDescription: General Examples - metroStoreTileLogo80: - metroStoreTileLogo: - metroStoreTileLogo140: - metroStoreTileLogo180: - metroStoreTileWideLogo80: - metroStoreTileWideLogo: - metroStoreTileWideLogo140: - metroStoreTileWideLogo180: - metroStoreTileSmallLogo80: - metroStoreTileSmallLogo: - metroStoreTileSmallLogo140: - metroStoreTileSmallLogo180: - metroStoreSmallTile80: - metroStoreSmallTile: - metroStoreSmallTile140: - metroStoreSmallTile180: - metroStoreLargeTile80: - metroStoreLargeTile: - metroStoreLargeTile140: - metroStoreLargeTile180: - metroStoreSplashScreenImage: - metroStoreSplashScreenImage140: - metroStoreSplashScreenImage180: - metroPhoneAppIcon: - metroPhoneAppIcon140: - metroPhoneAppIcon240: - metroPhoneSmallTile: - metroPhoneSmallTile140: - metroPhoneSmallTile240: - metroPhoneMediumTile: - metroPhoneMediumTile140: - metroPhoneMediumTile240: - metroPhoneWideTile: - metroPhoneWideTile140: - metroPhoneWideTile240: - metroPhoneSplashScreenImage: - metroPhoneSplashScreenImage140: - metroPhoneSplashScreenImage240: + wsaImages: {} metroTileShortName: metroCommandLineArgsFile: metroTileShowName: 0 @@ -391,29 +554,14 @@ PlayerSettings: metroFTAFileTypes: [] metroProtocolName: metroCompilationOverrides: 1 - blackberryDeviceAddress: - blackberryDevicePassword: - blackberryTokenPath: - blackberryTokenExires: - blackberryTokenAuthor: - blackberryTokenAuthorId: - blackberryCskPassword: - blackberrySaveLogPath: - blackberrySharedPermissions: 0 - blackberryCameraPermissions: 0 - blackberryGPSPermissions: 0 - blackberryDeviceIDPermissions: 0 - blackberryMicrophonePermissions: 0 - blackberryGamepadSupport: 0 - blackberryBuildId: 0 - blackberryLandscapeSplashScreen: {fileID: 0} - blackberryPortraitSplashScreen: {fileID: 0} - blackberrySquareSplashScreen: {fileID: 0} tizenProductDescription: tizenProductURL: tizenSigningProfileName: tizenGPSPermissions: 0 tizenMicrophonePermissions: 0 + tizenDeploymentTarget: + tizenDeploymentTargetType: -1 + tizenMinOSVersion: 1 n3dsUseExtSaveData: 0 n3dsCompressStaticMem: 1 n3dsExtSaveDataNumber: 0x12345 @@ -443,51 +591,26 @@ PlayerSettings: XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} XboxOneIsContentPackage: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 - intPropertyNames: - - Android::ScriptingBackend - - Metro::ScriptingBackend - - Standalone::ScriptingBackend - - WP8::ScriptingBackend - - WebGL::ScriptingBackend - - WebGL::audioCompressionFormat - - WebGL::exceptionSupport - - WebGL::memorySize - - iOS::Architecture - - iOS::EnableIncrementalBuildSupportForIl2cpp - - iOS::ScriptingBackend - Android::ScriptingBackend: 0 - Metro::ScriptingBackend: 2 - Standalone::ScriptingBackend: 0 - WP8::ScriptingBackend: 2 - WebGL::ScriptingBackend: 1 - WebGL::audioCompressionFormat: 4 - WebGL::exceptionSupport: 1 - WebGL::memorySize: 256 - iOS::Architecture: 0 - iOS::EnableIncrementalBuildSupportForIl2cpp: 0 - iOS::ScriptingBackend: 0 - boolPropertyNames: - - WebGL::analyzeBuildSize - - WebGL::dataCaching - - WebGL::useEmbeddedResources - WebGL::analyzeBuildSize: 0 - WebGL::dataCaching: 0 - WebGL::useEmbeddedResources: 0 - stringPropertyNames: - - WebGL::emscriptenArgs - - WebGL::template - - additionalIl2CppArgs::additionalIl2CppArgs - WebGL::emscriptenArgs: - WebGL::template: APPLICATION:Default - additionalIl2CppArgs::additionalIl2CppArgs: - firstStreamedSceneWithResources: 0 + xboxOneScriptCompiler: 0 + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: {} + facebookSdkVersion: 7.9.1 + apiCompatibilityLevel: 2 cloudProjectId: projectName: organizationId: cloudEnabled: 0 + enableNewInputSystem: 0 diff --git a/Source/ProjectSettings/ProjectVersion.txt b/Source/ProjectSettings/ProjectVersion.txt index b11ab9b5b..d542d5a64 100644 --- a/Source/ProjectSettings/ProjectVersion.txt +++ b/Source/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.2.2f1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.1p4 diff --git a/Source/ProjectSettings/QualitySettings.asset b/Source/ProjectSettings/QualitySettings.asset index d814d61d4..683fb13ed 100644 --- a/Source/ProjectSettings/QualitySettings.asset +++ b/Source/ProjectSettings/QualitySettings.asset @@ -4,127 +4,32 @@ QualitySettings: m_ObjectHideFlags: 0 serializedVersion: 5 - m_CurrentQuality: 5 + m_CurrentQuality: 0 m_QualitySettings: - serializedVersion: 2 - name: Fastest - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 15 - blendWeights: 1 - textureQuality: 1 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - vSyncCount: 0 - lodBias: .300000012 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Fast - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - vSyncCount: 0 - lodBias: .400000006 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Simple + name: Default pixelLightCount: 1 shadows: 1 - shadowResolution: 0 + shadowResolution: 1 shadowProjection: 1 shadowCascades: 1 - shadowDistance: 20 - blendWeights: 2 + shadowDistance: 50 + shadowNearPlaneOffset: 2 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + blendWeights: 1 textureQuality: 0 anisotropicTextures: 1 antiAliasing: 0 softParticles: 0 softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 vSyncCount: 0 - lodBias: .699999988 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Good - pixelLightCount: 2 - shadows: 2 - shadowResolution: 1 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 40 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 1 - vSyncCount: 1 - lodBias: 1 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Beautiful - pixelLightCount: 3 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 70 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - vSyncCount: 1 - lodBias: 1.5 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Fantastic - pixelLightCount: 4 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 4 - shadowDistance: 40 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 8 - softParticles: 1 - softVegetation: 1 - vSyncCount: 0 - lodBias: 2 + lodBias: 0.3 maximumLODLevel: 0 particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 5 - BlackBerry: 5 - Standalone: 5 - WP8: 5 - Web: 5 - Windows Store Apps: 5 - iPhone: 5 + m_PerPlatformDefaultQuality: {} diff --git a/Source/ProjectSettings/UnityAdsSettings.asset b/Source/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 224050ce8..000000000 --- a/Source/ProjectSettings/UnityAdsSettings.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!292 &1 -UnityAdsSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: diff --git a/Source/ProjectSettings/UnityAnalyticsManager.asset b/Source/ProjectSettings/UnityAnalyticsManager.asset deleted file mode 100644 index 4a7b66883..000000000 --- a/Source/ProjectSettings/UnityAnalyticsManager.asset +++ /dev/null @@ -1,10 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!303 &1 -UnityAnalyticsManager: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: diff --git a/Source/ProjectSettings/UnityConnectSettings.asset b/Source/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 000000000..ec1ab2929 --- /dev/null +++ b/Source/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,32 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + m_Enabled: 0 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_Enabled: 0 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_EnabledPlatforms: 4294967295 + m_IosGameId: + m_AndroidGameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/license.txt b/license.txt index 7444b5b74..1294daf8e 100644 --- a/license.txt +++ b/license.txt @@ -19,3 +19,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Assets used in examples: +1. Skybox Volume 2 (https://www.assetstore.unity3d.com/en/#!/content/3392) +2. Planet Earth Free (https://www.assetstore.unity3d.com/en/#!/content/23399) +3. Wooden Table and Chair (https://www.assetstore.unity3d.com/en/#!/content/18996) +4. Touch gesture illustrations provided by GestureWorks® (www.gestureworks.com) +5. Cartoon UI elements (http://opengameart.org/content/free-game-gui) +6. Cat images are just random images from Google search. \ No newline at end of file