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/ProjectSettings.asset b/AssetStore/ProjectSettings/ProjectSettings.asset index 415b20e55..03403af75 100644 --- a/AssetStore/ProjectSettings/ProjectSettings.asset +++ b/AssetStore/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,8 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 11 + productGUID: d1fbc6bd3a3f2df418cc5c74efc952d3 AndroidProfiler: 0 defaultScreenOrientation: 0 targetDevice: 2 @@ -13,20 +14,46 @@ PlayerSettings: 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,7 +76,9 @@ PlayerSettings: forceSingleInstance: 0 resizableWindow: 0 useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games gpuSkinning: 0 + graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -57,6 +86,7 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 0 allowFullscreenSwitch: 1 + graphicsJobMode: 0 macFullscreenMode: 2 d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 @@ -64,15 +94,13 @@ PlayerSettings: xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 xboxEnablePIXSampling: 0 - xboxEnableEnableRenderThreadRunsJobs: 0 n3dsDisableStereoscopicView: 0 n3dsEnableSharedListOpt: 1 n3dsEnableVSync: 0 - uiUse16BitDepthBuffer: 0 ignoreAlphaClear: 0 xboxOneResolution: 0 xboxOneMonoLoggingLevel: 0 - ps3SplashScreen: {fileID: 0} + xboxOneLoggingLevel: 1 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -91,36 +119,53 @@ 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 - tvOSTargetOSVersion: 900 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -141,6 +186,7 @@ PlayerSettings: tvOSSmallIconLayers: [] tvOSLargeIconLayers: [] tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -159,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} @@ -188,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 @@ -208,39 +267,124 @@ PlayerSettings: 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: @@ -252,7 +396,9 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -274,6 +420,7 @@ PlayerSettings: ps4ApplicationParam4: 0 ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 ps4Passcode: 5xr84P2R391UXaLHbavJvFZGfO47XWS2 ps4UseDebugIl2cppLibs: 0 ps4pnSessions: 1 @@ -281,20 +428,27 @@ PlayerSettings: 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} @@ -345,8 +499,35 @@ PlayerSettings: 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 metroPackageVersion: metroCertificatePath: @@ -372,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 @@ -424,46 +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: + 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 d4ad3ce51..cbfba31f0 100644 --- a/AssetStore/ProjectSettings/ProjectVersion.txt +++ b/AssetStore/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.3.6f1 -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/UnityConnectSettings.asset b/AssetStore/ProjectSettings/UnityConnectSettings.asset index 9b7a57834..1cb99bba0 100644 Binary files a/AssetStore/ProjectSettings/UnityConnectSettings.asset and b/AssetStore/ProjectSettings/UnityConnectSettings.asset differ diff --git a/Docs/docs.shfbproj b/Docs/docs.shfbproj index 2877f2d66..7832740c9 100644 --- a/Docs/docs.shfbproj +++ b/Docs/docs.shfbproj @@ -23,8 +23,9 @@ TouchScript ..\..\..\..\Program Files (x86)\Sandcastle\ - - + + + Website C# @@ -48,9 +49,9 @@ False TouchScript — multitouch library for Unity AboveNamespaces - Attributes, ExplicitInterfaceImplementations, InheritedMembers, 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. @@ -69,25 +70,20 @@ 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 - - - - - - + @@ -99,15 +95,19 @@ - - - - - + + + + + + + - - - + + + + + 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/WindowsTouch/WindowsTouch.cpp b/External/WindowsTouch/WindowsTouch.cpp index f7dadfb79..9bc7fc95f 100644 --- a/External/WindowsTouch/WindowsTouch.cpp +++ b/External/WindowsTouch/WindowsTouch.cpp @@ -7,31 +7,28 @@ extern "C" { - void __stdcall Init(TOUCH_API api, - MousePointerBeganFuncPtr mouseBegan, MousePointerMovedFuncPtr mouseMoved, - TouchPointerBeganFuncPtr touchBegan, TouchPointerMovedFuncPtr touchMoved, - PenPointerBeganFuncPtr penBegan, PenPointerMovedFuncPtr penMoved, - PointerEndedFuncPtr ended, PointerCancelledFuncPtr cancelled) + void __stdcall Init(TOUCH_API api, LogFuncPtr logFunc, PointerDelegatePtr delegate) { - _mousePointerBeganFunc = mouseBegan; - _mousePointerMovedFunc = mouseMoved; - _touchPointerBeganFunc = touchBegan; - _touchPointerMovedFunc = touchMoved; - _penPointerBeganFunc = penBegan; - _penPointerMovedFunc = penMoved; - _pointerEndedFunc = ended; - _pointerCancelledFunc = cancelled; + _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."); } } @@ -67,9 +64,12 @@ LRESULT CALLBACK wndProc8(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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: @@ -103,105 +103,39 @@ void decodeWin8Touches(UINT msg, WPARAM wParam, LPARAM lParam) p.y = pointerInfo.ptPixelLocation.y; ScreenToClient(_currentWindow, &p); - switch (msg) - { - case WM_POINTERDOWN: - { - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELED) != 0) return; + Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); + PointerData data {}; + data.pointerFlags = pointerInfo.pointerFlags; + data.changedButtons = pointerInfo.ButtonChangeType; - Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); - unsigned int buttons = 0, b; - switch (pointerInfo.pointerType) - { - case PT_MOUSE: - b = (((unsigned int)pointerInfo.ButtonChangeType - 1) / 2) * 3; - buttons |= 1 << (b + 1); // add down - buttons |= 1 << b; // add pressed - _mousePointerBeganFunc(pointerId, buttons, position); - break; - case PT_TOUCH: - POINTER_TOUCH_INFO touchInfo; - GetPointerTouchInfo(pointerId, &touchInfo); - buttons = 1 + 2; // first button down, pressed - _touchPointerBeganFunc(pointerId, buttons, touchInfo.orientation, touchInfo.pressure, position); - break; - case PT_PEN: - b = (((unsigned int)pointerInfo.ButtonChangeType - 1) / 2) * 3; - buttons |= 1 << (b + 1); // add down - buttons |= 1 << b; // add pressed - _penPointerBeganFunc(pointerId, buttons, position); - break; - } - break; - } - case WM_POINTERUP: + if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELED) != 0 + || msg == WM_POINTERCAPTURECHANGED) msg = POINTER_CANCELLED; + + switch (pointerInfo.pointerType) { - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELED) != 0) - { - _pointerCancelledFunc(pointerId, pointerInfo.pointerType); - } - else - { - unsigned int buttons = 0, b; - switch (pointerInfo.pointerType) - { - case PT_MOUSE: - case PT_PEN: - b = (((unsigned int)pointerInfo.ButtonChangeType - 1) / 2) * 3; - buttons |= 1 << (b + 2); // add up - break; - case PT_TOUCH: - buttons = 4; // first button up - break; - } - _pointerEndedFunc(pointerId, pointerInfo.pointerType, buttons); - } + case PT_MOUSE: break; - } - case WM_POINTERUPDATE: - { - if ((pointerInfo.pointerFlags & POINTER_FLAG_CANCELED) != 0) - { - _pointerCancelledFunc(pointerId, pointerInfo.pointerType); - } - else - { - Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); - unsigned int buttonsSet = 0, buttonsClear = 0; - if (pointerInfo.ButtonChangeType != POINTER_CHANGE_NONE) - { - unsigned int change = (unsigned int)pointerInfo.ButtonChangeType; - if (change % 2 == 0) // up - { - unsigned int b = (change / 2 - 1) * 3; - buttonsSet |= 1 << (b + 2); // add up - buttonsClear |= 1 << b; // remove pressed - } - else // down - { - unsigned int b = ((change - 1) / 2) * 3; - buttonsSet |= 1 << (b + 1); // add down - buttonsSet |= 1 << b; // add pressed - } - } - switch (pointerInfo.pointerType) - { - case PT_MOUSE: - _mousePointerMovedFunc(pointerId, buttonsSet, buttonsClear, position); - break; - case PT_TOUCH: - POINTER_TOUCH_INFO touchInfo; - GetPointerTouchInfo(pointerId, &touchInfo); - _touchPointerMovedFunc(pointerId, buttonsSet, buttonsClear, touchInfo.orientation, touchInfo.pressure, position); - break; - case PT_PEN: - _penPointerMovedFunc(pointerId, buttonsSet, buttonsClear, position); - 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) @@ -221,22 +155,36 @@ void decodeWin7Touches(UINT msg, WPARAM wParam, LPARAM lParam) 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) { - Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); - _touchPointerBeganFunc(touch.dwID, 3, 0, 0, position); + msg = WM_POINTERDOWN; + data.changedButtons = POINTER_CHANGE_FIRSTBUTTON_DOWN; } else if ((touch.dwFlags & TOUCHEVENTF_UP) != 0) { - _pointerEndedFunc(touch.dwID, PT_TOUCH, 4); + msg = WM_POINTERLEAVE; + data.changedButtons = POINTER_CHANGE_FIRSTBUTTON_UP; } else if ((touch.dwFlags & TOUCHEVENTF_MOVE) != 0) { - Vector2 position = Vector2(((float)p.x - _offsetX) * _scaleX, _screenHeight - ((float)p.y - _offsetY) * _scaleY); - _touchPointerMovedFunc(touch.dwID, 0, 0, 0, 0, position); + 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 index ea06d9575..1a6d15976 100644 --- a/External/WindowsTouch/WindowsTouch.h +++ b/External/WindowsTouch/WindowsTouch.h @@ -2,10 +2,150 @@ * @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; @@ -17,29 +157,23 @@ struct Vector2 } }; -typedef enum +struct PointerData { - WIN7, - WIN8 -} TOUCH_API; + 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); -typedef void(__stdcall * MousePointerBeganFuncPtr)(int id, unsigned int buttons, Vector2 position); -typedef void(__stdcall * MousePointerMovedFuncPtr)(int id, unsigned int buttonsSet, unsigned int buttonsClear, Vector2 position); -typedef void(__stdcall * TouchPointerBeganFuncPtr)(int id, unsigned int buttons, unsigned int orientation, unsigned int pressure, Vector2 position); -typedef void(__stdcall * TouchPointerMovedFuncPtr)(int id, unsigned int buttonsSet, unsigned int orientation, unsigned int pressure, unsigned int buttonsClear, Vector2 position); -typedef void(__stdcall * PenPointerBeganFuncPtr)(int id, unsigned int buttons, Vector2 position); -typedef void(__stdcall * PenPointerMovedFuncPtr)(int id, unsigned int buttonsSet, unsigned int buttonsClear, Vector2 position); -typedef void(__stdcall * PointerEndedFuncPtr)(int id, POINTER_INPUT_TYPE type, unsigned int buttons); -typedef void(__stdcall * PointerCancelledFuncPtr)(int id, POINTER_INPUT_TYPE type); - -MousePointerBeganFuncPtr _mousePointerBeganFunc; -MousePointerMovedFuncPtr _mousePointerMovedFunc; -TouchPointerBeganFuncPtr _touchPointerBeganFunc; -TouchPointerMovedFuncPtr _touchPointerMovedFunc; -PenPointerBeganFuncPtr _penPointerBeganFunc; -PenPointerMovedFuncPtr _penPointerMovedFunc; -PointerEndedFuncPtr _pointerEndedFunc; -PointerCancelledFuncPtr _pointerCancelledFunc; +PointerDelegatePtr _delegate; +LogFuncPtr _log; HWND _currentWindow; int _screenWidth; int _screenHeight; @@ -52,15 +186,12 @@ LONG_PTR _oldWindowProc; extern "C" { - EXPORT_API void __stdcall Init(TOUCH_API api, - MousePointerBeganFuncPtr mouseBegan, MousePointerMovedFuncPtr mouseMoved, - TouchPointerBeganFuncPtr touchBegan, TouchPointerMovedFuncPtr touchMoved, - PenPointerBeganFuncPtr penBegan, PenPointerMovedFuncPtr penMoved, - PointerEndedFuncPtr ended, PointerCancelledFuncPtr cancelled); + 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); diff --git a/External/WindowsTouch/WindowsTouch.vcxproj b/External/WindowsTouch/WindowsTouch.vcxproj index 50247a536..42ac710b2 100644 --- a/External/WindowsTouch/WindowsTouch.vcxproj +++ b/External/WindowsTouch/WindowsTouch.vcxproj @@ -23,6 +23,7 @@ Win32Proj WindowsTouch 8.1 + WindowsTouch diff --git a/README.md b/README.md index 8ef8b21f2..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/Source/Assets/TouchScript/Scripts/Behaviors/Transform.meta b/Source/Assets/Test.meta similarity index 67% rename from Source/Assets/TouchScript/Scripts/Behaviors/Transform.meta rename to Source/Assets/Test.meta index a6e0f489a..ed78c8085 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Transform.meta +++ b/Source/Assets/Test.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 94c706edb4eee4fa8a0d0fa0aad1e396 +guid: 7e1fcc64fde35914b886872755292f44 folderAsset: yes -timeCreated: 1477922543 +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 index a3df54b65..9ab5068d0 100644 --- a/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs +++ b/Source/Assets/TouchScript/Editor/Behaviors/TransformerEditor.cs @@ -6,66 +6,67 @@ using UnityEditor; using UnityEngine; using System.Reflection; -using TouchScript.Editor.Utils; +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_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."); - private Transformer instance; + 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 SerializedProperty smoothingFactor, positionThreshold, rotationThreshold, scaleThreshold; - private PropertyInfo enableSmoothing_prop; + private PropertyInfo enableSmoothing_prop; protected virtual void OnEnable() { enableSmoothing = serializedObject.FindProperty("enableSmoothing"); -// smoothingFactor = serializedObject.FindProperty("smoothingFactor"); -// positionThreshold = serializedObject.FindProperty("positionThreshold"); -// rotationThreshold = serializedObject.FindProperty("rotationThreshold"); -// scaleThreshold = serializedObject.FindProperty("scaleThreshold"); allowChangingFromOutside = serializedObject.FindProperty("allowChangingFromOutside"); instance = target as Transformer; - var type = instance.GetType(); - enableSmoothing_prop = type.GetProperty("EnableSmoothing", BindingFlags.Instance | BindingFlags.Public); + var type = instance.GetType(); + enableSmoothing_prop = type.GetProperty("EnableSmoothing", BindingFlags.Instance | BindingFlags.Public); } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif - GUILayout.Space(5); + 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--; - } + 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/Behaviors/Visualizer/TouchVisualizerEditor.cs b/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs deleted file mode 100644 index b57c59e1a..000000000 --- a/Source/Assets/TouchScript/Editor/Behaviors/Visualizer/TouchVisualizerEditor.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using TouchScript.Behaviors.Visualizer; -using UnityEditor; -using UnityEngine; -using TouchScript.Editor.Utils; - -namespace TouchScript.Editor.Behaviors.Visualizer -{ - - [CustomEditor(typeof(PointerVisualizer))] - internal sealed class TouchVisualizerEditor : UnityEditor.Editor - { - - public static readonly GUIContent TEXT_SETTINGS_HEADER = new GUIContent("Pointer settings", "General pointersettings."); - public static readonly GUIContent TEXT_DPI_HEADER = new GUIContent("Use DPI", "Scale touch pointer based on DPI."); - public static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced settings."); - - public static readonly GUIContent TEXT_POINTER_ID = new GUIContent("Show Pointer Id", "Display pointer id."); - public static readonly GUIContent TEXT_POINTER_FLAGS = new GUIContent("Show Pointer Flags", "Display pointer flags."); - public static readonly GUIContent TEXT_POINTER_SIZE = new GUIContent("Pointer size (cm)", "Pointer size in cm based on current DPI."); - - private SerializedProperty touchProxy, useDPI, touchSize, showTouchId, showFlags; - private SerializedProperty generalProps, advancedProps; - - private void OnEnable() - { - showTouchId = serializedObject.FindProperty("showPointerId"); - showFlags = serializedObject.FindProperty("showFlags"); - touchProxy = serializedObject.FindProperty("pointerProxy"); - useDPI = serializedObject.FindProperty("useDPI"); - touchSize = serializedObject.FindProperty("pointerSize"); - - generalProps = serializedObject.FindProperty("generalProps"); - advancedProps = serializedObject.FindProperty("advancedProps"); - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - - GUILayout.Space(5); - - var display = GUIElements.Header(TEXT_SETTINGS_HEADER, generalProps); - if (display) - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(showTouchId, TEXT_POINTER_ID); - EditorGUILayout.PropertyField(showFlags, TEXT_POINTER_FLAGS); - EditorGUI.indentLevel--; - } - - display = GUIElements.Header(TEXT_DPI_HEADER, useDPI, useDPI); - if (display) - { - EditorGUI.indentLevel++; - using (new EditorGUI.DisabledGroupScope(!useDPI.boolValue)) - { - EditorGUILayout.PropertyField(touchSize, TEXT_POINTER_SIZE); - } - EditorGUI.indentLevel--; - } - - display = GUIElements.Header(TEXT_ADVANCED_HEADER, advancedProps); - if (display) - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(touchProxy, new GUIContent("Pointer Proxy")); - EditorGUI.indentLevel--; - } - - 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/Debugging/PointerDebuggerWindow.cs.meta b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs.meta new file mode 100644 index 000000000..f147fa5be --- /dev/null +++ b/Source/Assets/TouchScript/Editor/Debugging/PointerDebuggerWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1684ac3d3422e4b458a73b6955a0cae3 +timeCreated: 1500410762 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Source/Assets/TouchScript/Editor/EditorResources.cs b/Source/Assets/TouchScript/Editor/EditorResources.cs index 2a455d37a..41f15a5a0 100644 --- a/Source/Assets/TouchScript/Editor/EditorResources.cs +++ b/Source/Assets/TouchScript/Editor/EditorResources.cs @@ -61,4 +61,4 @@ static bool searchForEditorResourcesPath(out string path) return true; } } -} +} \ No newline at end of file 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/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/EditorUI/GUIUtils.cs.meta b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs.meta new file mode 100644 index 000000000..79a3041ab --- /dev/null +++ b/Source/Assets/TouchScript/Editor/EditorUI/GUIUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e4af8ab947e1c4b959f59dba2bce9dc3 +timeCreated: 1500502342 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: 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/FlickGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/FlickGestureEditor.cs index 6765ed255..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 { - 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 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 0d4546cb7..1232e8a97 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs @@ -3,7 +3,7 @@ */ using System; -using TouchScript.Editor.Utils; +using TouchScript.Editor.EditorUI; using TouchScript.Gestures; using UnityEditor; using UnityEditorInternal; @@ -16,37 +16,37 @@ namespace TouchScript.Editor.Gestures internal class GestureEditor : UnityEditor.Editor { private const string FRIENDLY_GESTURES_PROP = "friendlyGestures"; - - 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_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); - 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 shouldDrawCombineTouches = false; - protected bool shouldDrawAdvanced = false; - protected bool shouldDrawGeneral = true; - - private Gesture instance; + + 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, combinePointers, combinePointersInterval, - useSendMessage, sendMessageTarget, sendStateChangeMessages, - useUnityEvents, sendStateChangeEvents; - private SerializedProperty OnStateChange; - private SerializedProperty advancedProps, limitsProps, generalProps; - private PropertyInfo useUnityEvents_prop, useSendMessage_prop; + 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; @@ -54,36 +54,35 @@ internal class GestureEditor : UnityEditor.Editor protected virtual void OnEnable() { - instance = target as Gesture; + instance = target as Gesture; advancedProps = serializedObject.FindProperty("advancedProps"); - limitsProps = serializedObject.FindProperty("limitsProps"); - generalProps = serializedObject.FindProperty("generalProps"); + limitsProps = serializedObject.FindProperty("limitsProps"); + generalProps = serializedObject.FindProperty("generalProps"); + basicEditor = serializedObject.FindProperty("basicEditor"); debugMode = serializedObject.FindProperty("debugMode"); friendlyGestures = serializedObject.FindProperty("friendlyGestures"); requireGestureToFail = serializedObject.FindProperty("requireGestureToFail"); - combinePointers = serializedObject.FindProperty("combinePointers"); - combinePointersInterval = serializedObject.FindProperty("combinePointersInterval"); useSendMessage = serializedObject.FindProperty("useSendMessage"); sendMessageTarget = serializedObject.FindProperty("sendMessageTarget"); sendStateChangeMessages = serializedObject.FindProperty("sendStateChangeMessages"); - useUnityEvents = serializedObject.FindProperty("useUnityEvents"); - sendStateChangeEvents = serializedObject.FindProperty("sendStateChangeEvents"); + useUnityEvents = serializedObject.FindProperty("useUnityEvents"); + sendStateChangeEvents = serializedObject.FindProperty("sendStateChangeEvents"); minPointers = serializedObject.FindProperty("minPointers"); maxPointers = serializedObject.FindProperty("maxPointers"); - OnStateChange = serializedObject.FindProperty("OnStateChange"); + 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); + var type = instance.GetType(); + useUnityEvents_prop = type.GetProperty("UseUnityEvents", BindingFlags.Instance | BindingFlags.Public); + useSendMessage_prop = type.GetProperty("UseSendMessage", BindingFlags.Instance | BindingFlags.Public); minPointersFloat = minPointers.intValue; maxPointersFloat = maxPointers.intValue; friendlyGesturesList = new ReorderableList(serializedObject, friendlyGestures, false, true, false, true); - friendlyGesturesList.drawHeaderCallback += (rect) => GUI.Label(rect, TEXT_FRIENDLY); + friendlyGesturesList.drawHeaderCallback += (rect) => GUI.Label(rect, TEXT_FRIENDLY); friendlyGesturesList.drawElementCallback += (rect, index, active, focused) => { rect.height = 16; @@ -95,144 +94,161 @@ 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; }; - - if (debugMode != null) shouldDrawAdvanced = true; } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); - - GUILayout.Space(5); - bool display; - - 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--; - } - } +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif + + GUILayout.Space(5); + bool display; + + if (basicEditor.boolValue) + { + drawBasic(); + if (GUIElements.BasicHelpBox(getHelpText())) + { + basicEditor.boolValue = false; + Repaint(); + } + } + else + { + 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(); + } serializedObject.ApplyModifiedProperties(); } - protected virtual void drawOtherGUI() - { - - } - - protected virtual void drawGeneral() - { - - } - - protected virtual void drawLimits() - { - var limitPointers = (minPointers.intValue > 0) || (maxPointers.intValue > 0); - var newLimitPointers = EditorGUILayout.ToggleLeft(TEXT_LIMIT_POINTERS, limitPointers); - if (newLimitPointers) - { - if (!limitPointers) - { - minPointersFloat = 0; - maxPointersFloat = 10; - } - else - { - minPointersFloat = (float) minPointers.intValue; - maxPointersFloat = (float) maxPointers.intValue; - } - //or this values doesn't change from script properly - EditorGUI.indentLevel++; - EditorGUILayout.LabelField("Min: " + (int)minPointersFloat + ", Max: " + (int)maxPointersFloat); - EditorGUILayout.MinMaxSlider(ref minPointersFloat, ref maxPointersFloat, 0, 10, GUILayout.MaxWidth(150)); - EditorGUI.indentLevel--; - } - else - { - if (limitPointers) - { - minPointersFloat = 0; - maxPointersFloat = 0; - } - } - - minPointers.intValue = (int)minPointersFloat; - maxPointers.intValue = (int)maxPointersFloat; - } - - protected virtual void drawFriendlyGestures() - { - GUILayout.Space(5); - drawGestureList(friendlyGestures, addFriendlyGesture); - GUILayout.Space(5); - } - - protected virtual void drawUnityEvents() - { - EditorGUILayout.PropertyField(OnStateChange); - EditorGUILayout.PropertyField(sendStateChangeEvents, TEXT_SEND_STATE_CHANGE_EVENTS); - } + protected virtual void drawBasic() {} + + protected virtual GUIContent getHelpText() + { + return new GUIContent(""); + } + + protected virtual void drawOtherGUI() {} + + protected virtual void drawGeneral() {} + + protected virtual void drawLimits() + { + var limitPointers = (minPointers.intValue > 0) || (maxPointers.intValue > 0); + var newLimitPointers = EditorGUILayout.ToggleLeft(TEXT_LIMIT_POINTERS, limitPointers); + if (newLimitPointers) + { + if (!limitPointers) + { + minPointersFloat = 0; + maxPointersFloat = 10; + } + else + { + minPointersFloat = (float) minPointers.intValue; + maxPointersFloat = (float) maxPointers.intValue; + } + //or this values doesn't change from script properly + EditorGUI.indentLevel++; + EditorGUILayout.LabelField("Min: " + (int) minPointersFloat + ", Max: " + (int) maxPointersFloat); + EditorGUILayout.MinMaxSlider(ref minPointersFloat, ref maxPointersFloat, 0, 10, GUILayout.MaxWidth(150)); + EditorGUI.indentLevel--; + } + else + { + if (limitPointers) + { + minPointersFloat = 0; + maxPointersFloat = 0; + } + } + + minPointers.intValue = (int) minPointersFloat; + maxPointers.intValue = (int) maxPointersFloat; + } + + protected virtual void drawFriendlyGestures() + { + GUILayout.Space(5); + drawGestureList(friendlyGestures, addFriendlyGesture); + GUILayout.Space(5); + } + + protected virtual void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnStateChange); + EditorGUILayout.PropertyField(sendStateChangeEvents, TEXT_SEND_STATE_CHANGE_EVENTS); + } protected virtual void drawSendMessage() { @@ -240,40 +256,18 @@ protected virtual void drawSendMessage() EditorGUILayout.PropertyField(sendStateChangeMessages, TEXT_SEND_STATE_CHANGE_MESSAGES); } - protected virtual void drawAdvanced() + protected virtual void drawAdvanced() {} + + protected virtual void drawDebug() { - drawCombineTouches(); - drawDebug(); + if (debugMode == null) return; + EditorGUILayout.PropertyField(debugMode, TEXT_DEBUG_MODE); } - protected virtual void drawCombineTouches() - { - if (shouldDrawCombineTouches) - { - 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(); - } - } - } - - 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); - } + protected virtual void drawRequireToFail() + { + EditorGUILayout.PropertyField(requireGestureToFail, TEXT_REQUIRE_GESTURE_TO_FAIL); + } #region Gesture List @@ -283,12 +277,12 @@ private void drawGestureList(SerializedProperty prop, Action 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."); + + 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; + private SerializedProperty OnLongPress; protected override void OnEnable() { timeToPress = serializedObject.FindProperty("timeToPress"); distanceLimit = serializedObject.FindProperty("distanceLimit"); - OnLongPress = serializedObject.FindProperty("OnLongPress"); + OnLongPress = serializedObject.FindProperty("OnLongPress"); + + base.OnEnable(); + } + + protected override void drawBasic() + { + EditorGUILayout.PropertyField(timeToPress, TEXT_TIME_TO_PRESS); + } - base.OnEnable(); + protected override GUIContent getHelpText() + { + return TEXT_HELP; } - protected override void drawGeneral () - { - EditorGUILayout.PropertyField(timeToPress, TEXT_TIME_TO_PRESS); + protected override void drawGeneral() + { + EditorGUILayout.PropertyField(timeToPress, TEXT_TIME_TO_PRESS); - base.drawGeneral(); - } + base.drawGeneral(); + } - protected override void drawLimits () - { + protected override void drawLimits() + { EditorGUILayout.PropertyField(distanceLimit, TEXT_DISTANCE_LIMIT); - base.drawLimits(); + base.drawLimits(); } - protected override void drawUnityEvents () - { - EditorGUILayout.PropertyField(OnLongPress); + protected override void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnLongPress); - base.drawUnityEvents (); - } + 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/PressGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs index 3fe025d7b..5c00da861 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/PressGestureEditor.cs @@ -11,31 +11,38 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(PressGesture), true)] internal sealed class PressGestureEditor : GestureEditor { - public static readonly GUIContent TEXT_IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores pointers 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; + private SerializedProperty OnPress; protected override void OnEnable() { ignoreChildren = serializedObject.FindProperty("ignoreChildren"); - OnPress = serializedObject.FindProperty("OnPress"); + OnPress = serializedObject.FindProperty("OnPress"); + + base.OnEnable(); + } - base.OnEnable(); + protected override GUIContent getHelpText() + { + return TEXT_HELP; } - protected override void drawGeneral() + protected override void drawGeneral() { EditorGUILayout.PropertyField(ignoreChildren, TEXT_IGNORE_CHILDREN); - base.drawGeneral(); + base.drawGeneral(); } - protected override void drawUnityEvents () - { - EditorGUILayout.PropertyField(OnPress); + protected override void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnPress); - base.drawUnityEvents(); - } + 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 7d182ce9b..ff2b1ec22 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/ReleaseGestureEditor.cs @@ -11,31 +11,38 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(ReleaseGesture), true)] internal sealed class ReleaseGestureEditor : GestureEditor { - public static readonly GUIContent TEXT_IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores pointers 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; + private SerializedProperty OnRelease; protected override void OnEnable() { ignoreChildren = serializedObject.FindProperty("ignoreChildren"); - OnRelease = serializedObject.FindProperty("OnRelease"); + OnRelease = serializedObject.FindProperty("OnRelease"); + + base.OnEnable(); + } - base.OnEnable(); + protected override GUIContent getHelpText() + { + return TEXT_HELP; } - protected override void drawGeneral() + protected override void drawGeneral() { EditorGUILayout.PropertyField(ignoreChildren, TEXT_IGNORE_CHILDREN); - base.drawGeneral(); + base.drawGeneral(); } - protected override void drawUnityEvents () - { - EditorGUILayout.PropertyField(OnRelease); + protected override void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnRelease); - base.drawUnityEvents(); - } + base.drawUnityEvents(); + } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs index 4b9ece4b9..eacfcc60b 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TapGestureEditor.cs @@ -11,47 +11,72 @@ namespace TouchScript.Editor.Gestures [CustomEditor(typeof(TapGesture), true)] internal sealed class TapGestureEditor : GestureEditor { - 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_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, distanceLimit, timeLimit; - private SerializedProperty OnTap; + 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() { numberOfTapsRequired = serializedObject.FindProperty("numberOfTapsRequired"); timeLimit = serializedObject.FindProperty("timeLimit"); distanceLimit = serializedObject.FindProperty("distanceLimit"); + combinePointers = serializedObject.FindProperty("combinePointers"); + combinePointersInterval = serializedObject.FindProperty("combinePointersInterval"); - OnTap = serializedObject.FindProperty("OnTap"); + OnTap = serializedObject.FindProperty("OnTap"); - shouldDrawCombineTouches = true; + base.OnEnable(); + } - base.OnEnable(); + 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)); } - protected override void drawGeneral() - { - 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)); + protected override GUIContent getHelpText() + { + return TEXT_HELP; + } - base.drawGeneral (); - } + protected override void drawGeneral() + { + 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)); + 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() + protected override void drawLimits() { EditorGUILayout.PropertyField(timeLimit, TEXT_TIME_LIMIT); EditorGUILayout.PropertyField(distanceLimit, TEXT_DISTANCE_LIMIT); - base.drawLimits(); + base.drawLimits(); } - protected override void drawUnityEvents () - { - EditorGUILayout.PropertyField(OnTap); + protected override void drawUnityEvents() + { + EditorGUILayout.PropertyField(OnTap); - base.drawUnityEvents(); - } + base.drawUnityEvents(); + } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs index 5ef17c9f1..b2016ecfd 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/OnePointTransformGestureBaseEditor.cs @@ -8,31 +8,51 @@ namespace TouchScript.Editor.Gestures.TransformGestures.Base { - internal class OnePointTransformGestureBaseEditor : TransformGestureBaseEditor + internal class OnePointTransformGestureBaseEditor : TransformGestureBaseEditor { + protected override void drawBasic() + { + var typeValue = type.intValue; + int newType = 0; + EditorGUILayout.LabelField(TEXT_TYPE); - protected override void drawGeneral() + 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++; - EditorGUILayout.BeginVertical(); - if (EditorGUILayout.ToggleLeft(TEXT_TYPE_ROTATION, - (typeValue & (int)TransformGesture.TransformType.Rotation) != 0)) - newType |= (int)TransformGesture.TransformType.Rotation; - if (EditorGUILayout.ToggleLeft(TEXT_TYPE_SCALING, - (typeValue & (int)TransformGesture.TransformType.Scaling) != 0)) - newType |= (int)TransformGesture.TransformType.Scaling; + + 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; - EditorGUILayout.EndVertical(); - EditorGUI.indentLevel--; + EditorGUI.indentLevel++; - EditorGUIUtility.labelWidth = 160; - EditorGUILayout.PropertyField(screenTransformThreshold, TEXT_SCREEN_TRANSFORM_THRESHOLD); + EditorGUIUtility.labelWidth = 160; + EditorGUILayout.PropertyField(screenTransformThreshold, TEXT_SCREEN_TRANSFORM_THRESHOLD); - base.drawGeneral(); + base.drawGeneral(); } - } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs index 75964f434..fec57b9a4 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TransformGestureBaseEditor.cs @@ -2,49 +2,147 @@ * @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("Type", "Method used to project 2d screen positions of pointers into 3d space."); - public static readonly GUIContent TEXT_PROJECTION_NORMAL = new GUIContent("Normal", "Normal of the plane in 3d space where pointers' positions are projected."); - - protected SerializedProperty type, minScreenPointsDistance, screenTransformThreshold; - protected SerializedProperty OnTransformStart, OnTransform, OnTransformComplete; - - 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"); - - base.OnEnable(); - } - - protected override void drawUnityEvents () - { - EditorGUILayout.PropertyField(OnTransformStart); - EditorGUILayout.PropertyField(OnTransform); - EditorGUILayout.PropertyField(OnTransformComplete); - - base.drawUnityEvents (); - } - - } -} + 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/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs index f556e3068..4cb6492f4 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/Base/TwoPointTransformGestureBaseEditor.cs @@ -8,33 +8,63 @@ namespace TouchScript.Editor.Gestures.TransformGestures.Base { - internal class TwoPointTransformGestureBaseEditor : TransformGestureBaseEditor + 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++; - EditorGUILayout.BeginVertical(); - if (EditorGUILayout.ToggleLeft(TEXT_TYPE_TRANSLATION, - (typeValue & (int)TransformGesture.TransformType.Translation) != 0)) - newType |= (int)TransformGesture.TransformType.Translation; - if (EditorGUILayout.ToggleLeft(TEXT_TYPE_ROTATION, - (typeValue & (int)TransformGesture.TransformType.Rotation) != 0)) - newType |= (int)TransformGesture.TransformType.Rotation; - if (EditorGUILayout.ToggleLeft(TEXT_TYPE_SCALING, - (typeValue & (int)TransformGesture.TransformType.Scaling) != 0)) - newType |= (int)TransformGesture.TransformType.Scaling; - type.intValue = newType; - EditorGUILayout.EndVertical(); - EditorGUI.indentLevel--; + 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(); + base.drawGeneral(); } } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs index e1317e19c..42a21a75a 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/PinnedTransformGestureEditor.cs @@ -6,40 +6,44 @@ using TouchScript.Gestures.TransformGestures; using UnityEditor; using UnityEngine; -using TouchScript.Editor.Utils; +using TouchScript.Editor.EditorUI; namespace TouchScript.Editor.Gestures.TransformGestures { [CustomEditor(typeof(PinnedTransformGesture), true)] internal class PinnedTransformGestureEditor : OnePointTransformGestureBaseEditor { - public SerializedProperty projection, projectionPlaneNormal; - public SerializedProperty projectionProps; + 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() { - projection = serializedObject.FindProperty("projection"); - projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); + base.OnEnable(); - projectionProps = serializedObject.FindProperty("projectionProps"); + initCustomProjection(); + } + + protected override void drawBasic() + { + base.drawBasic(); - base.OnEnable(); + customProjection = drawProjection(customProjection); } - protected override void drawOtherGUI() - { - var display = GUIElements.Header(TEXT_PROJECTION_HEADER, projectionProps); - if (display) - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(projection, TEXT_PROJECTION); - if (projection.enumValueIndex != (int)TransformGesture.ProjectionType.Layer) - { - EditorGUILayout.PropertyField(projectionPlaneNormal, TEXT_PROJECTION_NORMAL); - } - EditorGUI.indentLevel--; - } - } + 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/TransformGestures/ScreenTransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs index 4ada899fe..c30fa37f3 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/ScreenTransformGestureEditor.cs @@ -5,11 +5,18 @@ 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/TransformGestures/TransformGestureEditor.cs b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs index d6be51588..d205e6f0e 100644 --- a/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs +++ b/Source/Assets/TouchScript/Editor/Gestures/TransformGestures/TransformGestureEditor.cs @@ -5,41 +5,46 @@ using TouchScript.Editor.Gestures.TransformGestures.Base; using TouchScript.Gestures.TransformGestures; using UnityEditor; +using TouchScript.Editor.EditorUI; using UnityEngine; -using TouchScript.Editor.Utils; namespace TouchScript.Editor.Gestures.TransformGestures { [CustomEditor(typeof(TransformGesture), true)] internal class TransformGestureEditor : TwoPointTransformGestureBaseEditor { - public SerializedProperty projection, projectionPlaneNormal; - public SerializedProperty projectionProps; + 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() { - projection = serializedObject.FindProperty("projection"); - projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); + base.OnEnable(); + + initCustomProjection(); + } - projectionProps = serializedObject.FindProperty("projectionProps"); + protected override void drawBasic() + { + base.drawBasic(); - base.OnEnable(); + customProjection = drawProjection(customProjection); } - protected override void drawOtherGUI() + protected override GUIContent getHelpText() { - var display = GUIElements.Header(TEXT_PROJECTION_HEADER, projectionProps); - if (display) - { - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(projection, TEXT_PROJECTION); - if (projection.enumValueIndex != (int)TransformGesture.ProjectionType.Layer) - { - EditorGUILayout.PropertyField(projectionPlaneNormal, TEXT_PROJECTION_NORMAL); - } - EditorGUI.indentLevel--; - } + 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/InputSources/InputSourceEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs index 7cc5c5ee4..030363f56 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs +++ b/Source/Assets/TouchScript/Editor/InputSources/InputSourceEditor.cs @@ -10,14 +10,10 @@ namespace TouchScript.Editor.InputSources { public class InputSourceEditor : UnityEditor.Editor { - protected virtual void OnEnable() - { - } + protected virtual void OnEnable() {} - public override void OnInspectorGUI() - { - } + public override void OnInspectorGUI() {} protected virtual void drawAdvanced() {} } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs b/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs index c1c72b345..b6cc02970 100644 --- a/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs +++ b/Source/Assets/TouchScript/Editor/InputSources/StandardInputEditor.cs @@ -5,28 +5,34 @@ using TouchScript.InputSources; using UnityEditor; using UnityEngine; -using TouchScript.Editor.Utils; -using System.Reflection; +using TouchScript.Editor.EditorUI; namespace TouchScript.Editor.InputSources { - [CustomEditor(typeof (StandardInput), true)] + [CustomEditor(typeof(StandardInput), true)] internal sealed class StandardInputEditor : InputSourceEditor { - 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_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_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 native WM_TOUCH implementation,\n - None — no touch please."); + 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_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_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, webGLTouch, windows8Mouse, - windows7Mouse, universalWindowsMouse, emulateSecondMousePointer; - private SerializedProperty generalProps, windowsProps; + windows7Mouse, universalWindowsMouse, emulateSecondMousePointer; + + private SerializedProperty generalProps, windowsProps, webglProps; private StandardInput instance; @@ -35,6 +41,7 @@ protected override void OnEnable() base.OnEnable(); instance = target as StandardInput; + basicEditor = serializedObject.FindProperty("basicEditor"); windows8Touch = serializedObject.FindProperty("windows8API"); windows7Touch = serializedObject.FindProperty("windows7API"); webGLTouch = serializedObject.FindProperty("webGLTouch"); @@ -43,45 +50,88 @@ protected override void OnEnable() universalWindowsMouse = serializedObject.FindProperty("universalWindowsMouse"); emulateSecondMousePointer = serializedObject.FindProperty("emulateSecondMousePointer"); - generalProps = serializedObject.FindProperty("generalProps"); - windowsProps = serializedObject.FindProperty("windowsProps"); + generalProps = serializedObject.FindProperty("generalProps"); + windowsProps = serializedObject.FindProperty("windowsProps"); + webglProps = serializedObject.FindProperty("webglProps"); } public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); - - GUILayout.Space(5); - - var display = GUIElements.Header(TEXT_GENERAL_HEADER, generalProps); - if (display) - { - EditorGUI.indentLevel++; - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(emulateSecondMousePointer); - if (EditorGUI.EndChangeCheck()) - { - instance.EmulateSecondMousePointer = emulateSecondMousePointer.boolValue; - } - EditorGUILayout.PropertyField(webGLTouch); - EditorGUI.indentLevel--; - } - - 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--; - } - +#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(); } + + 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() + { + 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/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 index 4f4c6ddc9..37406e88e 100644 --- a/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs +++ b/Source/Assets/TouchScript/Editor/Layers/StandardLayerEditor.cs @@ -2,7 +2,7 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Editor.Utils; +using TouchScript.Editor.EditorUI; using TouchScript.Layers; using UnityEditor; using UnityEngine; @@ -12,17 +12,20 @@ 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_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_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."); - private SerializedProperty advanced, hit; + 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; @@ -34,8 +37,9 @@ protected virtual void OnEnable() { hideFlags = HideFlags.HideAndDontSave; - advanced = serializedObject.FindProperty("advancedProps"); - hit = serializedObject.FindProperty("hitProps"); + advancedProps = serializedObject.FindProperty("advancedProps"); + hitProps = serializedObject.FindProperty("hitProps"); + basicEditor = serializedObject.FindProperty("basicEditor"); hit3DObjects = serializedObject.FindProperty("hit3DObjects"); hit2DObjects = serializedObject.FindProperty("hit2DObjects"); hitWorldSpaceUI = serializedObject.FindProperty("hitWorldSpaceUI"); @@ -46,41 +50,67 @@ protected virtual void OnEnable() public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); - - GUILayout.Space(5); - var display = GUIElements.Header(TEXT_HIT_HEADER, hit); - if (display) - { - EditorGUI.indentLevel++; - drawHit(); - EditorGUI.indentLevel--; - } - - display = GUIElements.Header(TEXT_ADVANCED_HEADER, advanced); - if (display) - { - EditorGUI.indentLevel++; - drawAdvanced(); - EditorGUI.indentLevel--; - } +#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(); } - protected virtual void drawHit() - { - 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 drawHit() + { + var display = GUIElements.Header(TEXT_HIT_HEADER, hitProps); + if (display) + { + EditorGUI.indentLevel++; + doDrawHit(); + EditorGUI.indentLevel--; + } + } - protected virtual void drawAdvanced() + protected virtual void doDrawHit() { - EditorGUILayout.PropertyField(useHitFilters, TEXT_HIT_FILTERS); + 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/TouchManagerEditor.cs b/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs index 4b72c1343..b5486f592 100644 --- a/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs +++ b/Source/Assets/TouchScript/Editor/TouchManagerEditor.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using TouchScript.Devices.Display; -using TouchScript.Editor.Utils; +using TouchScript.Editor.EditorUI; using TouchScript.Layers; using UnityEditor; using UnityEditorInternal; @@ -18,34 +18,39 @@ namespace TouchScript.Editor [CustomEditor(typeof(TouchManager))] internal sealed class TouchManagerEditor : UnityEditor.Editor { - public static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced properties."); - 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_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 advancedProps; + 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 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; - advancedProps = serializedObject.FindProperty("advancedProps"); + basicEditor = serializedObject.FindProperty("basicEditor"); debugMode = serializedObject.FindProperty("debugMode"); layers = serializedObject.FindProperty("layers"); displayDevice = serializedObject.FindProperty("displayDevice"); @@ -57,24 +62,24 @@ private void OnEnable() 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); + 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, false, false, false); - layersList.headerHeight = 0; - layersList.footerHeight = 0; + layersList.headerHeight = 0; + layersList.footerHeight = 0; layersList.drawElementCallback += (rect, index, active, focused) => { rect.height = 16; @@ -92,103 +97,126 @@ private void OnEnable() public override void OnInspectorGUI() { - serializedObject.Update(); - - GUILayout.Space(5); - - var display = GUIElements.Header(TEXT_DEFAULTS_HEADER, shouldCreateCameraLayer); - if (display) - { - EditorGUI.indentLevel++; - using (new EditorGUI.DisabledGroupScope(Application.isPlaying)) - { - EditorGUILayout.PropertyField(shouldCreateCameraLayer, TEXT_CREATE_CAMERA_LAYER); - EditorGUILayout.PropertyField(shouldCreateStandardInput, TEXT_CREATE_STANDARD_INPUT); - } - EditorGUI.indentLevel--; - } - - display = GUIElements.Header(TEXT_USE_UNITY_EVENTS_HEADER, useUnityEvents, useUnityEvents, useUnityEvents_prop); - if (display) - { - 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--; - } - - display = GUIElements.Header(TEXT_USE_SEND_MESSAGE_HEADER, useSendMessage, useSendMessage, useSendMessage_prop); - if (display) - { - 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--; - } - - display = GUIElements.Header(TEXT_LAYERS_HEADER, layers); - if (display) - { - EditorGUI.indentLevel++; - using (new EditorGUI.DisabledGroupScope(Application.isPlaying)) - { - layersList.DoLayoutList(); - } - EditorGUI.indentLevel--; - } - - display = GUIElements.Header(TEXT_ADVANCED_HEADER, advancedProps); - if (display) - { - EditorGUI.indentLevel++; - drawAdvanced(); - EditorGUI.indentLevel--; - } +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif + + GUILayout.Space(5); + + if (basicEditor.boolValue) + { + drawLayers(); + + if (GUIElements.BasicHelpBox(TEXT_HELP)) + { + basicEditor.boolValue = false; + Repaint(); + } + } + else + { + drawDefaults(); + drawLayers(); + drawUnityEvents(); + drawSendMessage(); + drawDebug(); + } + + GUILayout.Label("v. " + TouchManager.VERSION + (string.IsNullOrEmpty(TouchManager.VERSION_SUFFIX) ? "" : " " + TouchManager.VERSION_SUFFIX), GUIElements.SmallTextRight); serializedObject.ApplyModifiedProperties(); } - private void drawAdvanced() + private void drawDefaults() + { + var display = GUIElements.Header(TEXT_DEFAULTS_HEADER, shouldCreateCameraLayer); + if (display) + { + EditorGUI.indentLevel++; + using (new EditorGUI.DisabledGroupScope(Application.isPlaying)) + { + EditorGUILayout.PropertyField(shouldCreateCameraLayer, TEXT_CREATE_CAMERA_LAYER); + EditorGUILayout.PropertyField(shouldCreateStandardInput, TEXT_CREATE_STANDARD_INPUT); + } + + 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 newDevice = EditorGUI.ObjectField(r, instance.DisplayDevice as Object, typeof(IDisplayDevice), true) as IDisplayDevice; + if (EditorGUI.EndChangeCheck()) + { + instance.DisplayDevice = newDevice; + EditorUtility.SetDirty(instance); + } + EditorGUI.EndProperty(); + + EditorGUI.indentLevel--; + } + } + + private void drawLayers() { - if (debugMode != null) - { - 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 newDevice = EditorGUI.ObjectField(r, instance.DisplayDevice as Object, typeof(IDisplayDevice), true) as IDisplayDevice; - if (EditorGUI.EndChangeCheck()) - { - instance.DisplayDevice = newDevice; - EditorUtility.SetDirty(instance); - } - EditorGUI.EndProperty(); - - drawDebug(); - } + 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 drawUnityEvents() + { + var display = GUIElements.Header(TEXT_USE_UNITY_EVENTS_HEADER, useUnityEvents, useUnityEvents, useUnityEvents_prop); + if (display) + { + 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--; + } + } + + private void drawSendMessage() + { + var display = GUIElements.Header(TEXT_USE_SEND_MESSAGE_HEADER, useSendMessage, useSendMessage, useSendMessage_prop); + if (display) + { + 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() @@ -203,17 +231,17 @@ private void refresh() { if (Application.isPlaying) { - var l = TouchManager.Instance.Layers; layers.arraySize = 0; - for (var i = 0; i < l.Count; i++) - { - layers.arraySize++; - layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = l[i]; - } + LayerManager.Instance.ForEach((l) => + { + layers.arraySize++; + layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = l; + return true; + }); } else { - var allLayers = FindObjectsOfType(typeof (TouchLayer)).Cast().ToList(); + var allLayers = FindObjectsOfType(typeof(TouchLayer)).Cast().ToList(); var toRemove = new List(); for (var i = 0; i < layers.arraySize; i++) { diff --git a/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs index e61eae7ec..8645a087b 100644 --- a/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs +++ b/Source/Assets/TouchScript/Editor/TouchScriptSettingsWindow.cs @@ -8,30 +8,28 @@ namespace TouchScript.Editor { - - [InitializeOnLoad] + [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 const string DEFINE_DEBUG = "TOUCHSCRIPT_DEBUG"; + private const string DEFINE_TUIO = "TOUCHSCRIPT_TUIO"; private static bool showAtStartup = true; - private static TouchScriptSettingsWindowSO so; + 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 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 }, - }; + private static Dictionary enabledDefines = new Dictionary() + { + {DEFINE_DEBUG, false}, + {DEFINE_TUIO, false}, + }; [MenuItem("Window/TouchScript/Settings", false, 0)] static void createWindow() @@ -45,149 +43,146 @@ static void createWindow() static TouchScriptSettingsWindow() { - EditorApplication.update += doShow; + 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 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(); + updateEnabledDefines(); } - private void OnDisable() - { - } + 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(); + 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; + private void init() + { + if (initialized) return; + initialized = true; - header = new GUIStyle(); + 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; - } - } -} + 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/Utils/GUIElements.cs b/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs deleted file mode 100644 index 26550800a..000000000 --- a/Source/Assets/TouchScript/Editor/Utils/GUIElements.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using UnityEngine; -using UnityEditor; -using System.Reflection; - -namespace TouchScript.Editor.Utils -{ - internal static class GUIElements - { - public static GUIStyle BoxStyle; - public static GUIStyle BoxLabelStyle; - - public static GUIStyle HelpBox; - public static GUIStyle HeaderStyle; - public static GUIStyle HeaderCheckbox; - public static GUIStyle HeaderFoldout; - - public static Texture2D PaneOptionsIcon; - - static GUIElements() - { - BoxStyle = 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, - }; - BoxStyle.normal.textColor = GUI.skin.label.normal.textColor; - - BoxLabelStyle = new GUIStyle(GUI.skin.label) - { - fontSize = 9, - padding = new RectOffset(0, 0, 5, 0), - }; - - HelpBox = new GUIStyle("HelpBox") - { - wordWrap = true, - }; - - HeaderStyle = 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"); - - 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, HeaderStyle); - GUI.Box(rect, title, HeaderStyle); - - 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; - } - } -} diff --git a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs index a4ea70aab..3920f081c 100644 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs +++ b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/NullToggleDrawer.cs @@ -32,13 +32,13 @@ 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; } } @@ -46,7 +46,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten { EditorGUI.BeginChangeCheck(); 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); + position = new Rect(position.x + 54, position.y + 18, Mathf.Min(position.width - 54, 100), 16); switch (property.propertyType) { case SerializedPropertyType.ObjectReference: @@ -139,7 +139,7 @@ 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; + EditorGUIUtility.labelWidth = 180; expanded = EditorGUI.ToggleLeft(position, label, expanded == true); } @@ -161,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; } @@ -183,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/ToggleLeftDrawer.cs b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs index 2a6e5ae51..c0c456bc4 100644 --- a/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs +++ b/Source/Assets/TouchScript/Editor/Utils/PropertyDrawers/ToggleLeftDrawer.cs @@ -24,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 aa5a1ebbd..6ced9e1d4 100644 --- a/Source/Assets/TouchScript/Examples/Camera/Camera.unity +++ b/Source/Assets/TouchScript/Examples/Camera/Camera.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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 @@ -113,10 +136,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -11.64} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1462230477} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -168,6 +191,8 @@ Camera: 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 @@ -177,10 +202,10 @@ 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 @@ -197,12 +222,12 @@ 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: 746517019} - {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} @@ -231,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 @@ -252,10 +277,10 @@ 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: 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} @@ -299,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 @@ -330,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 @@ -339,7 +366,6 @@ 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: 624081475} @@ -347,6 +373,7 @@ 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} @@ -357,12 +384,12 @@ 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 @@ -379,10 +406,10 @@ 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: 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} @@ -486,20 +513,12 @@ 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] value: objectReference: {fileID: 930800605} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 100002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 @@ -508,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 @@ -528,12 +547,12 @@ 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: 1541924794} - {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} @@ -562,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 @@ -583,12 +602,12 @@ 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} 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} @@ -622,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 @@ -631,6 +650,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -639,11 +659,11 @@ 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 @@ -660,10 +680,10 @@ 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: 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} @@ -707,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 @@ -731,13 +751,13 @@ 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: 1462230477} - {fileID: 2072767614} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &930800602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -749,17 +769,40 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74ae431eff8434b0897d3f7f1cff4311, type: 3} m_Name: m_EditorClassIdentifier: - debugMode: 1 + 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 minPointers: 1 maxPointers: 1 - 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.05 minScreenPointsDistance: 0.5 @@ -819,17 +862,40 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74ae431eff8434b0897d3f7f1cff4311, type: 3} m_Name: m_EditorClassIdentifier: - debugMode: 1 + 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 minPointers: 2 maxPointers: 10 - 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 screenTransformThreshold: 0.2 minScreenPointsDistance: 0.5 @@ -838,11 +904,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 @@ -859,10 +925,10 @@ 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 + 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} @@ -906,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 @@ -928,10 +994,10 @@ 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: 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} @@ -995,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 @@ -1017,10 +1083,10 @@ 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_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} @@ -1086,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 @@ -1105,21 +1171,21 @@ 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: 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 @@ -1136,10 +1202,10 @@ 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: 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} @@ -1183,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 @@ -1205,10 +1271,10 @@ 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_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} @@ -1279,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 @@ -1299,12 +1365,12 @@ 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} 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} @@ -1333,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 @@ -1355,10 +1421,10 @@ 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: 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} @@ -1422,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 @@ -1456,10 +1522,10 @@ 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1867657389 Prefab: m_ObjectHideFlags: 0 @@ -1499,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 @@ -1507,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 @@ -1527,12 +1597,12 @@ 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: 242343086} - {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} @@ -1561,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 @@ -1580,11 +1650,11 @@ 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_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} @@ -1595,12 +1665,12 @@ 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 @@ -1617,22 +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_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: @@ -1662,19 +1738,19 @@ Transform: 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.296496, y: 4.296493, z: 4.296493} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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 @@ -1691,10 +1767,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -1702,7 +1778,7 @@ 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.3 @@ -1712,6 +1788,7 @@ Light: m_Shadows: m_Type: 1 m_Resolution: 3 + m_CustomResolution: -1 m_Strength: 0.185 m_Bias: 0.1 m_NormalBias: 0.4 @@ -1724,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 b080cc30d..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: "2" + userData: "3" diff --git a/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs b/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs index 73938a3e4..72874fd94 100644 --- a/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs +++ b/Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs @@ -7,9 +7,7 @@ namespace TouchScript.Examples.CameraControl { - /// - /// This component controls camera movement. - /// + /// public class CameraController : MonoBehaviour { public ScreenTransformGesture TwoFingerMoveGesture; @@ -41,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 1e476ecba..a74b7ad80 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity +++ b/Source/Assets/TouchScript/Examples/Checkers/Checkers.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + serializedVersion: 9 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,37 +54,59 @@ 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 manualCellSize: 0 + cellSize: 0.16666666 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &12619638 stripped GameObject: @@ -144,14 +167,14 @@ 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 @@ -168,10 +191,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 31.264, y: 0, z: 0} 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 @@ -184,7 +207,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -244,6 +269,8 @@ Camera: 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 @@ -257,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 @@ -278,10 +305,10 @@ 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: 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} @@ -325,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 @@ -356,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 @@ -365,13 +394,13 @@ 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: 1962593004} - {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} @@ -488,37 +517,9 @@ Prefab: propertyPath: layers.Array.data[0] value: objectReference: {fileID: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - 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 - windows8API: 0 - windows7API: 0 - webPlayerTouch: 1 - webGLTouch: 1 - windows8Mouse: 1 - windows7Mouse: 1 - universalWindowsMouse: 1 - emulateSecondMousePointer: 1 --- !u!1001 &556842199 Prefab: m_ObjectHideFlags: 0 @@ -812,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 @@ -840,10 +843,10 @@ 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: 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} @@ -911,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 @@ -932,12 +935,12 @@ 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} 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} @@ -971,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 @@ -980,6 +983,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -1076,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 @@ -1096,12 +1100,12 @@ 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: 900258188} - {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} @@ -1134,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 @@ -1155,10 +1159,10 @@ 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: 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.77, y: 0} @@ -1275,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 @@ -1295,7 +1299,6 @@ 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} @@ -1303,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 @@ -1432,11 +1436,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 @@ -1453,10 +1457,10 @@ 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 + 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} @@ -1560,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 @@ -1588,10 +1594,10 @@ 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: 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} @@ -1699,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 @@ -1721,10 +1727,10 @@ 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_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} @@ -1911,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 @@ -1933,10 +1939,10 @@ 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_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} @@ -2110,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 @@ -2130,12 +2136,12 @@ 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} 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} @@ -2210,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 @@ -2244,10 +2250,10 @@ 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1766364327 Prefab: m_ObjectHideFlags: 0 @@ -2306,18 +2312,6 @@ MonoBehaviour: 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!114 &1841925477 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} @@ -2392,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 @@ -2412,12 +2406,12 @@ 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: 242343086} - {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} @@ -2534,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 @@ -2553,11 +2547,11 @@ 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_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} @@ -2572,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 @@ -2598,19 +2592,42 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, type: 3} m_Name: m_EditorClassIdentifier: - debugMode: 1 + 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 - 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: 0.1 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &2027571737 @@ -2634,12 +2651,12 @@ 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: 2041409367} - {fileID: 2130344072} m_Father: {fileID: 930800601} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &2027571740 MeshRenderer: m_ObjectHideFlags: 0 @@ -2650,22 +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_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: @@ -2680,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 @@ -2703,10 +2726,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 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: 2027571738} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &2041409368 BoxCollider: m_ObjectHideFlags: 0 @@ -2730,22 +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_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: @@ -2821,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 @@ -2840,7 +2869,6 @@ 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: 1423153197} - {fileID: 868514750} @@ -2860,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 @@ -2885,10 +2914,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -2896,7 +2925,7 @@ 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.3 @@ -2906,6 +2935,7 @@ Light: m_Shadows: m_Type: 2 m_Resolution: 3 + m_CustomResolution: -1 m_Strength: 0.56 m_Bias: 0.1 m_NormalBias: 0.4 @@ -2918,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 35dcd603c..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: "4" + userData: "5" diff --git a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs index 8b8aee113..8355c9702 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs +++ b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Board.cs @@ -7,6 +7,7 @@ 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 dd94ceb07..559eb97dc 100644 --- a/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs +++ b/Source/Assets/TouchScript/Examples/Checkers/Scripts/Exclusive.cs @@ -9,6 +9,7 @@ namespace TouchScript.Examples.Checkers { + /// public class Exclusive : MonoBehaviour, IGestureDelegate { public TransformGesture Target; @@ -27,7 +28,7 @@ private void Awake() private void Update() { - if (UnityEngine.Input.GetKey(KeyCode.Space)) + if (Input.GetKey(KeyCode.Space)) { exclusive = true; cachedRenderer.material.SetColor("_SpecColor", Color); diff --git a/Source/Assets/TouchScript/Examples/Colors/Colors.unity b/Source/Assets/TouchScript/Examples/Colors/Colors.unity index 7c3e45486..cd5edaf6a 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Colors.unity +++ b/Source/Assets/TouchScript/Examples/Colors/Colors.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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 @@ -114,10 +137,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -10} 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -130,7 +153,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 0 hit2DObjects: 1 hitWorldSpaceUI: 0 @@ -190,6 +215,8 @@ Camera: 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 @@ -199,9 +226,9 @@ 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 @@ -218,19 +245,19 @@ 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: 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 @@ -258,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 @@ -267,12 +296,12 @@ 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: 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} @@ -317,58 +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} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - 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 - windows8API: 0 - windows7API: 0 - webPlayerTouch: 1 - webGLTouch: 1 - windows8Mouse: 1 - windows7Mouse: 1 - universalWindowsMouse: 1 - emulateSecondMousePointer: 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 @@ -385,12 +382,12 @@ 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: 2046579559} - {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} @@ -419,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,12 +437,12 @@ 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} 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} @@ -479,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 @@ -488,6 +485,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -496,10 +494,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 @@ -516,12 +514,12 @@ 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: 62216952} - {fileID: 68250097} m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &930800602 MonoBehaviour: m_ObjectHideFlags: 0 @@ -540,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 @@ -562,10 +560,10 @@ 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: 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} @@ -629,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 @@ -650,10 +648,10 @@ 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 + 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} @@ -697,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 @@ -719,10 +717,10 @@ 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_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} @@ -788,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 @@ -810,10 +808,10 @@ 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_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} @@ -884,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 @@ -904,12 +902,12 @@ 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} 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} @@ -938,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 @@ -972,10 +970,10 @@ 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -1003,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 @@ -1022,11 +1020,11 @@ 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_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} @@ -1037,11 +1035,11 @@ 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 @@ -1058,10 +1056,10 @@ 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: 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} 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 0c0248370..8f1196083 100644 --- a/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs +++ b/Source/Assets/TouchScript/Examples/Colors/Scripts/Circle.cs @@ -8,6 +8,7 @@ namespace TouchScript.Examples.Colors { + /// public class Circle : MonoBehaviour { private bool isDestroyed = false; @@ -35,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 0e64d6a14..d2e80c837 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Cube.unity +++ b/Source/Assets/TouchScript/Examples/Cube/Cube.unity @@ -131,6 +131,7 @@ MonoBehaviour: m_EditorClassIdentifier: Name: Camera advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -346,42 +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: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} + 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 - windows8API: 0 - windows7API: 0 - webPlayerTouch: 1 - webGLTouch: 1 - windows8Mouse: 1 - windows7Mouse: 1 - universalWindowsMouse: 1 - emulateSecondMousePointer: 1 --- !u!1 &732284827 GameObject: m_ObjectHideFlags: 0 @@ -765,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 @@ -776,7 +755,13 @@ MonoBehaviour: 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 @@ -785,11 +770,29 @@ MonoBehaviour: 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 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!1 &1138005899 @@ -993,6 +996,7 @@ MonoBehaviour: m_EditorClassIdentifier: Name: RenderTexture Camera advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -1307,7 +1311,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3fd90a8856e1a49eba25728d5aaac9f2, 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 @@ -1316,6 +1326,8 @@ MonoBehaviour: useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] --- !u!23 &1880100170 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/Scripts/CustomPointerProxy.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs index f27d32b6d..3fe57c913 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/CustomPointerProxy.cs @@ -2,15 +2,18 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Behaviors.Cursors; using TouchScript.Pointers; -namespace TouchScript.Examples.Cube +namespace TouchScript.Examples.Cube { - public class CustomPointerProxy : Behaviors.Visualizer.PointerProxy + /// + public class CustomPointerProxy : PointerCursor { - protected override void updateOnce(Pointer pointer) { + protected override void updateOnce(IPointer pointer) + { if (pointer.InputSource is RedirectInput) Hide(); - + base.updateOnce(pointer); } } diff --git a/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs b/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs index 9803930bd..4afc392b7 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/Init.cs @@ -5,16 +5,18 @@ 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("Scene Camera"); + 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 d11bc2887..4c0762420 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs @@ -9,17 +9,17 @@ namespace TouchScript.Examples.Cube { + /// public class LayerDelegate : MonoBehaviour, ILayerDelegate { - public RedirectInput Source; public TouchLayer RenderTextureLayer; public bool ShouldReceivePointer(TouchLayer layer, IPointer pointer) { if (layer == RenderTextureLayer) - return pointer.InputSource == (IInputSource)Source; - return pointer.InputSource != (IInputSource)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 35628311b..cd87ed47f 100644 --- a/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs +++ b/Source/Assets/TouchScript/Examples/Cube/Scripts/RedirectInput.cs @@ -12,9 +12,9 @@ namespace TouchScript.Examples.Cube { + /// public class RedirectInput : InputSource { - public int Width = 512; public int Height = 512; @@ -39,7 +39,7 @@ public override bool CancelPointer(Pointer pointer, bool shouldReturn) map.Add(pointer.Id, newPointer); } } - return true; + return true; } protected override void OnEnable() @@ -76,12 +76,12 @@ private Vector2 processCoords(Vector2 value) private void pointerPressedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { var pointer = metaGestureEventArgs.Pointer; - if (pointer.InputSource == (IInputSource)this) return; + 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; + newPointer.Flags = pointer.Flags | Pointer.FLAG_ARTIFICIAL | Pointer.FLAG_INTERNAL; addPointer(newPointer); pressPointer(newPointer); map.Add(pointer.Id, newPointer); @@ -89,9 +89,9 @@ private void pointerPressedHandler(object sender, MetaGestureEventArgs metaGestu private void pointerUpdatedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { - var pointer = metaGestureEventArgs.Pointer; + var pointer = metaGestureEventArgs.Pointer; - if (pointer.InputSource == (IInputSource)this) return; + if (pointer.InputSource == (IInputSource) this) return; Pointer newPointer; if (!map.TryGetValue(pointer.Id, out newPointer)) return; @@ -105,7 +105,7 @@ private void pointerUpdatedHandler(object sender, MetaGestureEventArgs metaGestu private void pointerReleasedHandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { var pointer = metaGestureEventArgs.Pointer; - if (pointer.InputSource == (IInputSource)this) return; + if (pointer.InputSource == (IInputSource) this) return; Pointer newPointer; if (!map.TryGetValue(pointer.Id, out newPointer)) return; @@ -117,14 +117,12 @@ private void pointerReleasedHandler(object sender, MetaGestureEventArgs metaGest private void pointerCancelledhandler(object sender, MetaGestureEventArgs metaGestureEventArgs) { var pointer = metaGestureEventArgs.Pointer; - if (pointer.InputSource == (IInputSource)this) return; + 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 f6e0f851d..e68c675ed 100644 --- a/Source/Assets/TouchScript/Examples/Examples.unity +++ b/Source/Assets/TouchScript/Examples/Examples.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 15691938} - - 222: {fileID: 15691940} - - 114: {fileID: 15691939} + - component: {fileID: 15691938} + - component: {fileID: 15691940} + - component: {fileID: 15691939} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -111,10 +134,10 @@ 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: 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} @@ -165,11 +188,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 16824282} - - 222: {fileID: 16824284} - - 114: {fileID: 16824283} + - component: {fileID: 16824282} + - component: {fileID: 16824284} + - component: {fileID: 16824283} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -186,10 +209,10 @@ 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: 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} @@ -239,10 +262,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 37557109} - - 114: {fileID: 37557110} + - component: {fileID: 37557109} + - component: {fileID: 37557110} m_Layer: 5 m_Name: Examples m_TagString: Untagged @@ -259,12 +282,12 @@ 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: 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} @@ -287,13 +310,13 @@ 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 @@ -310,10 +333,10 @@ 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!81 &62216954 AudioListener: m_ObjectHideFlags: 0 @@ -365,6 +388,8 @@ Camera: 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 @@ -374,13 +399,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 96104532} - - 222: {fileID: 96104536} - - 114: {fileID: 96104535} - - 114: {fileID: 96104534} - - 114: {fileID: 96104533} + - component: {fileID: 96104532} + - component: {fileID: 96104536} + - component: {fileID: 96104535} + - component: {fileID: 96104534} + - component: {fileID: 96104533} m_Layer: 5 m_Name: Previous m_TagString: Untagged @@ -397,11 +422,11 @@ 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: 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} @@ -515,10 +540,10 @@ 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 @@ -549,21 +574,21 @@ 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: 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 201561627} - - 222: {fileID: 201561630} - - 114: {fileID: 201561629} - - 114: {fileID: 201561628} + - component: {fileID: 201561627} + - component: {fileID: 201561630} + - component: {fileID: 201561629} + - component: {fileID: 201561628} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -580,10 +605,10 @@ 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: 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} @@ -690,11 +715,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 299753859} - - 222: {fileID: 299753861} - - 114: {fileID: 299753860} + - component: {fileID: 299753859} + - component: {fileID: 299753861} + - component: {fileID: 299753860} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -711,10 +736,10 @@ 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: 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} @@ -758,12 +783,12 @@ 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: 309713871} + - component: {fileID: 309713874} + - component: {fileID: 309713873} + - component: {fileID: 309713872} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -780,10 +805,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -847,12 +872,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 321008078} - - 222: {fileID: 321008081} - - 114: {fileID: 321008080} - - 114: {fileID: 321008079} + - component: {fileID: 321008078} + - component: {fileID: 321008081} + - component: {fileID: 321008080} + - component: {fileID: 321008079} m_Layer: 5 m_Name: Portal m_TagString: Untagged @@ -869,14 +894,14 @@ 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: 1449561975} - {fileID: 1241691652} - {fileID: 1894139120} - {fileID: 329812103} m_Father: {fileID: 2098255038} - m_RootOrder: 6 + 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} @@ -938,11 +963,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 329812103} - - 222: {fileID: 329812105} - - 114: {fileID: 329812104} + - component: {fileID: 329812103} + - component: {fileID: 329812105} + - component: {fileID: 329812104} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -959,10 +984,10 @@ 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: 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} @@ -1006,12 +1031,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 341179473} - - 222: {fileID: 341179476} - - 114: {fileID: 341179475} - - 114: {fileID: 341179474} + - component: {fileID: 341179473} + - component: {fileID: 341179476} + - component: {fileID: 341179475} + - component: {fileID: 341179474} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -1028,10 +1053,10 @@ 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: 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} @@ -1138,12 +1163,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 357107825} - - 222: {fileID: 357107828} - - 114: {fileID: 357107827} - - 114: {fileID: 357107826} + - component: {fileID: 357107825} + - component: {fileID: 357107828} + - component: {fileID: 357107827} + - component: {fileID: 357107826} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -1160,10 +1185,10 @@ 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: 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} @@ -1227,12 +1252,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 363049655} - - 222: {fileID: 363049658} - - 114: {fileID: 363049657} - - 114: {fileID: 363049656} + - component: {fileID: 363049655} + - component: {fileID: 363049658} + - component: {fileID: 363049657} + - component: {fileID: 363049656} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -1249,10 +1274,10 @@ 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: 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} @@ -1359,11 +1384,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 385551183} - - 222: {fileID: 385551185} - - 114: {fileID: 385551184} + - component: {fileID: 385551183} + - component: {fileID: 385551185} + - component: {fileID: 385551184} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1380,10 +1405,10 @@ 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: 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} @@ -1433,12 +1458,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 406504771} - - 222: {fileID: 406504774} - - 114: {fileID: 406504773} - - 114: {fileID: 406504772} + - component: {fileID: 406504771} + - component: {fileID: 406504774} + - component: {fileID: 406504773} + - component: {fileID: 406504772} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -1455,10 +1480,10 @@ 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: 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} @@ -1565,11 +1590,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 452970292} - - 222: {fileID: 452970294} - - 114: {fileID: 452970293} + - component: {fileID: 452970292} + - component: {fileID: 452970294} + - component: {fileID: 452970293} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1586,10 +1611,10 @@ 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: 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} @@ -1633,12 +1658,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 507770921} - - 222: {fileID: 507770920} - - 114: {fileID: 507770919} - - 114: {fileID: 507770918} + - component: {fileID: 507770921} + - component: {fileID: 507770920} + - component: {fileID: 507770919} + - component: {fileID: 507770918} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -1708,10 +1733,10 @@ 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: 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} @@ -1722,11 +1747,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 558528359} - - 222: {fileID: 558528361} - - 114: {fileID: 558528360} + - component: {fileID: 558528359} + - component: {fileID: 558528361} + - component: {fileID: 558528360} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1743,10 +1768,10 @@ 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: 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} @@ -1790,12 +1815,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 574950114} - - 222: {fileID: 574950117} - - 114: {fileID: 574950116} - - 114: {fileID: 574950115} + - component: {fileID: 574950114} + - component: {fileID: 574950117} + - component: {fileID: 574950116} + - component: {fileID: 574950115} m_Layer: 5 m_Name: Taps m_TagString: Untagged @@ -1812,14 +1837,14 @@ 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: 1800191864} - {fileID: 745674114} - {fileID: 341179473} - {fileID: 865431078} m_Father: {fileID: 2098255038} - 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} @@ -1881,11 +1906,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 595145115} - - 222: {fileID: 595145117} - - 114: {fileID: 595145116} + - component: {fileID: 595145115} + - component: {fileID: 595145117} + - component: {fileID: 595145116} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -1902,10 +1927,10 @@ 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: 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} @@ -1956,12 +1981,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 601448587} - - 222: {fileID: 601448590} - - 114: {fileID: 601448589} - - 114: {fileID: 601448588} + - component: {fileID: 601448587} + - component: {fileID: 601448590} + - component: {fileID: 601448589} + - component: {fileID: 601448588} m_Layer: 5 m_Name: Raw Input m_TagString: Untagged @@ -1978,14 +2003,14 @@ 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: 1260024592} - {fileID: 595145115} - {fileID: 2001542684} - {fileID: 2073758707} m_Father: {fileID: 2098255038} - m_RootOrder: 8 + 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} @@ -2047,12 +2072,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 606054179} - - 114: {fileID: 606054182} - - 222: {fileID: 606054181} - - 114: {fileID: 606054180} + - component: {fileID: 606054179} + - component: {fileID: 606054182} + - component: {fileID: 606054181} + - component: {fileID: 606054180} m_Layer: 5 m_Name: Viewport m_TagString: Untagged @@ -2069,11 +2094,11 @@ 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: 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} @@ -2129,12 +2154,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 621592926} - - 222: {fileID: 621592929} - - 114: {fileID: 621592928} - - 114: {fileID: 621592927} + - component: {fileID: 621592926} + - component: {fileID: 621592929} + - component: {fileID: 621592928} + - component: {fileID: 621592927} m_Layer: 5 m_Name: Cube m_TagString: Untagged @@ -2151,14 +2176,14 @@ 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: 507770921} - {fileID: 749901011} - {fileID: 842217637} - {fileID: 2088901649} m_Father: {fileID: 2098255038} - m_RootOrder: 5 + 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} @@ -2220,10 +2245,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 666412329} - - 114: {fileID: 666412330} + - component: {fileID: 666412329} + - component: {fileID: 666412330} m_Layer: 5 m_Name: Buttons m_TagString: Untagged @@ -2240,13 +2265,13 @@ 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: 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} @@ -2272,16 +2297,18 @@ MonoBehaviour: 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 700544019} - - 222: {fileID: 700544021} - - 114: {fileID: 700544020} + - component: {fileID: 700544019} + - component: {fileID: 700544021} + - component: {fileID: 700544020} m_Layer: 5 m_Name: Ribbon m_TagString: Untagged @@ -2298,11 +2325,11 @@ 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: 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} @@ -2346,11 +2373,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 745674114} - - 222: {fileID: 745674116} - - 114: {fileID: 745674115} + - component: {fileID: 745674114} + - component: {fileID: 745674116} + - component: {fileID: 745674115} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -2367,10 +2394,10 @@ 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: 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} @@ -2420,11 +2447,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 749901011} - - 222: {fileID: 749901013} - - 114: {fileID: 749901012} + - component: {fileID: 749901011} + - component: {fileID: 749901013} + - component: {fileID: 749901012} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -2441,10 +2468,10 @@ 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: 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} @@ -2494,12 +2521,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 758236082} - - 222: {fileID: 758236085} - - 114: {fileID: 758236084} - - 114: {fileID: 758236083} + - component: {fileID: 758236082} + - component: {fileID: 758236085} + - component: {fileID: 758236084} + - component: {fileID: 758236083} m_Layer: 5 m_Name: Checkers m_TagString: Untagged @@ -2516,14 +2543,14 @@ 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: 1280257797} - {fileID: 16824282} - {fileID: 363049655} - {fileID: 1987127154} m_Father: {fileID: 2098255038} - m_RootOrder: 2 + 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} @@ -2585,12 +2612,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 767854197} - - 222: {fileID: 767854200} - - 114: {fileID: 767854199} - - 114: {fileID: 767854198} + - component: {fileID: 767854197} + - component: {fileID: 767854200} + - component: {fileID: 767854199} + - component: {fileID: 767854198} m_Layer: 5 m_Name: Close m_TagString: Untagged @@ -2607,10 +2634,10 @@ 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: 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} @@ -2706,12 +2733,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 801696179} - - 222: {fileID: 801696182} - - 114: {fileID: 801696181} - - 114: {fileID: 801696180} + - component: {fileID: 801696179} + - component: {fileID: 801696182} + - component: {fileID: 801696181} + - component: {fileID: 801696180} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -2728,10 +2755,10 @@ 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: 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} @@ -2790,17 +2817,106 @@ CanvasRenderer: 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 842217637} - - 222: {fileID: 842217640} - - 114: {fileID: 842217639} - - 114: {fileID: 842217638} + - component: {fileID: 842217637} + - component: {fileID: 842217640} + - component: {fileID: 842217639} + - component: {fileID: 842217638} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -2817,10 +2933,10 @@ 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: 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} @@ -2927,11 +3043,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 865431078} - - 222: {fileID: 865431080} - - 114: {fileID: 865431079} + - component: {fileID: 865431078} + - component: {fileID: 865431080} + - component: {fileID: 865431079} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -2948,10 +3064,10 @@ 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: 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} @@ -2995,12 +3111,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 870787322} - - 222: {fileID: 870787325} - - 114: {fileID: 870787324} - - 114: {fileID: 870787323} + - component: {fileID: 870787322} + - component: {fileID: 870787325} + - component: {fileID: 870787324} + - component: {fileID: 870787323} m_Layer: 5 m_Name: Camera m_TagString: Untagged @@ -3017,14 +3133,14 @@ 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: 879805661} - {fileID: 1030186641} - {fileID: 201561627} - {fileID: 452970292} m_Father: {fileID: 2098255038} - m_RootOrder: 1 + 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} @@ -3086,12 +3202,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 879805661} - - 222: {fileID: 879805664} - - 114: {fileID: 879805663} - - 114: {fileID: 879805662} + - component: {fileID: 879805661} + - component: {fileID: 879805664} + - component: {fileID: 879805663} + - component: {fileID: 879805662} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -3108,10 +3224,10 @@ 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: 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} @@ -3175,12 +3291,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 962873577} - - 222: {fileID: 962873580} - - 114: {fileID: 962873579} - - 114: {fileID: 962873578} + - component: {fileID: 962873577} + - component: {fileID: 962873580} + - component: {fileID: 962873579} + - component: {fileID: 962873578} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -3197,10 +3313,10 @@ 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: 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} @@ -3307,12 +3423,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1004776690} - - 222: {fileID: 1004776693} - - 114: {fileID: 1004776692} - - 114: {fileID: 1004776691} + - component: {fileID: 1004776690} + - component: {fileID: 1004776693} + - component: {fileID: 1004776692} + - component: {fileID: 1004776691} m_Layer: 5 m_Name: Multiuser m_TagString: Untagged @@ -3329,14 +3445,14 @@ 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: 2008717908} - {fileID: 385551183} - {fileID: 962873577} - {fileID: 1608867050} m_Father: {fileID: 2098255038} - m_RootOrder: 4 + 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} @@ -3398,11 +3514,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1030186641} - - 222: {fileID: 1030186643} - - 114: {fileID: 1030186642} + - component: {fileID: 1030186641} + - component: {fileID: 1030186643} + - component: {fileID: 1030186642} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -3419,10 +3535,10 @@ 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: 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} @@ -3473,12 +3589,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1037999862} - - 222: {fileID: 1037999865} - - 114: {fileID: 1037999864} - - 114: {fileID: 1037999863} + - component: {fileID: 1037999862} + - component: {fileID: 1037999865} + - component: {fileID: 1037999864} + - component: {fileID: 1037999863} m_Layer: 5 m_Name: Colors m_TagString: Untagged @@ -3495,14 +3611,14 @@ 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: 357107825} - {fileID: 15691938} - {fileID: 406504771} - {fileID: 299753859} m_Father: {fileID: 2098255038} - m_RootOrder: 7 + 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} @@ -3564,11 +3680,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1168732683} - - 222: {fileID: 1168732685} - - 114: {fileID: 1168732684} + - component: {fileID: 1168732683} + - component: {fileID: 1168732685} + - component: {fileID: 1168732684} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -3585,10 +3701,10 @@ 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: 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} @@ -3638,12 +3754,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1173809306} - - 222: {fileID: 1173809309} - - 114: {fileID: 1173809308} - - 114: {fileID: 1173809307} + - component: {fileID: 1173809306} + - component: {fileID: 1173809309} + - component: {fileID: 1173809308} + - component: {fileID: 1173809307} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -3660,10 +3776,10 @@ 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: 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} @@ -3727,11 +3843,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1241691652} - - 222: {fileID: 1241691654} - - 114: {fileID: 1241691653} + - component: {fileID: 1241691652} + - component: {fileID: 1241691654} + - component: {fileID: 1241691653} m_Layer: 5 m_Name: Description m_TagString: Untagged @@ -3748,10 +3864,10 @@ 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: 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} @@ -3801,12 +3917,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1260024592} - - 222: {fileID: 1260024595} - - 114: {fileID: 1260024594} - - 114: {fileID: 1260024593} + - component: {fileID: 1260024592} + - component: {fileID: 1260024595} + - component: {fileID: 1260024594} + - component: {fileID: 1260024593} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -3823,10 +3939,10 @@ 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: 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} @@ -3890,12 +4006,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1280257797} - - 222: {fileID: 1280257800} - - 114: {fileID: 1280257799} - - 114: {fileID: 1280257798} + - component: {fileID: 1280257797} + - component: {fileID: 1280257800} + - component: {fileID: 1280257799} + - component: {fileID: 1280257798} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -3912,10 +4028,10 @@ 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: 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} @@ -3979,12 +4095,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1317055114} - - 114: {fileID: 1317055117} - - 222: {fileID: 1317055116} - - 114: {fileID: 1317055115} + - component: {fileID: 1317055114} + - component: {fileID: 1317055117} + - component: {fileID: 1317055116} + - component: {fileID: 1317055115} m_Layer: 5 m_Name: Examples List m_TagString: Untagged @@ -4001,12 +4117,12 @@ 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: 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} @@ -4081,12 +4197,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1361172027} - - 222: {fileID: 1361172030} - - 114: {fileID: 1361172029} - - 114: {fileID: 1361172028} + - component: {fileID: 1361172027} + - component: {fileID: 1361172030} + - component: {fileID: 1361172029} + - component: {fileID: 1361172028} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -4103,10 +4219,10 @@ 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: 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} @@ -4213,12 +4329,12 @@ 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} - - 114: {fileID: 1402896515} + - component: {fileID: 1402896514} + - component: {fileID: 1402896517} + - component: {fileID: 1402896516} + - component: {fileID: 1402896515} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -4235,11 +4351,11 @@ 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: 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} @@ -4284,7 +4400,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1402896513} m_Enabled: 0 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -4293,21 +4409,90 @@ Canvas: 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1412835668} - - 222: {fileID: 1412835667} - - 114: {fileID: 1412835666} - - 114: {fileID: 1412835665} - - 114: {fileID: 1412835669} + - component: {fileID: 1412835668} + - component: {fileID: 1412835667} + - component: {fileID: 1412835666} + - component: {fileID: 1412835665} + - component: {fileID: 1412835669} m_Layer: 5 m_Name: List m_TagString: Untagged @@ -4409,11 +4594,11 @@ 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: 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} @@ -4442,12 +4627,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1449561975} - - 222: {fileID: 1449561978} - - 114: {fileID: 1449561977} - - 114: {fileID: 1449561976} + - component: {fileID: 1449561975} + - component: {fileID: 1449561978} + - component: {fileID: 1449561977} + - component: {fileID: 1449561976} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -4464,10 +4649,10 @@ 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: 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} @@ -4531,12 +4716,12 @@ 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} - - 114: {fileID: 1487808227} + - component: {fileID: 1487808224} + - component: {fileID: 1487808226} + - component: {fileID: 1487808225} + - component: {fileID: 1487808227} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -4553,10 +4738,10 @@ 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: 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} @@ -4615,36 +4800,242 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.297} m_EffectDistance: {x: 1, y: -1} m_UseGraphicAlpha: 1 ---- !u!1 &1608867049 +--- !u!1 &1562323887 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1608867050} - - 222: {fileID: 1608867052} - - 114: {fileID: 1608867051} + - component: {fileID: 1562323888} + - component: {fileID: 1562323890} + - component: {fileID: 1562323889} m_Layer: 5 - m_Name: Image + m_Name: Description m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1608867050 +--- !u!224 &1562323888 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1608867049} + 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} @@ -4688,11 +5079,11 @@ 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} + - component: {fileID: 1654745587} + - component: {fileID: 1654745588} + - component: {fileID: 1654745589} m_Layer: 0 m_Name: Examples m_TagString: Untagged @@ -4709,12 +5100,12 @@ 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: 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 @@ -4738,7 +5129,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: ScreenSpace UI Layer + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 0 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -4752,13 +5145,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1778454010} - - 222: {fileID: 1778454014} - - 114: {fileID: 1778454013} - - 114: {fileID: 1778454012} - - 114: {fileID: 1778454011} + - component: {fileID: 1778454010} + - component: {fileID: 1778454014} + - component: {fileID: 1778454013} + - component: {fileID: 1778454012} + - component: {fileID: 1778454011} m_Layer: 5 m_Name: Next m_TagString: Untagged @@ -4775,11 +5168,11 @@ 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: 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} @@ -4893,12 +5286,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1784197137} - - 222: {fileID: 1784197140} - - 114: {fileID: 1784197139} - - 114: {fileID: 1784197138} + - component: {fileID: 1784197137} + - component: {fileID: 1784197140} + - component: {fileID: 1784197139} + - component: {fileID: 1784197138} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -4915,10 +5308,10 @@ 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: 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} @@ -4982,12 +5375,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1800191864} - - 222: {fileID: 1800191867} - - 114: {fileID: 1800191866} - - 114: {fileID: 1800191865} + - component: {fileID: 1800191864} + - component: {fileID: 1800191867} + - component: {fileID: 1800191866} + - component: {fileID: 1800191865} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -5004,10 +5397,10 @@ 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: 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} @@ -5071,12 +5464,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1894139120} - - 222: {fileID: 1894139123} - - 114: {fileID: 1894139122} - - 114: {fileID: 1894139121} + - component: {fileID: 1894139120} + - component: {fileID: 1894139123} + - component: {fileID: 1894139122} + - component: {fileID: 1894139121} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -5093,10 +5486,10 @@ 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: 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} @@ -5198,17 +5591,108 @@ CanvasRenderer: 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: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1924054934} - - 222: {fileID: 1924054937} - - 114: {fileID: 1924054936} - - 114: {fileID: 1924054935} + - component: {fileID: 1924054934} + - component: {fileID: 1924054937} + - component: {fileID: 1924054936} + - component: {fileID: 1924054935} m_Layer: 5 m_Name: Examples m_TagString: Untagged @@ -5225,10 +5709,10 @@ 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: 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} @@ -5292,11 +5776,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1987127154} - - 222: {fileID: 1987127156} - - 114: {fileID: 1987127155} + - component: {fileID: 1987127154} + - component: {fileID: 1987127156} + - component: {fileID: 1987127155} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -5313,10 +5797,10 @@ 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: 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} @@ -5360,12 +5844,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2001542684} - - 222: {fileID: 2001542687} - - 114: {fileID: 2001542686} - - 114: {fileID: 2001542685} + - component: {fileID: 2001542684} + - component: {fileID: 2001542687} + - component: {fileID: 2001542686} + - component: {fileID: 2001542685} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -5382,10 +5866,10 @@ 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: 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} @@ -5492,12 +5976,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2008717908} - - 222: {fileID: 2008717911} - - 114: {fileID: 2008717910} - - 114: {fileID: 2008717909} + - component: {fileID: 2008717908} + - component: {fileID: 2008717911} + - component: {fileID: 2008717910} + - component: {fileID: 2008717909} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -5514,10 +5998,10 @@ 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: 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: 33.699997, y: 21.6} @@ -5581,12 +6065,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2032927211} - - 223: {fileID: 2032927214} - - 114: {fileID: 2032927213} - - 114: {fileID: 2032927212} + - component: {fileID: 2032927211} + - component: {fileID: 2032927214} + - component: {fileID: 2032927213} + - component: {fileID: 2032927212} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -5603,12 +6087,12 @@ 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: 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} @@ -5658,7 +6142,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2032927210} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -5667,6 +6151,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -5675,11 +6160,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2073758707} - - 222: {fileID: 2073758709} - - 114: {fileID: 2073758708} + - component: {fileID: 2073758707} + - component: {fileID: 2073758709} + - component: {fileID: 2073758708} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -5696,10 +6181,10 @@ 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: 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} @@ -5743,12 +6228,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2076713667} - - 222: {fileID: 2076713670} - - 114: {fileID: 2076713669} - - 114: {fileID: 2076713668} + - component: {fileID: 2076713667} + - component: {fileID: 2076713670} + - component: {fileID: 2076713669} + - component: {fileID: 2076713668} m_Layer: 5 m_Name: Photos m_TagString: Untagged @@ -5765,7 +6250,6 @@ 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: 801696179} - {fileID: 1168732683} @@ -5773,6 +6257,7 @@ RectTransform: - {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} @@ -5834,11 +6319,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2088901649} - - 222: {fileID: 2088901651} - - 114: {fileID: 2088901650} + - component: {fileID: 2088901649} + - component: {fileID: 2088901651} + - component: {fileID: 2088901650} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -5855,10 +6340,10 @@ 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: 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} @@ -5902,10 +6387,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2098255038} - - 114: {fileID: 2098255039} + - component: {fileID: 2098255038} + - component: {fileID: 2098255039} m_Layer: 5 m_Name: Content m_TagString: Untagged @@ -5922,23 +6407,24 @@ 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: 601448587} - {fileID: 574950114} - {fileID: 870787322} - - {fileID: 758236082} - {fileID: 2076713667} - - {fileID: 1004776690} - - {fileID: 621592926} + - {fileID: 758236082} - {fileID: 321008078} - {fileID: 1037999862} - - {fileID: 601448587} + - {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: 734} + m_SizeDelta: {x: 0, y: 815} m_Pivot: {x: 0, y: 1} --- !u!114 &2098255039 MonoBehaviour: @@ -5960,3 +6446,5 @@ MonoBehaviour: m_Spacing: 2 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 diff --git a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity index be61f342d..a208c35ad 100644 --- a/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity +++ b/Source/Assets/TouchScript/Examples/Multiuser/Multiuser.unity @@ -728,7 +728,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, 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 @@ -737,8 +743,15 @@ MonoBehaviour: 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 @@ -939,7 +952,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, 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 @@ -948,8 +967,15 @@ MonoBehaviour: 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 @@ -1074,37 +1100,9 @@ Prefab: propertyPath: layers.Array.data[4] value: objectReference: {fileID: 2041906757} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - 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 - windows8API: 0 - windows7API: 0 - webPlayerTouch: 1 - webGLTouch: 1 - windows8Mouse: 1 - windows7Mouse: 1 - universalWindowsMouse: 1 - emulateSecondMousePointer: 1 --- !u!1001 &583512110 Prefab: m_ObjectHideFlags: 0 @@ -1394,7 +1392,13 @@ MonoBehaviour: 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 @@ -1403,11 +1407,29 @@ MonoBehaviour: 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: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!4 &739470077 stripped @@ -1670,6 +1692,7 @@ MonoBehaviour: m_EditorClassIdentifier: Name: Right 3D Camera advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -2000,7 +2023,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, 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 @@ -2009,8 +2038,15 @@ MonoBehaviour: 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 @@ -2160,7 +2196,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, 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 @@ -2169,10 +2211,28 @@ MonoBehaviour: 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: 0.05 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1164346784 @@ -2632,7 +2692,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38e07bff8743d4ee38bf724a7a2b4cbb, 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 @@ -2641,10 +2707,28 @@ MonoBehaviour: 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: 0.05 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1388179444 @@ -2837,6 +2921,7 @@ MonoBehaviour: m_EditorClassIdentifier: Name: 2D Camera advancedProps: 0 + hitProps: 0 hit3DObjects: 0 hit2DObjects: 1 hitWorldSpaceUI: 0 @@ -3557,6 +3642,7 @@ MonoBehaviour: m_EditorClassIdentifier: Name: Left 3D Camera advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -3643,7 +3729,13 @@ MonoBehaviour: 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 @@ -3652,11 +3744,29 @@ MonoBehaviour: 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: 0 projectionPlaneNormal: {x: 0, y: 0, z: 1} --- !u!1001 &2057195942 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 79d8a9d36..98d433d84 100644 --- a/Source/Assets/TouchScript/Examples/Photos/Photos.unity +++ b/Source/Assets/TouchScript/Examples/Photos/Photos.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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: 0.5 m_FlareStrength: 1 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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: [] @@ -144,10 +167,10 @@ 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: 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} @@ -158,14 +181,14 @@ 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 @@ -182,10 +205,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 32.96, y: -45, z: 0} 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 @@ -198,7 +221,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: Main Camera + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 0 hit2DObjects: 0 hitWorldSpaceUI: 1 @@ -258,6 +283,8 @@ Camera: 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 @@ -267,12 +294,12 @@ 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} + - component: {fileID: 94606778} + - component: {fileID: 94606781} + - component: {fileID: 94606780} + - component: {fileID: 94606779} m_Layer: 0 m_Name: Add Button m_TagString: Untagged @@ -289,12 +316,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 346878481} - {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: 0.6024834, y: 0.31418145} m_AnchoredPosition: {x: 7, y: 4.5} @@ -390,11 +417,11 @@ 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 @@ -411,10 +438,10 @@ 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: 2107589903} m_RootOrder: 0 + 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} @@ -433,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: [] @@ -458,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 @@ -479,10 +506,10 @@ 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: 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} @@ -501,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: [] @@ -526,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 @@ -547,10 +574,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -59} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -569,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: [] @@ -600,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 @@ -622,7 +649,6 @@ 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: 411870819} - {fileID: 1406281477} @@ -630,6 +656,7 @@ RectTransform: - {fileID: 701351979} m_Father: {fileID: 2107589903} m_RootOrder: 1 + 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.5} @@ -655,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 @@ -668,7 +697,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.392} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -693,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 @@ -715,11 +744,11 @@ 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: 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} @@ -769,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 @@ -778,6 +807,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 1 m_TargetDisplay: 0 @@ -786,10 +816,10 @@ 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 @@ -806,13 +836,13 @@ 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: 620448983} - {fileID: 1169177132} - {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} @@ -838,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 @@ -900,12 +932,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 20.6555} m_Children: - {fileID: 1593048785} - {fileID: 994844643} m_Father: {fileID: 1979221409} m_RootOrder: 0 + 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} @@ -922,10 +954,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: - enableSmoothing: 0 + enableSmoothing: 1 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &238072901 @@ -939,20 +971,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &238072902 @@ -966,17 +1021,29 @@ MonoBehaviour: 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 - 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 &238072905 MonoBehaviour: @@ -995,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 @@ -1016,10 +1083,10 @@ 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: 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} @@ -1063,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 @@ -1084,10 +1151,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 25.4} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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.855} @@ -1106,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: [] @@ -1131,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 @@ -1152,10 +1219,10 @@ 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: 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} @@ -1199,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 @@ -1220,10 +1287,10 @@ 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: 94606778} m_RootOrder: 0 + 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} @@ -1242,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: [] @@ -1273,12 +1340,12 @@ 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} + - component: {fileID: 411870819} + - component: {fileID: 411870818} + - component: {fileID: 411870817} + - component: {fileID: 411870816} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -1380,12 +1447,12 @@ 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: 107321542} - {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} @@ -1396,11 +1463,11 @@ 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 @@ -1417,12 +1484,12 @@ 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: 660229293} - {fileID: 1414219394} m_Father: {fileID: 0} - m_RootOrder: 4 + 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} @@ -1456,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 @@ -1465,6 +1532,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -1473,15 +1541,15 @@ 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 @@ -1498,12 +1566,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1674922492} - {fileID: 1402680836} m_Father: {fileID: 1979221409} m_RootOrder: 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} @@ -1532,17 +1600,29 @@ MonoBehaviour: 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 - 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 &449324830 MonoBehaviour: @@ -1558,7 +1638,7 @@ MonoBehaviour: enableSmoothing: 0 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &449324831 @@ -1572,20 +1652,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &449324832 @@ -1625,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 @@ -1646,10 +1749,10 @@ 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: 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} @@ -1693,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 @@ -1718,12 +1821,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 28.7244} m_Children: - {fileID: 1065855870} - {fileID: 1772489001} m_Father: {fileID: 1979221409} m_RootOrder: 3 + 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} @@ -1752,17 +1855,29 @@ MonoBehaviour: 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 - 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 &536919391 MonoBehaviour: @@ -1778,7 +1893,7 @@ MonoBehaviour: enableSmoothing: 0 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &536919392 @@ -1792,20 +1907,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &536919393 @@ -1879,22 +2017,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: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[1] - value: - objectReference: {fileID: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[2] - value: - objectReference: {fileID: 62216953} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 @@ -1903,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 @@ -1925,10 +2055,10 @@ 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: 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} @@ -1994,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 @@ -2015,10 +2145,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -2037,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: [] @@ -2062,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 @@ -2083,10 +2213,10 @@ 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: 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} @@ -2105,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: [] @@ -2130,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 @@ -2150,12 +2280,12 @@ 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: 494057711} - {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} @@ -2184,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 @@ -2205,10 +2335,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -2227,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: [] @@ -2252,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 @@ -2272,12 +2402,12 @@ 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: 281947296} - {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} @@ -2306,11 +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} - - 114: {fileID: 651643061} + - component: {fileID: 651643064} + - component: {fileID: 651643063} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -2318,23 +2447,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &651643061 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 651643060} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 803d2abe167ae40a0957010be5cfb7d1, type: 3} - m_Name: - m_EditorClassIdentifier: - HorizontalAxis: Horizontal - VerticalAxis: Vertical - SubmitButton: Submit - CancelButton: Cancel - InputActionsPerSecond: 10 - RepeatDelay: 0.5 --- !u!114 &651643063 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2358,18 +2470,18 @@ 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: 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 @@ -2386,11 +2498,11 @@ 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: 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: 0.25263783, y: 1} m_AnchoredPosition: {x: 5, y: 50} @@ -2401,11 +2513,11 @@ 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 @@ -2422,10 +2534,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -2444,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: [] @@ -2469,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 @@ -2490,10 +2602,10 @@ 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: 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} @@ -2512,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: [] @@ -2537,12 +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} + - component: {fileID: 701351979} + - component: {fileID: 701351983} + - component: {fileID: 701351982} + - component: {fileID: 701351981} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -2559,12 +2671,12 @@ 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: 585113474} - {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} @@ -2660,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 @@ -2685,12 +2797,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 581803647} - {fileID: 1423800608} m_Father: {fileID: 1979221409} 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: 218, y: -143.99887} @@ -2707,17 +2819,29 @@ MonoBehaviour: 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 - 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 &886654114 MonoBehaviour: @@ -2730,10 +2854,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 978a486d8ecf8437cbb87e8534908895, type: 3} m_Name: m_EditorClassIdentifier: - enableSmoothing: 0 + enableSmoothing: 1 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &886654115 @@ -2747,20 +2871,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &886654117 @@ -2812,10 +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} + - component: {fileID: 894414302} + - component: {fileID: 894414306} m_Layer: 0 m_Name: Camera m_TagString: Untagged @@ -2832,10 +2979,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1292123036} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!20 &894414306 Camera: m_ObjectHideFlags: 0 @@ -2866,6 +3013,8 @@ Camera: 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 @@ -2875,12 +3024,12 @@ 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 @@ -2897,10 +3046,10 @@ 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: 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} @@ -2964,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 @@ -2983,7 +3132,6 @@ 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: 1292123036} - {fileID: 2135305920} @@ -2992,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 @@ -3018,10 +3167,10 @@ 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: 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} @@ -3040,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: [] @@ -3065,12 +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} + - component: {fileID: 994844643} + - component: {fileID: 994844647} + - component: {fileID: 994844646} + - component: {fileID: 994844645} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -3087,10 +3236,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -3186,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 @@ -3207,13 +3356,13 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.000027779} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1236964526} m_RootOrder: 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: -0.13402, y: -21.1} + 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 @@ -3229,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: [] @@ -3260,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 @@ -3281,13 +3430,13 @@ 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: 2107589903} m_RootOrder: 2 + 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.1, y: -6} + 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 @@ -3303,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: [] @@ -3334,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 @@ -3355,10 +3504,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -3377,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: [] @@ -3402,12 +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} + - component: {fileID: 1101956163} + - component: {fileID: 1101956167} + - component: {fileID: 1101956166} + - component: {fileID: 1101956165} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -3424,12 +3573,12 @@ 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: 982847340} - {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} @@ -3525,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 @@ -3545,12 +3694,12 @@ 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: 327443543} - {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} @@ -3579,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 @@ -3600,7 +3749,6 @@ RectTransform: 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: 0.6, y: 0.6, z: 0.6} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1027187498} - {fileID: 290456373} @@ -3608,6 +3756,7 @@ RectTransform: - {fileID: 1301221420} m_Father: {fileID: 204253028} m_RootOrder: 0 + 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} @@ -3626,7 +3775,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.392} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3651,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 @@ -3672,10 +3821,10 @@ 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: 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} @@ -3694,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: [] @@ -3725,12 +3874,12 @@ 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: World Space Plane m_TagString: Untagged @@ -3747,12 +3896,12 @@ 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: 1932435999} - {fileID: 894414302} m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &1292123037 MeshRenderer: m_ObjectHideFlags: 0 @@ -3762,22 +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_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: @@ -3790,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: @@ -3803,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 @@ -3824,11 +3981,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.000007119311} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -3847,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: [] @@ -3872,12 +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} + - component: {fileID: 1402680836} + - component: {fileID: 1402680840} + - component: {fileID: 1402680839} + - component: {fileID: 1402680838} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -3894,10 +4051,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -3993,12 +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} + - component: {fileID: 1406281477} + - component: {fileID: 1406281481} + - component: {fileID: 1406281480} + - component: {fileID: 1406281479} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -4015,12 +4172,12 @@ 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: 689392537} - {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} @@ -4116,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 @@ -4192,13 +4349,13 @@ 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: 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.3} + m_AnchoredPosition: {x: 156, y: 48.300003} m_SizeDelta: {x: 276, y: 68.5} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1423800607 @@ -4206,12 +4363,12 @@ 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} + - component: {fileID: 1423800608} + - component: {fileID: 1423800612} + - component: {fileID: 1423800611} + - component: {fileID: 1423800610} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -4228,10 +4385,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -4327,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 @@ -4349,10 +4506,10 @@ 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: 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} @@ -4418,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 @@ -4439,10 +4596,10 @@ 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.0000001, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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: 0.000019073486, y: 0.00004196167} @@ -4461,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: [] @@ -4485,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 @@ -4510,12 +4667,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 634725412} - {fileID: 2041974587} m_Father: {fileID: 1979221409} m_RootOrder: 4 + 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} @@ -4532,17 +4689,29 @@ MonoBehaviour: 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 - 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 &1485721905 MonoBehaviour: @@ -4558,7 +4727,7 @@ MonoBehaviour: enableSmoothing: 0 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &1485721906 @@ -4572,20 +4741,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1485721907 @@ -4637,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 @@ -4658,10 +4850,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -4680,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: [] @@ -4705,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 @@ -4726,10 +4918,10 @@ 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: 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} @@ -4748,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: [] @@ -4779,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 @@ -4800,10 +4992,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -4822,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: [] @@ -4857,12 +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} + - component: {fileID: 1772489001} + - component: {fileID: 1772489005} + - component: {fileID: 1772489004} + - component: {fileID: 1772489003} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -4879,10 +5071,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -4978,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 @@ -4999,10 +5191,10 @@ 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: 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} @@ -5021,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: [] @@ -5052,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 @@ -5074,13 +5266,13 @@ RectTransform: m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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: 0.01001} @@ -5130,7 +5322,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1932435998} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 62216957} m_PlaneDistance: 100 @@ -5139,6 +5331,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -5147,13 +5340,13 @@ 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 @@ -5170,7 +5363,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -25} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 238072899} - {fileID: 886654112} @@ -5180,6 +5372,7 @@ 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: -0.000002682209} @@ -5198,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: [] @@ -5252,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 @@ -5277,12 +5470,12 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 663465965} - {fileID: 2082518918} m_Father: {fileID: 1979221409} 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: -141, y: -231} @@ -5299,17 +5492,29 @@ MonoBehaviour: 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 - 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 &1979821163 MonoBehaviour: @@ -5325,7 +5530,7 @@ MonoBehaviour: enableSmoothing: 1 smoothingFactor: 0.0001 positionThreshold: 0.0001 - rotationThreshold: 0.01 + rotationThreshold: 0.1 scaleThreshold: 0.0001 allowChangingFromOutside: 0 --- !u!114 &1979821164 @@ -5339,20 +5544,43 @@ MonoBehaviour: 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 + basicEditor: 1 + 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: 7 screenTransformThreshold: 0.1 minScreenPointsDistance: 0.5 + projectionProps: 0 projection: 2 projectionPlaneNormal: {x: 0, y: 1, z: 0} --- !u!114 &1979821165 @@ -5404,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 @@ -5425,10 +5653,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -25} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -5447,7 +5675,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 0.09411765} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5472,12 +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} + - component: {fileID: 2041974587} + - component: {fileID: 2041974591} + - component: {fileID: 2041974590} + - component: {fileID: 2041974589} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -5494,10 +5722,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -5593,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 @@ -5614,10 +5842,10 @@ 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: 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} @@ -5636,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: [] @@ -5667,12 +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} + - component: {fileID: 2082518918} + - component: {fileID: 2082518922} + - component: {fileID: 2082518921} + - component: {fileID: 2082518920} m_Layer: 0 m_Name: Close m_TagString: Untagged @@ -5689,10 +5917,10 @@ RectTransform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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} @@ -5788,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 @@ -5810,13 +6038,13 @@ 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: 101996207} - {fileID: 187227222} - {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} @@ -5866,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 @@ -5875,6 +6103,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -5883,10 +6112,10 @@ 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 @@ -5903,10 +6132,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -5914,7 +6143,7 @@ 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.3 @@ -5924,6 +6153,7 @@ Light: m_Shadows: m_Type: 1 m_Resolution: -1 + m_CustomResolution: -1 m_Strength: 0.2 m_Bias: 0.05 m_NormalBias: 0.4 @@ -5936,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 161e2ebac..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: "3" + 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 e2096f8ba..c07cc2bdb 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Portal.unity +++ b/Source/Assets/TouchScript/Examples/Portal/Portal.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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 @@ -114,11 +137,11 @@ Transform: 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_LocalEulerAnglesHint: {x: 89.980194, y: 0, z: 0} 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 @@ -131,11 +154,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: Camera + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 - hitScreenSpaceUI: 0 + hitScreenSpaceUI: 1 layerMask: serializedVersion: 2 m_Bits: 4294967295 @@ -191,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: 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 @@ -231,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 @@ -240,225 +337,25 @@ 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: 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: 0.5, y: 0.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: -0.00000008940697, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -4.3, y: -6.06, z: 0.4} - m_LocalScale: {x: 5, y: 5, z: 5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - 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: 0.01 ---- !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_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.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: 0.5 - m_Center: {x: 0, y: 0.0000009536743, z: -0.00000023841858} ---- !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: - enableSmoothing: 0 - smoothingFactor: 0.0001 - positionThreshold: 0.0001 - rotationThreshold: 0.01 - scaleThreshold: 0.0001 - allowChangingFromOutside: 0 ---- !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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - screenTransformThreshold: 0.1 - minScreenPointsDistance: 0.5 - 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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - 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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - 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: 0.05 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 --- !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 @@ -475,12 +372,12 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 2.15, y: 0, z: 10} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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 @@ -520,105 +417,281 @@ 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: m_Enabled - value: 1 - objectReference: {fileID: 0} 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} + - 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_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_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 &740851134 + 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: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 712d87efeee01774088f382a8449caab, 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: + 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 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!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_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 &587840595 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 587840591} + 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 &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 @@ -635,10 +708,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1283428183} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &762219658 MonoBehaviour: m_ObjectHideFlags: 0 @@ -660,22 +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_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: @@ -684,448 +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.01, y: -3.64, z: 0.1} - m_LocalScale: {x: 5, y: 5, z: 5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - 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_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.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: 0.01 ---- !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: - enableSmoothing: 0 - smoothingFactor: 0.0001 - positionThreshold: 0.0001 - rotationThreshold: 0.01 - scaleThreshold: 0.0001 - allowChangingFromOutside: 0 ---- !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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - screenTransformThreshold: 0.1 - minScreenPointsDistance: 0.5 - 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: 0.5 - m_Center: {x: 0, y: -0.00000047683716, z: -0.00000023841858} ---- !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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - 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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - 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: 0.05 - 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: -0.00000008940697, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6.24, y: 6.08, z: 0.3} - m_LocalScale: {x: 5, y: 5, z: 5} + 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} - 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: 0.01 ---- !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_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &893756809 -MeshFilter: +--- !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: 0.5 - m_Center: {x: 0, y: -0.00000071525574, z: -0.00000023841858} ---- !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: - enableSmoothing: 0 - smoothingFactor: 0.0001 - positionThreshold: 0.0001 - rotationThreshold: 0.01 - scaleThreshold: 0.0001 - allowChangingFromOutside: 0 ---- !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 minPointers: 0 maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 useSendMessage: 0 sendStateChangeMessages: 0 sendMessageTarget: {fileID: 0} + useUnityEvents: 0 + sendStateChangeEvents: 0 requireGestureToFail: {fileID: 0} friendlyGestures: [] - type: 1 - screenTransformThreshold: 0.1 - minScreenPointsDistance: 0.5 - 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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!114 &893756814 -MonoBehaviour: + 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: 893756805} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c6be551879cd14d739b0188844ef2c60, type: 3} - m_Name: - m_EditorClassIdentifier: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - ignoreChildren: 0 ---- !u!54 &893756815 -Rigidbody: + m_GameObject: {fileID: 965152937} +--- !u!1 &1005780167 +GameObject: 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: 0.05 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!1 &930800600 + 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: 1005780167} + 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 &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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - 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 @@ -1142,10 +1206,10 @@ 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 + 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} @@ -1189,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 @@ -1208,225 +1272,143 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: -0, z: 1.59} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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: -0.00000008940697, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -8.32, y: 4.82, z: 0.2} - m_LocalScale: {x: 5, y: 5, z: 5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + 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: 0.01 ---- !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_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.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: 0.5 - m_Center: {x: 0, y: -0.00000047683716, z: -0.00000023841858} ---- !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: - enableSmoothing: 0 - smoothingFactor: 0.0001 - positionThreshold: 0.0001 - rotationThreshold: 0.01 - scaleThreshold: 0.0001 - allowChangingFromOutside: 0 ---- !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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - useSendMessage: 0 - sendStateChangeMessages: 0 - sendMessageTarget: {fileID: 0} - requireGestureToFail: {fileID: 0} - friendlyGestures: [] - type: 1 - screenTransformThreshold: 0.1 - minScreenPointsDistance: 0.5 - 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 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 &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: - debugMode: 0 - advancedProps: 0 - minPointers: 0 - maxPointers: 0 - combinePointers: 0 - combinePointersInterval: 0.3 - 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: 0.05 - 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 @@ -1443,12 +1425,12 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 2} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1762297559} - {fileID: 762219657} m_Father: {fileID: 498618157} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!135 &1283428184 SphereCollider: m_ObjectHideFlags: 0 @@ -1477,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 @@ -1499,10 +1481,10 @@ 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_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} @@ -1566,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 @@ -1588,14 +1570,14 @@ 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_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_AnchoredPosition: {x: 178, y: 90} + m_SizeDelta: {x: 320, y: 151} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1552723602 MonoBehaviour: @@ -1632,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 @@ -1663,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 @@ -1683,12 +1665,12 @@ 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} 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} @@ -1712,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 @@ -1751,22 +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_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: @@ -1784,19 +1919,19 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 10, y: 10, z: 10} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 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 @@ -1827,10 +1962,10 @@ 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 + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -1858,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 @@ -1877,11 +2012,11 @@ 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_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} @@ -1892,10 +2027,10 @@ 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 @@ -1912,10 +2047,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 930800601} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -1923,7 +2058,7 @@ 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.3 @@ -1933,6 +2068,7 @@ Light: m_Shadows: m_Type: 2 m_Resolution: 3 + m_CustomResolution: -1 m_Strength: 0.56 m_Bias: 0.1 m_NormalBias: 0.4 @@ -1945,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 5fde18802..b2e04a0ba 100644 --- a/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs +++ b/Source/Assets/TouchScript/Examples/Portal/Scripts/Planet.cs @@ -8,6 +8,7 @@ namespace TouchScript.Examples.Portal { + /// public class Planet : MonoBehaviour { private enum PlanetStatus @@ -48,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; @@ -59,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 922e8cd9d..a892f4c41 100644 --- a/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity +++ b/Source/Assets/TouchScript/Examples/RawInput/RawInput.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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 @@ -114,10 +137,10 @@ Transform: 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 + m_LocalEulerAnglesHint: {x: 23.6635, y: -180, z: -180} --- !u!114 &62216953 MonoBehaviour: m_ObjectHideFlags: 0 @@ -181,6 +204,8 @@ Camera: 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 @@ -190,10 +215,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 @@ -221,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 @@ -230,11 +257,11 @@ 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} 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} @@ -279,59 +306,109 @@ Prefab: propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: layers.Array.data[0] - value: + - target: {fileID: 400002, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + propertyPath: m_RootOrder + value: 0 objectReference: {fileID: 0} - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: m_Enabled + propertyPath: shouldCreateCameraLayer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + m_IsPrefabParent: 0 +--- !u!1001 &630877083 +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: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: shouldCreateStandardInput + - target: {fileID: 22401058, guid: c0dc5781cae4a6348b42ea6b818a3f9c, type: 2} + propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} - - target: {fileID: 11400000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} - propertyPath: shouldCreateCameraLayer + - 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: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} + m_ParentPrefab: {fileID: 100100000, guid: c0dc5781cae4a6348b42ea6b818a3f9c, 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 - windows8API: 0 - windows7API: 0 - webPlayerTouch: 1 - webGLTouch: 1 - windows8Mouse: 1 - windows7Mouse: 1 - universalWindowsMouse: 1 - emulateSecondMousePointer: 1 --- !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 @@ -348,12 +425,12 @@ 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} 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} @@ -387,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 @@ -396,6 +473,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -404,9 +482,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 @@ -423,22 +501,22 @@ 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} 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 @@ -455,10 +533,10 @@ 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 + 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} @@ -502,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 @@ -524,10 +602,10 @@ 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_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} @@ -591,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 @@ -613,10 +691,10 @@ 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_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.2} @@ -684,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 @@ -704,12 +782,12 @@ 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} 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} @@ -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 @@ -772,40 +850,18 @@ 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 ---- !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 @@ -822,11 +878,11 @@ 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_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} @@ -837,10 +893,10 @@ 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 @@ -857,10 +913,10 @@ Transform: 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &2135305921 Light: m_ObjectHideFlags: 0 @@ -868,7 +924,7 @@ 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.3 @@ -878,6 +934,7 @@ Light: m_Shadows: m_Type: 2 m_Resolution: 3 + m_CustomResolution: -1 m_Strength: 0.56 m_Bias: 0.1 m_NormalBias: 0.4 @@ -890,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 b7f6fd2ae..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; 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 757a0b662..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,12 +15,12 @@ public class Kick : MonoBehaviour private TapGesture gesture; private Rigidbody rb; - private Camera activeCamera; + private Camera activeCamera; private void OnEnable() { rb = GetComponent(); - activeCamera = GameObject.Find("Scene Camera").GetComponent(); + activeCamera = GameObject.Find("Scene Camera").GetComponent(); gesture = GetComponent(); gesture.Tapped += tappedHandler; } @@ -31,11 +32,11 @@ private void OnDisable() private void tappedHandler(object sender, System.EventArgs e) { - var ray = activeCamera.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 7f71494e5..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; @@ -33,8 +34,8 @@ private void tappedHandler(object sender, EventArgs e) 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 9e8ec5d49..f5c2aacd0 100644 --- a/Source/Assets/TouchScript/Examples/Taps/Taps.unity +++ b/Source/Assets/TouchScript/Examples/Taps/Taps.unity @@ -1,19 +1,19 @@ %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: 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: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: 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 @@ -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: 6 + 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_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_RuntimeCPUUsage: 25 + 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 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666666 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: Scene Camera m_TagString: MainCamera @@ -114,10 +137,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 31.264, y: 0, z: 0} 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 @@ -130,7 +153,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Name: Scene Camera + basicEditor: 1 advancedProps: 0 + hitProps: 0 hit3DObjects: 1 hit2DObjects: 0 hitWorldSpaceUI: 0 @@ -190,6 +215,8 @@ Camera: 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 @@ -203,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 @@ -224,10 +251,10 @@ 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: 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} @@ -271,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 @@ -302,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 @@ -311,13 +340,13 @@ 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: 922779737} - {fileID: 1679844150} - {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} @@ -386,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,7 +434,6 @@ 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: 497908867} - {fileID: 769487672} @@ -415,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} @@ -458,18 +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: 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: m_Enabled - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 1c4dd8a13f501b04f84fe824120f70bb, type: 2} m_IsPrefabParent: 0 @@ -492,20 +517,34 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a878a6ff128243dfb1d89ca0273f059, 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 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: 2 - timeLimit: Infinity + timeLimit: 1 distanceLimit: Infinity + combinePointers: 0 + combinePointersInterval: 0.3 --- !u!114 &584553679 MonoBehaviour: m_ObjectHideFlags: 0 @@ -529,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 @@ -545,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 @@ -553,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 @@ -594,17 +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} + - component: {fileID: 740851132} + - component: {fileID: 740851135} + - component: {fileID: 740851134} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -621,12 +662,12 @@ 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} 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} @@ -660,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 @@ -669,6 +710,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -785,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,12 +865,12 @@ 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: 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} @@ -839,9 +881,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 @@ -858,7 +900,6 @@ 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} @@ -866,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 @@ -892,10 +934,10 @@ 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 + 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} @@ -939,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 @@ -960,10 +1002,10 @@ 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: 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} @@ -1007,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 @@ -1029,10 +1071,10 @@ 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: 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} @@ -1166,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 @@ -1194,10 +1238,10 @@ 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: 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} @@ -1261,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 @@ -1283,10 +1327,10 @@ 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_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} @@ -1396,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 @@ -1418,10 +1462,10 @@ 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_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} @@ -1544,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 @@ -1564,12 +1608,12 @@ 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} 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} @@ -1602,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 @@ -1636,10 +1680,10 @@ 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 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1772227325 Prefab: m_ObjectHideFlags: 0 @@ -1647,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 @@ -1667,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 @@ -1687,12 +1799,12 @@ 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: 242343086} - {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} @@ -1721,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 @@ -1740,11 +1852,11 @@ 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_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} @@ -1755,10 +1867,10 @@ 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 @@ -1775,10 +1887,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 37.5, y: -60.899998, z: 8.2324} 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 @@ -1786,7 +1898,7 @@ 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.3 @@ -1796,6 +1908,7 @@ Light: m_Shadows: m_Type: 2 m_Resolution: 3 + m_CustomResolution: -1 m_Strength: 0.56 m_Bias: 0.1 m_NormalBias: 0.4 @@ -1808,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 435cfb1ed..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: "1" + userData: "2" diff --git a/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs index 6fde3c15c..47f0ff31e 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ExamplesList.cs @@ -1,19 +1,22 @@ -using UnityEngine; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ -public class ExamplesList : MonoBehaviour -{ - - public RectTransform Content; +using UnityEngine; - void Start () - { - gameObject.SetActive(false); - } +/// +public class ExamplesList : MonoBehaviour +{ + public RectTransform Content; - public void ShowHide() - { - gameObject.SetActive(!gameObject.activeSelf); - Content.localPosition = Vector3.zero; - } + 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/Highlight.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs index a7d3e665f..a7c4b7e5b 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Highlight.cs @@ -3,42 +3,40 @@ */ using UnityEngine; -using System.Collections; -using TouchScript.Behaviors; +using TouchScript.Behaviors.UI; -public class Highlight : MonoBehaviour +/// +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; - } - -} + 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/KillMe.cs b/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs index 3f3754f17..52c84878a 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs @@ -7,9 +7,7 @@ namespace TouchScript.Examples { - /// - /// When enabled this component destroys the GameObject it is attached to in seconds. - /// + /// 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 78bec68aa..115c549b9 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs @@ -5,34 +5,31 @@ 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 { - /// - /// This component loads demo scenes in a loop. - /// + /// public class Runner : MonoBehaviour { private static Runner instance; private TouchLayer layer; - public void LoadLevel(string name) - { + public void LoadLevel(string name) + { #if UNITY_5_3_OR_NEWER - SceneManager.LoadScene(name); + SceneManager.LoadScene(name); #else Application.LoadLevel(name); #endif - } + } public void LoadNextLevel() { @@ -43,20 +40,20 @@ public void LoadNextLevel() #endif } - public void LoadPreviousLevel() - { + 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); + 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() + private void Start() { if (instance == null) { @@ -64,26 +61,27 @@ private void Start() 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"); - } - } + 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 @@ -100,10 +98,18 @@ private void Start() } } + 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) { @@ -117,9 +123,9 @@ private void OnLevelWasLoaded(int num) #endif private IEnumerator resetUILayer() - { - yield return new WaitForEndOfFrame(); - TouchManager.Instance.AddLayer(layer, 0); - } + { + 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 index f7a60cfae..8f3a5d564 100644 --- a/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs +++ b/Source/Assets/TouchScript/Examples/_misc/Scripts/ShowMe.cs @@ -1,13 +1,18 @@ -using UnityEngine; +/* + * @author Valentin Simonov / http://va.lent.in/ + */ + +using UnityEngine; using System.Collections; -public class ShowMe : MonoBehaviour +/// +public class ShowMe : MonoBehaviour { - IEnumerator Start () - { - var canvas = GetComponent(); - canvas.enabled = false; - yield return new WaitForSeconds(.5f); - canvas.enabled = true; - } -} + 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/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/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/_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 e2fcc9e46..a50fac3a2 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs +++ b/Source/Assets/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs @@ -29,7 +29,11 @@ protected override void OnEnable() public override void OnInspectorGUI() { - serializedObject.UpdateIfDirtyOrScript(); +#if UNITY_5_6_OR_NEWER + serializedObject.UpdateIfRequiredOrScript(); +#else + serializedObject.UpdateIfDirtyOrScript(); +#endif EditorGUILayout.PropertyField(tuioPort); diff --git a/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs b/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs index 780f02620..dcf62db52 100644 --- a/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs +++ b/Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs @@ -13,7 +13,7 @@ using TUIOsharp.Entities; using UnityEngine; -namespace TouchScript.InputSources +namespace TouchScript.InputSources { /// /// Processes TUIO 1.1 input. @@ -93,7 +93,7 @@ public InputType SupportedInputs private ObjectProcessor objectProcessor; private BlobProcessor blobProcessor; - private Dictionary cursorToInternalId = new Dictionary(); + private Dictionary cursorToInternalId = new Dictionary(10); private Dictionary blobToInternalId = new Dictionary(); private Dictionary objectToInternalId = new Dictionary(); private int screenWidth; @@ -108,8 +108,8 @@ public InputType SupportedInputs public TuioInput() { - touchPool = new ObjectPool(20, () => new TouchPointer(this), null, (t) => t.INTERNAL_Reset()); - objectPool = new ObjectPool(10, () => new ObjectPointer(this), null, (t) => t.INTERNAL_Reset()); + touchPool = new ObjectPool(20, () => new TouchPointer(this), null, resetPointer); + objectPool = new ObjectPool(10, () => new ObjectPointer(this), null, resetPointer); } #endregion @@ -117,11 +117,14 @@ public TuioInput() #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; } /// @@ -217,7 +220,8 @@ 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) + } + else if (pointer.Type == Pointer.PointerType.Object) { objectPool.Release(pointer as ObjectPointer); } @@ -358,6 +362,11 @@ private void updateObjectProperties(ObjectPointer obj, TuioObject target) obj.Angle = target.Angle; } + private void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } + #endregion #region Event handlers @@ -493,8 +502,7 @@ private void OnObjectRemoved(object sender, TuioObjectEventArgs e) #endregion } - } #endif - #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/Source/Assets/TouchScript/Prefabs/Pointer Visualizer.meta b/Source/Assets/TouchScript/Prefabs/Cursors.meta similarity index 100% rename from Source/Assets/TouchScript/Prefabs/Pointer Visualizer.meta rename to Source/Assets/TouchScript/Prefabs/Cursors.meta diff --git a/Source/Assets/TouchScript/Prefabs/Pointer Visualizer.prefab b/Source/Assets/TouchScript/Prefabs/Cursors.prefab similarity index 75% rename from Source/Assets/TouchScript/Prefabs/Pointer Visualizer.prefab rename to Source/Assets/TouchScript/Prefabs/Cursors.prefab index c3060008e..58008feac 100644 --- a/Source/Assets/TouchScript/Prefabs/Pointer 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: Pointer 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: - pointerProxy: {fileID: 11468960, guid: 4230502e1973f4c9e9ef6767dcc8c602, type: 2} - showPointerId: 1 - showFlags: 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 - pointerSize: 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} @@ -98,8 +106,7 @@ Prefab: - target: {fileID: 0} propertyPath: pointerProxy value: - objectReference: {fileID: 11468960, guid: 4230502e1973f4c9e9ef6767dcc8c602, - type: 2} + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 100000} diff --git a/Source/Assets/TouchScript/Prefabs/Pointer Visualizer.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Prefabs/Pointer 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/Pointer Visualizer/Pointer Hit.prefab b/Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab similarity index 55% rename from Source/Assets/TouchScript/Prefabs/Pointer Visualizer/Pointer Hit.prefab rename to Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab index 5b8bb08ae..18c2dff48 100644 --- a/Source/Assets/TouchScript/Prefabs/Pointer Visualizer/Pointer 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,95 +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: Pointer 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: 0.003921569, g: 0.9960785, b: 0.9960785, 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_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Id: 0 - - Tags: Bla' ---- !u!114 &11446012 + 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: 152322} + m_GameObject: {fileID: 117830} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: d78b78253cc71a64ca6bf0978d7ac99e, 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 &11454912 -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: -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: 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 @@ -123,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,34 +148,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: 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: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 22471328} - m_RootOrder: 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: 47} - m_Pivot: {x: 0, y: 0.5} --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 @@ -184,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/Pointer Visualizer/Pointer Hit.prefab.meta b/Source/Assets/TouchScript/Prefabs/Cursors/Pointer.prefab.meta similarity index 100% rename from Source/Assets/TouchScript/Prefabs/Pointer Visualizer/Pointer 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/PointerVisualizer.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.cs.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/Cursors/CursorManager.cs.meta index 39a9874cd..0b725e78b 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.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/PointerProxy.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs.meta similarity index 76% rename from Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.cs.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/Cursors/PointerCursor.cs.meta index 814d41e12..7c9a29c24 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.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/Transformer.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs index a3da933bc..af22125cc 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs +++ b/Source/Assets/TouchScript/Scripts/Behaviors/Transformer.cs @@ -18,13 +18,34 @@ namespace TouchScript.Behaviors [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 } @@ -53,10 +74,7 @@ public bool EnableSmoothing public float SmoothingFactor { get { return smoothingFactor * 100000f; } - set - { - smoothingFactor = Mathf.Clamp(value / 100000f, 0, 1); - } + set { smoothingFactor = Mathf.Clamp(value / 100000f, 0, 1); } } /// @@ -116,16 +134,16 @@ public bool AllowChangingFromOutside private bool enableSmoothing = false; [SerializeField] - private float smoothingFactor = 1f/100000f; + private float smoothingFactor = 1f / 100000f; [SerializeField] - private float positionThreshold = 0.0001f; + private float positionThreshold = 0.01f; [SerializeField] - private float rotationThreshold = 0.01f; + private float rotationThreshold = 0.1f; [SerializeField] - private float scaleThreshold = 0.0001f; + private float scaleThreshold = 0.01f; [SerializeField] [ToggleLeft] @@ -136,6 +154,7 @@ public bool AllowChangingFromOutside private TransformGestureBase gesture; private Transform cachedTransform; + private TransformGesture.TransformType transformMask; private Vector3 targetPosition, targetScale; private Quaternion targetRotation; @@ -187,6 +206,8 @@ private void stateIdle() if (newLocalScale != transform.localScale) transform.localScale = newLocalScale; transform.rotation = lastRotation = targetRotation; } + + transformMask = TransformGesture.TransformType.None; } private void stateManual() @@ -196,13 +217,14 @@ private void stateManual() targetPosition = lastPosition = cachedTransform.position; targetRotation = lastRotation = cachedTransform.rotation; targetScale = lastScale = cachedTransform.localScale; + transformMask = TransformGesture.TransformType.None; } private void stateAutomatic() { setState(TransformerState.Automatic); - if (!enableSmoothing) stateIdle(); + if (!enableSmoothing || transformMask == TransformGesture.TransformType.None) stateIdle(); } private void setState(TransformerState newState) @@ -220,72 +242,83 @@ private void update() if (!enableSmoothing) return; - var fraction = 1 - Mathf.Pow(smoothingFactor, Time.deltaTime); + var fraction = 1 - Mathf.Pow(smoothingFactor, Time.unscaledDeltaTime); + var changed = false; - 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) + if ((transformMask & TransformGesture.TransformType.Scaling) != 0) { - transform.localScale = newLocalScale; - // Something might have adjusted our scale. - lastScale = transform.localScale; + 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 (allowChangingFromOutside) + if ((transformMask & TransformGesture.TransformType.Rotation) != 0) { - // Changed by someone else. - if (transform.rotation != lastRotation) targetRotation = transform.rotation; + 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; } - transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, fraction); - // Something might have adjusted our rotation. - lastRotation = transform.rotation; - var pos = transform.position; - if (allowChangingFromOutside) + if ((transformMask & TransformGesture.TransformType.Translation) != 0) { - // 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; + 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; } - transform.position = Vector3.Lerp(pos, targetPosition, fraction); - // Something might have adjusted our position (most likely Unity UI). - lastPosition = transform.position; - if (state == TransformerState.Automatic) - { - var dP = (targetPosition - lastPosition).sqrMagnitude; - var dS = (targetScale - lastScale).sqrMagnitude; - var dR = Quaternion.Angle(targetRotation, lastRotation); - if (dP < positionThreshold && dR < rotationThreshold && dS < scaleThreshold) stateIdle(); - } + if (state == TransformerState.Automatic && !changed) stateIdle(); } private void manualUpdate() { - if (state != TransformerState.Manual) stateManual(); + 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); @@ -294,9 +327,10 @@ private void manualUpdate() private void applyValues() { - cachedTransform.localScale = targetScale; - cachedTransform.rotation = targetRotation; - cachedTransform.position = targetPosition; + 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 @@ -318,8 +352,8 @@ private void stateChangedHandler(object sender, GestureStateChangeEventArgs gest stateAutomatic(); break; case Gesture.GestureState.Failed: - if (gestureStateChangeEventArgs.PreviousState == Gesture.GestureState.Possible) - stateAutomatic(); + case Gesture.GestureState.Idle: + if (gestureStateChangeEventArgs.PreviousState == Gesture.GestureState.Possible) stateAutomatic(); break; } } 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/OverHelper.cs b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs similarity index 98% rename from Source/Assets/TouchScript/Scripts/Behaviors/OverHelper.cs rename to Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs index 8513f2553..03ed25894 100644 --- a/Source/Assets/TouchScript/Scripts/Behaviors/OverHelper.cs +++ b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs @@ -8,14 +8,14 @@ using TouchScript.Utils; using UnityEngine; -namespace TouchScript.Behaviors +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_OverHelper.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_UI_OverHelper.htm")] public class OverHelper : MonoBehaviour { diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/OverHelper.cs.meta b/Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Behaviors/OverHelper.cs.meta rename to Source/Assets/TouchScript/Scripts/Behaviors/UI/OverHelper.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.cs deleted file mode 100644 index 40b4b6cf2..000000000 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Text; -using TouchScript.Pointers; -using UnityEngine; -using UnityEngine.UI; - -namespace TouchScript.Behaviors.Visualizer -{ - /// - /// Visual cursor implementation used by TouchScript. - /// - [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Visualizer_TouchProxy.htm")] - public class PointerProxy : PointerProxyBase - { - /// - /// The link to UI.Text component. - /// - public Text Text; - - private StringBuilder stringBuilder = new StringBuilder(64); - - #region Protected methods - - /// - protected override void updateOnce(Pointer pointer) - { - base.updateOnce(pointer); - - stringBuilder.Length = 0; - stringBuilder.Append("Pointer id: "); - stringBuilder.Append(pointer.Id); - gameObject.name = stringBuilder.ToString(); - - if (Text == null) return; - if (!ShowPointerId && !ShowFlags) - { - Text.text = ""; - return; - } - - stringBuilder.Length = 0; - if (ShowPointerId) - { - stringBuilder.Append("Id: "); - stringBuilder.Append(pointer.Id); - } - if (ShowFlags) - { - if (stringBuilder.Length > 0) stringBuilder.Append("\n"); - stringBuilder.Append("Flags: "); - stringBuilder.Append(pointer.Flags); - } - - Text.text = stringBuilder.ToString(); - } - - #endregion - } - - /// - /// Base class for cursors. - /// - public class PointerProxyBase : MonoBehaviour - { - #region Public properties - - /// - /// Gets or sets cursor size. - /// - /// Cursor size in pixels. - public uint Size - { - get { return size; } - set - { - size = value; - rect.sizeDelta = Vector2.one * size; - } - } - - /// - /// Gets or sets a value indicating whether pointer id text should be displayed on screen. - /// - /// true if pointer id text should be displayed on screen; otherwise, false. - public bool ShowPointerId { get; set; } - - /// - /// Gets or sets a value indicating whether pointer flags text should be displayed on screen. - /// - /// true if pointer flags text should be displayed on screen; otherwise, false. - public bool ShowFlags { get; set; } - - #endregion - - #region Private variables - - /// - /// Cached RectTransform. - /// - protected RectTransform rect; - - /// - /// Cursor size. - /// - protected uint size = 1; - - protected uint hash = uint.MaxValue; - - #endregion - - #region Public methods - - /// - /// Initializes (resets) the cursor. - /// - /// Parent container. - /// Pointer this cursor represents. - public void Init(RectTransform parent, Pointer pointer) - { - hash = uint.MaxValue; - - show(); - rect.SetParent(parent); - rect.SetAsLastSibling(); - update(pointer); - } - - /// - /// Updates the pointer. This method is called when the pointer is moved. - /// - /// Pointer this cursor represents. - public void UpdatePointer(Pointer pointer) - { - update(pointer); - } - - /// - /// Hides this instance. - /// - public void Hide() - { - hide(); - } - - #endregion - - #region Unity methods - - private void Awake() - { - rect = transform as RectTransform; - if (rect == null) - { - Debug.LogError("PointerProxy 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 pointer"; - } - - /// - /// Shows this instance. - /// - protected virtual void show() - { - gameObject.SetActive(true); - } - - /// - /// This method is called once when the cursor is initialized. - /// - /// The pointer. - protected virtual void updateOnce(Pointer pointer) {} - - /// - /// This method is called every time when the pointer changes. - /// - /// The pointer. - public virtual void update(Pointer pointer) - { - rect.anchoredPosition = pointer.Position; - var newHash = getPointerHash(pointer); - if (newHash != hash) updateOnce(pointer); - hash = newHash; - } - - #endregion - - #region Private functions - - private uint getPointerHash(Pointer pointer) - { - return pointer.Flags; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.cs b/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.cs deleted file mode 100644 index 6e64a6f31..000000000 --- a/Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.cs +++ /dev/null @@ -1,228 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System.Collections.Generic; -using TouchScript.Utils; -using TouchScript.Utils.Attributes; -using UnityEngine; - -namespace TouchScript.Behaviors.Visualizer -{ - /// - /// 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_Visualizer_TouchVisualizer.htm")] - public class PointerVisualizer : MonoBehaviour - { - #region Public properties - - /// - /// Gets or sets pointer UI element prefab which represents a pointer on screen. - /// - /// A prefab with a script derived from PointerProxyBase. - public PointerProxyBase PointerProxy - { - get { return pointerProxy; } - set - { - pointerProxy = value; - updateDefaultSize(); - } - } - - /// - /// Gets or sets a value indicating whether pointer id text should be displayed on screen. - /// - /// true if pointer id text should be displayed on screen; otherwise, false. - public bool ShowPointerId - { - get { return showPointerId; } - set { showPointerId = value; } - } - - /// - /// Gets or sets a value indicating whether pointer flags text should be displayed on screen. - /// - /// true if pointer flags text should be displayed on screen; otherwise, false. - public bool ShowFlags - { - get { return showFlags; } - set { showFlags = 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; } - } - - /// - /// 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 PointerSize - { - get { return pointerSize; } - set { pointerSize = value; } - } - - #endregion - - #region Private variables - - [SerializeField] - private bool generalProps; // Used in the custom inspector - - [SerializeField] - private bool advancedProps; // Used in the custom inspector - - [SerializeField] - private PointerProxyBase pointerProxy; - - [SerializeField] - [ToggleLeft] - private bool showPointerId = true; - - [SerializeField] - [ToggleLeft] - private bool showFlags = true; - - [SerializeField] - [ToggleLeft] - private bool useDPI = true; - - [SerializeField] - private float pointerSize = 1f; - - private uint 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("PointerVisualizer must be on an UI element!"); - enabled = false; - } - updateDefaultSize(); - } - - private void OnEnable() - { - if (TouchManager.Instance != null) - { - 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.PointersPressed -= pointersPressedHandler; - TouchManager.Instance.PointersReleased -= pointersReleasedHandler; - TouchManager.Instance.PointersUpdated -= PointersUpdatedHandler; - TouchManager.Instance.PointersCancelled -= pointersCancelledHandler; - } - } - - #endregion - - #region Private functions - - private PointerProxyBase instantiateProxy() - { - return Instantiate(pointerProxy); - } - - private void clearProxy(PointerProxyBase proxy) - { - proxy.Hide(); - } - - private uint getPointerSize() - { - if (useDPI) return (uint) (pointerSize * TouchManager.Instance.DotsPerCentimeter); - return defaultSize; - } - - private void updateDefaultSize() - { - if (pointerProxy != null) - { - var rt = pointerProxy.GetComponent(); - if (rt) defaultSize = (uint) rt.sizeDelta.x; - } - } - - #endregion - - #region Event handlers - - private void pointersPressedHandler(object sender, PointerEventArgs e) - { - if (pointerProxy == null) return; - - var count = e.Pointers.Count; - for (var i = 0; i < count; i++) - { - var pointer = e.Pointers[i]; - var proxy = pool.Get(); - proxy.Size = getPointerSize(); - proxy.ShowPointerId = showPointerId; - proxy.ShowFlags = showFlags; - proxy.Init(rect, pointer); - proxies.Add(pointer.Id, proxy); - } - } - - private void PointersUpdatedHandler(object sender, PointerEventArgs e) - { - var count = e.Pointers.Count; - for (var i = 0; i < count; i++) - { - var pointer = e.Pointers[i]; - PointerProxyBase proxy; - if (!proxies.TryGetValue(pointer.Id, out proxy)) continue; - proxy.UpdatePointer(pointer); - } - } - - private void pointersReleasedHandler(object sender, PointerEventArgs e) - { - var count = e.Pointers.Count; - for (var i = 0; i < count; i++) - { - var pointer = e.Pointers[i]; - PointerProxyBase proxy; - if (!proxies.TryGetValue(pointer.Id, out proxy)) continue; - proxies.Remove(pointer.Id); - pool.Release(proxy); - } - } - - private void pointersCancelledHandler(object sender, PointerEventArgs e) - { - pointersReleasedHandler(sender, e); - } - - #endregion - } -} \ No newline at end of file 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 96% rename from Source/Assets/TouchScript/Scripts/DebuggableMonoBehaviour.cs rename to Source/Assets/TouchScript/Scripts/Core/DebuggableMonoBehaviour.cs index 89fd419ad..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. 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/TouchManagerInstance.cs b/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs similarity index 74% rename from Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs rename to Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs index bf6969af7..fee118951 100644 --- a/Source/Assets/TouchScript/Scripts/TouchManagerInstance.cs +++ b/Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs @@ -12,16 +12,17 @@ using TouchScript.Utils; using TouchScript.Pointers; using UnityEngine; - +using UnityEngine.Profiling; +using TouchScript.Core; #if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; +using TouchScript.Debugging.Loggers; #endif - #if UNITY_5_4_OR_NEWER using UnityEngine.SceneManagement; #endif -namespace TouchScript +namespace TouchScript.Core { /// /// Default implementation of . @@ -95,7 +96,9 @@ public event EventHandler PointersCancelled #region Public properties - /// + /// + /// Gets the instance of TouchManager singleton. + /// public static TouchManagerInstance Instance { get @@ -140,7 +143,7 @@ public IDisplayDevice DisplayDevice { displayDevice = value; } - updateDPI(); + UpdateResolution(); } } @@ -164,12 +167,6 @@ public bool ShouldCreateStandardInput set { shouldCreateStandardInput = value; } } - /// - public IList Layers - { - get { return new List(layers); } - } - /// public IList Inputs { @@ -206,21 +203,25 @@ 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 float dotsPerCentimeter = TouchManager.CM_TO_INCH * 96; + + private ILayerManager layerManager; - private List layers = new List(10); - private int layerCount = 0; private List inputs = new List(3); private int inputCount = 0; @@ -245,64 +246,31 @@ public IList PressedPointers private int nextPointerId = 0; private object pointerLock = new object(); + // Cache delegates + private Func _layerAddPointer, _layerUpdatePointer, _layerRemovePointer, _layerCancelPointer; + #endregion - #region Public methods + #region Temporary variables - /// - public bool AddLayer(TouchLayer layer, int index = -1, bool addIfExists = true) - { - if (layer == null) return false; + // Used in layer dispatch fucntions + private Pointer tmpPointer; - 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; - } + #endregion - /// - public bool RemoveLayer(TouchLayer layer) - { - if (layer == null) return false; - var result = layers.Remove(layer); - if (result) layerCount--; - return result; - } + #region Debug - /// - 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); - } +#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) @@ -339,42 +307,42 @@ public void CancelPointer(int id) CancelPointer(id, false); } - #endregion - - #region Internal methods - /// - internal bool INTERNAL_GetHitTarget(IPointer pointer, out HitData hit) + public void UpdateResolution() { - hit = default(HitData); - - for (var i = 0; i < layerCount; i++) + if (DisplayDevice != null) { - 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; - } + DisplayDevice.UpdateDPI(); + dpi = DisplayDevice.DPI; } - - return false; + 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++); + pointer.INTERNAL_Init(nextPointerId); pointersAdded.Add(pointer); #if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Added: " + pointer); + pLogger.Log(pointer, PointerEvent.IdAllocated); #endif + + nextPointerId++; } } @@ -386,10 +354,9 @@ internal void INTERNAL_UpdatePointer(int id) if (!idToPointer.TryGetValue(id, out pointer)) { // This pointer was added this frame - pointer = pointersAdded.Find((t) => t.Id == id); - // No pointer with such id - if (pointer == null) + 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 @@ -398,10 +365,6 @@ internal void INTERNAL_UpdatePointer(int id) } pointersUpdated.Add(id); - -#if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Updated: " + pointer); -#endif } } @@ -413,28 +376,26 @@ internal void INTERNAL_PressPointer(int id) if (!idToPointer.TryGetValue(id, out pointer)) { // This pointer was added this frame - pointer = pointersAdded.Find((t) => t.Id == id); - // No pointer with such id - if (pointer == null) - { + 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."); + 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."); + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to PRESS more than once this frame."); #else pointersPressed.Add(id); #endif -#if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Pressed: " + pointer); -#endif } } @@ -446,29 +407,27 @@ internal void INTERNAL_ReleasePointer(int id) Pointer pointer; if (!idToPointer.TryGetValue(id, out pointer)) { - // This pointer was added this frame - pointer = pointersAdded.Find((t) => t.Id == id); - // No pointer with such id - if (pointer == null) - { + // 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."); + 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."); + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to END more than once this frame."); #else pointersReleased.Add(id); #endif -#if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Released: " + pointer); -#endif } } @@ -480,29 +439,27 @@ internal void INTERNAL_RemovePointer(int id) Pointer pointer; if (!idToPointer.TryGetValue(id, out pointer)) { - // This pointer was added this frame - pointer = pointersAdded.Find((t) => t.Id == id); - // No pointer with such id - if (pointer == null) - { + // 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."); + 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."); + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to REMOVE more than once this frame."); #else pointersRemoved.Add(pointer.Id); #endif -#if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Removed: " + pointer); -#endif } } @@ -514,29 +471,27 @@ internal void INTERNAL_CancelPointer(int id) Pointer pointer; if (!idToPointer.TryGetValue(id, out pointer)) { - // This pointer was added this frame - pointer = pointersAdded.Find((t) => t.Id == id); - // No pointer with such id - if (pointer == null) - { + // 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."); + 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."); + if (DebugMode) + Debug.LogWarning("TouchScript > Pointer with id [" + id + + "] is requested to CANCEL more than once this frame."); #else pointersCancelled.Add(pointer.Id); #endif -#if TOUCHSCRIPT_DEBUG - if (DebugMode) Debug.Log("TouchScript > Pointer Cancelled: " + pointer); -#endif } } @@ -556,6 +511,10 @@ private void Awake() return; } +#if TOUCHSCRIPT_DEBUG + pLogger = Debugging.TouchScriptDebugger.Instance.PointerLogger; +#endif + #if UNITY_5_4_OR_NEWER SceneManager.sceneLoaded += sceneLoadedHandler; #endif @@ -563,13 +522,30 @@ private void Awake() gameObject.hideFlags = HideFlags.HideInHierarchy; DontDestroyOnLoad(gameObject); - updateDPI(); + 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 @@ -588,14 +564,13 @@ private void OnLevelWasLoaded(int value) 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 + // 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; - yield return null; - updateLayers(); createCameraLayer(); createInput(); } @@ -616,33 +591,17 @@ private void OnApplicationQuit() #region Private functions - private void updateDPI() - { - dpi = DisplayDevice == null ? 96 : DisplayDevice.DPI; - dotsPerCentimeter = TouchManager.CM_TO_INCH*dpi; -#if TOUCHSCRIPT_DEBUG - debugPointerSize = 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 (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(); - AddLayer(layer); + var layer = Camera.main.gameObject.AddComponent(); + layerManager.AddLayer(layer); } } } @@ -670,11 +629,21 @@ private void createInput() 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++) @@ -684,12 +653,13 @@ private void updateAdded(List pointers) this.pointers.Add(pointer); idToPointer.Add(pointer.Id, pointer); - for (var j = 0; j < layerCount; j++) - { - var touchLayer = layers[j]; - if (touchLayer == null) continue; - touchLayer.INTERNAL_AddPointer(pointer); - } +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Added); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerAddPointer); + tmpPointer = null; #if TOUCHSCRIPT_DEBUG if (DebugMode) addDebugFigureForPointer(pointer); @@ -699,10 +669,24 @@ private void updateAdded(List pointers) 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++) @@ -712,22 +696,25 @@ private void updateUpdated(List pointers) 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."); + 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 { - for (var j = 0; j < layerCount; j++) - { - var touchLayer = layers[j]; - if (touchLayer == null) continue; - touchLayer.INTERNAL_UpdatePointer(pointer); - } + tmpPointer = pointer; + layerManager.ForEach(_layerUpdatePointer); + tmpPointer = null; } #if TOUCHSCRIPT_DEBUG @@ -738,10 +725,24 @@ private void updateUpdated(List pointers) 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++) @@ -751,21 +752,24 @@ private void updatePressed(List pointers) 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."); + 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); - } + + 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 } @@ -773,10 +777,18 @@ private void updatePressed(List pointers) 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++) @@ -792,6 +804,11 @@ private void updateReleased(List pointers) } 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); @@ -810,10 +827,18 @@ private void updateReleased(List pointers) 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++) @@ -832,12 +857,13 @@ private void updateRemoved(List pointers) pressedPointers.Remove(pointer); list.Add(pointer); - for (var j = 0; j < layerCount; j++) - { - var touchLayer = layers[j]; - if (touchLayer == null) continue; - touchLayer.INTERNAL_RemovePointer(pointer); - } +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Removed); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerRemovePointer); + tmpPointer = null; #if TOUCHSCRIPT_DEBUG if (DebugMode) removeDebugFigureForPointer(pointer); @@ -854,10 +880,24 @@ private void updateRemoved(List pointers) 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++) @@ -867,8 +907,9 @@ private void updateCancelled(List pointers) 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."); + if (DebugMode) + Debug.LogWarning("TouchScript > Id [" + id + + "] was in CANCELLED list but no pointer with such id found."); #endif continue; } @@ -877,12 +918,13 @@ private void updateCancelled(List pointers) pressedPointers.Remove(pointer); list.Add(pointer); - for (var j = 0; j < layerCount; j++) - { - var touchLayer = layers[j]; - if (touchLayer == null) continue; - touchLayer.INTERNAL_CancelPointer(pointer); - } +#if TOUCHSCRIPT_DEBUG + pLogger.Log(pointer, PointerEvent.Cancelled); +#endif + + tmpPointer = pointer; + layerManager.ForEach(_layerCancelPointer); + tmpPointer = null; #if TOUCHSCRIPT_DEBUG if (DebugMode) removeDebugFigureForPointer(pointer); @@ -898,6 +940,16 @@ private void updateCancelled(List pointers) 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() @@ -911,6 +963,7 @@ private void sendFrameStartedToPointers() private void updatePointers() { + IsInsidePointerFrame = true; if (frameStartedInvoker != null) frameStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty); // need to copy buffers since they might get updated during execution @@ -960,11 +1013,11 @@ private void updatePointers() } } - var count = pointers.Count; - for (var i = 0; i < count; i++) - { - pointers[i].INTERNAL_UpdatePosition(); - } + var count = pointers.Count; + for (var i = 0; i < count; i++) + { + pointers[i].INTERNAL_UpdatePosition(); + } if (addedList != null) { @@ -999,8 +1052,23 @@ private void updatePointers() } 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; 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/Utils/DebugUtils.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/DebugUtils.meta rename to Source/Assets/TouchScript/Scripts/Debugging/GL.meta diff --git a/Source/Assets/TouchScript/Scripts/Utils/DebugUtils/DebugHelper.cs b/Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs similarity index 88% rename from Source/Assets/TouchScript/Scripts/Utils/DebugUtils/DebugHelper.cs rename to Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs index 6643dcba8..53423adb1 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/DebugUtils/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.DebugUtils +using UnityEngine; + +namespace TouchScript.Debugging.GL { public static class DebugHelper { diff --git a/Source/Assets/TouchScript/Scripts/Utils/DebugUtils/DebugHelper.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/DebugUtils/DebugHelper.cs.meta rename to Source/Assets/TouchScript/Scripts/Debugging/GL/DebugHelper.cs.meta diff --git a/Source/Assets/TouchScript/Scripts/Utils/DebugUtils/GLDebug.cs b/Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs similarity index 87% rename from Source/Assets/TouchScript/Scripts/Utils/DebugUtils/GLDebug.cs rename to Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs index 8c342a185..59a07e2ee 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/DebugUtils/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.DebugUtils +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/DebugUtils/GLDebug.cs.meta b/Source/Assets/TouchScript/Scripts/Debugging/GL/GLDebug.cs.meta similarity index 100% rename from Source/Assets/TouchScript/Scripts/Utils/DebugUtils/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 091138dd1..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,103 +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.WindowsEditor: - case RuntimePlatform.WindowsPlayer: - 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 } - default: - 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 eb0b62747..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 @@ -12,7 +13,7 @@ namespace TouchScript /// /// 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 + /// 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 diff --git a/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs b/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs deleted file mode 100644 index 014153a9a..000000000 --- a/Source/Assets/TouchScript/Scripts/GestureManagerInstance.cs +++ /dev/null @@ -1,589 +0,0 @@ -/* - * @author Valentin Simonov / http://va.lent.in/ - */ - -using System; -using System.Collections.Generic; -using TouchScript.Gestures; -using TouchScript.Utils; -using TouchScript.Pointers; -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> _updatePressed, _updateUpdated, _updateReleased, _updateCancelled; - private Action _processTarget, _processTargetBegan; - - #endregion - - #region Temporary variables - - // Temporary variables for update methods. - // Dictionary> - pointers sorted by targets - private Dictionary> targetPointers = new Dictionary>(10); - // Dictionary> - pointers sorted by gesture - private Dictionary> gesturePointers = new Dictionary>(10); - private List activeGestures = new List(20); - - private static ObjectPool> gestureListPool = new ObjectPool>(10, - () => new List(20), null, (l) => l.Clear()); - - private static ObjectPool> pointerListPool = new ObjectPool>(20, - () => new List(10), null, (l) => l.Clear()); - - private static ObjectPool> transformListPool = new ObjectPool>(10, - () => new List(10), 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; - _updatePressed = doUpdatePressed; - _updateUpdated = doUpdateUpdated; - _updateReleased = doUpdateReleased; - _updateCancelled = doUpdateCancelled; - - gestureListPool.WarmUp(5); - pointerListPool.WarmUp(10); - transformListPool.WarmUp(5); - } - - 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 doUpdatePressed(Gesture gesture, IList pointers) - { - gesture.INTERNAL_PointersPressed(pointers); - } - - private void doUpdateUpdated(Gesture gesture, IList pointers) - { - gesture.INTERNAL_PointersUpdated(pointers); - } - - private void doUpdateReleased(Gesture gesture, IList pointers) - { - gesture.INTERNAL_PointersReleased(pointers); - } - - private void doUpdateCancelled(Gesture gesture, IList pointers) - { - gesture.INTERNAL_PointersCancelled(pointers); - } - - private void update(IList pointers, Action process, - Action> dispatch) - { - // WARNING! Arcane magic ahead! - // gestures which got any pointers - // needed because there's no order in dictionary - activeGestures.Clear(); - var targets = transformListPool.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) - { - List list; - if (!targetPointers.TryGetValue(target, out list)) - { - list = pointerListPool.Get(); - targetPointers.Add(target, list); - targets.Add(target); - } - list.Add(pointer); - } - } - - // process all targets - get and sort all gestures on targets in hierarchy - count = targets.Count; - for (var i = 0; i < count; i++) - { - var target = targets[i]; - process(target); - pointerListPool.Release(targetPointers[target]); - } - transformListPool.Release(targets); - - // dispatch gesture events with pointers assigned to them - count = activeGestures.Count; - for (var i = 0; i < count; i++) - { - var gesture = activeGestures[i]; - var list = gesturePointers[gesture]; - if (gestureIsActive(gesture)) dispatch(gesture, list); - pointerListPool.Release(list); - } - - targetPointers.Clear(); - gesturePointers.Clear(); - } - - private void processTarget(Transform target) - { - var targetList = targetPointers[target]; - var pointerCount = targetList.Count; - - // gestures on objects in the hierarchy from "root" to target - var list = gestureListPool.Get(); - getHierarchyEndingWith(target, list); - - var count = list.Count; - for (var i = 0; i < count; i++) - { - var gesture = list[i]; - if (!gestureIsActive(gesture)) continue; - - var pointerList = pointerListPool.Get(); - for (var j = 0; j < pointerCount; j++) - { - var pointer = targetList[j]; - if (gesture.HasPointer(pointer)) pointerList.Add(pointer); - } - - if (pointerList.Count > 0) - { - if (gesturePointers.ContainsKey(gesture)) - { - gesturePointers[gesture].AddRange(pointerList); - pointerListPool.Release(pointerList); - } - else - { - activeGestures.Add(gesture); - gesturePointers.Add(gesture, pointerList); - } - } - else - { - pointerListPool.Release(pointerList); - } - } - gestureListPool.Release(list); - } - - private void processTargetBegan(Transform target) - { - var targetList = targetPointers[target]; - var pointerCount = targetList.Count; - - 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 canReceivePointers = 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 - canReceivePointers = false; - break; - } - } - - // check gesture's ShouldReceivePointer callback - if (!canReceivePointers) continue; - - var pointerList = pointerListPool.Get(); - for (var j = 0; j < pointerCount; j++) - { - var pointer = targetList[j]; - if (shouldReceivePointer(gesture, pointer)) pointerList.Add(pointer); - } - if (pointerList.Count > 0) - { - if (gesturePointers.ContainsKey(gesture)) - { - gesturePointers[gesture].AddRange(pointerList); - pointerListPool.Release(pointerList); - } - else - { - activeGestures.Add(gesture); - gesturePointers.Add(gesture, pointerList); - } - } - else - { - pointerListPool.Release(pointerList); - } - } - - 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.Idle); - } - 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 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(); - } - - private void frameStartedHandler(object sender, EventArgs eventArgs) - { - resetGestures(); - } - - private void pointersPressedHandler(object sender, PointerEventArgs pointerEventArgs) - { - update(pointerEventArgs.Pointers, _processTargetBegan, _updatePressed); - } - - private void PointersUpdatedHandler(object sender, PointerEventArgs pointerEventArgs) - { - update(pointerEventArgs.Pointers, _processTarget, _updateUpdated); - } - - private void pointersReleasedHandler(object sender, PointerEventArgs pointerEventArgs) - { - update(pointerEventArgs.Pointers, _processTarget, _updateReleased); - } - - private void pointersCancelledHandler(object sender, PointerEventArgs pointerEventArgs) - { - update(pointerEventArgs.Pointers, _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 40cae9a69..4b69b4887 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/FlickGesture.cs @@ -7,6 +7,7 @@ using TouchScript.Utils; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -137,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() { @@ -149,6 +164,12 @@ protected void LateUpdate() deltaSequence.Add(ScreenPosition - PreviousScreenPosition); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks @@ -156,6 +177,10 @@ protected void LateUpdate() /// protected override void pointersPressed(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersPressed(pointers); if (pointersNumState == PointersNumState.PassedMaxThreshold || @@ -169,11 +194,19 @@ protected override void pointersPressed(IList pointers) if (isActive) setState(GestureState.Failed); else isActive = true; } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// protected override void pointersUpdated(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersUpdated(pointers); if (isActive || !moving) @@ -185,11 +218,19 @@ protected override void pointersUpdated(IList pointers) moving = true; } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// protected override void pointersReleased(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersReleased(pointers); if (NumPointers == 0) @@ -197,13 +238,16 @@ protected override void pointersReleased(IList pointers) 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]; @@ -225,10 +269,14 @@ protected override void pointersReleased(IList pointers) 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 1f331a9a3..59b285373 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/Gesture.cs @@ -11,6 +11,7 @@ using TouchScript.Pointers; using UnityEngine; using UnityEngine.Events; +using TouchScript.Core; namespace TouchScript.Gestures { @@ -21,7 +22,10 @@ public abstract class Gesture : DebuggableMonoBehaviour { #region Constants - [Serializable] + /// + /// Unity event for gesture state changes. + /// + [Serializable] public class GestureEvent : UnityEvent {} /// @@ -200,29 +204,6 @@ public Gesture RequireGestureToFail } } - /// - /// 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; } - } - /// /// Gets or sets whether gesture should use Unity's SendMessage in addition to C# events. /// @@ -347,7 +328,7 @@ public virtual Vector2 ScreenPosition if (!TouchManager.IsInvalidPosition(cachedScreenPosition)) return cachedScreenPosition; return TouchManager.INVALID_POSITION; } - return ClusterUtils.Get2DCenterPosition(activePointers); + return activePointers[0].Position; } } @@ -365,7 +346,7 @@ public virtual Vector2 PreviousScreenPosition return cachedPreviousScreenPosition; return TouchManager.INVALID_POSITION; } - return ClusterUtils.GetPrevious2DCenterPosition(activePointers); + return activePointers[0].PreviousPosition; } } @@ -459,28 +440,29 @@ protected IGestureManager gestureManager /// protected Transform cachedTransform; + /// + [SerializeField] + [HideInInspector] + protected bool basicEditor = true; + [SerializeField] + [HideInInspector] private bool generalProps; // Used in the custom inspector [SerializeField] + [HideInInspector] private bool limitsProps; // Used in the custom inspector [SerializeField] + [HideInInspector] private bool advancedProps; // Used in the custom inspector - [SerializeField] + [SerializeField] private int minPointers = 0; [SerializeField] private int maxPointers = 0; - [SerializeField] - [ToggleLeft] - private bool combinePointers = false; - - [SerializeField] - private float combinePointersInterval = .3f; - [SerializeField] [ToggleLeft] private bool useSendMessage = false; @@ -509,7 +491,6 @@ protected IGestureManager gestureManager private int numPointers; private ReadOnlyCollection readonlyActivePointers; - private TimedSequence pointerSequence = new TimedSequence(); private GestureManagerInstance gestureManagerInstance; private GestureState delayedStateChange = GestureState.Idle; private bool requiredGestureFailed = false; @@ -520,13 +501,13 @@ protected IGestureManager gestureManager /// Cached screen position. /// 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 pointers when the gesture is recognized since all pointers are gone. /// - private Vector2 cachedPreviousScreenPosition; + protected Vector2 cachedPreviousScreenPosition; #endregion @@ -621,7 +602,6 @@ public void Cancel(bool cancelPointers, bool returnPointers) switch (state) { case GestureState.Cancelled: - case GestureState.Ended: case GestureState.Failed: return; } @@ -647,7 +627,7 @@ public virtual HitData GetScreenPositionHitData() { HitData hit; fakePointer.Position = ScreenPosition; - touchManager.INTERNAL_GetHitTarget(fakePointer, out hit); + LayerManager.Instance.GetHitTarget(fakePointer, out hit); return hit; } @@ -823,36 +803,20 @@ internal void INTERNAL_PointersReleased(IList pointers) for (var i = 0; i < count; i++) activePointers.Remove(pointers[i]); numPointers = total; - if (combinePointers) - { - for (var i = 0; i < count; i++) pointerSequence.Add(pointers[i]); - - if (NumPointers == 0) - { - // Checking which points were removed in clusterExistenceTime seconds to set their centroid as cached screen position - var cluster = pointerSequence.FindElementsLaterThan(Time.time - combinePointersInterval, - shouldCachePointerPosition); - cachedScreenPosition = ClusterUtils.Get2DCenterPosition(cluster); - cachedPreviousScreenPosition = ClusterUtils.GetPrevious2DCenterPosition(cluster); - } - } - else - { - 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; - } - } - } + 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); } diff --git a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs index ef9e6fced..ff6bbb047 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/LongPressGesture.cs @@ -9,6 +9,7 @@ using TouchScript.Utils.Attributes; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -42,7 +43,10 @@ public event EventHandler LongPressed // Needed to overcome iOS AOT limitations private EventHandler longPressedInvoker; - public GestureEvent OnLongPress = new GestureEvent(); + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnLongPress = new GestureEvent(); #endregion @@ -87,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() { @@ -99,6 +117,12 @@ protected override void OnEnable() distanceLimitInPixelsSquared = Mathf.Pow(distanceLimit * touchManager.DotsPerCentimeter, 2); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks @@ -106,6 +130,10 @@ protected override void OnEnable() /// protected override void pointersPressed(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersPressed(pointers); if (pointersNumState == PointersNumState.PassedMaxThreshold || @@ -118,11 +146,19 @@ protected override void pointersPressed(IList pointers) setState(GestureState.Possible); StartCoroutine("wait"); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// protected override void pointersUpdated(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersUpdated(pointers); if (distanceLimit < float.PositiveInfinity) @@ -130,17 +166,29 @@ protected override void pointersUpdated(IList pointers) totalMovement += ScreenPosition - PreviousScreenPosition; if (totalMovement.sqrMagnitude > distanceLimitInPixelsSquared) setState(GestureState.Failed); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// protected override void pointersReleased(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersReleased(pointers); if (pointersNumState == PointersNumState.PassedMinThreshold) { setState(GestureState.Failed); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// @@ -149,7 +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); + if (UseUnityEvents) OnLongPress.Invoke(this); } /// @@ -173,14 +221,11 @@ private IEnumerator wait() if (State == GestureState.Possible) { - if (GetScreenPositionHitData().Target.IsChildOf(cachedTransform)) - { - 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 379f19c2a..62192912e 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/MetaGesture.cs @@ -7,6 +7,7 @@ using TouchScript.Utils; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -85,13 +86,45 @@ public event EventHandler PointerCancelled pointerReleasedInvoker, pointerCancelledInvoker; - #endregion + #endregion - #region Gesture callbacks + #region Private variables - /// - protected override void pointersPressed(IList pointers) +#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 + } + + [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 (State == GestureState.Idle) setState(GestureState.Began); @@ -106,11 +139,19 @@ protected override void pointersPressed(IList pointers) { 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 pointersUpdated(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersUpdated(pointers); if (State == GestureState.Began || State == GestureState.Changed) setState(GestureState.Changed); @@ -125,11 +166,19 @@ protected override void pointersUpdated(IList pointers) { 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 pointersReleased(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersReleased(pointers); if ((State == GestureState.Began || State == GestureState.Changed) && NumPointers == 0) setState(GestureState.Ended); @@ -144,11 +193,19 @@ protected override void pointersReleased(IList pointers) { 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 pointersCancelled(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersCancelled(pointers); var length = pointers.Count; @@ -161,6 +218,10 @@ protected override void pointersCancelled(IList pointers) { 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 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/PressGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs index 0cd866a1d..35ef5f821 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/PressGesture.cs @@ -8,6 +8,7 @@ using TouchScript.Utils.Attributes; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -47,7 +48,10 @@ public event EventHandler Pressed // Needed to overcome iOS AOT limitations private EventHandler pressedInvoker; - public GestureEvent OnPress = new GestureEvent(); + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnPress = new GestureEvent(); #endregion @@ -71,6 +75,30 @@ 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 @@ -102,18 +130,32 @@ public override bool CanBePreventedByGesture(Gesture gesture) /// protected override void pointersPressed(IList pointers) { +#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 } /// @@ -123,7 +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); + 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 6271252d7..1cd64faf0 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/ReleaseGesture.cs @@ -8,6 +8,7 @@ using TouchScript.Utils.Attributes; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -42,6 +43,9 @@ 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 @@ -66,12 +70,36 @@ 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 ShouldReceivePointer(Pointer pointer) + #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.ShouldReceivePointer(pointer); if (!base.ShouldReceivePointer(pointer)) return false; @@ -97,26 +125,48 @@ public override bool CanBePreventedByGesture(Gesture gesture) /// 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) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersReleased(pointers); if (pointersNumState == PointersNumState.PassedMinThreshold) setState(GestureState.Recognized); + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// 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 e1709c166..be6ed2749 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TapGesture.cs @@ -9,6 +9,7 @@ using TouchScript.Utils.Attributes; using TouchScript.Pointers; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.Gestures { @@ -42,7 +43,10 @@ public event EventHandler Tapped // Needed to overcome iOS AOT limitations private EventHandler tappedInvoker; - public GestureEvent OnTap = new GestureEvent(); + /// + /// Unity event, occurs when gesture is recognized. + /// + public GestureEvent OnTap = new GestureEvent(); #endregion @@ -86,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 @@ -95,13 +122,18 @@ 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; @@ -111,24 +143,39 @@ public float DistanceLimit 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 + #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; - } + /// + 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 + #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() { @@ -137,6 +184,12 @@ protected override void OnEnable() distanceLimitInPixelsSquared = Mathf.Pow(distanceLimit * touchManager.DotsPerCentimeter, 2); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks @@ -144,12 +197,19 @@ protected override void OnEnable() /// protected override void pointersPressed(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersPressed(pointers); if (pointersNumState == PointersNumState.PassedMaxThreshold || pointersNumState == PointersNumState.PassedMinMaxThreshold) { setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif return; } @@ -174,6 +234,9 @@ protected override void pointersPressed(IList pointers) if ((pointers[0].Position - startPosition).sqrMagnitude > distanceLimitInPixelsSquared) { setState(GestureState.Failed); +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif return; } } @@ -189,11 +252,19 @@ protected override void pointersPressed(IList pointers) isActive = true; } } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } /// protected override void pointersUpdated(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersUpdated(pointers); if (distanceLimit < float.PositiveInfinity) @@ -201,34 +272,65 @@ protected override void pointersUpdated(IList pointers) 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 pointersReleased(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersReleased(pointers); - if (NumPointers == 0) + if (combinePointers) { - if (!isActive) - { - setState(GestureState.Failed); - return; - } + var count = pointers.Count; + for (var i = 0; i < count; i++) pointerSequence.Add(pointers[i]); - // pointers outside of gesture target are ignored in shouldCachePointerPosition() - // if all pointers 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 } /// @@ -239,7 +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); + if (UseUnityEvents) OnTap.Invoke(this); } /// 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/Base/OnePointTrasformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs index 94edb7991..40abbf73a 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/OnePointTrasformGestureBase.cs @@ -10,7 +10,7 @@ #if TOUCHSCRIPT_DEBUG using System.Collections; -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; #endif namespace TouchScript.Gestures.TransformGestures.Base @@ -187,7 +187,8 @@ protected override void pointersUpdated(IList pointers) deltaRotation = dR; deltaScale = dS; setState(GestureState.Changed); - break; + resetValues(); + break; } } } @@ -272,6 +273,7 @@ protected virtual Vector2 getPointPreviousScreenPosition() return activePointers[0].PreviousPosition; } + /// protected override void updateType() { type = type & ~TransformGesture.TransformType.Translation; diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs index 5538a5513..13acb87bc 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TransformGestureBase.cs @@ -9,7 +9,7 @@ using UnityEngine; #if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; #endif namespace TouchScript.Gestures.TransformGestures.Base @@ -67,8 +67,19 @@ 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 @@ -147,6 +158,9 @@ public Vector3 RotationAxis /// protected float screenTransformPixelThresholdSquared; + /// + /// The bit mask of what transform operations happened this frame. + /// protected TransformGesture.TransformType transformMask; /// @@ -185,6 +199,9 @@ public Vector3 RotationAxis /// protected Vector3 targetPosition; + /// + /// The type of the transforms this gesture can dispatch. + /// [SerializeField] protected TransformGesture.TransformType type = TransformGesture.TransformType.Translation | TransformGesture.TransformType.Scaling | TransformGesture.TransformType.Rotation; @@ -314,11 +331,7 @@ protected override void reset() { base.reset(); - deltaPosition = Vector3.zero; - deltaRotation = 0f; - deltaScale = 1f; - - transformMask = 0; + resetValues(); isTransforming = false; } @@ -326,8 +339,22 @@ protected override void reset() #region Protected methods + /// + /// Updates the type of the gesture. + /// protected virtual void updateType() {} + /// + /// Resets the frame delta values. + /// + protected void resetValues() + { + deltaPosition = Vector3.zero; + deltaRotation = 0f; + deltaScale = 1f; + transformMask = 0; + } + #if TOUCHSCRIPT_DEBUG protected int debugID; protected Coroutine debugCoroutine; diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs index 02f95f4c1..1f7884624 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Base/TwoPointTransformGestureBase.cs @@ -10,11 +10,14 @@ #if TOUCHSCRIPT_DEBUG using System.Collections; -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; #endif namespace TouchScript.Gestures.TransformGestures.Base { + /// + /// Abstract base classfor two-point transform gestures. + /// public abstract class TwoPointTransformGestureBase : TransformGestureBase { #region Constants @@ -41,28 +44,6 @@ public virtual float MinScreenPointsDistance } } - /// - public override Vector2 ScreenPosition - { - get - { - if (NumPointers == 0) return TouchManager.INVALID_POSITION; - if (NumPointers == 1) return activePointers[0].Position; - return (getPointScreenPosition(0) + getPointScreenPosition(1)) * .5f; - } - } - - /// - public override Vector2 PreviousScreenPosition - { - get - { - if (NumPointers == 0) return TouchManager.INVALID_POSITION; - if (NumPointers == 1) return activePointers[0].PreviousPosition; - return (getPointPreviousScreenPosition(0) + getPointPreviousScreenPosition(1)) * .5f; - } - } - #endregion #region Private variables @@ -253,6 +234,7 @@ protected override void pointersUpdated(IList pointers) deltaRotation = dR; deltaScale = dS; setState(GestureState.Changed); + resetValues(); break; } } diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs index 6925bdb4d..863058e5b 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs @@ -14,7 +14,7 @@ namespace TouchScript.Gestures.TransformGestures.Clustered /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Pinned Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/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 diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredPinnedTransformGesture.cs.meta index c89441338..dc28d9407 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs index d64a99af6..9f34c1787 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs @@ -14,7 +14,7 @@ namespace TouchScript.Gestures.TransformGestures.Clustered /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Screen Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/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 diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredScreenTransformGesture.cs.meta index addbcced0..2994ee866 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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/TransformGestures/Clustered/ClusteredTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs index cd7c24ad7..cbd15f599 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs @@ -14,7 +14,7 @@ namespace TouchScript.Gestures.TransformGestures.Clustered /// Should be used for large touch surfaces. /// [AddComponentMenu("TouchScript/Gestures/Clustered/Transform Gesture (Clustered)")] - [HelpURL("http://touchscript.github.io/docs/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 diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/Clustered/ClusteredTransformGesture.cs.meta index 6e8f83d6b..a7df18aad 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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 index ac1d60017..98cf79937 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ITransformGesture.cs @@ -33,21 +33,24 @@ public interface ITransformGesture /// TransformGesture.TransformType TransformMask { get; } - /// - /// Gets delta position between this frame and the last frame in world coordinates. - /// - Vector3 DeltaPosition { get; } - - /// - /// Gets delta rotation between this frame and last frame in degrees. - /// - 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. - /// - float DeltaScale { 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. diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs index 28d44e217..b7a992b78 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs @@ -7,8 +7,10 @@ using TouchScript.Layers; using TouchScript.Utils.Geom; using TouchScript.Pointers; +using UnityEngine.Profiling; + #if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; #endif using UnityEngine; @@ -18,7 +20,7 @@ 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_PinnedTransformGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_PinnedTransformGesture.htm")] public class PinnedTransformGesture : OnePointTrasformGestureBase { #region Constants @@ -87,6 +89,10 @@ public Plane TransformPlane private TouchLayer projectionLayer; private Plane transformPlane; +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + #endregion #region Public methods @@ -99,7 +105,11 @@ public Plane TransformPlane protected override void Awake() { base.Awake(); + transformPlane = new Plane(); +#if UNITY_5_6_OR_NEWER + gestureSampler = CustomSampler.Create("[TouchScript] Pinned Transform Gesture"); +#endif } /// @@ -110,6 +120,12 @@ protected override void OnEnable() updateProjectionPlane(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Gesture callbacks @@ -117,6 +133,10 @@ protected override void OnEnable() /// protected override void pointersPressed(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersPressed(pointers); if (NumPointers == pointers.Count) @@ -128,18 +148,41 @@ protected override void pointersPressed(IList pointers) drawDebug(activePointers[0].ProjectionParams.ProjectFrom(cachedTransform.position), activePointers[0].Position); #endif } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } -#if TOUCHSCRIPT_DEBUG +#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 diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/PinnedTransformGesture.cs.meta index f1dd73cfc..f934b7a13 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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/TransformGestures/ScreenTransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs index f357b5e60..16fb17847 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs @@ -6,10 +6,9 @@ using TouchScript.Layers; using TouchScript.Utils.Geom; using UnityEngine; -#if TOUCHSCRIPT_DEBUG +using UnityEngine.Profiling; using System.Collections.Generic; using TouchScript.Pointers; -#endif namespace TouchScript.Gestures.TransformGestures { @@ -17,27 +16,81 @@ 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/html/T_TouchScript_Gestures_ScreenTransformGesture.htm")] + [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 TOUCHSCRIPT_DEBUG +#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 /// 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 diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/ScreenTransformGesture.cs.meta index 4948188d7..c7436c8d8 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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/TransformGestures/TransformGesture.cs b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs index 95929d26a..827792c94 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs +++ b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -8,8 +8,10 @@ using TouchScript.Layers; using TouchScript.Utils; using TouchScript.Pointers; +using UnityEngine.Profiling; + #if TOUCHSCRIPT_DEBUG -using TouchScript.Utils.DebugUtils; +using TouchScript.Debugging.GL; #endif using UnityEngine; @@ -19,7 +21,7 @@ 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/html/T_TouchScript_Gestures_TransformGesture.htm")] + [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Gestures_TransformGestures_TransformGesture.htm")] public class TransformGesture : TwoPointTransformGestureBase { #region Constants @@ -30,6 +32,11 @@ public class TransformGesture : TwoPointTransformGestureBase [Flags] public enum TransformType { + /// + /// No transform. + /// + None = 0, + /// /// Translation. /// @@ -128,8 +135,8 @@ public Vector3 LocalDeltaPosition #region Private variables - [SerializeField] - private bool projectionProps; // Used in the custom inspector + [SerializeField] + private bool projectionProps; // Used in the custom inspector [SerializeField] private ProjectionType projection = ProjectionType.Layer; @@ -140,6 +147,10 @@ public Vector3 LocalDeltaPosition private TouchLayer projectionLayer; private Plane transformPlane; +#if UNITY_5_6_OR_NEWER + private CustomSampler gestureSampler; +#endif + #endregion #region Public methods @@ -152,16 +163,27 @@ public Vector3 LocalDeltaPosition 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 @@ -169,6 +191,10 @@ protected override void OnEnable() /// protected override void pointersPressed(IList pointers) { +#if UNITY_5_6_OR_NEWER + gestureSampler.Begin(); +#endif + base.pointersPressed(pointers); if (NumPointers == pointers.Count) @@ -176,24 +202,56 @@ protected override void pointersPressed(IList pointers) projectionLayer = activePointers[0].GetPressData().Layer; updateProjectionPlane(); } + +#if UNITY_5_6_OR_NEWER + gestureSampler.End(); +#endif } -#if TOUCHSCRIPT_DEBUG +#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; diff --git a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs.meta b/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/TransformGesture.cs.meta index 161fb15e1..1c3c80e0d 100644 --- a/Source/Assets/TouchScript/Scripts/Gestures/TransformGestures/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/Hit/HitData.cs b/Source/Assets/TouchScript/Scripts/Hit/HitData.cs index 86392329b..a94e36171 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/HitData.cs +++ b/Source/Assets/TouchScript/Scripts/Hit/HitData.cs @@ -21,7 +21,15 @@ public struct HitData [Flags] public enum HitType { - ScreenSpace, + /// + /// An unknown hit. + /// + Unknown, + + /// + /// Nothing hit, but some object grabbed the pointer. + /// + Screen, /// /// 3D hit. @@ -97,6 +105,9 @@ public RaycastHitUI RaycastHitUI get { return raycastHitUI; } } + /// + /// Indicates if this is a Screen Space hit. + /// public bool ScreenSpace { get { return screenSpace; } @@ -144,6 +155,9 @@ public Vector3 Normal } } + /// + /// Distance to the hit point. + /// public float Distance { get @@ -161,6 +175,9 @@ public float Distance } } + /// + /// Sorting layer of the hit target. + /// public int SortingLayer { get @@ -171,7 +188,7 @@ public int SortingLayer return 0; case HitType.World2D: if (sortingLayer == -1) updateSortingValues(); - return sortingLayer; + return sortingLayer; case HitType.UI: return raycastHitUI.SortingLayer; } @@ -179,6 +196,9 @@ public int SortingLayer } } + /// + /// Sorting order of the hit target. + /// public int SortingOrder { get @@ -220,6 +240,8 @@ public int SortingOrder /// 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; @@ -231,13 +253,15 @@ public HitData(Transform target, TouchLayer layer, bool screenSpace = false) raycastHit = default(RaycastHit); raycastHit2D = default(RaycastHit2D); raycastHitUI = default(RaycastHitUI); - type = HitType.ScreenSpace; + 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; @@ -248,6 +272,8 @@ public HitData(RaycastHit value, TouchLayer layer, bool screenSpace = false) : t /// 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) { @@ -259,8 +285,10 @@ public HitData(RaycastHit2D value, TouchLayer layer, bool screenSpace = false) : /// 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.GameObject.transform, layer, screenSpace) + this(value.Target, layer, screenSpace) { raycastHitUI = value; type = HitType.UI; diff --git a/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs b/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs index 25d8ebcd8..b9092dea7 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs +++ b/Source/Assets/TouchScript/Scripts/Hit/HitTest.cs @@ -40,6 +40,7 @@ public abstract class HitTest : MonoBehaviour /// /// Determines whether a pointer hit the object. /// + /// Pointer to raycast. /// Data from a raycast. /// 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) diff --git a/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs index 90ddbe90f..970e8a532 100644 --- a/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs +++ b/Source/Assets/TouchScript/Scripts/Hit/RaycastHitUI.cs @@ -8,20 +8,18 @@ namespace TouchScript.Hit { - public struct RaycastHitUI - { - - public GameObject GameObject; - 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; - - } -} - + /// + 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/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 c7c8b567b..375a859c4 100644 --- a/Source/Assets/TouchScript/Scripts/ITouchManager.cs +++ b/Source/Assets/TouchScript/Scripts/ITouchManager.cs @@ -94,7 +94,7 @@ 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 pointer input from some device. @@ -107,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 layers. - IList Layers { get; } - /// /// Gets the list of /// @@ -147,29 +141,12 @@ public interface ITouchManager IList PressedPointers { 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. + /// 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. @@ -189,7 +166,7 @@ public interface ITouchManager /// Cancels a pointer and returns it to the system of need. /// /// Pointer id to cancel. - /// Should the pointer be returned to the system. + /// If the pointer should be redispatched to the system. void CancelPointer(int id, bool shouldReturn); /// @@ -197,6 +174,11 @@ public interface ITouchManager /// /// Pointer id to cancel. void CancelPointer(int id); + + /// + /// Tells TouchScript to update internal state after a resolution change. + /// + void UpdateResolution(); } /// diff --git a/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs b/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs index 6984bb2c5..2f60e4b6d 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs @@ -2,6 +2,7 @@ * @author Valentin Simonov / http://va.lent.in/ */ +using TouchScript.Core; using TouchScript.Pointers; namespace TouchScript.InputSources @@ -15,7 +16,6 @@ namespace TouchScript.InputSources /// public interface IInputSource : INTERNAL_IInputSource { - /// /// Gets or sets current coordinates remapper. /// @@ -23,9 +23,14 @@ public interface IInputSource : INTERNAL_IInputSource 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 pointer. @@ -36,6 +41,9 @@ public interface IInputSource : INTERNAL_IInputSource bool CancelPointer(Pointer pointer, bool shouldReturn); } + /// + /// Internal methods for . DO NOT USE ANY OF THEM! + /// public interface INTERNAL_IInputSource { /// diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs index 730d40d46..9410a5d95 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -14,32 +14,32 @@ namespace TouchScript.InputSources.InputHandlers /// public class MouseHandler : IInputSource, IDisposable { - #region Consts + #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 - } + 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 + #endregion #region Public properties @@ -75,7 +75,7 @@ public bool EmulateSecondMousePointer private PointerDelegate removePointer; private PointerDelegate cancelPointer; - private State state; + private State state; private ObjectPool mousePool; private MousePointer mousePointer, fakeMousePointer; private Vector3 mousePointPos = Vector3.zero; @@ -100,99 +100,147 @@ public MouseHandler(PointerDelegate addPointer, PointerDelegate updatePointer, P this.removePointer = removePointer; this.cancelPointer = cancelPointer; - mousePool = new ObjectPool(4, () => new MousePointer(this), null, (t) => t.INTERNAL_Reset()); + mousePool = new ObjectPool(4, () => new MousePointer(this), null, resetPointer); mousePointPos = Input.mousePosition; - mousePointer = internalAddPointer(remapCoordinates(mousePointPos)); + mousePointer = internalAddPointer(remapCoordinates(mousePointPos)); - stateMouse(); + stateMouse(); } #region Public methods + /// + /// Cancels the mouse pointer. + /// + public void CancelMousePointer() + { + if (mousePointer != null) + { + cancelPointer(mousePointer); + mousePointer = null; + } + } + /// - public void UpdateInput() + public bool UpdateInput() { - var buttons = state == State.MouseAndFake ? fakeMousePointer.Buttons : mousePointer.Buttons; - var newButtons = getMouseButtons(); - var pos = Input.mousePosition; - Vector2 remappedPos = new Vector2(0, 0); - - if (mousePointPos != pos) - { - remappedPos = remapCoordinates(new Vector2(pos.x, pos.y)); - mousePointer.Position = remappedPos; - updatePointer(mousePointer); - } - - var scroll = Input.mouseScrollDelta; - if (!Mathf.Approximately(scroll.sqrMagnitude, 0.0f)) - { - mousePointer.ScrollDelta = scroll; - updatePointer(mousePointer); - } + var pos = Input.mousePosition; + Vector2 remappedPos = new Vector2(0, 0); + bool updated = false; + + if (mousePointPos != pos) + { + remappedPos = remapCoordinates(new Vector2(pos.x, pos.y)); + + if (mousePointer == null) + { + mousePointer = internalAddPointer(remappedPos); + } + else + { + mousePointer.Position = remappedPos; + updatePointer(mousePointer); + } + updated = true; + } + + 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)) + { + mousePointer.ScrollDelta = scroll; + updatePointer(mousePointer); + } + else + { + mousePointer.ScrollDelta = Vector2.zero; + } if (emulateSecondMousePointer) { - switch (state) - { - 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; - } - } else { - if (buttons != newButtons) updateButtons(buttons, newButtons); - } - - mousePointPos = pos; + switch (state) + { + 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; + } + } + else + { + if (buttons != newButtons) + { + updateButtons(buttons, newButtons); + updated = true; + } + } + + mousePointPos = pos; + return updated; + } + + /// + public void UpdateResolution() + { + TouchManager.Instance.CancelPointer(mousePointer.Id); } /// @@ -202,7 +250,7 @@ public bool CancelPointer(Pointer pointer, bool shouldReturn) { cancelPointer(mousePointer); if (shouldReturn) mousePointer = internalReturnPointer(mousePointer); - else mousePointer = internalAddPointer(mousePointer.Position); // can't totally cancel mouse pointer + else mousePointer = internalAddPointer(mousePointer.Position); // can't totally cancel mouse pointer return true; } if (pointer.Equals(fakeMousePointer)) @@ -215,7 +263,9 @@ public bool CancelPointer(Pointer pointer, bool shouldReturn) return false; } - /// + /// + /// Releases resources. + /// public void Dispose() { if (mousePointer != null) @@ -266,16 +316,16 @@ private Pointer.PointerButtonState getMouseButtons() return buttons; } - private void updateButtons(Pointer.PointerButtonState oldButtons, Pointer.PointerButtonState newButtons) - { + private void updateButtons(Pointer.PointerButtonState oldButtons, Pointer.PointerButtonState newButtons) + { // pressed something - if (oldButtons == Pointer.PointerButtonState.Nothing) + if (oldButtons == Pointer.PointerButtonState.Nothing) { // pressed and released this frame if ((newButtons & Pointer.PointerButtonState.AnyButtonPressed) == 0) { // Add pressed buttons for processing - mousePointer.Buttons = newButtons | (Pointer.PointerButtonState) ((uint) (newButtons & Pointer.PointerButtonState.AnyButtonDown) >> 1); + mousePointer.Buttons = PointerUtils.PressDownButtons(newButtons); pressPointer(mousePointer); internalReleaseMousePointer(newButtons); } @@ -302,29 +352,30 @@ private void updateButtons(Pointer.PointerButtonState oldButtons, Pointer.Pointe updatePointer(mousePointer); } } - } - - private bool fakeTouchReleased() - { - if (!Input.GetKey(KeyCode.LeftAlt)) - { - // Alt is released, need to kill the fake touch - fakeMousePointer.Buttons = (Pointer.PointerButtonState)((uint)fakeMousePointer.Buttons << 2); // 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 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; + pointer.Flags |= flags; addPointer(pointer); + updatePointer(pointer); return pointer; } @@ -343,7 +394,7 @@ private MousePointer internalReturnPointer(MousePointer pointer) if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) { // Adding down state this frame - newPointer.Buttons |= (Pointer.PointerButtonState) ((uint) (newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) << 1); + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); pressPointer(newPointer); } return newPointer; @@ -355,36 +406,40 @@ private Vector2 remapCoordinates(Vector2 position) return position; } - #endregion + private void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } - #region State logic + #endregion - private void stateMouse() - { - setState(State.Mouse); - } + #region State logic - private void stateWaitingForFake() - { - setState(State.WaitingForFake); - } + private void stateMouse() + { + setState(State.Mouse); + } - private void stateMouseAndFake() - { - setState(State.MouseAndFake); - } + private void stateWaitingForFake() + { + setState(State.WaitingForFake); + } - private void stateStationaryFake() - { - setState(State.StationaryFake); - } + private void stateMouseAndFake() + { + setState(State.MouseAndFake); + } - private void setState(State newState) - { - state = newState; - } + private void stateStationaryFake() + { + setState(State.StationaryFake); + } - #endregion + private void setState(State newState) + { + state = newState; + } + #endregion } } \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs index 48c4578f8..d492b6637 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/TouchHandler.cs @@ -1,4 +1,4 @@ -/* +/* * @author Michael Holub * @author Valentin Simonov / http://va.lent.in/ */ @@ -8,6 +8,7 @@ using TouchScript.Pointers; using TouchScript.Utils; using UnityEngine; +using UnityEngine.Profiling; namespace TouchScript.InputSources.InputHandlers { @@ -43,9 +44,13 @@ public bool HasPointers private ObjectPool touchPool; // Unity fingerId -> TouchScript touch info - private Dictionary systemToInternalId = new Dictionary(); + private Dictionary systemToInternalId = new Dictionary(10); private int pointersNum; +#if UNITY_5_6_OR_NEWER + private CustomSampler updateSampler; +#endif + #endregion /// @@ -66,15 +71,23 @@ public TouchHandler(PointerDelegate addPointer, PointerDelegate updatePointer, P this.removePointer = removePointer; this.cancelPointer = cancelPointer; - touchPool = new ObjectPool(10, () => new TouchPointer(this), null, (t) => t.INTERNAL_Reset()); + 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 /// - public void UpdateInput() + 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); @@ -95,20 +108,22 @@ public void UpdateInput() } break; case TouchPhase.Moved: - if (systemToInternalId.TryGetValue(t.fingerId, out touchState)) - { - if (touchState.Phase != TouchPhase.Canceled) - { - touchState.Pointer.Position = t.position; + if (systemToInternalId.TryGetValue(t.fingerId, out touchState)) + { + if (touchState.Phase != TouchPhase.Canceled) + { + touchState.Pointer.Position = t.position; updatePointer(touchState.Pointer); - } - } + } + } else { // Missed began phase 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)) { @@ -145,8 +160,17 @@ public void UpdateInput() break; } } + +#if UNITY_5_6_OR_NEWER + updateSampler.End(); +#endif + + return Input.touchCount > 0; } + /// + public void UpdateResolution() {} + /// public bool CancelPointer(Pointer pointer, bool shouldReturn) { @@ -172,7 +196,9 @@ public bool CancelPointer(Pointer pointer, bool shouldReturn) return false; } - /// + /// + /// Releases resources. + /// public void Dispose() { foreach (var touchState in systemToInternalId) @@ -243,6 +269,11 @@ private Vector2 remapCoordinates(Vector2 position) return position; } + private void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } + #endregion private struct TouchState @@ -255,8 +286,6 @@ public TouchState(Pointer pointer, TouchPhase phase = TouchPhase.Began) 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 index 5975bfc93..d8485ca56 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/WindowsPointerHandlers.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ * @author Valentin Frolov * @author Andrew David Griffiths @@ -11,23 +11,27 @@ 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. + /// 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 + #region Public properties + /// + /// Should the primary pointer also dispatch a mouse pointer. + /// public bool MouseInPointer { get { return mouseInPointer; } set { - EnableMouseInPointer(value); + WindowsUtils.EnableMouseInPointer(value); mouseInPointer = value; if (mouseInPointer) { @@ -39,9 +43,7 @@ public bool MouseInPointer { if ((mousePointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) { - var pressed = (uint) (mousePointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed); - mousePointer.Buttons |= (Pointer.PointerButtonState) (pressed << 2); // add up state - mousePointer.Buttons &= ~Pointer.PointerButtonState.AnyButtonPressed; // remove pressed state + mousePointer.Buttons = PointerUtils.UpPressedButtons(mousePointer.Buttons); releasePointer(mousePointer); } removePointer(mousePointer); @@ -50,30 +52,37 @@ public bool MouseInPointer } } -#endregion + #endregion -#region Private variables + #region Private variables private bool mouseInPointer = true; -#endregion + #endregion -#region Constructor + #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, (t) => t.INTERNAL_Reset()); - penPool = new ObjectPool(2, () => new PenPointer(this), null, (t) => t.INTERNAL_Reset()); + 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 + #endregion + + #region Public methods -#region Public methods + /// + public override bool UpdateInput() + { + base.UpdateInput(); + return true; + } /// public override bool CancelPointer(Pointer pointer, bool shouldReturn) @@ -82,14 +91,13 @@ public override bool CancelPointer(Pointer pointer, bool shouldReturn) { cancelPointer(mousePointer); if (shouldReturn) mousePointer = internalReturnMousePointer(mousePointer); - else mousePointer = internalAddMousePointer(pointer.Position); // can't totally cancell mouse pointer + else mousePointer = internalAddMousePointer(pointer.Position); // can't totally cancel mouse pointer return true; } if (pointer.Equals(penPointer)) { cancelPointer(penPointer); if (shouldReturn) penPointer = internalReturnPenPointer(penPointer); - else penPointer = internalAddPenPointer(pointer.Position); // can't totally cancell mouse pointer return true; } return base.CancelPointer(pointer, shouldReturn); @@ -109,14 +117,14 @@ public override void Dispose() penPointer = null; } - EnableMouseInPointer(false); + WindowsUtils.EnableMouseInPointer(false); base.Dispose(); } -#endregion + #endregion -#region Internal methods + #region Internal methods /// public override void INTERNAL_DiscardPointer(Pointer pointer) @@ -126,48 +134,56 @@ public override void INTERNAL_DiscardPointer(Pointer pointer) else base.INTERNAL_DiscardPointer(pointer); } -#endregion - + #endregion } public class Windows7PointerHandler : WindowsPointerHandler { - private int touchInputSize; - /// 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 + #region Consts /// - /// Source of pointer input. + /// Windows constant to turn off press and hold visual effect. /// - public enum PointerSource - { - Pointer, - Pen, - Mouse - } + public const string PRESS_AND_HOLD_ATOM = "MicrosoftTabletPenServiceProperty"; /// - /// Windows constant to turn off press and hold visual effect. + /// The method delegate used to pass data from the native DLL. /// - public const string PRESS_AND_HOLD_ATOM = "MicrosoftTabletPenServiceProperty"; + /// Pointer id. + /// Current event. + /// Pointer type. + /// Pointer position. + /// Pointer data. + protected delegate void NativePointerDelegate(int id, PointerEvent evt, PointerType type, Vector2 position, PointerData data); - protected delegate void NativeMousePointerDown(int id, Pointer.PointerButtonState buttons, Vector2 position); - protected delegate void NativeMousePointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, Vector2 position); - protected delegate void NativeTouchPointerDown(int id, Pointer.PointerButtonState buttons, uint orientation, uint pressure, Vector2 position); - protected delegate void NativeTouchPointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, uint orientation, uint pressure, Vector2 position); - protected delegate void NativePenPointerDown(int id, Pointer.PointerButtonState buttons, Vector2 position); - protected delegate void NativePenPointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, Vector2 position); - protected delegate void NativePointerUp(int id, POINTER_INPUT_TYPE type, Pointer.PointerButtonState buttons); - protected delegate void NativePointerCancel(int id, POINTER_INPUT_TYPE type); + /// + /// 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 @@ -178,16 +194,10 @@ public enum PointerSource #endregion - #region Protected variables + #region Private variables - private NativeMousePointerDown nativeMousePointerDownDelegate; - private NativeMousePointerUpdate nativeMousePointerUpdateDelegate; - private NativeTouchPointerDown nativeTouchPointerDownDelegate; - private NativeTouchPointerUpdate nativeTouchPointerUpdateDelegate; - private NativePenPointerDown nativePenPointerDownDelegate; - private NativePenPointerUpdate nativePenPointerUpdateDelegate; - private NativePointerUp nativePointerUpDelegate; - private NativePointerCancel nativePointerCancelDelegate; + private NativePointerDelegate nativePointerDelegate; + private NativeLog nativeLogDelegate; protected PointerDelegate addPointer; protected PointerDelegate updatePointer; @@ -198,7 +208,7 @@ public enum PointerSource protected IntPtr hMainWindow; protected ushort pressAndHoldAtomID; - protected Dictionary winTouchToInternalId = new Dictionary(); + protected Dictionary winTouchToInternalId = new Dictionary(10); protected ObjectPool touchPool; protected ObjectPool mousePool; @@ -228,29 +238,31 @@ public WindowsPointerHandler(PointerDelegate addPointer, PointerDelegate updateP this.removePointer = removePointer; this.cancelPointer = cancelPointer; - nativeMousePointerDownDelegate = nativeMousePointerDown; - nativeMousePointerUpdateDelegate = nativeMousePointerUpdate; - nativeTouchPointerDownDelegate = nativeTouchPointerDown; - nativeTouchPointerUpdateDelegate = nativeTouchPointerUpdate; - nativePenPointerDownDelegate = nativePenPointerDown; - nativePenPointerUpdateDelegate = nativePenPointerUpdate; - nativePointerUpDelegate = nativePointerUp; - nativePointerCancelDelegate = nativePointerCancel; + nativeLogDelegate = nativeLog; + nativePointerDelegate = nativePointer; - touchPool = new ObjectPool(10, () => new TouchPointer(this), null, (t) => t.INTERNAL_Reset()); + touchPool = new ObjectPool(10, () => new TouchPointer(this), null, resetPointer); - hMainWindow = GetActiveWindow(); + hMainWindow = WindowsUtils.GetActiveWindow(); disablePressAndHold(); - initScaling(); + setScaling(); } -#endregion + #endregion + + #region Public methods -#region Public methods + /// + public virtual bool UpdateInput() + { + return false; + } /// - public void UpdateInput() + public virtual void UpdateResolution() { + setScaling(); + if (mousePointer != null) TouchManager.Instance.CancelPointer(mousePointer.Id); } /// @@ -278,7 +290,9 @@ public virtual bool CancelPointer(Pointer pointer, bool shouldReturn) return false; } - /// + /// + /// Releases resources. + /// public virtual void Dispose() { foreach (var i in winTouchToInternalId) cancelPointer(i.Value); @@ -288,9 +302,9 @@ public virtual void Dispose() DisposePlugin(); } -#endregion + #endregion -#region Internal methods + #region Internal methods /// public virtual void INTERNAL_DiscardPointer(Pointer pointer) @@ -301,16 +315,14 @@ public virtual void INTERNAL_DiscardPointer(Pointer pointer) touchPool.Release(p); } -#endregion + #endregion -#region Protected methods + #region Protected methods - protected TouchPointer internalAddTouchPointer(Vector2 position, uint orientation = 0, float pressure = 0) + protected TouchPointer internalAddTouchPointer(Vector2 position) { var pointer = touchPool.Get(); pointer.Position = remapCoordinates(position); - pointer.Orientation = orientation; - pointer.Pressure = pressure; pointer.Buttons |= Pointer.PointerButtonState.FirstButtonDown | Pointer.PointerButtonState.FirstButtonPressed; addPointer(pointer); pressPointer(pointer); @@ -353,7 +365,7 @@ protected MousePointer internalReturnMousePointer(MousePointer pointer) if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) { // Adding down state this frame - newPointer.Buttons |= (Pointer.PointerButtonState)((uint)(newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) << 1); + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); pressPointer(newPointer); } return newPointer; @@ -361,12 +373,19 @@ protected MousePointer internalReturnMousePointer(MousePointer pointer) 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(); @@ -376,7 +395,7 @@ protected PenPointer internalReturnPenPointer(PenPointer pointer) if ((newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) != 0) { // Adding down state this frame - newPointer.Buttons |= (Pointer.PointerButtonState)((uint)(newPointer.Buttons & Pointer.PointerButtonState.AnyButtonPressed) << 1); + newPointer.Buttons = PointerUtils.DownPressedButtons(newPointer.Buttons); pressPointer(newPointer); } return newPointer; @@ -384,11 +403,7 @@ protected PenPointer internalReturnPenPointer(PenPointer pointer) protected void init(TOUCH_API api) { - Init(api, - nativeMousePointerDownDelegate, nativeMousePointerUpdateDelegate, - nativeTouchPointerDownDelegate, nativeTouchPointerUpdateDelegate, - nativePenPointerDownDelegate, nativePenPointerUpdateDelegate, - nativePointerUpDelegate, nativePointerCancelDelegate); + Init(api, nativeLogDelegate, nativePointerDelegate); } protected Vector2 remapCoordinates(Vector2 position) @@ -397,6 +412,11 @@ protected Vector2 remapCoordinates(Vector2 position) return position; } + protected void resetPointer(Pointer p) + { + p.INTERNAL_Reset(); + } + #endregion #region Private functions @@ -404,12 +424,12 @@ protected Vector2 remapCoordinates(Vector2 position) private 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); + 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); ); } @@ -417,137 +437,186 @@ private void enablePressAndHold() { if (pressAndHoldAtomID != 0) { - RemoveProp(hMainWindow, PRESS_AND_HOLD_ATOM); - GlobalDeleteAtom(pressAndHoldAtomID); + WindowsUtils.RemoveProp(hMainWindow, PRESS_AND_HOLD_ATOM); + WindowsUtils.GlobalDeleteAtom(pressAndHoldAtomID); } } - private void initScaling() + private void setScaling() { + var screenWidth = Screen.width; + var screenHeight = Screen.height; + if (!Screen.fullScreen) { - SetScreenParams(Screen.width, Screen.height, 0, 0, 1, 1); + SetScreenParams(screenWidth, screenHeight, 0, 0, 1, 1); return; } int width, height; - getNativeMonitorResolution(out width, out height); - float scale = Mathf.Max(Screen.width / ((float)width), Screen.height / ((float)height)); - SetScreenParams(Screen.width, Screen.height, (width - Screen.width / scale) * .5f, (height - Screen.height / scale) * .5f, scale, 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; - } + 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 nativeMousePointerDown(int id, Pointer.PointerButtonState buttons, Vector2 position) + private void nativeLog(string log) { - mousePointer.Buttons = buttons; - pressPointer(mousePointer); + Debug.Log("[WindowsTouch.dll]: " + log); } - private void nativeTouchPointerDown(int id, Pointer.PointerButtonState buttons, uint orientation, uint pressure, Vector2 position) + private void nativePointer(int id, PointerEvent evt, PointerType type, Vector2 position, PointerData data) { - winTouchToInternalId.Add(id, internalAddTouchPointer(position, orientation, pressure / 1024f)); - } - - private void nativePenPointerDown(int id, Pointer.PointerButtonState buttons, Vector2 position) - { - penPointer.Buttons = buttons; - pressPointer(penPointer); + 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 void nativeMousePointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, Vector2 position) + private Pointer.PointerButtonState updateButtons(Pointer.PointerButtonState current, PointerFlags flags, ButtonChangeType change) { - if (mousePointer == null) return; - mousePointer.Position = position; - mousePointer.Buttons &= ~buttonsClear; - mousePointer.Buttons |= buttonsSet; - updatePointer(mousePointer); + 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 void nativeTouchPointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, uint orientation, uint pressure, Vector2 position) + private float getTouchPressure(ref PointerData data) { - TouchPointer touchPointer; - if (!winTouchToInternalId.TryGetValue(id, out touchPointer)) return; - touchPointer.Position = position; - touchPointer.Orientation = orientation; - touchPointer.Pressure = pressure / 1024f; - touchPointer.Buttons &= ~buttonsClear; - touchPointer.Buttons |= buttonsSet; - updatePointer(touchPointer); + var reliable = (data.Mask & (uint) TouchMask.Pressure) > 0; + if (reliable) return data.Pressure / 1024f; + return TouchPointer.DEFAULT_PRESSURE; } - private void nativePenPointerUpdate(int id, Pointer.PointerButtonState buttonsSet, Pointer.PointerButtonState buttonsClear, Vector2 position) + private float getTouchRotation(ref PointerData data) { - if (penPointer == null) return; - penPointer.Position = position; - penPointer.Buttons &= ~buttonsClear; - penPointer.Buttons |= buttonsSet; - updatePointer(penPointer); + var reliable = (data.Mask & (uint) TouchMask.Orientation) > 0; + if (reliable) return data.Rotation / 180f * Mathf.PI; + return TouchPointer.DEFAULT_ROTATION; } - private void nativePointerUp(int id, POINTER_INPUT_TYPE type, Pointer.PointerButtonState buttons) + private float getPenPressure(ref PointerData data) { - switch (type) - { - case POINTER_INPUT_TYPE.PT_MOUSE: - mousePointer.Buttons = buttons; - releasePointer(mousePointer); - break; - case POINTER_INPUT_TYPE.PT_TOUCH: - TouchPointer touchPointer; - if (winTouchToInternalId.TryGetValue(id, out touchPointer)) - { - winTouchToInternalId.Remove(id); - internalRemoveTouchPointer(touchPointer); - } - break; - case POINTER_INPUT_TYPE.PT_PEN: - penPointer.Buttons = buttons; - releasePointer(penPointer); - break; - } + var reliable = (data.Mask & (uint) PenMask.Pressure) > 0; + if (reliable) return data.Pressure / 1024f; + return PenPointer.DEFAULT_PRESSURE; } - private void nativePointerCancel(int id, POINTER_INPUT_TYPE type) + private float getPenRotation(ref PointerData data) { - switch (type) - { - case POINTER_INPUT_TYPE.PT_MOUSE: - cancelPointer(mousePointer); - mousePointer = internalAddMousePointer(mousePointer.Position); // can't totally cancell mouse pointer - break; - case POINTER_INPUT_TYPE.PT_TOUCH: - TouchPointer touchPointer; - if (winTouchToInternalId.TryGetValue(id, out touchPointer)) - { - winTouchToInternalId.Remove(id); - cancelPointer(touchPointer); - } - break; - case POINTER_INPUT_TYPE.PT_PEN: - cancelPointer(penPointer); - penPointer = internalAddPenPointer(penPointer.Position); // can't totally cancell mouse pointer; - break; - } + var reliable = (data.Mask & (uint) PenMask.Rotation) > 0; + if (reliable) return data.Rotation / 180f * Mathf.PI; + return PenPointer.DEFAULT_ROTATION; } #endregion @@ -560,62 +629,113 @@ protected enum TOUCH_API WIN8 } - private const int TABLET_DISABLE_PRESSANDHOLD = 0x00000001; - private const int TABLET_DISABLE_PENTAPFEEDBACK = 0x00000008; - private const int TABLET_DISABLE_PENBARRELFEEDBACK = 0x00000010; - private const int TABLET_DISABLE_FLICKS = 0x00010000; + protected enum PointerEvent : uint + { + Enter = 0x0249, + Leave = 0x024A, + Update = 0x0245, + Down = 0x0246, + Up = 0x0247, + Cancelled = 0x1000 + } - private const int MONITOR_DEFAULTTONEAREST = 2; + protected enum PointerType + { + Pointer = 0x00000001, + Touch = 0x00000002, + Pen = 0x00000003, + Mouse = 0x00000004, + TouchPad = 0x00000005 + } - [StructLayout(LayoutKind.Sequential)] - private struct MONITORINFO + [Flags] + protected enum PointerFlags { - public int cbSize; - public RECT rcMonitor; - public RECT rcWork; - public uint dwFlags; + 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 } - [StructLayout(LayoutKind.Sequential)] - private struct RECT + protected enum ButtonChangeType { - public int Left, Top, Right, Bottom; + None, + FirstDown, + FirstUp, + SecondDown, + SecondUp, + ThirdDown, + ThirdUp, + FourthDown, + FourthUp, + FifthDown, + FifthUp + } - public RECT(int left, int top, int right, int bottom) - { - Left = left; - Top = top; - Right = right; - Bottom = bottom; - } + [Flags] + protected enum TouchFlags + { + None = 0x00000000 + } - public int Height - { - get { return Bottom - Top; } - set { Bottom = value + Top; } - } + [Flags] + protected enum TouchMask + { + None = 0x00000000, + ContactArea = 0x00000001, + Orientation = 0x00000002, + Pressure = 0x00000004 + } - public int Width - { - get { return Right - Left; } - set { Right = value + Left; } - } + [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 } - protected enum POINTER_INPUT_TYPE + [StructLayout(LayoutKind.Sequential)] + protected struct PointerData { - PT_POINTER = 0x00000001, - PT_TOUCH = 0x00000002, - PT_PEN = 0x00000003, - PT_MOUSE = 0x00000004, + 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, - NativeMousePointerDown nativeMousePointerDown, NativeMousePointerUpdate nativeMousePointerUpdate, - NativeTouchPointerDown nativeTouchPointerDown, NativeTouchPointerUpdate nativeTouchPointerUpdate, - NativePenPointerDown nativePenPointerDown, NativePenPointerUpdate nativePenPointerUpdate, - NativePointerUp nativePointerUp, NativePointerCancel nativePointerCancel); + private static extern void Init(TOUCH_API api, NativeLog log, NativePointerDelegate pointerDelegate); [DllImport("WindowsTouch", EntryPoint = "Dispose", CallingConvention = CallingConvention.StdCall)] private static extern void DisposePlugin(); @@ -623,30 +743,6 @@ private static extern void Init(TOUCH_API api, [DllImport("WindowsTouch", CallingConvention = CallingConvention.StdCall)] private static extern void SetScreenParams(int width, int height, float offsetX, float offsetY, float scaleX, float scaleY); - [DllImport("user32.dll")] - private static extern IntPtr GetActiveWindow(); - - [DllImport("user32.dll")] - private static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); - - [DllImport("user32.dll")] - private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi); - - [DllImport("Kernel32.dll")] - private static extern ushort GlobalAddAtom(string lpString); - - [DllImport("Kernel32.dll")] - private static extern ushort GlobalDeleteAtom(ushort nAtom); - - [DllImport("user32.dll")] - private static extern int SetProp(IntPtr hWnd, string lpString, int hData); - - [DllImport("user32.dll")] - private static extern int RemoveProp(IntPtr hWnd, string lpString); - - [DllImport("user32.dll")] - public static extern IntPtr EnableMouseInPointer(bool value); - #endregion } } diff --git a/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs b/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs index c60a7dd62..bd6d5d065 100644 --- a/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs +++ b/Source/Assets/TouchScript/Scripts/InputSources/InputSource.cs @@ -3,6 +3,7 @@ */ using System; +using TouchScript.Core; using TouchScript.Pointers; using UnityEngine; @@ -41,9 +42,12 @@ public ICoordinatesRemapper CoordinatesRemapper #region Private variables - [SerializeField] [HideInInspector] private bool advancedProps; // is used to save whether advanced properties are opened or closed + /// + [SerializeField] + [HideInInspector] + protected bool basicEditor = true; - private ICoordinatesRemapper coordinatesRemapper; + private ICoordinatesRemapper coordinatesRemapper; private TouchManagerInstance manager; #endregion @@ -51,10 +55,14 @@ public ICoordinatesRemapper CoordinatesRemapper #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) { @@ -66,9 +74,7 @@ public virtual bool CancelPointer(Pointer pointer, bool shouldReturn) #region Internal methods /// - public virtual void INTERNAL_DiscardPointer(Pointer pointer) - { - } + public virtual void INTERNAL_DiscardPointer(Pointer pointer) {} #endregion @@ -164,15 +170,13 @@ protected virtual void cancelPointer(Pointer pointer) /// Called from setter to update touch handlers with the new value. /// /// The new remapper. - protected virtual void updateCoordinatesRemapper(ICoordinatesRemapper remapper) - { - } + protected virtual void updateCoordinatesRemapper(ICoordinatesRemapper remapper) {} /// /// Remaps the coordinates using the if it is set. /// /// The position. - /// Remapped position if is set; otherwise. + /// Remapped position if is set; the value of position argument otherwise. protected virtual Vector2 remapCoordinates(Vector2 position) { if (coordinatesRemapper != null) return coordinatesRemapper.Remap(position); diff --git a/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs b/Source/Assets/TouchScript/Scripts/InputSources/StandardInput.cs index ec266a6c5..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/ */ @@ -145,13 +145,23 @@ public bool EmulateSecondMousePointer private static StandardInput instance; - [SerializeField] - private bool generalProps; // Used in the custom inspector +#pragma warning disable CS0414 [SerializeField] - private bool windowsProps; // Used in the custom inspector + [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] @@ -189,12 +199,49 @@ public bool EmulateSecondMousePointer #region Public methods /// - public override void UpdateInput() + public override bool UpdateInput() { - base.UpdateInput(); + if (base.UpdateInput()) return true; - if (touchHandler != null) touchHandler.UpdateInput(); - if (mouseHandler != null) mouseHandler.UpdateInput(); + var handled = false; +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + if (windows8PointerHandler != null) + { + handled = windows8PointerHandler.UpdateInput(); + } + else + { + if (windows7PointerHandler != null) + { + handled = windows7PointerHandler.UpdateInput(); + } + else +#endif + if (touchHandler != null) + { + handled = touchHandler.UpdateInput(); + } + if (mouseHandler != null) + { + if (handled) mouseHandler.CancelMousePointer(); + else handled = mouseHandler.UpdateInput(); + } + +#if UNITY_STANDALONE_WIN && !UNITY_EDITOR + } +#endif + return handled; + } + + /// + public override void UpdateResolution() + { +#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(); } /// @@ -314,6 +361,12 @@ protected override void OnDisable() base.OnDisable(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Protected methods @@ -398,6 +451,6 @@ private void disableWindows8Touch() } #endif -#endregion + #endregion } } \ No newline at end of file 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/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/ProjectionParams.cs b/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs index 7c5addf77..64ce549eb 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/ProjectionParams.cs @@ -2,7 +2,7 @@ * @author Valentin Simonov / http://va.lent.in/ */ -using TouchScript.Utils; +using TouchScript.Utils.Geom; using UnityEngine; namespace TouchScript.Layers @@ -87,7 +87,7 @@ public class WorldSpaceCanvasProjectionParams : ProjectionParams protected Camera camera; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The canvas. public WorldSpaceCanvasProjectionParams(Canvas canvas) diff --git a/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs index d612be1d6..59e6bf6e0 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs @@ -15,12 +15,19 @@ 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; } @@ -31,6 +38,9 @@ public bool Hit3DObjects } } + /// + /// 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; } @@ -41,22 +51,36 @@ public bool Hit2DObjects } } + /// + /// 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; } + 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; } @@ -102,11 +126,21 @@ public override Vector3 WorldProjectionNormal #endif private static RaycastHit2D[] raycastHits2D = new RaycastHit2D[20]; - [SerializeField] +#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] - private bool hitProps; + [HideInInspector] + private bool hitProps; [SerializeField] [ToggleLeft] @@ -114,11 +148,11 @@ public override Vector3 WorldProjectionNormal [SerializeField] [ToggleLeft] - private bool hit2DObjects = true; + private bool hit2DObjects = true; [SerializeField] [ToggleLeft] - private bool hitWorldSpaceUI = true; + private bool hitWorldSpaceUI = true; [SerializeField] [ToggleLeft] @@ -132,6 +166,7 @@ public override Vector3 WorldProjectionNormal private bool useHitFilters = false; private bool lookForCameraObjects = false; + private TouchScriptInputModule inputModule; /// /// Camera. @@ -142,6 +177,7 @@ public override Vector3 WorldProjectionNormal #region Public methods + /// public override HitResult Hit(IPointer pointer, out HitData hit) { if (base.Hit(pointer, out hit) != HitResult.Hit) return HitResult.Miss; @@ -216,23 +252,29 @@ private void OnEnable() { if (!Application.isPlaying) return; TouchManager.Instance.FrameStarted += frameStartedHandler; - StartCoroutine(lateEnable()); + StartCoroutine(lateEnable()); } - private IEnumerator lateEnable() - { - // Need to wait while EventSystem initializes - yield return new WaitForEndOfFrame(); - if (TouchScriptInputModule.Instance != null) TouchScriptInputModule.Instance.INTERNAL_Retain(); - } + private IEnumerator lateEnable() + { + // Need to wait while EventSystem initializes + yield return new WaitForEndOfFrame(); + setupInputModule(); + } private void OnDisable() { if (!Application.isPlaying) return; - if (TouchScriptInputModule.Instance != null) TouchScriptInputModule.Instance.INTERNAL_Release(); + 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 @@ -263,6 +305,22 @@ protected override void setName() #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); @@ -276,7 +334,8 @@ private HitResult performWorldSearch(IPointer pointer, out HitData hit) var ray = _camera.ScreenPointToRay(position); int count; - + bool exclusiveSet = manager.HasExclusive; + if (hit3DObjects) { #if UNITY_5_3_OR_NEWER @@ -289,11 +348,20 @@ private HitResult performWorldSearch(IPointer pointer, out HitData hit) // 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++) raycastHitList.Add(raycastHits[i]); + 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) { @@ -307,17 +375,30 @@ private HitResult performWorldSearch(IPointer pointer, out HitData hit) hit = new HitData(raycastHitList[0], this); return HitResult.Hit; } - if (useHitFilters) return doHit(pointer, raycastHits[0], out hit); - hit = new HitData(raycastHits[0], this); + + 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++) hitList.Add(new HitData(raycastHits[i], this)); + 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++) hitList.Add(new HitData(raycastHits2D[i], this)); + 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) @@ -330,9 +411,9 @@ private HitResult performWorldSearch(IPointer pointer, out HitData hit) { var raycaster = raycasters[i] as GraphicRaycaster; if (raycaster == null) continue; - var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); // TODO: cache + var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); if ((canvas == null) || (canvas.renderMode == RenderMode.ScreenSpaceOverlay) || (canvas.worldCamera != _camera)) continue; - performUISearchForCanvas(pointer, canvas, raycaster, float.MaxValue, ray); + performUISearchForCanvas(pointer, canvas, raycaster, _camera, float.MaxValue, ray); } count = raycastHitUIList.Count; @@ -368,7 +449,6 @@ private HitResult performWorldSearch(IPointer pointer, out HitData hit) private HitResult performSSUISearch(IPointer pointer, out HitData hit) { hit = default(HitData); - raycastHitUIList.Clear(); if (raycasters == null) raycasters = TouchScriptInputModule.Instance.GetRaycasters(); @@ -378,7 +458,7 @@ private HitResult performSSUISearch(IPointer pointer, out HitData hit) { var raycaster = raycasters[i] as GraphicRaycaster; if (raycaster == null) continue; - var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); // TODO: cache + var canvas = TouchScriptInputModule.Instance.GetCanvasForRaycaster(raycaster); if ((canvas == null) || (canvas.renderMode != RenderMode.ScreenSpaceOverlay)) continue; performUISearchForCanvas(pointer, canvas, raycaster); } @@ -397,23 +477,29 @@ private HitResult performSSUISearch(IPointer pointer, out HitData hit) } 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, float maxDistance = float.MaxValue, Ray ray = default(Ray)) + 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 eventCamera = canvas.worldCamera; var foundGraphics = GraphicRegistry.GetGraphicsForCanvas(canvas); - var count2 = foundGraphics.Count; - for (var j = 0; j < count2; j++) + var count = foundGraphics.Count; + var exclusiveSet = manager.HasExclusive; + + for (var i = 0; i < count; i++) { - var graphic = foundGraphics[j]; + 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; @@ -424,9 +510,8 @@ private HitResult performSSUISearch(IPointer pointer, out HitData hit) if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, position, eventCamera)) continue; - if (graphic.Raycast(position, null)) + if (graphic.Raycast(position, eventCamera)) { - var t = graphic.transform; if (raycaster.ignoreReversedGraphics) if (eventCamera == null) { @@ -444,7 +529,7 @@ private HitResult performSSUISearch(IPointer pointer, out HitData hit) float distance = 0; - if ((eventCamera == null) || (canvas.renderMode == RenderMode.ScreenSpaceOverlay)) { } + if ((eventCamera == null) || (canvas.renderMode == RenderMode.ScreenSpaceOverlay)) {} else { var transForward = t.forward; @@ -457,17 +542,17 @@ private HitResult performSSUISearch(IPointer pointer, out HitData hit) } raycastHitUIList.Add( - new RaycastHitUI() - { - GameObject = graphic.gameObject, - Raycaster = raycaster, - Graphic = graphic, - GraphicIndex = raycastHitUIList.Count, - Depth = graphic.depth, - SortingLayer = canvas.sortingLayerID, - SortingOrder = canvas.sortingOrder, - Distance = distance - }); + new RaycastHitUI() + { + Target = graphic.transform, + Raycaster = raycaster, + Graphic = graphic, + GraphicIndex = raycastHitUIList.Count, + Depth = graphic.depth, + SortingLayer = canvas.sortingLayerID, + SortingOrder = canvas.sortingOrder, + Distance = distance + }); } } } @@ -558,6 +643,5 @@ private void frameStartedHandler(object sender, EventArgs eventArgs) } #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 index 8c8bbea4e..fff9e3d94 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Layers/StandardLayer.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/TouchLayer.cs b/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs index 36977e6e6..286cd98c3 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/TouchLayer.cs @@ -20,14 +20,13 @@ namespace TouchScript.Layers /// /// /// 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. + /// 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 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 Events /// @@ -74,6 +73,15 @@ public virtual Vector3 WorldProjectionNormal /// protected ProjectionParams layerProjectionParams; + /// + /// Layer manager. + /// + protected ILayerManager manager; + + #endregion + + #region Temporary variables + private List tmpHitTestList = new List(10); #endregion @@ -95,7 +103,7 @@ public virtual ProjectionParams GetProjectionParams(Pointer pointer) /// /// Pointer. /// Hit result. - /// true, if an object is hit, ; false otherwise. + /// true, if an object is hit, ; false otherwise. public virtual HitResult Hit(IPointer pointer, out HitData hit) { hit = default(HitData); @@ -120,6 +128,7 @@ protected virtual void Awake() setName(); if (!Application.isPlaying) return; + manager = LayerManager.Instance; layerProjectionParams = createProjectionParams(); StartCoroutine(lateAwake()); } @@ -129,7 +138,7 @@ private IEnumerator lateAwake() yield return null; // Add ourselves after TouchManager finished adding layers in order - TouchManager.Instance.AddLayer(this, -1, false); + manager.AddLayer(this, -1, false); } // To be able to turn layers off @@ -143,7 +152,7 @@ protected virtual void OnDestroy() if (!Application.isPlaying || TouchManager.Instance == null) return; StopAllCoroutines(); - TouchManager.Instance.RemoveLayer(this); + manager.RemoveLayer(this); } #endregion @@ -164,12 +173,12 @@ internal bool INTERNAL_PressPointer(Pointer pointer) { pressPointer(pointer); if (pointerPressInvoker != null) pointerPressInvoker.InvokeHandleExceptions(this, new TouchLayerEventArgs(pointer)); - return true; + return true; } internal void INTERNAL_ReleasePointer(Pointer pointer) { - endPointer(pointer); + releasePointer(pointer); } internal void INTERNAL_RemovePointer(Pointer pointer) @@ -186,6 +195,12 @@ internal void INTERNAL_CancelPointer(Pointer pointer) #region Protected functions + /// + /// Checks the hit filters. + /// + /// The pointer. + /// HitData for the pointer. + /// protected HitResult checkHitFilters(IPointer pointer, HitData hit) { hit.Target.GetComponents(tmpHitTestList); @@ -212,10 +227,15 @@ protected virtual void setName() if (string.IsNullOrEmpty(Name)) Name = "Layer"; } - protected virtual void addPointer(Pointer pointer) { } + /// + /// Called when a pointer is added. + /// + /// Pointer. + /// This method may also be used to update some internal state or resend this event somewhere. + protected virtual void addPointer(Pointer pointer) {} /// - /// Called when a layer is touched to query the layer if this pointer hits something. + /// 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. @@ -229,13 +249,18 @@ protected virtual void pressPointer(Pointer pointer) {} protected virtual void updatePointer(Pointer pointer) {} /// - /// Called when a pointer ends. + /// Called when a pointer is released. /// /// Pointer. /// This method may also be used to update some internal state or resend this event somewhere. - protected virtual void endPointer(Pointer pointer) {} + protected virtual void releasePointer(Pointer pointer) {} - protected virtual void removePointer(Pointer pointer) { } + /// + /// Called when a pointer is removed. + /// + /// Pointer. + /// This method may also be used to update some internal state or resend this event somewhere. + protected virtual void removePointer(Pointer pointer) {} /// /// Called when a pointer is cancelled. diff --git a/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs index 742d5c148..9ee625d6f 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs +++ b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs @@ -11,33 +11,39 @@ 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 (shuttingDown) return null; if (instance == null) { - var es = EventSystem.current; + var es = EventSystem.current; if (es == null) - { - es = FindObjectOfType(); - if (es == null) - { - var go = new GameObject("EventSystem"); - es = go.AddComponent(); - } - } + { + es = FindObjectOfType(); + if (es == null) + { + var go = new GameObject("EventSystem"); + es = go.AddComponent(); + } + } instance = es.GetComponent(); - if (instance == null) instance = es.gameObject.AddComponent(); + if (instance == null) instance = es.gameObject.AddComponent(); } return instance; } @@ -54,11 +60,11 @@ public static TouchScriptInputModule Instance #region Private variables - private static bool shuttingDown = false; + private static bool shuttingDown = false; private static TouchScriptInputModule instance; private static FieldInfo raycastersProp; private static PropertyInfo canvasProp; - private static Dictionary raycasterCanvasCache = new Dictionary(); + private static Dictionary raycasterCanvasCache = new Dictionary(10); private int refCount = 0; private UIStandardInputModule ui; @@ -72,8 +78,8 @@ 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); + GetField("s_Raycasters", BindingFlags.NonPublic | BindingFlags.Static); + canvasProp = typeof(GraphicRaycaster).GetProperty("canvas", BindingFlags.NonPublic | BindingFlags.Instance); } } @@ -100,20 +106,29 @@ protected override void OnDisable() base.OnDisable(); } - private void OnApplicationQuit() - { - shuttingDown = true; - } + 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(); @@ -128,13 +143,13 @@ public Canvas GetCanvasForRaycaster(BaseRaycaster raycaster) public override void Process() { - if (ui != null) ui.Process(); + if (ui != null) ui.Process(); } public override bool IsPointerOverGameObject(int pointerId) { - if (ui != null) return ui.IsPointerOverGameObject(pointerId); - return false; + if (ui != null) return ui.IsPointerOverGameObject(pointerId); + return false; } public override bool ShouldActivateModule() @@ -157,12 +172,19 @@ public override void UpdateModule() {} #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(); @@ -176,6 +198,7 @@ internal int INTERNAL_Release() 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; @@ -185,8 +208,9 @@ private void enable() private void disable() { - if (TouchManager.Instance != null && ui != null) + 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; @@ -198,21 +222,27 @@ private void disable() #endregion - #region Event handlers - - #endregion - - #region Copypasted code from UI + #region Copy-pasted code from UI - // last update: df1947cd (5.4f3) + /// + /// 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 @@ -221,15 +251,15 @@ public UIStandardInputModule(TouchScriptInputModule input) private Vector2 m_LastMoveVector; private float m_PrevActionTime; - private Dictionary m_PointerData = new Dictionary(); + 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; - } + 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) { @@ -255,12 +285,12 @@ protected void DeselectIfSelectionChanged(GameObject currentOverGo, BaseEventDat input.eventSystem.SetSelectedGameObject(null, pointerEvent); } - protected PointerEventData GetLastPointerEventData(int id) - { - PointerEventData data; - GetPointerData(id, out data, false); - return data; - } + 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) { @@ -391,33 +421,86 @@ protected void RemovePointerData(int id) m_PointerData.Remove(id); } - private void convertRaycast(RaycastHitUI old, ref RaycastResult current) - { - current.module = old.Raycaster; - current.gameObject = old.GameObject; - current.depth = old.Depth; - current.index = old.GraphicIndex; - current.sortingLayer = old.SortingLayer; - current.sortingOrder = old.SortingOrder; - } + 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 ProcessUpdated(object sender, PointerEventArgs pointerEventArgs) + 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; @@ -426,7 +509,7 @@ public virtual void ProcessUpdated(object sender, PointerEventArgs pointerEventA convertRaycast(over.RaycastHitUI, ref raycast); raycast.screenPosition = data.position; data.pointerCurrentRaycast = raycast; - + input.HandlePointerExitAndEnter(data, currentOverGo); bool moving = data.IsPointerMoving(); @@ -463,18 +546,30 @@ public virtual void ProcessUpdated(object sender, PointerEventArgs pointerEventA 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 over = pointer.GetOverData(); var target = over.Target; var currentOverGo = target == null ? null : target.gameObject; @@ -482,6 +577,7 @@ public virtual void ProcessPressed(object sender, PointerEventArgs pointerEventA data.delta = Vector2.zero; data.dragging = false; data.useDragThreshold = true; + data.position = pointer.Position; data.pressPosition = pointer.Position; data.pointerPressRaycast = data.pointerCurrentRaycast; @@ -533,19 +629,32 @@ public virtual void ProcessPressed(object sender, PointerEventArgs pointerEventA 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 = pointer.GetOverData().Target; + var target = over.Target; var currentOverGo = target == null ? null : target.gameObject; ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerUpHandler); @@ -583,19 +692,29 @@ public virtual void ProcessReleased(object sender, PointerEventArgs pointerEvent 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 = pointer.GetOverData().Target; + var target = over.Target; var currentOverGo = target == null ? null : target.gameObject; ExecuteEvents.Execute(data.pointerPress, data, ExecuteEvents.pointerUpHandler); @@ -619,28 +738,43 @@ public virtual void ProcessCancelled(object sender, PointerEventArgs pointerEven 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/Layers/UI/TouchScriptInputModule.cs.meta b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs.meta index f5b86693d..f0b279514 100644 --- a/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.cs.meta +++ b/Source/Assets/TouchScript/Scripts/Layers/UI/TouchScriptInputModule.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/Pointers/FakePointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs index dd80d4d27..f78aa06ca 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/FakePointer.cs @@ -8,35 +8,51 @@ namespace TouchScript.Pointers { + /// + /// Fake pointer. + /// + /// public class FakePointer : IPointer { - #region Public properties /// - public int Id { get; set; } + public int Id { get; private set; } /// - public Pointer.PointerType Type { get; set; } + public Pointer.PointerType Type { get; private set; } /// - public IInputSource InputSource { get; set; } + public IInputSource InputSource { get; private set; } /// public Vector2 Position { get; set; } /// - public uint Flags { 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; @@ -52,7 +68,7 @@ public FakePointer() public HitData GetOverData(bool forceRecalculate = false) { HitData overData; - TouchManagerInstance.Instance.INTERNAL_GetHitTarget(this, out overData); + LayerManager.Instance.GetHitTarget(this, out overData); return overData; } diff --git a/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs index 2dce019fb..a9e223cef 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/IPointer.cs @@ -8,6 +8,9 @@ namespace TouchScript.Pointers { + /// + /// Interface for an abstract pointer. + /// public interface IPointer { /// @@ -20,6 +23,11 @@ public interface IPointer /// Pointer.PointerType Type { get; } + /// + /// Current buttons state of the pointer. + /// + Pointer.PointerButtonState Buttons { get; } + /// /// Original input source which created this pointer. /// @@ -27,15 +35,20 @@ public interface IPointer IInputSource InputSource { get; } /// - /// Current position in screen coordinates. + /// Current position in screen coordinates. /// Vector2 Position { get; set; } /// - /// Gets or sets pointer flags: + /// 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; set; } + uint Flags { get; } /// /// Returns for current pointer position, i.e. what is right beneath it. Caches the result for the entire frame. diff --git a/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs index 7e18f9cd0..99f624ba9 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/MousePointer.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -7,15 +7,16 @@ 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 @@ -34,6 +35,7 @@ public MousePointer(IInputSource input) : base(input) #region Public methods + /// public override void CopyFrom(Pointer target) { base.CopyFrom(target); @@ -53,6 +55,5 @@ public override void CopyFrom(Pointer target) //} #endregion - } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs index 03cea48f7..ed897852f 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/ObjectPointer.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -6,12 +6,36 @@ 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 /// @@ -71,10 +95,10 @@ public override void CopyFrom(Pointer target) internal override void INTERNAL_Reset() { base.INTERNAL_Reset(); - ObjectId = 0; - Width = 0; - Height = 0; - Angle = 0; + ObjectId = DEFAULT_OBJECT_ID; + Width = DEFAULT_WIDTH; + Height = DEFAULT_HEIGHT; + Angle = DEFAULT_ANGLE; } #endregion diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs index 14f8c8718..83ee8ef70 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/PenPointer.cs @@ -1,4 +1,4 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ @@ -6,12 +6,40 @@ 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 @@ -27,12 +55,15 @@ public PenPointer(IInputSource input) : base(input) #region Internal functions - //internal override void INTERNAL_Reset() - //{ - // base.INTERNAL_Reset(); - //} + /// + internal override void INTERNAL_Reset() + { + base.INTERNAL_Reset(); - #endregion + Rotation = DEFAULT_ROTATION; + Pressure = DEFAULT_PRESSURE; + } + #endregion } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs index b1fda70c4..d00db78af 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/Pointer.cs @@ -4,6 +4,7 @@ using System; using System.Text; +using TouchScript.Core; using TouchScript.Hit; using TouchScript.InputSources; using TouchScript.Layers; @@ -17,7 +18,7 @@ namespace TouchScript.Pointers /// 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 + public class Pointer : IPointer, IEquatable { #region Constants @@ -27,12 +28,20 @@ public class Pointer : IPointer public const int INVALID_POINTER = -1; /// - /// Indicates that this pointer is generated by script and is not mapped to any device input. + /// 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. /// @@ -64,9 +73,15 @@ public enum PointerType 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, /// @@ -78,83 +93,83 @@ public enum PointerButtonState FirstButtonPressed = 1 << 0, /// - /// First button pressed this frame. + /// 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. /// - FirstButtonDown = 1 << 1, + SecondButtonPressed = 1 << 1, /// - /// First button released this frame. + /// 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. /// - FirstButtonUp = 1 << 2, + ThirdButtonPressed = 1 << 2, /// - /// 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. + /// 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. /// - SecondButtonPressed = 1 << 3, + FourthButtonPressed = 1 << 3, /// - /// Second button pressed this frame. + /// 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. /// - SecondButtonDown = 1 << 4, + FifthButtonPressed = 1 << 4, /// - /// Second button released this frame. + /// First button pressed this frame. /// - SecondButtonUp = 1 << 5, + FirstButtonDown = 1 << 11, /// - /// 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. + /// First button released this frame. /// - ThirdButtonPressed = 1 << 6, + FirstButtonUp = 1 << 12, /// - /// Third button pressed this frame. + /// Second button pressed this frame. /// - ThirdButtonDown = 1 << 7, + SecondButtonDown = 1 << 13, /// - /// Third button released this frame. + /// Second button released this frame. /// - ThirdButtonUp = 1 << 8, + SecondButtonUp = 1 << 14, /// - /// 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. + /// Third button pressed this frame. /// - FourthButtonPressed = 1 << 9, + ThirdButtonDown = 1 << 15, /// - /// Fourth button pressed this frame. + /// Third button released this frame. /// - FourthButtonDown = 1 << 10, + ThirdButtonUp = 1 << 16, /// - /// Fourth button released this frame. + /// Fourth button pressed this frame. /// - FourthButtonUp = 1 << 11, + FourthButtonDown = 1 << 17, /// - /// 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. + /// Fourth button released this frame. /// - FifthButtonPressed = 1 << 12, + FourthButtonUp = 1 << 18, /// /// Fifth button pressed this frame. /// - FifthButtonDown = 1 << 13, + FifthButtonDown = 1 << 19, /// /// Fifth button released this frame. /// - FifthButtonUp = 1 << 14, + FifthButtonUp = 1 << 20, /// /// Any button is pressed. @@ -182,33 +197,23 @@ public enum PointerButtonState /// public PointerType Type { get; protected set; } + /// public PointerButtonState Buttons { get; set; } - /// - /// Original input source which created this pointer. - /// - /// + /// public IInputSource InputSource { get; private set; } - /// - /// Current position in screen coordinates. - /// Note: setting this property doesn't immediately change its value, the value actually changes during the next TouchManager update phase. - /// + /// public Vector2 Position { get { return position; } set { newPosition = value; } } - /// - /// Previous (during last frame) in screen coordinates. - /// + /// public Vector2 PreviousPosition { get; private set; } - /// - /// 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. - /// + /// public uint Flags { get; set; } /// @@ -229,7 +234,7 @@ public ProjectionParams ProjectionParams private static StringBuilder builder; - private TouchManagerInstance manager; + private LayerManagerInstance layerManager; private int refCount = 0; private Vector2 position, newPosition; private HitData pressData, overData; @@ -244,7 +249,7 @@ public HitData GetOverData(bool forceRecalculate = false) { if (overDataIsDirty || forceRecalculate) { - manager.INTERNAL_GetHitTarget(this, out overData); + layerManager.GetHitTarget(this, out overData); overDataIsDirty = false; } return overData; @@ -259,7 +264,7 @@ public HitData GetPressData() } /// - /// Copies values from . + /// Copies values from the target. /// /// The target pointer to copy values from. public virtual void CopyFrom(Pointer target) @@ -302,30 +307,10 @@ public override string ToString() 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(", buttons: "); - if (Buttons == PointerButtonState.Nothing) - { - builder.Append("-"); - } - else - { - var b = (uint) Buttons; - for (int i = 0; i < 5; i++) - { - int pressed = 1 << (i * 3); - int down = 1 << (i * 3 + 1); - int up = 1 << (i * 3 + 2); - if ((b & (pressed | down | up)) != 0) - { - builder.Append(i + 1); - if ((b & (pressed)) != 0) builder.Append("+"); - if ((b & (down)) != 0) builder.Append("v"); - if ((b & (up)) != 0) builder.Append("^"); - } - } - } builder.Append(", position: "); builder.Append(Position); builder.Append(")"); @@ -341,7 +326,7 @@ public override string ToString() /// public Pointer(IInputSource input) { - manager = TouchManager.Instance as TouchManagerInstance; + layerManager = LayerManager.Instance as LayerManagerInstance; Type = PointerType.Unknown; InputSource = input; INTERNAL_Reset(); diff --git a/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs index e7a500145..f90184666 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/PointerFactory.cs @@ -11,9 +11,8 @@ namespace TouchScript.Pointers /// public static class PointerFactory { - /// - /// Creates a pointer of type attached to input source. + /// Creates a pointer of certain type attached to the input source. /// /// Pointer type to create. /// Input source to attach the pointer to. @@ -33,6 +32,5 @@ public static Pointer Create(Pointer.PointerType type, IInputSource input) } return null; } - } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs index a231f057c..70c72e096 100644 --- a/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs +++ b/Source/Assets/TouchScript/Scripts/Pointers/TouchPointer.cs @@ -11,11 +11,32 @@ namespace TouchScript.Pointers /// 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 - public uint Orientation { get; set; } + /// + /// 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 @@ -34,12 +55,15 @@ public TouchPointer(IInputSource input) : base(input) #region Internal functions - //internal override void INTERNAL_Reset() - //{ - // base.INTERNAL_Reset(); - //} + /// + internal override void INTERNAL_Reset() + { + base.INTERNAL_Reset(); - #endregion + Rotation = DEFAULT_ROTATION; + Pressure = DEFAULT_PRESSURE; + } + #endregion } -} +} \ No newline at end of file diff --git a/Source/Assets/TouchScript/Scripts/TouchManager.cs b/Source/Assets/TouchScript/Scripts/TouchManager.cs index b762726d6..2d4338d8a 100644 --- a/Source/Assets/TouchScript/Scripts/TouchManager.cs +++ b/Source/Assets/TouchScript/Scripts/TouchManager.cs @@ -1,9 +1,10 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ using System; using System.Collections.Generic; +using TouchScript.Core; using TouchScript.Devices.Display; using TouchScript.Layers; using TouchScript.Pointers; @@ -15,7 +16,7 @@ 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. /// /// /// @@ -33,9 +34,16 @@ public sealed class TouchManager : DebuggableMonoBehaviour 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 {} @@ -151,60 +159,64 @@ public enum MessageName /// TouchScript version. /// public static readonly Version VERSION = new Version(9, 0); - public static readonly string VERSION_SUFFIX = "alpha"; + + /// + /// TouchScript version suffix. + /// + public static readonly string VERSION_SUFFIX = ""; #endregion - #region Events + #region Events - /// - /// Occurs when a new frame is started before all other events. - /// - public FrameEvent OnFrameStart = new FrameEvent(); + /// + /// 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 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 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 are updated. + /// + [SerializeField] + public PointerEvent OnPointersUpdate = new PointerEvent(); - /// - /// Occurs when pointers touch the surface. - /// - [SerializeField] - public PointerEvent OnPointersPress = 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 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 removed from the system. + /// + [SerializeField] + public PointerEvent OnPointersRemove = new PointerEvent(); - /// - /// Occurs when pointers are cancelled. - /// - [SerializeField] - public PointerEvent OnPointersCancel = new PointerEvent(); + /// + /// Occurs when pointers are cancelled. + /// + [SerializeField] + public PointerEvent OnPointersCancel = new PointerEvent(); - #endregion + #endregion #region Public properties @@ -326,6 +338,7 @@ public bool UseUnityEvents #if TOUCHSCRIPT_DEBUG + /// public override bool DebugMode { get { return base.DebugMode; } @@ -349,17 +362,22 @@ public override bool DebugMode /// 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 - [SerializeField] - private bool advancedProps; // is used to save if advanced properties are opened or closed + #pragma warning disable CS0414 [SerializeField] + [HideInInspector] + private bool basicEditor = true; + + #pragma warning restore CS0414 + + [SerializeField] private Object displayDevice; [SerializeField] @@ -376,7 +394,8 @@ public static bool IsInvalidPosition(Vector2 position) [SerializeField] private MessageType sendMessageEvents = MessageType.PointersPressed | MessageType.PointersCancelled | - MessageType.PointersReleased | MessageType.PointersUpdated; + MessageType.PointersReleased | MessageType.PointersUpdated | + MessageType.PointersAdded | MessageType.PointersRemoved; [SerializeField] private GameObject sendMessageTarget; @@ -404,14 +423,15 @@ private void Awake() 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() { updateSendMessageSubscription(); - updateUnityEventsSubscription(); + updateUnityEventsSubscription(); } private void OnDisable() @@ -420,6 +440,12 @@ private void OnDisable() removeUnityEventsSubscriptions(); } + [ContextMenu("Basic Editor")] + private void switchToBasicEditor() + { + basicEditor = true; + } + #endregion #region Private functions 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/Utils/BinaryUtils.cs b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs index 669f785d7..b47049acb 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/BinaryUtils.cs @@ -1,17 +1,26 @@ -/* +/* * @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; + int i = digits - 1; while (i >= 0) { @@ -20,5 +29,34 @@ public static void ToBinaryString(uint value, StringBuilder builder, int digits } } + /// + /// 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/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 98% rename from Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs rename to Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs index 94e8d745a..3acb24629 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/ProjectionUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/Geom/ProjectionUtils.cs @@ -4,7 +4,7 @@ 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/ObjectPool.cs b/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs index 338ae5011..5b7cf1f92 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/ObjectPool.cs @@ -1,4 +1,4 @@ -/* +/* * @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 @@ -7,12 +7,14 @@ using System; using System.Collections.Generic; using UnityEngine.Events; + #if OBJECTPOOL_DEBUG using UnityEngine; #endif namespace TouchScript.Utils { + /// public class ObjectPool where T : class { public delegate T0 UnityFunc(); @@ -36,14 +38,15 @@ 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) @@ -66,6 +69,7 @@ public T Get() { #if OBJECTPOOL_DEBUG created = true; + logWarning("Created an object."); #endif element = onNew(); CountAll++; @@ -94,6 +98,13 @@ public void Release(T element) #endif } + public void Release(object element) + { + var obj = (T) element; + if (obj == null) return; + Release(obj); + } + #if OBJECTPOOL_DEBUG private void log(string message) { @@ -101,6 +112,12 @@ private void log(string message) 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; 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 index dfc8630bf..785072a30 100644 --- a/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs +++ b/Source/Assets/TouchScript/Scripts/Utils/PointerUtils.cs @@ -1,7 +1,8 @@ -/* +/* * @author Valentin Simonov / http://va.lent.in/ */ +using System.Text; using TouchScript.Hit; using TouchScript.Pointers; using UnityEngine; @@ -9,10 +10,12 @@ namespace TouchScript.Utils { /// - /// Pointer utils. + /// Utility methods to work with Pointers. /// public static class PointerUtils { + private static StringBuilder sb; + /// /// Determines whether the pointer is over its target GameObject. /// @@ -51,5 +54,150 @@ public static bool IsPointerOnTarget(IPointer pointer, Transform target, out Hit 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/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/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/Textures/Touch.png.meta b/Source/Assets/TouchScript/Textures/Touch.png.meta deleted file mode 100644 index 34912225d..000000000 --- a/Source/Assets/TouchScript/Textures/Touch.png.meta +++ /dev/null @@ -1,54 +0,0 @@ -fileFormatVersion: 2 -guid: f5c75ed8c6bed0f489d9003aa739aff7 -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -2 - maxTextureSize: 1024 - textureSettings: - filterMode: 1 - aniso: 0 - 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: 5 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Source/ProjectSettings/EditorBuildSettings.asset b/Source/ProjectSettings/EditorBuildSettings.asset index bad151e91..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 + guid: 9bc4a96ba8ead427ab54f883160abc15 - enabled: 1 path: Assets/TouchScript/Examples/Photos/Photos.unity + guid: e43bdd4f3bf144b74b4726208781dd66 - enabled: 1 path: Assets/TouchScript/Examples/Checkers/Checkers.unity + guid: 6ba58961df0a14cad91763f92bda13b9 - enabled: 1 path: Assets/TouchScript/Examples/Portal/Portal.unity - - enabled: 1 - path: Assets/TouchScript/Examples/RawInput/RawInput.unity + guid: 20ddca9320eeb4eb28b7ce5fcb289923 - enabled: 1 path: Assets/TouchScript/Examples/Colors/Colors.unity + guid: c56b29ea5ec5a4713b65552d4a8bd9ac - enabled: 1 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/ProjectSettings.asset b/Source/ProjectSettings/ProjectSettings.asset index 0dab5dcee..68627b0a0 100644 --- a/Source/ProjectSettings/ProjectSettings.asset +++ b/Source/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,8 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 11 + productGUID: 0b2aa2b1c24cbc74ca2d27d2f6d0b8b4 AndroidProfiler: 0 defaultScreenOrientation: 3 targetDevice: 2 @@ -13,20 +14,46 @@ PlayerSettings: 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,7 +76,9 @@ PlayerSettings: forceSingleInstance: 0 resizableWindow: 0 useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games gpuSkinning: 1 + graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -57,6 +86,7 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 0 allowFullscreenSwitch: 1 + graphicsJobMode: 0 macFullscreenMode: 2 d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 @@ -64,15 +94,13 @@ PlayerSettings: xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 xboxEnablePIXSampling: 0 - xboxEnableEnableRenderThreadRunsJobs: 0 n3dsDisableStereoscopicView: 0 n3dsEnableSharedListOpt: 1 n3dsEnableVSync: 0 - uiUse16BitDepthBuffer: 0 ignoreAlphaClear: 0 xboxOneResolution: 0 xboxOneMonoLoggingLevel: 0 - ps3SplashScreen: {fileID: 0} + xboxOneLoggingLevel: 1 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -91,36 +119,53 @@ 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 - tvOSTargetOSVersion: 900 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -141,6 +186,7 @@ PlayerSettings: tvOSSmallIconLayers: [] tvOSLargeIconLayers: [] tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -159,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} @@ -188,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 @@ -208,39 +267,121 @@ PlayerSettings: 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: @@ -252,7 +393,9 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -274,6 +417,7 @@ PlayerSettings: ps4ApplicationParam4: 0 ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 ps4Passcode: 5xr84P2R391UXaLHbavJvFZGfO47XWS2 ps4UseDebugIl2cppLibs: 0 ps4pnSessions: 1 @@ -281,20 +425,27 @@ PlayerSettings: 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} @@ -345,10 +496,39 @@ PlayerSettings: 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 metroPackageVersion: metroCertificatePath: @@ -374,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 @@ -426,50 +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: + 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 d4ad3ce51..d542d5a64 100644 --- a/Source/ProjectSettings/ProjectVersion.txt +++ b/Source/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.3.6f1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.1p4 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/UnityConnectSettings.asset b/Source/ProjectSettings/UnityConnectSettings.asset index 9b7a57834..ec1ab2929 100644 --- a/Source/ProjectSettings/UnityConnectSettings.asset +++ b/Source/ProjectSettings/UnityConnectSettings.asset @@ -3,6 +3,15 @@ --- !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 @@ -12,3 +21,12 @@ UnityConnectSettings: 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