diff --git a/Assets/Demigiant/DOTween/DOTween.dll b/Assets/Demigiant/DOTween/DOTween.dll deleted file mode 100644 index ea7a2d6..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween.dll and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween.dll.mdb b/Assets/Demigiant/DOTween/DOTween.dll.mdb deleted file mode 100644 index 047f0eb..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween.dll.mdb and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween.dll.meta b/Assets/Demigiant/DOTween/DOTween.dll.meta deleted file mode 100644 index 9b4a425..0000000 --- a/Assets/Demigiant/DOTween/DOTween.dll.meta +++ /dev/null @@ -1,14 +0,0 @@ -fileFormatVersion: 2 -guid: 6e38ac6b1c3556b4c888ca8552375e1e -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween43.dll b/Assets/Demigiant/DOTween/DOTween43.dll deleted file mode 100644 index eeced7b..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween43.dll and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/Assets/Demigiant/DOTween/DOTween43.dll.mdb deleted file mode 100644 index 22a0d88..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween43.dll.mdb and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween43.dll.meta b/Assets/Demigiant/DOTween/DOTween43.dll.meta deleted file mode 100644 index b106e6e..0000000 --- a/Assets/Demigiant/DOTween/DOTween43.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: 831dacc04ecdc2a45ac1450225643711 -timeCreated: 1435040073 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween43.xml b/Assets/Demigiant/DOTween/DOTween43.xml deleted file mode 100644 index 2d78cb8..0000000 --- a/Assets/Demigiant/DOTween/DOTween43.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - DOTween43 - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween43 methods, require Unity 4.3 or later. - - - - Tweens a SpriteRenderer's color to the given value. - Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's alpha color to the given value. - Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Rigidbody2D's position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's X position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's Y position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's rotation to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a SpriteRenderer's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - diff --git a/Assets/Demigiant/DOTween/DOTween43.xml.meta b/Assets/Demigiant/DOTween/DOTween43.xml.meta deleted file mode 100644 index dc33668..0000000 --- a/Assets/Demigiant/DOTween/DOTween43.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a849b8221cc04cf489cd84c1c21e5883 -timeCreated: 1435040074 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween46.dll b/Assets/Demigiant/DOTween/DOTween46.dll deleted file mode 100644 index 935b9a0..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween46.dll and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/Assets/Demigiant/DOTween/DOTween46.dll.mdb deleted file mode 100644 index 40c4629..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween46.dll.mdb and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween46.dll.meta b/Assets/Demigiant/DOTween/DOTween46.dll.meta deleted file mode 100644 index f5fbc5b..0000000 --- a/Assets/Demigiant/DOTween/DOTween46.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: b4adc4392a5d88b4593dbf0238835e83 -timeCreated: 1435040073 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween46.xml b/Assets/Demigiant/DOTween/DOTween46.xml deleted file mode 100644 index c19bb73..0000000 --- a/Assets/Demigiant/DOTween/DOTween46.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - DOTween46 - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween46 methods, require Unity 4.6 or later. - - - - Tweens a CanvasGroup's alpha color to the given value. - Also stores the canvasGroup as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Graphic's color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Graphic's alpha color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's alpha color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's fillAmount to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reach (0 to 1)The duration of the tween - - - Tweens an LayoutElement's flexibleWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens an LayoutElement's minWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens an LayoutElement's preferredWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Outline's effectColor to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Outline's effectColor alpha to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Outline's effectDistance to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a RectTransform's anchoredPosition to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchoredPosition3D to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's sizeDelta to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The direction and strength of the punch (added to the RectTransform's current position) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the punch direction and the opposite direction, - while 0 oscillates only between the punch and the start position - If TRUE the tween will smoothly snap all values to integers - - - Shakes a RectTransform's anchoredPosition with the given values. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - - - Shakes a RectTransform's anchoredPosition with the given values. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Slider's value to the given value. - Also stores the Slider as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Text's color to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Text's alpha color to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Text's text to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end string to tween toThe duration of the tween - If TRUE (default), rich text will be interpreted correctly while animated, - otherwise all tags will be considered as normal text - The type of scramble mode to use, if any - A string containing the characters to use for scrambling. - Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. - Leave it to NULL (default) to use default ones - - - Tweens a Graphic's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Graphic as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Image's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Image as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Text's color BY the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Text as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - diff --git a/Assets/Demigiant/DOTween/DOTween50.dll b/Assets/Demigiant/DOTween/DOTween50.dll deleted file mode 100644 index 89ba536..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween50.dll and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/Assets/Demigiant/DOTween/DOTween50.dll.mdb deleted file mode 100644 index 77c869b..0000000 Binary files a/Assets/Demigiant/DOTween/DOTween50.dll.mdb and /dev/null differ diff --git a/Assets/Demigiant/DOTween/DOTween50.dll.meta b/Assets/Demigiant/DOTween/DOTween50.dll.meta deleted file mode 100644 index 663468a..0000000 --- a/Assets/Demigiant/DOTween/DOTween50.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: d49cceec2f86b3e49806b17975a001ae -timeCreated: 1435040074 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween50.xml b/Assets/Demigiant/DOTween/DOTween50.xml deleted file mode 100644 index 5c9ddd3..0000000 --- a/Assets/Demigiant/DOTween/DOTween50.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - DOTween50 - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween50 methods, require Unity 5.0 or later. - - - - Tweens an AudioMixer's exposed float to the given value. - Also stores the AudioMixer as the tween's target so it can be used for filtered operations. - Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer. - Name given to the exposed float to set - The end value to reachThe duration of the tween - - - - Completes all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - - - - Kills all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens killed. - - If TRUE completes the tween before killing it - - - - Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens flipped. - - - - - Sends to the given position all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - - Pauses all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens paused. - - - - - Plays all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays backwards all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays forward all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Restarts all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens restarted. - - - - - Rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - - - diff --git a/Assets/Demigiant/DOTween/DOTween50.xml.meta b/Assets/Demigiant/DOTween/DOTween50.xml.meta deleted file mode 100644 index 2b955c7..0000000 --- a/Assets/Demigiant/DOTween/DOTween50.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0dbc058f235d9de40b2b34f948d9c1dc -timeCreated: 1435040074 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll deleted file mode 100644 index bef6d65..0000000 Binary files a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and /dev/null differ diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb deleted file mode 100644 index 877466b..0000000 Binary files a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and /dev/null differ diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta b/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta deleted file mode 100644 index d6b786a..0000000 --- a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta +++ /dev/null @@ -1,14 +0,0 @@ -fileFormatVersion: 2 -guid: 0d6555af380a7264a9cd5a9083b1c4ad -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta b/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta deleted file mode 100644 index e7f428b..0000000 --- a/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta +++ /dev/null @@ -1,53 +0,0 @@ -fileFormatVersion: 2 -guid: 0d7e06117784ff44bacb9c9e551592b3 -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: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta b/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta deleted file mode 100644 index e2618fc..0000000 --- a/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta +++ /dev/null @@ -1,53 +0,0 @@ -fileFormatVersion: 2 -guid: 073261fcf37d98645bac61b0e19ec84f -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: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/readme.txt b/Assets/Demigiant/DOTween/readme.txt deleted file mode 100644 index 3439db1..0000000 --- a/Assets/Demigiant/DOTween/readme.txt +++ /dev/null @@ -1,18 +0,0 @@ -DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant - -// GET STARTED ////////////////////////////////////////////// - -- After importing a new DOTween update, select DOTween's Utility Panel from the Tools menu (if it doesn't open automatically) and press the "Setup DOTween..." button to set up additional features based on your Unity version. -- In your code, add "using DG.Tweening" to each class where you want to use DOTween. -- You're ready to tween. Check out the links below for full documentation and license info. - - -// LINKS /////////////////////////////////////////////////////// - -DOTween website (documentation, examples, etc): http://dotween.demigiant.com -DOTween license: http://dotween.demigiant.com/license.php -DOTween repository (Google Code): https://code.google.com/p/dotween/ - -// NOTES ////////////////////////////////////////////////////// - -- DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences \ No newline at end of file diff --git a/Assets/Demigiant/DOTween/Editor.meta b/Assets/Gizmos.meta similarity index 58% rename from Assets/Demigiant/DOTween/Editor.meta rename to Assets/Gizmos.meta index 9f7ab67..520260c 100644 --- a/Assets/Demigiant/DOTween/Editor.meta +++ b/Assets/Gizmos.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: d8f0b460caa83e348bed784454847666 +guid: 645bd32b1e488654dab138ea1b1719c0 folderAsset: yes -timeCreated: 1435039946 -licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Gizmos/Cinemachine.meta b/Assets/Gizmos/Cinemachine.meta new file mode 100644 index 0000000..9e42ac6 --- /dev/null +++ b/Assets/Gizmos/Cinemachine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fcad657709ccce848b07e4d56545fb6d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Gizmos/Cinemachine/cm_logo_lg.png b/Assets/Gizmos/Cinemachine/cm_logo_lg.png new file mode 100644 index 0000000..47f1903 Binary files /dev/null and b/Assets/Gizmos/Cinemachine/cm_logo_lg.png differ diff --git a/Assets/Gizmos/Cinemachine/cm_logo_lg.png.meta b/Assets/Gizmos/Cinemachine/cm_logo_lg.png.meta new file mode 100644 index 0000000..cdd51f2 --- /dev/null +++ b/Assets/Gizmos/Cinemachine/cm_logo_lg.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 723f5237d572afd47bc239650a2ff442 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MMM.meta b/Assets/MMM.meta deleted file mode 100644 index 6669c08..0000000 --- a/Assets/MMM.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 21b9d34e44e3a414c8c626fd40866fcd -folderAsset: yes -timeCreated: 1435543424 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MMM/Trails.meta b/Assets/MMM/Trails.meta deleted file mode 100644 index 4e7bf72..0000000 --- a/Assets/MMM/Trails.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bacdce40f51db094e90a9afad954ebca -folderAsset: yes -timeCreated: 1436856610 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MMM/Trails/Materials/Unlit.mat b/Assets/MMM/Trails/Materials/Unlit.mat deleted file mode 100644 index 2abca47..0000000 --- a/Assets/MMM/Trails/Materials/Unlit.mat +++ /dev/null @@ -1,157 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 5 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: Unlit - m_Shader: {fileID: 4800000, guid: 9a5b59439e8c53d4e9239ea69d21748d, type: 3} - m_ShaderKeywords: - m_LightmapFlags: 5 - m_CustomRenderQueue: -1 - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - data: - first: - name: _MainTex - second: - m_Texture: {fileID: 2800000, guid: 93415dc3da2b33443a2d6cdb553cc1c3, type: 3} - 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: _Cutoff - second: .5 - data: - first: - name: PixelSnap - second: 0 - data: - first: - name: _SrcBlend - second: 1 - data: - first: - name: _DstBlend - second: 0 - data: - first: - name: _Parallax - second: .0199999996 - data: - first: - name: _ZWrite - second: 1 - data: - first: - name: _Glossiness - second: .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: _EmissionScaleUI - second: 0 - data: - first: - name: _Mode - second: 0 - data: - first: - name: _Metallic - second: 0 - data: - first: - name: _InvFade - second: 1 - m_Colors: - data: - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - data: - first: - name: _Color - second: {r: .345588207, g: .2780478, b: .226156995, a: 1} - data: - first: - name: _EmissionColorUI - second: {r: 1, g: 1, b: 1, a: 1} - data: - first: - name: _TintColor - second: {r: .257352948, g: .182522222, b: .141922578, a: 1} diff --git a/Assets/MMM/Trails/Scenes/5. A Simplification.unity.meta b/Assets/MMM/Trails/Scenes/5. A Simplification.unity.meta deleted file mode 100644 index fe68757..0000000 --- a/Assets/MMM/Trails/Scenes/5. A Simplification.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2c5bb73adc822864c8558418cbc1a90f -timeCreated: 1435562058 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MMM/Trails/Scenes/x-OnWhite.unity b/Assets/MMM/Trails/Scenes/x-OnWhite.unity deleted file mode 100644 index 41c1345..0000000 --- a/Assets/MMM/Trails/Scenes/x-OnWhite.unity +++ /dev/null @@ -1,1668 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: .25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} - m_FogMode: 3 - m_FogDensity: .00999999978 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} - m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} - m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: .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} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 ---- !u!157 &4 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 5 - m_GIWorkflowMode: 0 - m_LightmapsMode: 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: 1 - m_LightmapEditorSettings: - serializedVersion: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &5 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: .5 - agentHeight: 2 - agentSlope: 45 - agentClimb: .400000006 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: .166666672 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!4 &69896990 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1229480314} ---- !u!1 &141526077 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 142362, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 141526080} - - 222: {fileID: 141526079} - - 114: {fileID: 141526078} - m_Layer: 0 - m_Name: Title Label - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &141526078 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11476656, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 141526077} - 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_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 21 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: UNITY CREATIVE CODE WORKSHOP ---- !u!222 &141526079 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22282182, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 141526077} ---- !u!224 &141526080 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22472634, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 141526077} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -40.3299866} - m_SizeDelta: {x: 616, y: 30.230011} - m_Pivot: {x: 0, y: 0} ---- !u!1 &149550811 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 149550816} - - 20: {fileID: 149550815} - - 92: {fileID: 149550814} - - 124: {fileID: 149550813} - - 81: {fileID: 149550812} - - 114: {fileID: 149550817} - - 114: {fileID: 149550818} - - 114: {fileID: 149550819} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &149550812 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 ---- !u!124 &149550813 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 ---- !u!92 &149550814 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 ---- !u!20 &149550815 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 1, g: 1, b: 1, a: .0196078438} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: .300000012 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 30 - m_Depth: 1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 ---- !u!4 &149550816 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -200} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!114 &149550817 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7fceaeb339b971b429c4cc600acabd13, type: 3} - m_Name: - m_EditorClassIdentifier: - tweakMode: 1 - screenBlendMode: 0 - hdr: 0 - sepBlurSpread: 8.47999954 - quality: 1 - bloomIntensity: .819999993 - bloomThreshold: .419999987 - bloomThresholdColor: {r: 1, g: 1, b: 1, a: 1} - bloomBlurIterations: 2 - hollywoodFlareBlurIterations: 1 - flareRotation: 0 - lensflareMode: 0 - hollyStretchWidth: 1.61000001 - lensflareIntensity: 7.46999979 - lensflareThreshold: 0 - lensFlareSaturation: .529999971 - flareColorA: {r: .400000006, g: .400000006, b: .800000012, a: .75} - flareColorB: {r: .400000006, g: .800000012, b: .800000012, a: .75} - flareColorC: {r: .800000012, g: .400000006, b: .800000012, a: .75} - flareColorD: {r: .800000012, g: .400000006, b: 0, a: .75} - lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, - type: 3} - lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} - screenBlendShader: {fileID: 4800000, guid: 7856cbff0a0ca45c787d5431eb805bb0, type: 3} - blurAndFlaresShader: {fileID: 4800000, guid: be6e39cf196f146d5be72fbefb18ed75, type: 3} - brightPassFilterShader: {fileID: 4800000, guid: 0aeaa4cb29f5d4e9c8455f04c8575c8c, - type: 3} ---- !u!114 &149550818 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 51ad75ed9bf526344a02bac2a0d1631e, type: 3} - m_Name: - m_EditorClassIdentifier: - SCShader: {fileID: 4800000, guid: 7fe2d09a0b14ad34082fa52f5ea20388, type: 3} - bypass: 0 - blendMode: 3 - label: {fileID: 941726148} ---- !u!114 &149550819 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8fbe8446fd51be9428ddd636a2232155, type: 3} - m_Name: - m_EditorClassIdentifier: - triggerKey: 112 - superSize: 5 - subfolder: Workshop ---- !u!4 &216749479 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1713580364} ---- !u!4 &249788757 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 696603875} ---- !u!1 &274258591 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 274258593} - - 108: {fileID: 274258592} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &274258592 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 274258591} - m_Enabled: 1 - serializedVersion: 6 - m_Type: 1 - m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_Strength: 1 - m_Bias: .0500000007 - m_NormalBias: .400000006 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_BounceIntensity: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} ---- !u!4 &274258593 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 274258591} - m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 ---- !u!1001 &453583533 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -.184459448 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: 3.9009459 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube3 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.x - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.y - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.z - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1 &661570572 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 107714, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 661570573} - - 222: {fileID: 661570575} - - 114: {fileID: 661570574} - m_Layer: 0 - m_Name: Screengrab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &661570573 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22441870, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 661570572} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 5 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 14, y: 66} - m_SizeDelta: {x: 334, y: 16.6000004} - m_Pivot: {x: 0, y: 0} ---- !u!114 &661570574 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11411700, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 661570572} - 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: .917647064, b: .79411763, a: 1} - m_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'P: Save Picture' ---- !u!222 &661570575 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22265110, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 661570572} ---- !u!1001 &696603875 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -.200000003 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: 1.04999995 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube4 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1 &744575981 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 744575982} - - 114: {fileID: 744575983} - m_Layer: 0 - m_Name: Brush - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &744575982 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 744575981} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: .334459454, y: .929054022, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 69896990} - - {fileID: 249788757} - - {fileID: 1295950817} - - {fileID: 970831597} - - {fileID: 1482024962} - - {fileID: 2084791589} - - {fileID: 216749479} - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!114 &744575983 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 744575981} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1ce0ae6c1e5dd57459f86322b9bac063, type: 3} - m_Name: - m_EditorClassIdentifier: - speed: 5 - velocity: {x: 0, y: 0, z: 0} - KeyUp: 119 - KeyDown: 115 - KeyLeft: 97 - KeyRight: 100 ---- !u!1 &791851530 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 197456, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 791851531} - - 222: {fileID: 791851533} - - 114: {fileID: 791851532} - m_Layer: 0 - m_Name: Instructions - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &791851531 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22420678, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 791851530} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 4 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 13.9999924, y: 0} - m_SizeDelta: {x: 334, y: 66} - m_Pivot: {x: 0, y: 0} ---- !u!114 &791851532 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11499414, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 791851530} - 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: .917647064, b: .79411763, a: 1} - m_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'WSAD: Move - - Space: Toggle UI - - +/-: Scene Switch - - ]/[: Blending Switch' ---- !u!222 &791851533 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22282010, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 791851530} ---- !u!1 &856500148 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 141232, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 856500149} - - 223: {fileID: 856500152} - - 114: {fileID: 856500151} - - 114: {fileID: 856500150} - - 114: {fileID: 856500153} - m_Layer: 0 - m_Name: UI - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &856500149 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22470090, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 856500148} - 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: 1487544264} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &856500150 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11499986, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 856500148} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &856500151 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11428876, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 856500148} - 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: 720, y: 480} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &856500152 -Canvas: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22307324, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 856500148} - m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!114 &856500153 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 856500148} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 92556c0bbf9be5d41988f5e02496d2b6, type: 3} - m_Name: - m_EditorClassIdentifier: - keyNext: 61 - keyPrevious: 45 ---- !u!114 &941726148 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11494596, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785739161} - 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: .772058845, g: .772058845, b: .772058845, a: 1} - m_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Blend: Average' ---- !u!4 &970831597 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 453583533} ---- !u!1001 &1229480314 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: 3.05999994 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: 2.8499999 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube5 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!4 &1295950817 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1679757769} ---- !u!1 &1398539223 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1398539224} - - 222: {fileID: 1398539226} - - 114: {fileID: 1398539225} - m_Layer: 0 - m_Name: License - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1398539224 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1398539223} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 6 - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -92.6999969, y: 7.80000019} - m_SizeDelta: {x: 167.800003, y: 15.6000004} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1398539225 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1398539223} - 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_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 8 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 2 - m_RichText: 1 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 1 - m_LineSpacing: 1 - m_Text: Photo CC-BY-SA Luca Galuzzi ---- !u!222 &1398539226 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1398539223} ---- !u!1 &1423535244 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 128698, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1423535245} - - 222: {fileID: 1423535249} - - 114: {fileID: 1423535248} - m_Layer: 5 - m_Name: Curtain - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1423535245 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22483222, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1423535244} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 1.62519646e-05} - m_SizeDelta: {x: 0, y: -3.05175781e-05} - m_Pivot: {x: .5, y: .5} ---- !u!114 &1423535248 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11424616, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1423535244} - 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: 0, g: 0, b: 0, a: 0} - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1423535249 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22273482, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1423535244} ---- !u!1 &1476324477 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1476324481} - - 114: {fileID: 1476324480} - - 114: {fileID: 1476324479} - - 114: {fileID: 1476324478} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1476324478 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1476324477} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_AllowActivationOnStandalone: 0 ---- !u!114 &1476324479 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1476324477} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_AllowActivationOnMobileDevice: 0 ---- !u!114 &1476324480 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1476324477} - 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 &1476324481 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1476324477} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 ---- !u!4 &1482024962 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1707130292} ---- !u!1 &1487544263 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 107658, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1487544264} - - 114: {fileID: 1487544266} - - 225: {fileID: 1487544265} - m_Layer: 0 - m_Name: Group - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1487544264 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22424872, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487544263} - m_LocalRotation: {x: 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: 1423535245} - - {fileID: 141526080} - - {fileID: 2051193836} - - {fileID: 1785739162} - - {fileID: 791851531} - - {fileID: 661570573} - - {fileID: 1398539224} - m_Father: {fileID: 856500149} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: .5} ---- !u!225 &1487544265 -CanvasGroup: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22504392, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487544263} - m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 1 - m_BlocksRaycasts: 1 - m_IgnoreParentGroups: 0 ---- !u!114 &1487544266 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11440604, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1487544263} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4b084395420f3ff478518156e7412f6d, type: 3} - m_Name: - m_EditorClassIdentifier: - trigger: 32 - speed: .25 ---- !u!1001 &1558328999 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -2.44000006 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: -.74000001 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube6 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1001 &1679757769 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -3.08999991 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: 2.78999996 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube1 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1001 &1707130292 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -.25 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: -2.69000006 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube2 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1001 &1713580364 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: 1.48000002 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: -.899999976 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube7 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Materials.Array.data[0] - value: - objectReference: {fileID: 2100000, guid: 1205720b13e8d474bbac320af1cf85b9, type: 2} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[0].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[3].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[1].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[4].rgba - value: 4278190080 - objectReference: {fileID: 0} - - target: {fileID: 9603520, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Colors.m_Color[2].rgba - value: 4278190181 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1 &1785739161 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 182958, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1785739162} - - 222: {fileID: 1785739163} - - 114: {fileID: 941726148} - - 114: {fileID: 1785739164} - m_Layer: 0 - m_Name: Blend Mode - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1785739162 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22443038, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785739161} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 3 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -104.900002} - m_SizeDelta: {x: 334, y: 30} - m_Pivot: {x: 0, y: 0} ---- !u!222 &1785739163 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22213020, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785739161} ---- !u!114 &1785739164 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11409674, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785739161} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d4636cb1dddeede49a1929372dde64dd, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &2051193835 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 170056, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 2051193836} - - 222: {fileID: 2051193839} - - 114: {fileID: 2051193838} - - 114: {fileID: 2051193837} - m_Layer: 0 - m_Name: Scene Label - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2051193836 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22415184, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2051193835} - m_LocalRotation: {x: 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: 1487544264} - m_RootOrder: 2 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -70.8000031} - m_SizeDelta: {x: 334, y: 30} - m_Pivot: {x: 0, y: 0} ---- !u!114 &2051193837 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2051193835} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9d685198df43dba48ac52ad763af62b7, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &2051193838 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11479556, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2051193835} - 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: .352941155, g: .839350998, b: 1, a: 1} - m_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 21 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Scene Label ---- !u!222 &2051193839 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22216400, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2051193835} ---- !u!4 &2084791589 -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1558328999} diff --git a/Assets/MMM/Trails/Scenes/x-OnWhite.unity.meta b/Assets/MMM/Trails/Scenes/x-OnWhite.unity.meta deleted file mode 100644 index 04cec1a..0000000 --- a/Assets/MMM/Trails/Scenes/x-OnWhite.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2bfdbfeccca378b4bbd3b9e004049940 -timeCreated: 1437029959 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/DOTweenSettings.asset b/Assets/Resources/DOTweenSettings.asset index cbbc0f7..c222af9 100644 --- a/Assets/Resources/DOTweenSettings.asset +++ b/Assets/Resources/DOTweenSettings.asset @@ -8,20 +8,35 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 16995157, guid: 6e38ac6b1c3556b4c888ca8552375e1e, type: 3} + m_Script: {fileID: 16995157, guid: a811bde74b26b53498b4f6d872b09b6d, type: 3} m_Name: DOTweenSettings m_EditorClassIdentifier: useSafeMode: 1 + timeScale: 1 + useSmoothDeltaTime: 0 + maxSmoothUnscaledTime: 0.15 + rewindCallbackMode: 0 showUnityEditorReport: 0 - logBehaviour: 2 + logBehaviour: 0 drawGizmos: 1 defaultRecyclable: 0 defaultAutoPlay: 3 defaultUpdateType: 0 defaultTimeScaleIndependent: 0 defaultEaseType: 6 - defaultEaseOvershootOrAmplitude: 1.70158005 + defaultEaseOvershootOrAmplitude: 1.70158 defaultEasePeriod: 0 defaultAutoKill: 1 defaultLoopType: 0 storeSettingsLocation: 0 + modules: + showPanel: 0 + audioEnabled: 0 + physicsEnabled: 0 + physics2DEnabled: 0 + spriteEnabled: 0 + uiEnabled: 1 + textMeshProEnabled: 0 + tk2DEnabled: 0 + showPlayingTweens: 0 + showPausedTweens: 0 diff --git a/Assets/Resources/DOTweenSettings.asset.meta b/Assets/Resources/DOTweenSettings.asset.meta index c50648e..3fca407 100644 --- a/Assets/Resources/DOTweenSettings.asset.meta +++ b/Assets/Resources/DOTweenSettings.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 guid: a3e1acdc1aa79734daf7a801b5fd0929 -timeCreated: 1435040068 -licenseType: Pro NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/UnityVS.meta b/Assets/UnityVS.meta deleted file mode 100644 index 7d580dc..0000000 --- a/Assets/UnityVS.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 02fe78e962405814a83b8ba6c9471d32 -folderAsset: yes -timeCreated: 1434954187 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll deleted file mode 100644 index 556b776..0000000 Binary files a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll and /dev/null differ diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta deleted file mode 100644 index 6a2e6d4..0000000 --- a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll.meta +++ /dev/null @@ -1 +0,0 @@ -guid: 38d405c119fcc7c4e83d4a478a40ff2f diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll deleted file mode 100644 index 09a9d1a..0000000 Binary files a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll and /dev/null differ diff --git a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta b/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta deleted file mode 100644 index 19d28ec..0000000 --- a/Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta +++ /dev/null @@ -1 +0,0 @@ -guid: 4ad02dc83da735c4e8d945332b9202f6 diff --git a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll deleted file mode 100644 index a0d1cf4..0000000 Binary files a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll and /dev/null differ diff --git a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta b/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta deleted file mode 100644 index 8edffdc..0000000 --- a/Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta +++ /dev/null @@ -1,20 +0,0 @@ -fileFormatVersion: 2 -guid: 3fdb4a88e3c3d744d9b05462e9cb1abc -timeCreated: 1434954190 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/_Project.meta b/Assets/_Project.meta new file mode 100644 index 0000000..ce4a438 --- /dev/null +++ b/Assets/_Project.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a6ff4ba1d9d86c946b0aa7924090447d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MMM/Trails/Fonts.meta b/Assets/_Project/Fonts.meta similarity index 100% rename from Assets/MMM/Trails/Fonts.meta rename to Assets/_Project/Fonts.meta diff --git a/Assets/MMM/Trails/Fonts/Danrex 100.ttf b/Assets/_Project/Fonts/Danrex 100.ttf similarity index 100% rename from Assets/MMM/Trails/Fonts/Danrex 100.ttf rename to Assets/_Project/Fonts/Danrex 100.ttf diff --git a/Assets/MMM/Trails/Fonts/Danrex 100.ttf.meta b/Assets/_Project/Fonts/Danrex 100.ttf.meta similarity index 100% rename from Assets/MMM/Trails/Fonts/Danrex 100.ttf.meta rename to Assets/_Project/Fonts/Danrex 100.ttf.meta diff --git a/Assets/MMM/Trails/Fonts/Typodermic - ExpresswayRg-Regular.ttf b/Assets/_Project/Fonts/Typodermic - ExpresswayRg-Regular.ttf similarity index 100% rename from Assets/MMM/Trails/Fonts/Typodermic - ExpresswayRg-Regular.ttf rename to Assets/_Project/Fonts/Typodermic - ExpresswayRg-Regular.ttf diff --git a/Assets/MMM/Trails/Fonts/Typodermic - ExpresswayRg-Regular.ttf.meta b/Assets/_Project/Fonts/Typodermic - ExpresswayRg-Regular.ttf.meta similarity index 100% rename from Assets/MMM/Trails/Fonts/Typodermic - ExpresswayRg-Regular.ttf.meta rename to Assets/_Project/Fonts/Typodermic - ExpresswayRg-Regular.ttf.meta diff --git a/Assets/MMM/Trails/Materials.meta b/Assets/_Project/Materials.meta similarity index 100% rename from Assets/MMM/Trails/Materials.meta rename to Assets/_Project/Materials.meta diff --git a/Assets/MMM/Trails/Materials/FirstMaterial.mat b/Assets/_Project/Materials/FirstMaterial.mat similarity index 100% rename from Assets/MMM/Trails/Materials/FirstMaterial.mat rename to Assets/_Project/Materials/FirstMaterial.mat diff --git a/Assets/MMM/Trails/Materials/FirstMaterial.mat.meta b/Assets/_Project/Materials/FirstMaterial.mat.meta similarity index 100% rename from Assets/MMM/Trails/Materials/FirstMaterial.mat.meta rename to Assets/_Project/Materials/FirstMaterial.mat.meta diff --git a/Assets/MMM/Trails/Materials/RoundTrailHead.mat b/Assets/_Project/Materials/RoundTrailHead.mat similarity index 100% rename from Assets/MMM/Trails/Materials/RoundTrailHead.mat rename to Assets/_Project/Materials/RoundTrailHead.mat diff --git a/Assets/MMM/Trails/Materials/RoundTrailHead.mat.meta b/Assets/_Project/Materials/RoundTrailHead.mat.meta similarity index 100% rename from Assets/MMM/Trails/Materials/RoundTrailHead.mat.meta rename to Assets/_Project/Materials/RoundTrailHead.mat.meta diff --git a/Assets/_Project/Materials/Unlit.mat b/Assets/_Project/Materials/Unlit.mat new file mode 100644 index 0000000..2999aab --- /dev/null +++ b/Assets/_Project/Materials/Unlit.mat @@ -0,0 +1,77 @@ +%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: Unlit + m_Shader: {fileID: 4800000, guid: 9a5b59439e8c53d4e9239ea69d21748d, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + 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: 2800000, guid: 93415dc3da2b33443a2d6cdb553cc1c3, type: 3} + 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: + - PixelSnap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _InvFade: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.3455882, g: 0.2780478, b: 0.226157, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TintColor: {r: 0.25735295, g: 0.18252222, b: 0.14192258, a: 1} diff --git a/Assets/MMM/Trails/Materials/Unlit.mat.meta b/Assets/_Project/Materials/Unlit.mat.meta similarity index 100% rename from Assets/MMM/Trails/Materials/Unlit.mat.meta rename to Assets/_Project/Materials/Unlit.mat.meta diff --git a/Assets/MMM/Trails/Prefabs.meta b/Assets/_Project/Prefabs.meta similarity index 100% rename from Assets/MMM/Trails/Prefabs.meta rename to Assets/_Project/Prefabs.meta diff --git a/Assets/MMM/Trails/Prefabs/Brush.prefab b/Assets/_Project/Prefabs/Brush.prefab similarity index 100% rename from Assets/MMM/Trails/Prefabs/Brush.prefab rename to Assets/_Project/Prefabs/Brush.prefab diff --git a/Assets/MMM/Trails/Prefabs/Brush.prefab.meta b/Assets/_Project/Prefabs/Brush.prefab.meta similarity index 100% rename from Assets/MMM/Trails/Prefabs/Brush.prefab.meta rename to Assets/_Project/Prefabs/Brush.prefab.meta diff --git a/Assets/MMM/Trails/Prefabs/BrushCube.prefab b/Assets/_Project/Prefabs/BrushCube.prefab similarity index 50% rename from Assets/MMM/Trails/Prefabs/BrushCube.prefab rename to Assets/_Project/Prefabs/BrushCube.prefab index 66568bd..f45685b 100644 --- a/Assets/MMM/Trails/Prefabs/BrushCube.prefab +++ b/Assets/_Project/Prefabs/BrushCube.prefab @@ -5,12 +5,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 438116} - - 33: {fileID: 3341138} - - 23: {fileID: 2302090} - - 96: {fileID: 9603520} + - component: {fileID: 438116} + - component: {fileID: 3341138} + - component: {fileID: 2302090} + - component: {fileID: 9603520} m_Layer: 0 m_Name: BrushCube m_TagString: Untagged @@ -25,11 +25,12 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 153354} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.08999991, y: 2.78999996, z: 0} + m_LocalPosition: {x: -3.09, y: 2.79, 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!23 &2302090 MeshRenderer: m_ObjectHideFlags: 1 @@ -39,20 +40,30 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 10303, 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: 1 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &3341138 MeshFilter: @@ -63,6 +74,7 @@ MeshFilter: m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!96 &9603520 TrailRenderer: + serializedVersion: 2 m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} @@ -70,41 +82,88 @@ TrailRenderer: m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} - m_SubsetIndices: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 m_Time: 30 - m_StartWidth: .119999997 - m_EndWidth: .200000003 - m_Colors: - m_Color[0]: - serializedVersion: 2 - rgba: 4278190313 - m_Color[1]: - serializedVersion: 2 - rgba: 4294964224 - m_Color[2]: - serializedVersion: 2 - rgba: 4278190080 - m_Color[3]: + m_Parameters: + serializedVersion: 2 + widthMultiplier: 1 + widthCurve: serializedVersion: 2 - rgba: 4292346111 - m_Color[4]: + m_Curve: + - serializedVersion: 2 + time: 0 + value: 0.12 + 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 - rgba: 4294967295 - m_MinVertexDistance: .100000001 + key0: {r: 0.9137255, g: 0, b: 0, a: 1} + key1: {r: 0, g: 0.95686275, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 1} + key3: {r: 1, g: 0, b: 0.84705883, a: 1} + key4: {r: 1, g: 1, b: 1, a: 1} + 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: 16384 + ctime2: 32768 + ctime3: 49151 + ctime4: 65535 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 16384 + atime2: 32768 + atime3: 49151 + atime4: 65535 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 5 + m_NumAlphaKeys: 5 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + generateLightingData: 0 + m_MinVertexDistance: 0.1 m_Autodestruct: 0 --- !u!1001 &100100000 Prefab: diff --git a/Assets/MMM/Trails/Prefabs/BrushCube.prefab.meta b/Assets/_Project/Prefabs/BrushCube.prefab.meta similarity index 100% rename from Assets/MMM/Trails/Prefabs/BrushCube.prefab.meta rename to Assets/_Project/Prefabs/BrushCube.prefab.meta diff --git a/Assets/MMM/Trails/Prefabs/MouseBrush.prefab b/Assets/_Project/Prefabs/MouseBrush.prefab similarity index 100% rename from Assets/MMM/Trails/Prefabs/MouseBrush.prefab rename to Assets/_Project/Prefabs/MouseBrush.prefab diff --git a/Assets/MMM/Trails/Prefabs/MouseBrush.prefab.meta b/Assets/_Project/Prefabs/MouseBrush.prefab.meta similarity index 100% rename from Assets/MMM/Trails/Prefabs/MouseBrush.prefab.meta rename to Assets/_Project/Prefabs/MouseBrush.prefab.meta diff --git a/Assets/MMM/Trails/Prefabs/UI.prefab b/Assets/_Project/Prefabs/UI.prefab similarity index 100% rename from Assets/MMM/Trails/Prefabs/UI.prefab rename to Assets/_Project/Prefabs/UI.prefab diff --git a/Assets/MMM/Trails/Prefabs/UI.prefab.meta b/Assets/_Project/Prefabs/UI.prefab.meta similarity index 100% rename from Assets/MMM/Trails/Prefabs/UI.prefab.meta rename to Assets/_Project/Prefabs/UI.prefab.meta diff --git a/Assets/MMM/Trails/Scenes.meta b/Assets/_Project/Scenes.meta similarity index 100% rename from Assets/MMM/Trails/Scenes.meta rename to Assets/_Project/Scenes.meta diff --git a/Assets/MMM/Trails/Scenes/1. Whitesnake.unity b/Assets/_Project/Scenes/1. Whitesnake.unity similarity index 100% rename from Assets/MMM/Trails/Scenes/1. Whitesnake.unity rename to Assets/_Project/Scenes/1. Whitesnake.unity diff --git a/Assets/MMM/Trails/Scenes/1. Whitesnake.unity.meta b/Assets/_Project/Scenes/1. Whitesnake.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/1. Whitesnake.unity.meta rename to Assets/_Project/Scenes/1. Whitesnake.unity.meta diff --git a/Assets/MMM/Trails/Scenes/2. Light Cycle.unity b/Assets/_Project/Scenes/2. Light Cycle.unity similarity index 100% rename from Assets/MMM/Trails/Scenes/2. Light Cycle.unity rename to Assets/_Project/Scenes/2. Light Cycle.unity diff --git a/Assets/MMM/Trails/Scenes/2. Light Cycle.unity.meta b/Assets/_Project/Scenes/2. Light Cycle.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/2. Light Cycle.unity.meta rename to Assets/_Project/Scenes/2. Light Cycle.unity.meta diff --git a/Assets/MMM/Trails/Scenes/3. Enter The Mirror.unity b/Assets/_Project/Scenes/3. Enter The Mirror.unity similarity index 100% rename from Assets/MMM/Trails/Scenes/3. Enter The Mirror.unity rename to Assets/_Project/Scenes/3. Enter The Mirror.unity diff --git a/Assets/MMM/Trails/Scenes/3. Enter The Mirror.unity.meta b/Assets/_Project/Scenes/3. Enter The Mirror.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/3. Enter The Mirror.unity.meta rename to Assets/_Project/Scenes/3. Enter The Mirror.unity.meta diff --git a/Assets/MMM/Trails/Scenes/4. The Camera Follows.unity b/Assets/_Project/Scenes/4. The Camera Follows.unity similarity index 100% rename from Assets/MMM/Trails/Scenes/4. The Camera Follows.unity rename to Assets/_Project/Scenes/4. The Camera Follows.unity diff --git a/Assets/MMM/Trails/Scenes/4. The Camera Follows.unity.meta b/Assets/_Project/Scenes/4. The Camera Follows.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/4. The Camera Follows.unity.meta rename to Assets/_Project/Scenes/4. The Camera Follows.unity.meta diff --git a/Assets/MMM/Trails/Scenes/5. A Simplification.unity b/Assets/_Project/Scenes/5. The Cinemachine Follows.unity similarity index 77% rename from Assets/MMM/Trails/Scenes/5. A Simplification.unity rename to Assets/_Project/Scenes/5. The Cinemachine Follows.unity index 0d08c05..e2ffebf 100644 --- a/Assets/MMM/Trails/Scenes/5. A Simplification.unity +++ b/Assets/_Project/Scenes/5. The Cinemachine Follows.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} - m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} - m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,15 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 11 m_GIWorkflowMode: 0 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -56,56 +54,126 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 9 m_Resolution: 2 m_BakeResolution: 40 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: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666672 manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!4 &69896990 stripped -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1229480314} +--- !u!1001 &140206516 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 480988683} + m_Modifications: + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalPosition.x + value: 1.48000002 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalPosition.y + value: -.899999976 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_Name + value: BrushCube7 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_IsPrefabParent: 0 --- !u!1 &149550811 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 149550816} - - 20: {fileID: 149550815} - - 92: {fileID: 149550814} - - 124: {fileID: 149550813} - - 81: {fileID: 149550812} - - 114: {fileID: 149550817} - - 114: {fileID: 149550818} - - 114: {fileID: 149550819} + - component: {fileID: 149550816} + - component: {fileID: 149550815} + - component: {fileID: 149550814} + - component: {fileID: 149550813} + - component: {fileID: 149550812} + - component: {fileID: 149550817} + - component: {fileID: 149550819} + - component: {fileID: 149550818} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -143,18 +211,18 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 30 + near clip plane: 0.1 + far clip plane: 5000 + field of view: 40 + orthographic: 0 + orthographic size: 10 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -162,11 +230,14 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 - m_StereoMirrorMode: 0 + m_StereoSeparation: 0.022 --- !u!4 &149550816 Transform: m_ObjectHideFlags: 0 @@ -174,11 +245,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 149550811} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -200} + m_LocalPosition: {x: 0.33445945, y: 0.929054, z: -270.61} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &149550817 MonoBehaviour: m_ObjectHideFlags: 0 @@ -193,23 +265,23 @@ MonoBehaviour: tweakMode: 1 screenBlendMode: 0 hdr: 0 - sepBlurSpread: 8.47999954 + sepBlurSpread: 2.97 quality: 1 - bloomIntensity: 3.63000011 - bloomThreshold: .419999987 + bloomIntensity: 1.45 + bloomThreshold: 0.35 bloomThresholdColor: {r: 1, g: 1, b: 1, a: 1} - bloomBlurIterations: 2 - hollywoodFlareBlurIterations: 1 + bloomBlurIterations: 1 + hollywoodFlareBlurIterations: 2 flareRotation: 0 - lensflareMode: 0 - hollyStretchWidth: 1.61000001 - lensflareIntensity: .400000006 - lensflareThreshold: 0 - lensFlareSaturation: .529999971 - flareColorA: {r: .400000006, g: .400000006, b: .800000012, a: .75} - flareColorB: {r: .400000006, g: .800000012, b: .800000012, a: .75} - flareColorC: {r: .800000012, g: .400000006, b: .800000012, a: .75} - flareColorD: {r: .800000012, g: .400000006, b: 0, a: .75} + lensflareMode: 1 + hollyStretchWidth: 2.5 + lensflareIntensity: 0 + lensflareThreshold: 0.3 + lensFlareSaturation: 0.75 + flareColorA: {r: 0.4, g: 0.4, b: 0.8, a: 0.75} + flareColorB: {r: 0.4, g: 0.8, b: 0.8, a: 0.75} + flareColorC: {r: 0.8, g: 0.4, b: 0.8, a: 0.75} + flareColorD: {r: 0.8, g: 0.4, b: 0, a: 0.75} lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, type: 3} lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} @@ -225,12 +297,15 @@ MonoBehaviour: m_GameObject: {fileID: 149550811} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8fbe8446fd51be9428ddd636a2232155, type: 3} + m_Script: {fileID: 11500000, guid: def8cbf5800847a47937e657561c2826, type: 3} m_Name: m_EditorClassIdentifier: - triggerKey: 0 - superSize: 3 - subfolder: Workshop + shader: {fileID: 4800000, guid: 0fef04b2fcf69454a932f248fcb956a3, type: 3} + bypass: 0 + triggerNext: 93 + triggerPrevious: 91 + triggerBypass: 98 + blendMode: 2 --- !u!114 &149550819 MonoBehaviour: m_ObjectHideFlags: 0 @@ -239,31 +314,21 @@ MonoBehaviour: m_GameObject: {fileID: 149550811} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: def8cbf5800847a47937e657561c2826, type: 3} + m_Script: {fileID: 11500000, guid: 8fbe8446fd51be9428ddd636a2232155, type: 3} m_Name: m_EditorClassIdentifier: - shader: {fileID: 4800000, guid: 0fef04b2fcf69454a932f248fcb956a3, type: 3} - bypass: 0 - triggerNext: 93 - triggerPrevious: 91 - blendMode: 0 ---- !u!4 &216749479 stripped -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1713580364} ---- !u!4 &249788757 stripped -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 696603875} + triggerKey: 112 + superSize: 3 + subfolder: Workshop --- !u!1 &274258591 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 274258593} - - 108: {fileID: 274258592} + - component: {fileID: 274258593} + - component: {fileID: 274258592} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -278,9 +343,9 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 - m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 @@ -288,9 +353,11 @@ Light: m_Shadows: m_Type: 2 m_Resolution: -1 + m_CustomResolution: -1 m_Strength: 1 - m_Bias: .0500000007 - m_NormalBias: .400000006 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -299,90 +366,31 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 4 + 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 &274258593 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} - m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 ---- !u!1001 &453583533 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &376802800 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} - m_Modifications: - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.x - value: -.184459448 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.y - value: 3.9009459 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Name - value: BrushCube3 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.x - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.y - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_LocalScale.z - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_IsPrefabParent: 0 ---- !u!1001 &696603875 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x @@ -420,22 +428,18 @@ Prefab: propertyPath: m_Name value: BrushCube4 objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!1 &744575981 +--- !u!1 &480988682 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 744575982} - - 114: {fileID: 744575983} + - component: {fileID: 480988683} + - component: {fileID: 480988684} m_Layer: 0 m_Name: Brush m_TagString: Untagged @@ -443,42 +447,52 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &744575982 +--- !u!4 &480988683 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 744575981} + m_GameObject: {fileID: 480988682} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: .334459454, y: .929054022, z: 0} + m_LocalPosition: {x: 0.33445945, y: 0.929054, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 69896990} - - {fileID: 249788757} - - {fileID: 1295950817} - - {fileID: 970831597} - - {fileID: 1482024962} - - {fileID: 2084791589} - - {fileID: 216749479} + - {fileID: 1825946502} + - {fileID: 871296002} + - {fileID: 1015621389} + - {fileID: 1465970063} + - {fileID: 754879093} + - {fileID: 2056578442} + - {fileID: 1950487843} m_Father: {fileID: 0} m_RootOrder: 1 ---- !u!114 &744575983 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &480988684 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 744575981} + m_GameObject: {fileID: 480988682} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1ce0ae6c1e5dd57459f86322b9bac063, type: 3} m_Name: m_EditorClassIdentifier: - speed: 20 + speed: 25 velocity: {x: 0, y: 0, z: 0} + moveOnPress: 0 KeyUp: 119 KeyDown: 115 KeyLeft: 97 KeyRight: 100 +--- !u!4 &754879093 stripped +Transform: + m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_PrefabInternal: {fileID: 2134967504} +--- !u!4 &871296002 stripped +Transform: + m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_PrefabInternal: {fileID: 376802800} --- !u!1001 &941726147 Prefab: m_ObjectHideFlags: 0 @@ -561,29 +575,24 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_IsPrefabParent: 0 ---- !u!224 &941726148 stripped -RectTransform: - m_PrefabParentObject: {fileID: 22424872, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 941726147} ---- !u!4 &970831597 stripped +--- !u!4 &1015621389 stripped Transform: m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 453583533} ---- !u!1001 &1229480314 + m_PrefabInternal: {fileID: 1059011605} +--- !u!1001 &1059011605 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x - value: 3.05999994 + value: -3.08999991 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.y - value: 2.8499999 + value: 2.78999996 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.z @@ -607,41 +616,33 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_RootOrder - value: 0 + value: 2 objectReference: {fileID: 0} - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_Name - value: BrushCube5 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 + value: BrushCube1 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!4 &1295950817 stripped -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1679757769} ---- !u!4 &1482024962 stripped +--- !u!4 &1465970063 stripped Transform: m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1707130292} ---- !u!1001 &1558328999 + m_PrefabInternal: {fileID: 1592190500} +--- !u!1001 &1592190500 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x - value: -2.44000006 + value: -.184459448 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.y - value: -.74000001 + value: 3.9009459 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.z @@ -665,33 +666,41 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_RootOrder - value: 5 + value: 3 objectReference: {fileID: 0} - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_Name - value: BrushCube6 + value: BrushCube3 objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + propertyPath: m_LocalScale.z + value: 2 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!1001 &1679757769 +--- !u!1001 &1642425450 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x - value: -3.08999991 + value: 3.05999994 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.y - value: 2.78999996 + value: 2.8499999 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.z @@ -715,102 +724,29 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_RootOrder - value: 2 + value: 0 objectReference: {fileID: 0} - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_Name - value: BrushCube1 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 + value: BrushCube5 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!1 &1693116632 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 107714, guid: 134baa4997b93004791c6415e1c854ab, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1693116633} - - 222: {fileID: 1693116635} - - 114: {fileID: 1693116634} - m_Layer: 0 - m_Name: Screengrab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1693116633 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22441870, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1693116632} - m_LocalRotation: {x: 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: 941726148} - m_RootOrder: 3 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 14.0000124, y: 65.9999924} - m_SizeDelta: {x: 334, y: 16.6000004} - m_Pivot: {x: 0, y: 0} ---- !u!114 &1693116634 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11411700, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1693116632} - 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: .917647064, b: .79411763, a: 1} - m_FontData: - m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'P: Save Picture' ---- !u!222 &1693116635 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22265110, guid: 134baa4997b93004791c6415e1c854ab, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1693116632} ---- !u!1001 &1707130292 +--- !u!1001 &1781038435 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x - value: -.25 + value: -2.44000006 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.y - value: -2.69000006 + value: -.74000001 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.z @@ -834,33 +770,41 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_Name - value: BrushCube2 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 + value: BrushCube6 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!1001 &1713580364 +--- !u!4 &1825946502 stripped +Transform: + m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_PrefabInternal: {fileID: 1642425450} +--- !u!4 &1950487843 stripped +Transform: + m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_PrefabInternal: {fileID: 140206516} +--- !u!4 &2056578442 stripped +Transform: + m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} + m_PrefabInternal: {fileID: 1781038435} +--- !u!1001 &2134967504 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 744575982} + m_TransformParent: {fileID: 480988683} m_Modifications: - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.x - value: 1.48000002 + value: -.25 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.y - value: -.899999976 + value: -2.69000006 objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_LocalPosition.z @@ -884,20 +828,12 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_RootOrder - value: 6 + value: 4 objectReference: {fileID: 0} - target: {fileID: 153354, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} propertyPath: m_Name - value: BrushCube7 - objectReference: {fileID: 0} - - target: {fileID: 2302090, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - propertyPath: m_Enabled - value: 0 + value: BrushCube2 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} m_IsPrefabParent: 0 ---- !u!4 &2084791589 stripped -Transform: - m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} - m_PrefabInternal: {fileID: 1558328999} diff --git a/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta b/Assets/_Project/Scenes/5. The Cinemachine Follows.unity.meta similarity index 63% rename from Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta rename to Assets/_Project/Scenes/5. The Cinemachine Follows.unity.meta index ce72dcc..c4c48f2 100644 --- a/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta +++ b/Assets/_Project/Scenes/5. The Cinemachine Follows.unity.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: b457b86750a11f1408e1681d38996e8e -timeCreated: 1435040073 +guid: b3b3ec43d74830147a7e7aa938d4ada8 +timeCreated: 1435297257 licenseType: Pro DefaultImporter: userData: diff --git a/Assets/MMM/Trails/Scenes/6. Texturality.unity b/Assets/_Project/Scenes/6. Texturality.unity similarity index 85% rename from Assets/MMM/Trails/Scenes/6. Texturality.unity rename to Assets/_Project/Scenes/6. Texturality.unity index e6ee4f4..9e417e9 100644 --- a/Assets/MMM/Trails/Scenes/6. Texturality.unity +++ b/Assets/_Project/Scenes/6. Texturality.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} - m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} - m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,15 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 11 m_GIWorkflowMode: 0 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -56,36 +54,64 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 9 m_Resolution: 2 m_BakeResolution: 40 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: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666672 manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!4 &69896990 stripped Transform: @@ -96,11 +122,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 142362, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 141526080} - - 222: {fileID: 141526079} - - 114: {fileID: 141526078} + - component: {fileID: 141526080} + - component: {fileID: 141526079} + - component: {fileID: 141526078} m_Layer: 0 m_Name: Title Label m_TagString: Untagged @@ -122,6 +148,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 21 @@ -130,6 +162,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -155,9 +188,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -40.3299866} + m_AnchoredPosition: {x: 10, y: -40.329987} m_SizeDelta: {x: 616, y: 30.230011} m_Pivot: {x: 0, y: 0} --- !u!1 &149550811 @@ -165,16 +199,16 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 149550816} - - 20: {fileID: 149550815} - - 92: {fileID: 149550814} - - 124: {fileID: 149550813} - - 81: {fileID: 149550812} - - 114: {fileID: 149550817} - - 114: {fileID: 149550818} - - 114: {fileID: 149550819} + - component: {fileID: 149550816} + - component: {fileID: 149550815} + - component: {fileID: 149550814} + - component: {fileID: 149550813} + - component: {fileID: 149550812} + - component: {fileID: 149550817} + - component: {fileID: 149550818} + - component: {fileID: 149550819} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -212,14 +246,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -231,11 +265,14 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 - m_StereoMirrorMode: 0 + m_StereoSeparation: 0.022 --- !u!4 &149550816 Transform: m_ObjectHideFlags: 0 @@ -248,6 +285,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &149550817 MonoBehaviour: m_ObjectHideFlags: 0 @@ -262,23 +300,23 @@ MonoBehaviour: tweakMode: 1 screenBlendMode: 0 hdr: 0 - sepBlurSpread: 8.47999954 + sepBlurSpread: 8.48 quality: 1 - bloomIntensity: .819999993 - bloomThreshold: .419999987 + bloomIntensity: 0.82 + bloomThreshold: 0.42 bloomThresholdColor: {r: 1, g: 1, b: 1, a: 1} bloomBlurIterations: 2 hollywoodFlareBlurIterations: 1 flareRotation: 0 lensflareMode: 0 - hollyStretchWidth: 1.61000001 - lensflareIntensity: 7.46999979 + hollyStretchWidth: 1.61 + lensflareIntensity: 7.47 lensflareThreshold: 0 - lensFlareSaturation: .529999971 - flareColorA: {r: .400000006, g: .400000006, b: .800000012, a: .75} - flareColorB: {r: .400000006, g: .800000012, b: .800000012, a: .75} - flareColorC: {r: .800000012, g: .400000006, b: .800000012, a: .75} - flareColorD: {r: .800000012, g: .400000006, b: 0, a: .75} + lensFlareSaturation: 0.53 + flareColorA: {r: 0.4, g: 0.4, b: 0.8, a: 0.75} + flareColorB: {r: 0.4, g: 0.8, b: 0.8, a: 0.75} + flareColorC: {r: 0.8, g: 0.4, b: 0.8, a: 0.75} + flareColorD: {r: 0.8, g: 0.4, b: 0, a: 0.75} lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, type: 3} lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} @@ -301,6 +339,7 @@ MonoBehaviour: bypass: 0 triggerNext: 93 triggerPrevious: 91 + triggerBypass: 98 blendMode: 0 --- !u!114 &149550819 MonoBehaviour: @@ -329,10 +368,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 274258593} - - 108: {fileID: 274258592} + - component: {fileID: 274258593} + - component: {fileID: 274258592} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -347,9 +386,9 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 - m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 @@ -357,9 +396,11 @@ Light: m_Shadows: m_Type: 2 m_Resolution: -1 + m_CustomResolution: -1 m_Strength: 1 - m_Bias: .0500000007 - m_NormalBias: .400000006 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -368,22 +409,25 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 4 + 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 &274258593 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} - m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &453583533 Prefab: m_ObjectHideFlags: 0 @@ -463,11 +507,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 107714, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 661570573} - - 222: {fileID: 661570575} - - 114: {fileID: 661570574} + - component: {fileID: 661570573} + - component: {fileID: 661570575} + - component: {fileID: 661570574} m_Layer: 0 m_Name: Screengrab m_TagString: Untagged @@ -488,10 +532,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 14, y: 66} - m_SizeDelta: {x: 334, y: 16.6000004} + m_SizeDelta: {x: 334, y: 16.6} m_Pivot: {x: 0, y: 0} --- !u!114 &661570574 MonoBehaviour: @@ -506,7 +551,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: .917647064, b: .79411763, a: 1} + m_Color: {r: 1, g: 0.91764706, b: 0.7941176, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -515,6 +566,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -594,10 +646,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 744575982} - - 114: {fileID: 744575983} + - component: {fileID: 744575982} + - component: {fileID: 744575983} m_Layer: 0 m_Name: Brush m_TagString: Untagged @@ -612,7 +664,7 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 744575981} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: .334459454, y: .929054022, z: 0} + m_LocalPosition: {x: 0.33445945, y: 0.929054, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 69896990} @@ -624,6 +676,7 @@ Transform: - {fileID: 216749479} m_Father: {fileID: 0} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &744575983 MonoBehaviour: m_ObjectHideFlags: 0 @@ -637,6 +690,7 @@ MonoBehaviour: m_EditorClassIdentifier: speed: 20 velocity: {x: 0, y: 0, z: 0} + moveOnPress: 0 KeyUp: 119 KeyDown: 115 KeyLeft: 97 @@ -646,11 +700,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 197456, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 791851531} - - 222: {fileID: 791851533} - - 114: {fileID: 791851532} + - component: {fileID: 791851531} + - component: {fileID: 791851533} + - component: {fileID: 791851532} m_Layer: 0 m_Name: Instructions m_TagString: Untagged @@ -671,9 +725,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 13.9999924, y: 0} + m_AnchoredPosition: {x: 13.999992, y: 0} m_SizeDelta: {x: 334, y: 66} m_Pivot: {x: 0, y: 0} --- !u!114 &791851532 @@ -689,7 +744,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: .917647064, b: .79411763, a: 1} + m_Color: {r: 1, g: 0.91764706, b: 0.7941176, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -698,6 +759,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -721,13 +783,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 141232, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 856500149} - - 223: {fileID: 856500152} - - 114: {fileID: 856500151} - - 114: {fileID: 856500150} - - 114: {fileID: 856500153} + - component: {fileID: 856500149} + - component: {fileID: 856500152} + - component: {fileID: 856500151} + - component: {fileID: 856500150} + - component: {fileID: 856500153} m_Layer: 0 m_Name: UI m_TagString: Untagged @@ -749,6 +811,7 @@ RectTransform: - {fileID: 1487544264} 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} @@ -801,7 +864,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 856500148} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -809,8 +872,11 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!114 &856500153 MonoBehaviour: m_ObjectHideFlags: 0 @@ -837,7 +903,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .772058845, g: .772058845, b: .772058845, a: 1} + m_Color: {r: 0.77205884, g: 0.77205884, b: 0.77205884, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -846,6 +918,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -860,13 +933,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1194767091} - - 33: {fileID: 1194767090} - - 64: {fileID: 1194767089} - - 23: {fileID: 1194767088} - - 114: {fileID: 1194767092} + - component: {fileID: 1194767091} + - component: {fileID: 1194767090} + - component: {fileID: 1194767088} + - component: {fileID: 1194767092} m_Layer: 0 m_Name: BG Quad m_TagString: Untagged @@ -883,33 +955,31 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: 2fd8bbb2d0e411c49859012e4e54d583, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 1 - m_ReflectionProbeUsage: 1 m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!64 &1194767089 -MeshCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194767087} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &1194767090 MeshFilter: m_ObjectHideFlags: 0 @@ -925,10 +995,11 @@ Transform: m_GameObject: {fileID: 1194767087} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 200} - m_LocalScale: {x: 77.4921646, y: 77.4921646, z: 0} + m_LocalScale: {x: 73.84099, y: 73.84099, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1194767092 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1012,11 +1083,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1398539224} - - 222: {fileID: 1398539226} - - 114: {fileID: 1398539225} + - component: {fileID: 1398539224} + - component: {fileID: 1398539226} + - component: {fileID: 1398539225} m_Layer: 0 m_Name: License m_TagString: Untagged @@ -1036,11 +1107,12 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -92.6999969, y: 7.80000019} - m_SizeDelta: {x: 167.800003, y: 15.6000004} - m_Pivot: {x: .5, y: .5} + m_AnchoredPosition: {x: -92.70001, y: 7.799988} + m_SizeDelta: {x: 167.8, y: 15.6} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1398539225 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1054,14 +1126,21 @@ MonoBehaviour: 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: 8 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 10 + m_MinSize: 8 m_MaxSize: 40 m_Alignment: 2 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 @@ -1078,12 +1157,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1476324481} - - 114: {fileID: 1476324480} - - 114: {fileID: 1476324479} - - 114: {fileID: 1476324478} + - component: {fileID: 1476324481} + - component: {fileID: 1476324480} + - component: {fileID: 1476324479} + - component: {fileID: 1476324478} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -1102,7 +1181,7 @@ MonoBehaviour: m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_AllowActivationOnStandalone: 0 + m_ForceModuleActive: 0 --- !u!114 &1476324479 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1119,8 +1198,8 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_RepeatDelay: .5 - m_AllowActivationOnMobileDevice: 0 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 --- !u!114 &1476324480 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1147,6 +1226,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1482024962 stripped Transform: m_PrefabParentObject: {fileID: 438116, guid: 9624f7d2eee60a2499e0b87db420cde7, type: 2} @@ -1156,11 +1236,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 107658, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1487544264} - - 114: {fileID: 1487544266} - - 225: {fileID: 1487544265} + - component: {fileID: 1487544264} + - component: {fileID: 1487544266} + - component: {fileID: 1487544265} m_Layer: 0 m_Name: Group m_TagString: Untagged @@ -1187,11 +1267,12 @@ RectTransform: - {fileID: 1398539224} m_Father: {fileID: 856500149} 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, y: .5} + m_Pivot: {x: 0, y: 0.5} --- !u!225 &1487544265 CanvasGroup: m_ObjectHideFlags: 0 @@ -1217,7 +1298,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: trigger: 32 - speed: .25 + speed: 0.25 --- !u!1001 &1558328999 Prefab: m_ObjectHideFlags: 0 @@ -1471,12 +1552,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 182958, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1785739162} - - 222: {fileID: 1785739163} - - 114: {fileID: 941726148} - - 114: {fileID: 1785739164} + - component: {fileID: 1785739162} + - component: {fileID: 1785739163} + - component: {fileID: 941726148} + - component: {fileID: 1785739164} m_Layer: 0 m_Name: Blend Mode m_TagString: Untagged @@ -1497,9 +1578,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -104.900002} + m_AnchoredPosition: {x: 10, y: -104.9} m_SizeDelta: {x: 334, y: 30} m_Pivot: {x: 0, y: 0} --- !u!222 &1785739163 @@ -1526,12 +1608,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 170056, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2051193836} - - 222: {fileID: 2051193839} - - 114: {fileID: 2051193838} - - 114: {fileID: 2051193837} + - component: {fileID: 2051193836} + - component: {fileID: 2051193839} + - component: {fileID: 2051193838} + - component: {fileID: 2051193837} m_Layer: 0 m_Name: Scene Label m_TagString: Untagged @@ -1552,9 +1634,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 10, y: -70.8000031} + m_AnchoredPosition: {x: 10, y: -70.8} m_SizeDelta: {x: 334, y: 30} m_Pivot: {x: 0, y: 0} --- !u!114 &2051193837 @@ -1581,7 +1664,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .352941155, g: .839350998, b: 1, a: 1} + m_Color: {r: 0.35294116, g: 0.839351, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 21 @@ -1590,6 +1679,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 diff --git a/Assets/MMM/Trails/Scenes/6. Texturality.unity.meta b/Assets/_Project/Scenes/6. Texturality.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/6. Texturality.unity.meta rename to Assets/_Project/Scenes/6. Texturality.unity.meta diff --git a/Assets/MMM/Trails/Scenes/7. Mouse.unity b/Assets/_Project/Scenes/7. Mouse.unity similarity index 76% rename from Assets/MMM/Trails/Scenes/7. Mouse.unity rename to Assets/_Project/Scenes/7. Mouse.unity index 3b05a4e..50b47b6 100644 --- a/Assets/MMM/Trails/Scenes/7. Mouse.unity +++ b/Assets/_Project/Scenes/7. Mouse.unity @@ -1,32 +1,33 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 8 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} - m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} - m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,15 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 11 m_GIWorkflowMode: 0 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -56,47 +54,75 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 9 m_Resolution: 2 m_BakeResolution: 40 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: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 --- !u!196 &5 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentTypeID: 0 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666672 manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &141526077 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 142362, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 141526080} - - 222: {fileID: 141526079} - - 114: {fileID: 141526078} + - component: {fileID: 141526080} + - component: {fileID: 141526079} + - component: {fileID: 141526078} m_Layer: 0 m_Name: Title Label m_TagString: Untagged @@ -118,6 +144,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 21 @@ -126,6 +158,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -151,9 +184,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -40.3299866} + m_AnchoredPosition: {x: 10, y: -40.329987} m_SizeDelta: {x: 616, y: 30.230011} m_Pivot: {x: 0, y: 0} --- !u!1 &149550811 @@ -161,17 +195,15 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 149550816} - - 20: {fileID: 149550815} - - 92: {fileID: 149550814} - - 124: {fileID: 149550813} - - 81: {fileID: 149550812} - - 114: {fileID: 149550817} - - 114: {fileID: 149550818} - - 114: {fileID: 149550819} - - 114: {fileID: 149550820} + - component: {fileID: 149550816} + - component: {fileID: 149550815} + - component: {fileID: 149550813} + - component: {fileID: 149550812} + - component: {fileID: 149550817} + - component: {fileID: 149550818} + - component: {fileID: 149550819} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -187,13 +219,6 @@ AudioListener: m_GameObject: {fileID: 149550811} m_Enabled: 1 --- !u!124 &149550813 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 ---- !u!92 &149550814 Behaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} @@ -209,18 +234,18 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 30 + orthographic size: 60 m_Depth: 1 m_CullingMask: serializedVersion: 2 @@ -228,11 +253,14 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 - m_StereoMirrorMode: 0 + m_StereoSeparation: 0.022 --- !u!4 &149550816 Transform: m_ObjectHideFlags: 0 @@ -240,11 +268,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 149550811} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -200} + m_LocalPosition: {x: 0, y: 0, z: -300} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &149550817 MonoBehaviour: m_ObjectHideFlags: 0 @@ -259,23 +288,23 @@ MonoBehaviour: tweakMode: 1 screenBlendMode: 0 hdr: 0 - sepBlurSpread: 8.47999954 + sepBlurSpread: 8.48 quality: 1 - bloomIntensity: .819999993 - bloomThreshold: .419999987 + bloomIntensity: 0.82 + bloomThreshold: 0.42 bloomThresholdColor: {r: 1, g: 1, b: 1, a: 1} bloomBlurIterations: 2 hollywoodFlareBlurIterations: 1 flareRotation: 0 lensflareMode: 0 - hollyStretchWidth: 1.61000001 - lensflareIntensity: 7.46999979 + hollyStretchWidth: 1.61 + lensflareIntensity: 7.47 lensflareThreshold: 0 - lensFlareSaturation: .529999971 - flareColorA: {r: .400000006, g: .400000006, b: .800000012, a: .75} - flareColorB: {r: .400000006, g: .800000012, b: .800000012, a: .75} - flareColorC: {r: .800000012, g: .400000006, b: .800000012, a: .75} - flareColorD: {r: .800000012, g: .400000006, b: 0, a: .75} + lensFlareSaturation: 0.53 + flareColorA: {r: 0.4, g: 0.4, b: 0.8, a: 0.75} + flareColorB: {r: 0.4, g: 0.8, b: 0.8, a: 0.75} + flareColorC: {r: 0.8, g: 0.4, b: 0.8, a: 0.75} + flareColorD: {r: 0.8, g: 0.4, b: 0, a: 0.75} lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, type: 3} lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} @@ -298,6 +327,7 @@ MonoBehaviour: bypass: 0 triggerNext: 93 triggerPrevious: 91 + triggerBypass: 98 blendMode: 0 --- !u!114 &149550819 MonoBehaviour: @@ -313,28 +343,15 @@ MonoBehaviour: triggerKey: 112 superSize: 3 subfolder: Workshop ---- !u!114 &149550820 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 149550811} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e2ddf27c4a81468428f873b778790ef8, type: 3} - m_Name: - m_EditorClassIdentifier: - brushPrefab: {fileID: 166144, guid: 70bf8a9610f88d04696686bac796207e, type: 2} - gridSnap: 4 --- !u!1 &274258591 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 274258593} - - 108: {fileID: 274258592} + - component: {fileID: 274258593} + - component: {fileID: 274258592} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -349,9 +366,9 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 - m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 @@ -359,9 +376,11 @@ Light: m_Shadows: m_Type: 2 m_Resolution: -1 + m_CustomResolution: -1 m_Strength: 1 - m_Bias: .0500000007 - m_NormalBias: .400000006 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -370,32 +389,35 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 4 + 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 &274258593 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274258591} - m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &661570572 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 107714, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 661570573} - - 222: {fileID: 661570575} - - 114: {fileID: 661570574} + - component: {fileID: 661570573} + - component: {fileID: 661570575} + - component: {fileID: 661570574} m_Layer: 0 m_Name: Screengrab m_TagString: Untagged @@ -416,10 +438,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 14, y: 66} - m_SizeDelta: {x: 334, y: 16.6000004} + m_SizeDelta: {x: 334, y: 16.6} m_Pivot: {x: 0, y: 0} --- !u!114 &661570574 MonoBehaviour: @@ -434,7 +457,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: .917647064, b: .79411763, a: 1} + m_Color: {r: 1, g: 0.91764706, b: 0.7941176, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -443,6 +472,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -460,11 +490,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 197456, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 791851531} - - 222: {fileID: 791851533} - - 114: {fileID: 791851532} + - component: {fileID: 791851531} + - component: {fileID: 791851533} + - component: {fileID: 791851532} m_Layer: 0 m_Name: Instructions m_TagString: Untagged @@ -485,9 +515,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 13.9999924, y: 0} + m_AnchoredPosition: {x: 13.999992, y: 0} m_SizeDelta: {x: 334, y: 66} m_Pivot: {x: 0, y: 0} --- !u!114 &791851532 @@ -503,7 +534,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: .917647064, b: .79411763, a: 1} + m_Color: {r: 1, g: 0.91764706, b: 0.7941176, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -512,6 +549,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -535,13 +573,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 141232, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 856500149} - - 223: {fileID: 856500152} - - 114: {fileID: 856500151} - - 114: {fileID: 856500150} - - 114: {fileID: 856500153} + - component: {fileID: 856500149} + - component: {fileID: 856500152} + - component: {fileID: 856500151} + - component: {fileID: 856500150} + - component: {fileID: 856500153} m_Layer: 0 m_Name: UI m_TagString: Untagged @@ -563,6 +601,7 @@ RectTransform: - {fileID: 1487544264} 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} @@ -615,7 +654,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 856500148} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -623,8 +662,11 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!114 &856500153 MonoBehaviour: m_ObjectHideFlags: 0 @@ -651,7 +693,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .772058845, g: .772058845, b: .772058845, a: 1} + m_Color: {r: 0.77205884, g: 0.77205884, b: 0.77205884, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 12 @@ -660,41 +708,71 @@ MonoBehaviour: 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: 'Blend: FullA' ---- !u!1 &1476324477 +--- !u!1 &1160048930 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 1476324481} - - 114: {fileID: 1476324480} - - 114: {fileID: 1476324479} - - 114: {fileID: 1476324478} + - component: {fileID: 1160048931} + - component: {fileID: 1160048932} m_Layer: 0 - m_Name: EventSystem + m_Name: Brush m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1476324478 +--- !u!4 &1160048931 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1160048930} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 200} + 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!114 &1160048932 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1476324477} + m_GameObject: {fileID: 1160048930} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: e2ddf27c4a81468428f873b778790ef8, type: 3} m_Name: m_EditorClassIdentifier: - m_AllowActivationOnStandalone: 0 + brushPrefab: {fileID: 166144, guid: 70bf8a9610f88d04696686bac796207e, type: 2} + gridSnap: 1 +--- !u!1 &1476324477 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1476324481} + - component: {fileID: 1476324480} + - component: {fileID: 1476324479} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!114 &1476324479 MonoBehaviour: m_ObjectHideFlags: 0 @@ -711,8 +789,8 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_RepeatDelay: .5 - m_AllowActivationOnMobileDevice: 0 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 --- !u!114 &1476324480 MonoBehaviour: m_ObjectHideFlags: 0 @@ -739,16 +817,17 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1487544263 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 107658, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1487544264} - - 114: {fileID: 1487544266} - - 225: {fileID: 1487544265} + - component: {fileID: 1487544264} + - component: {fileID: 1487544266} + - component: {fileID: 1487544265} m_Layer: 0 m_Name: Group m_TagString: Untagged @@ -774,11 +853,12 @@ RectTransform: - {fileID: 661570573} m_Father: {fileID: 856500149} 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, y: .5} + m_Pivot: {x: 0, y: 0.5} --- !u!225 &1487544265 CanvasGroup: m_ObjectHideFlags: 0 @@ -804,18 +884,18 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: trigger: 32 - speed: .25 + speed: 0.25 --- !u!1 &1785739161 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 182958, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 1785739162} - - 222: {fileID: 1785739163} - - 114: {fileID: 941726148} - - 114: {fileID: 1785739164} + - component: {fileID: 1785739162} + - component: {fileID: 1785739163} + - component: {fileID: 941726148} + - component: {fileID: 1785739164} m_Layer: 0 m_Name: Blend Mode m_TagString: Untagged @@ -836,9 +916,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 10, y: -104.900002} + m_AnchoredPosition: {x: 10, y: -104.9} m_SizeDelta: {x: 334, y: 30} m_Pivot: {x: 0, y: 0} --- !u!222 &1785739163 @@ -865,12 +946,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 170056, guid: 134baa4997b93004791c6415e1c854ab, type: 2} m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 2051193836} - - 222: {fileID: 2051193839} - - 114: {fileID: 2051193838} - - 114: {fileID: 2051193837} + - component: {fileID: 2051193836} + - component: {fileID: 2051193839} + - component: {fileID: 2051193838} + - component: {fileID: 2051193837} m_Layer: 0 m_Name: Scene Label m_TagString: Untagged @@ -891,9 +972,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1487544264} 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: 10, y: -70.8000031} + m_AnchoredPosition: {x: 10, y: -70.8} m_SizeDelta: {x: 334, y: 30} m_Pivot: {x: 0, y: 0} --- !u!114 &2051193837 @@ -920,7 +1002,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .352941155, g: .839350998, b: 1, a: 1} + m_Color: {r: 0.35294116, g: 0.839351, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: a4ffd643312fe694b9212baed4fc033c, type: 3} m_FontSize: 21 @@ -929,6 +1017,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 diff --git a/Assets/MMM/Trails/Scenes/7. Mouse.unity.meta b/Assets/_Project/Scenes/7. Mouse.unity.meta similarity index 100% rename from Assets/MMM/Trails/Scenes/7. Mouse.unity.meta rename to Assets/_Project/Scenes/7. Mouse.unity.meta diff --git a/Assets/MMM/Trails/Scripts.meta b/Assets/_Project/Scripts.meta similarity index 100% rename from Assets/MMM/Trails/Scripts.meta rename to Assets/_Project/Scripts.meta diff --git a/Assets/MMM/Trails/Scripts/CameraFollow.cs b/Assets/_Project/Scripts/CameraFollow.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/CameraFollow.cs rename to Assets/_Project/Scripts/CameraFollow.cs diff --git a/Assets/MMM/Trails/Scripts/CameraFollow.cs.meta b/Assets/_Project/Scripts/CameraFollow.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/CameraFollow.cs.meta rename to Assets/_Project/Scripts/CameraFollow.cs.meta diff --git a/Assets/MMM/Trails/Scripts/DestroyDelayed.cs b/Assets/_Project/Scripts/DestroyDelayed.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/DestroyDelayed.cs rename to Assets/_Project/Scripts/DestroyDelayed.cs diff --git a/Assets/MMM/Trails/Scripts/DestroyDelayed.cs.meta b/Assets/_Project/Scripts/DestroyDelayed.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/DestroyDelayed.cs.meta rename to Assets/_Project/Scripts/DestroyDelayed.cs.meta diff --git a/Assets/MMM/Trails/Scripts/FillScreen.cs b/Assets/_Project/Scripts/FillScreen.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/FillScreen.cs rename to Assets/_Project/Scripts/FillScreen.cs diff --git a/Assets/MMM/Trails/Scripts/FillScreen.cs.meta b/Assets/_Project/Scripts/FillScreen.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/FillScreen.cs.meta rename to Assets/_Project/Scripts/FillScreen.cs.meta diff --git a/Assets/MMM/Trails/Scripts/GroupToggleFromKeyboard.cs b/Assets/_Project/Scripts/GroupToggleFromKeyboard.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/GroupToggleFromKeyboard.cs rename to Assets/_Project/Scripts/GroupToggleFromKeyboard.cs diff --git a/Assets/MMM/Trails/Scripts/GroupToggleFromKeyboard.cs.meta b/Assets/_Project/Scripts/GroupToggleFromKeyboard.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/GroupToggleFromKeyboard.cs.meta rename to Assets/_Project/Scripts/GroupToggleFromKeyboard.cs.meta diff --git a/Assets/MMM/Trails/Scripts/MouseBrush.cs b/Assets/_Project/Scripts/MouseBrush.cs similarity index 92% rename from Assets/MMM/Trails/Scripts/MouseBrush.cs rename to Assets/_Project/Scripts/MouseBrush.cs index 049cd30..82e7b02 100644 --- a/Assets/MMM/Trails/Scripts/MouseBrush.cs +++ b/Assets/_Project/Scripts/MouseBrush.cs @@ -7,6 +7,7 @@ public class MouseBrush : MonoBehaviour { public GameObject brushPrefab; public int gridSnap = 1; + internal GameObject currentBrush; internal Vector3 mousePositionPrevious; @@ -63,9 +64,9 @@ Vector3 GetBrushPositionFromMouse() // Call a delayed destroy on the brush, unset the currentBrush void RemoveBrush(int index) { - if (this.currentBrush != null) + if (currentBrush != null) { - this.currentBrush.GetComponent().Trigger(this.currentBrush.GetComponentInChildren().time); + currentBrush.GetComponent().Trigger(this.currentBrush.GetComponentInChildren().time); } currentBrush = null; } diff --git a/Assets/MMM/Trails/Scripts/MouseBrush.cs.meta b/Assets/_Project/Scripts/MouseBrush.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/MouseBrush.cs.meta rename to Assets/_Project/Scripts/MouseBrush.cs.meta diff --git a/Assets/MMM/Trails/Scripts/MoveXY.cs b/Assets/_Project/Scripts/MoveXY.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/MoveXY.cs rename to Assets/_Project/Scripts/MoveXY.cs diff --git a/Assets/MMM/Trails/Scripts/MoveXY.cs.meta b/Assets/_Project/Scripts/MoveXY.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/MoveXY.cs.meta rename to Assets/_Project/Scripts/MoveXY.cs.meta diff --git a/Assets/MMM/Trails/Scripts/SceneSwitcher.cs b/Assets/_Project/Scripts/SceneSwitcher.cs similarity index 65% rename from Assets/MMM/Trails/Scripts/SceneSwitcher.cs rename to Assets/_Project/Scripts/SceneSwitcher.cs index 822d164..9fa49fb 100644 --- a/Assets/MMM/Trails/Scripts/SceneSwitcher.cs +++ b/Assets/_Project/Scripts/SceneSwitcher.cs @@ -1,5 +1,5 @@ using UnityEngine; -using System.Collections; +using UnityEngine.SceneManagement; /** * Use Keyboard to switch between all scenes in build @@ -19,25 +19,25 @@ void Update () { if (Input.GetKeyDown(keyNext)) { // Increment Scene - int nextLevel = Application.loadedLevel; + int nextLevel = SceneManager.GetActiveScene().buildIndex; nextLevel++; - if (nextLevel >= Application.levelCount) + if (nextLevel >= SceneManager.sceneCountInBuildSettings) { nextLevel = 0; } - Application.LoadLevel(nextLevel); + SceneManager.LoadScene(nextLevel); } if (Input.GetKeyDown(keyPrevious)) { // Decrement Scene - int nextLevel = Application.loadedLevel; + int nextLevel = SceneManager.GetActiveScene().buildIndex; nextLevel--; if (nextLevel < 0) { - nextLevel = Application.levelCount - 1; + nextLevel = SceneManager.sceneCountInBuildSettings - 1; } - Application.LoadLevel(nextLevel); + SceneManager.LoadScene(nextLevel); } } diff --git a/Assets/MMM/Trails/Scripts/SceneSwitcher.cs.meta b/Assets/_Project/Scripts/SceneSwitcher.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/SceneSwitcher.cs.meta rename to Assets/_Project/Scripts/SceneSwitcher.cs.meta diff --git a/Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs b/Assets/_Project/Scripts/SetLabelFromBlendmode.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs rename to Assets/_Project/Scripts/SetLabelFromBlendmode.cs diff --git a/Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs.meta b/Assets/_Project/Scripts/SetLabelFromBlendmode.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/SetLabelFromBlendmode.cs.meta rename to Assets/_Project/Scripts/SetLabelFromBlendmode.cs.meta diff --git a/Assets/MMM/Trails/Scripts/SetLabelFromSceneName.cs b/Assets/_Project/Scripts/SetLabelFromSceneName.cs similarity index 100% rename from Assets/MMM/Trails/Scripts/SetLabelFromSceneName.cs rename to Assets/_Project/Scripts/SetLabelFromSceneName.cs diff --git a/Assets/MMM/Trails/Scripts/SetLabelFromSceneName.cs.meta b/Assets/_Project/Scripts/SetLabelFromSceneName.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/SetLabelFromSceneName.cs.meta rename to Assets/_Project/Scripts/SetLabelFromSceneName.cs.meta diff --git a/Assets/MMM/Trails/Scripts/SimpleGrab.cs b/Assets/_Project/Scripts/SimpleGrab.cs similarity index 95% rename from Assets/MMM/Trails/Scripts/SimpleGrab.cs rename to Assets/_Project/Scripts/SimpleGrab.cs index 45ddebc..5a5aafe 100644 --- a/Assets/MMM/Trails/Scripts/SimpleGrab.cs +++ b/Assets/_Project/Scripts/SimpleGrab.cs @@ -36,7 +36,7 @@ void Update() // Capture the screenshot and log the path to the console void TakeScreenshot() { - Application.CaptureScreenshot(GetScreenshotName(), superSize); + ScreenCapture.CaptureScreenshot(GetScreenshotName(), superSize); Debug.LogFormat("Captured Screenshot to {0}", GetScreenshotName()); } diff --git a/Assets/MMM/Trails/Scripts/SimpleGrab.cs.meta b/Assets/_Project/Scripts/SimpleGrab.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/SimpleGrab.cs.meta rename to Assets/_Project/Scripts/SimpleGrab.cs.meta diff --git a/Assets/MMM/Trails/Scripts/Symmetry.cs b/Assets/_Project/Scripts/Symmetry.cs similarity index 93% rename from Assets/MMM/Trails/Scripts/Symmetry.cs rename to Assets/_Project/Scripts/Symmetry.cs index bdcce37..efde524 100644 --- a/Assets/MMM/Trails/Scripts/Symmetry.cs +++ b/Assets/_Project/Scripts/Symmetry.cs @@ -15,6 +15,7 @@ public class Symmetry : PostEffectsBase public bool bypass = false; public KeyCode triggerNext = KeyCode.RightBracket; public KeyCode triggerPrevious = KeyCode.LeftBracket; + public KeyCode triggerBypass = KeyCode.B; public BlendModes blendMode; private BlendModes deltaBlendMode; internal int blendModesCount; @@ -66,12 +67,12 @@ void OnRenderImage(RenderTexture source, RenderTexture destination) void Update() { - if (Input.GetKeyDown(KeyCode.M)) + if (Input.GetKeyDown(triggerBypass)) { bypass = !bypass; } - if (Input.GetKeyDown(KeyCode.RightBracket)) + if (Input.GetKeyDown(triggerNext)) { int blendModeIndex = (int)blendMode + 1; if (blendModeIndex >= blendModesCount) @@ -82,7 +83,7 @@ void Update() SendBlendmodeChange(blendMode); } - if (Input.GetKeyDown(KeyCode.LeftBracket)) + if (Input.GetKeyDown(triggerPrevious)) { int blendModeIndex = (int)blendMode - 1; if (blendModeIndex < 0) diff --git a/Assets/MMM/Trails/Scripts/Symmetry.cs.meta b/Assets/_Project/Scripts/Symmetry.cs.meta similarity index 100% rename from Assets/MMM/Trails/Scripts/Symmetry.cs.meta rename to Assets/_Project/Scripts/Symmetry.cs.meta diff --git a/Assets/MMM/Trails/Shaders.meta b/Assets/_Project/Shaders.meta similarity index 100% rename from Assets/MMM/Trails/Shaders.meta rename to Assets/_Project/Shaders.meta diff --git a/Assets/MMM/Trails/Shaders/MaskedTint.shader b/Assets/_Project/Shaders/MaskedTint.shader similarity index 100% rename from Assets/MMM/Trails/Shaders/MaskedTint.shader rename to Assets/_Project/Shaders/MaskedTint.shader diff --git a/Assets/MMM/Trails/Shaders/MaskedTint.shader.meta b/Assets/_Project/Shaders/MaskedTint.shader.meta similarity index 100% rename from Assets/MMM/Trails/Shaders/MaskedTint.shader.meta rename to Assets/_Project/Shaders/MaskedTint.shader.meta diff --git a/Assets/MMM/Trails/Shaders/mmmSymmetry.shader b/Assets/_Project/Shaders/mmmSymmetry.shader similarity index 96% rename from Assets/MMM/Trails/Shaders/mmmSymmetry.shader rename to Assets/_Project/Shaders/mmmSymmetry.shader index 0df8abd..ff5dbc9 100644 --- a/Assets/MMM/Trails/Shaders/mmmSymmetry.shader +++ b/Assets/_Project/Shaders/mmmSymmetry.shader @@ -36,7 +36,7 @@ v2f vert(appdata_t IN) { v2f OUT; - OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); + OUT.vertex = UnityObjectToClipPos(IN.vertex); OUT.texcoord = IN.texcoord; OUT.color = IN.color; return OUT; diff --git a/Assets/MMM/Trails/Shaders/mmmSymmetry.shader.meta b/Assets/_Project/Shaders/mmmSymmetry.shader.meta similarity index 100% rename from Assets/MMM/Trails/Shaders/mmmSymmetry.shader.meta rename to Assets/_Project/Shaders/mmmSymmetry.shader.meta diff --git a/Assets/MMM/Trails/Textures.meta b/Assets/_Project/Textures.meta similarity index 100% rename from Assets/MMM/Trails/Textures.meta rename to Assets/_Project/Textures.meta diff --git a/Assets/MMM/Trails/Textures/Libya_Galuzzi_Desolate.jpg b/Assets/_Project/Textures/Libya_Galuzzi_Desolate.jpg similarity index 100% rename from Assets/MMM/Trails/Textures/Libya_Galuzzi_Desolate.jpg rename to Assets/_Project/Textures/Libya_Galuzzi_Desolate.jpg diff --git a/Assets/MMM/Trails/Textures/Libya_Galuzzi_Desolate.jpg.meta b/Assets/_Project/Textures/Libya_Galuzzi_Desolate.jpg.meta similarity index 100% rename from Assets/MMM/Trails/Textures/Libya_Galuzzi_Desolate.jpg.meta rename to Assets/_Project/Textures/Libya_Galuzzi_Desolate.jpg.meta diff --git a/Assets/_Vendor.meta b/Assets/_Vendor.meta new file mode 100644 index 0000000..55c517f --- /dev/null +++ b/Assets/_Vendor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c61693d5b60280043a51477cf38ad13c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine.meta b/Assets/_Vendor/Cinemachine.meta new file mode 100644 index 0000000..656e034 --- /dev/null +++ b/Assets/_Vendor/Cinemachine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e3264fd13d027b4ca1eb0c7ba8a8af8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base.meta b/Assets/_Vendor/Cinemachine/Base.meta new file mode 100644 index 0000000..d8bf5a9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8786806e37330e349b5885f2972851b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor.meta b/Assets/_Vendor/Cinemachine/Base/Editor.meta new file mode 100644 index 0000000..a5680e8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d8623b6a09cb5ab4ea2c51347a3a074c +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors.meta new file mode 100644 index 0000000..de858b6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6b46e8ffe448f084ab12938cb774d063 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs new file mode 100644 index 0000000..4110174 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs @@ -0,0 +1,156 @@ +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineBasicMultiChannelPerlin))] + internal sealed class CinemachineBasicMultiChannelPerlinEditor + : BaseEditor + { + List mNoisePresets; + string[] mNoisePresetNames; + SerializedProperty m_Profile; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_NoiseProfile)); + return excluded; + } + + private void OnEnable() + { + m_Profile = FindProperty(x => x.m_NoiseProfile); + RebuildProfileList(); + } + + void RebuildProfileList() + { + mNoisePresets = FindAssetsByType(); +#if UNITY_2018_1_OR_NEWER + if (ScriptableObjectUtility.CinemachineIsPackage) + AddAssetsFromDirectory( + mNoisePresets, + ScriptableObjectUtility.CinemachineInstallAssetPath + "/Presets/Noise"); +#endif + mNoisePresets.Insert(0, null); + List presetNameList = new List(); + foreach (var n in mNoisePresets) + presetNameList.Add((n == null) ? "(none)" : n.name); + mNoisePresetNames = presetNameList.ToArray(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + + if (m_Profile.objectReferenceValue == null) + EditorGUILayout.HelpBox( + "A Noise Profile is required. You may choose from among the NoiseSettings assets defined in the project.", + MessageType.Warning); + + Rect rect = EditorGUILayout.GetControlRect(true); + float iconSize = rect.height + 4; + rect.width -= iconSize; + int preset = mNoisePresets.IndexOf((NoiseSettings)m_Profile.objectReferenceValue); + preset = EditorGUI.Popup(rect, "Noise Profile", preset, mNoisePresetNames); + NoiseSettings newProfile = preset < 0 ? null : mNoisePresets[preset]; + if ((NoiseSettings)m_Profile.objectReferenceValue != newProfile) + { + m_Profile.objectReferenceValue = newProfile; + serializedObject.ApplyModifiedProperties(); + } + rect.x += rect.width; rect.width = iconSize; rect.height = iconSize; + if (GUI.Button(rect, EditorGUIUtility.IconContent("_Popup"), GUI.skin.label)) + { + GenericMenu menu = new GenericMenu(); + if (m_Profile.objectReferenceValue != null) + { + menu.AddItem(new GUIContent("Edit"), false, () => Selection.activeObject = m_Profile.objectReferenceValue); + menu.AddItem(new GUIContent("Clone"), false, () => + { + m_Profile.objectReferenceValue = CreateProfile( + (NoiseSettings)m_Profile.objectReferenceValue); + RebuildProfileList(); + serializedObject.ApplyModifiedProperties(); + }); + menu.AddItem(new GUIContent("Locate"), false, () => EditorGUIUtility.PingObject(m_Profile.objectReferenceValue)); + } + menu.AddItem(new GUIContent("New"), false, () => + { + //Undo.RecordObject(Target, "Change Noise Profile"); + m_Profile.objectReferenceValue = CreateProfile(null); + RebuildProfileList(); + serializedObject.ApplyModifiedProperties(); + }); + menu.ShowAsContext(); + } + + DrawRemainingPropertiesInInspector(); + } + + public static List FindAssetsByType() where T : UnityEngine.Object + { + List assets = new List(); + string[] guids = AssetDatabase.FindAssets(string.Format("t:{0}", typeof(T))); + for (int i = 0; i < guids.Length; i++) + { + string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]); + T asset = AssetDatabase.LoadAssetAtPath(assetPath); + if (asset != null) + { + assets.Add(asset); + } + } + return assets; + } + + static void AddAssetsFromDirectory(List assets, string path) where T : UnityEngine.Object + { + try + { + var info = new DirectoryInfo(path); + var fileInfo = info.GetFiles(); + foreach (var file in fileInfo) + { + string name = path + "/" + file.Name; + T a = AssetDatabase.LoadAssetAtPath(name, typeof(T)) as T; + if (a != null) + assets.Add(a); + } + } + catch + { + } + } + + NoiseSettings CreateProfile(NoiseSettings copyFrom) + { + var path = string.Empty; + var scene = Target.gameObject.scene; + if (string.IsNullOrEmpty(scene.path)) + path = "Assets/"; + else + { + var scenePath = Path.GetDirectoryName(scene.path); + var extPath = scene.name + "_Profiles"; + var profilePath = scenePath + "/" + extPath; + if (!AssetDatabase.IsValidFolder(profilePath)) + AssetDatabase.CreateFolder(scenePath, extPath); + path = profilePath + "/"; + } + + var profile = ScriptableObject.CreateInstance(); + if (copyFrom != null) + profile.CopyFrom(copyFrom); + path += Target.VirtualCamera.Name + " Noise.asset"; + path = AssetDatabase.GenerateUniqueAssetPath(path); + AssetDatabase.CreateAsset(profile, path); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + return profile; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs.meta new file mode 100644 index 0000000..c744f95 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBasicMultiChannelPerlinEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ee42f1964a0e8224c90be81905946699 +timeCreated: 1484091313 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs new file mode 100644 index 0000000..6a976ac --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs @@ -0,0 +1,206 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineBlendListCamera))] + internal sealed class CinemachineBlendListCameraEditor + : CinemachineVirtualCameraBaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_Instructions)); + return excluded; + } + + private UnityEditorInternal.ReorderableList mChildList; + private UnityEditorInternal.ReorderableList mInstructionList; + + protected override void OnEnable() + { + base.OnEnable(); + mChildList = null; + mInstructionList = null; + } + + protected override void OnDisable() + { + base.OnDisable(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mInstructionList == null) + SetupInstructionList(); + if (mChildList == null) + SetupChildList(); + + // Ordinary properties + DrawHeaderInInspector(); + DrawPropertyInInspector(FindProperty(x => x.m_Priority)); + DrawTargetsInInspector(FindProperty(x => x.m_Follow), FindProperty(x => x.m_LookAt)); + DrawRemainingPropertiesInInspector(); + + // Instructions + UpdateCameraCandidates(); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.Separator(); + mInstructionList.DoLayoutList(); + + // vcam children + EditorGUILayout.Separator(); + mChildList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + { + serializedObject.ApplyModifiedProperties(); + Target.ValidateInstructions(); + } + + // Extensions + DrawExtensionsWidgetInInspector(); + } + + private string[] mCameraCandidates; + private Dictionary mCameraIndexLookup; + private void UpdateCameraCandidates() + { + List vcams = new List(); + mCameraIndexLookup = new Dictionary(); + vcams.Add("(none)"); + CinemachineVirtualCameraBase[] children = Target.ChildCameras; + foreach (var c in children) + { + mCameraIndexLookup[c] = vcams.Count; + vcams.Add(c.Name); + } + mCameraCandidates = vcams.ToArray(); + } + + private int GetCameraIndex(Object obj) + { + if (obj == null || mCameraIndexLookup == null) + return 0; + CinemachineVirtualCameraBase vcam = obj as CinemachineVirtualCameraBase; + if (vcam == null) + return 0; + if (!mCameraIndexLookup.ContainsKey(vcam)) + return 0; + return mCameraIndexLookup[vcam]; + } + + void SetupInstructionList() + { + mInstructionList = new UnityEditorInternal.ReorderableList(serializedObject, + serializedObject.FindProperty(() => Target.m_Instructions), + true, true, true, true); + + // Needed for accessing field names as strings + CinemachineBlendListCamera.Instruction def = new CinemachineBlendListCamera.Instruction(); + + float vSpace = 2; + float hSpace = 3; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + float hBigSpace = EditorGUIUtility.singleLineHeight * 2 / 3; + mInstructionList.drawHeaderCallback = (Rect rect) => + { + float sharedWidth = rect.width - EditorGUIUtility.singleLineHeight + - floatFieldWidth - hSpace - hBigSpace; + rect.x += EditorGUIUtility.singleLineHeight; rect.width = sharedWidth / 2; + EditorGUI.LabelField(rect, "Child"); + + rect.x += rect.width + hSpace; + EditorGUI.LabelField(rect, "Blend in"); + + rect.x += rect.width + hBigSpace; rect.width = floatFieldWidth; + EditorGUI.LabelField(rect, "Hold"); + }; + + mInstructionList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + SerializedProperty instProp = mInstructionList.serializedProperty.GetArrayElementAtIndex(index); + float sharedWidth = rect.width - floatFieldWidth - hSpace - hBigSpace; + rect.y += vSpace; rect.height = EditorGUIUtility.singleLineHeight; + + rect.width = sharedWidth / 2; + SerializedProperty vcamSelProp = instProp.FindPropertyRelative(() => def.m_VirtualCamera); + int currentVcam = GetCameraIndex(vcamSelProp.objectReferenceValue); + int vcamSelection = EditorGUI.Popup(rect, currentVcam, mCameraCandidates); + if (currentVcam != vcamSelection) + vcamSelProp.objectReferenceValue = (vcamSelection == 0) + ? null : Target.ChildCameras[vcamSelection - 1]; + + rect.x += rect.width + hSpace; rect.width = sharedWidth / 2; + if (index > 0) + EditorGUI.PropertyField(rect, instProp.FindPropertyRelative(() => def.m_Blend), + GUIContent.none); + + if (index < mInstructionList.count - 1) + { + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = hBigSpace; + + rect.x += rect.width; rect.width = floatFieldWidth + hBigSpace; + SerializedProperty holdProp = instProp.FindPropertyRelative(() => def.m_Hold); + EditorGUI.PropertyField(rect, holdProp, new GUIContent(" ", holdProp.tooltip)); + holdProp.floatValue = Mathf.Max(holdProp.floatValue, 0); + + EditorGUIUtility.labelWidth = oldWidth; + } + }; + } + + void SetupChildList() + { + float vSpace = 2; + mChildList = new UnityEditorInternal.ReorderableList(serializedObject, + serializedObject.FindProperty(() => Target.m_ChildCameras), + true, true, true, true); + + mChildList.drawHeaderCallback = (Rect rect) => + { + EditorGUI.LabelField(rect, "Virtual Camera Children"); + }; + mChildList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + rect.y += vSpace; + Vector2 pos = rect.position; + rect.height = EditorGUIUtility.singleLineHeight; + SerializedProperty element + = mChildList.serializedProperty.GetArrayElementAtIndex(index); + EditorGUI.PropertyField(rect, element, GUIContent.none); + }; + mChildList.onChangedCallback = (UnityEditorInternal.ReorderableList l) => + { + if (l.index < 0 || l.index >= l.serializedProperty.arraySize) + return; + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + vcam.transform.SetSiblingIndex(l.index); + }; + mChildList.onAddCallback = (UnityEditorInternal.ReorderableList l) => + { + var index = l.serializedProperty.arraySize; + var vcam = CinemachineMenu.CreateDefaultVirtualCamera(); + Undo.SetTransformParent(vcam.transform, Target.transform, ""); + vcam.transform.SetSiblingIndex(index); + }; + mChildList.onRemoveCallback = (UnityEditorInternal.ReorderableList l) => + { + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + Undo.DestroyObjectImmediate(vcam.gameObject); + }; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs.meta new file mode 100644 index 0000000..e00e0fb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlendListCameraEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0181db608628b494d8ae50728e507ce1 +timeCreated: 1509479768 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs new file mode 100644 index 0000000..8eddd12 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs @@ -0,0 +1,161 @@ +using UnityEngine; +using UnityEditor; +using UnityEditorInternal; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineBlenderSettings))] + internal sealed class CinemachineBlenderSettingsEditor : BaseEditor + { + private ReorderableList mBlendList; + + /// + /// Called when building the Camera popup menus, to get the domain of possible + /// cameras. If no delegate is set, will find all top-level (non-slave) + /// virtual cameras in the scene. + /// + public GetAllVirtualCamerasDelegate GetAllVirtualCameras; + public delegate CinemachineVirtualCameraBase[] GetAllVirtualCamerasDelegate(); + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_CustomBlends)); + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mBlendList == null) + SetupBlendList(); + + DrawRemainingPropertiesInInspector(); + + UpdateCameraCandidates(); + mBlendList.DoLayoutList(); + serializedObject.ApplyModifiedProperties(); + } + + private string[] mCameraCandidates; + private Dictionary mCameraIndexLookup; + private void UpdateCameraCandidates() + { + List vcams = new List(); + mCameraIndexLookup = new Dictionary(); + + CinemachineVirtualCameraBase[] candidates; + if (GetAllVirtualCameras != null) + candidates = GetAllVirtualCameras(); + else + { + // Get all top-level (i.e. non-slave) virtual cameras + candidates = Resources.FindObjectsOfTypeAll( + typeof(CinemachineVirtualCameraBase)) as CinemachineVirtualCameraBase[]; + + for (int i = 0; i < candidates.Length; ++i) + if (candidates[i].ParentCamera != null) + candidates[i] = null; + } + vcams.Add("(none)"); + vcams.Add(CinemachineBlenderSettings.kBlendFromAnyCameraLabel); + foreach (CinemachineVirtualCameraBase c in candidates) + if (c != null && !vcams.Contains(c.Name)) + vcams.Add(c.Name); + + mCameraCandidates = vcams.ToArray(); + for (int i = 0; i < mCameraCandidates.Length; ++i) + mCameraIndexLookup[mCameraCandidates[i]] = i; + } + + private int GetCameraIndex(string name) + { + if (name == null || mCameraIndexLookup == null) + return 0; + if (!mCameraIndexLookup.ContainsKey(name)) + return 0; + return mCameraIndexLookup[name]; + } + + void SetupBlendList() + { + mBlendList = new ReorderableList(serializedObject, + serializedObject.FindProperty(() => Target.m_CustomBlends), + true, true, true, true); + + // Needed for accessing string names of fields + CinemachineBlenderSettings.CustomBlend def = new CinemachineBlenderSettings.CustomBlend(); + CinemachineBlendDefinition def2 = new CinemachineBlendDefinition(); + + float vSpace = 2; + float hSpace = 3; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + mBlendList.drawHeaderCallback = (Rect rect) => + { + rect.width -= (EditorGUIUtility.singleLineHeight + 2 * hSpace); + rect.width /= 3; + Vector2 pos = rect.position; pos.x += EditorGUIUtility.singleLineHeight; + rect.position = pos; + EditorGUI.LabelField(rect, "From"); + + pos.x += rect.width + hSpace; rect.position = pos; + EditorGUI.LabelField(rect, "To"); + + pos.x += rect.width + hSpace; rect.width -= floatFieldWidth + hSpace; rect.position = pos; + EditorGUI.LabelField(rect, "Style"); + + pos.x += rect.width + hSpace; rect.width = floatFieldWidth; rect.position = pos; + EditorGUI.LabelField(rect, "Time"); + }; + + mBlendList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + SerializedProperty element + = mBlendList.serializedProperty.GetArrayElementAtIndex(index); + + rect.y += vSpace; + rect.height = EditorGUIUtility.singleLineHeight; + Vector2 pos = rect.position; + rect.width -= 2 * hSpace; rect.width /= 3; + SerializedProperty fromProp = element.FindPropertyRelative(() => def.m_From); + int current = GetCameraIndex(fromProp.stringValue); + int sel = EditorGUI.Popup(rect, current, mCameraCandidates); + if (current != sel) + fromProp.stringValue = mCameraCandidates[sel]; + + pos.x += rect.width + hSpace; rect.position = pos; + SerializedProperty toProp = element.FindPropertyRelative(() => def.m_To); + current = GetCameraIndex(toProp.stringValue); + sel = EditorGUI.Popup(rect, current, mCameraCandidates); + if (current != sel) + toProp.stringValue = mCameraCandidates[sel]; + + SerializedProperty blendProp = element.FindPropertyRelative(() => def.m_Blend); + pos.x += rect.width + hSpace; rect.width -= floatFieldWidth; rect.position = pos; + SerializedProperty styleProp = blendProp.FindPropertyRelative(() => def2.m_Style); + EditorGUI.PropertyField(rect, styleProp, GUIContent.none); + + if (styleProp.intValue != (int)CinemachineBlendDefinition.Style.Cut) + { + pos.x += rect.width + hSpace; rect.width = floatFieldWidth; rect.position = pos; + SerializedProperty timeProp = blendProp.FindPropertyRelative(() => def2.m_Time); + EditorGUI.PropertyField(rect, timeProp, GUIContent.none); + } + }; + + mBlendList.onAddCallback = (ReorderableList l) => + { + var index = l.serializedProperty.arraySize; + ++l.serializedProperty.arraySize; + SerializedProperty blendProp = l.serializedProperty.GetArrayElementAtIndex( + index).FindPropertyRelative(() => def.m_Blend); + + blendProp.FindPropertyRelative(() => def2.m_Style).enumValueIndex + = (int)CinemachineBlendDefinition.Style.EaseInOut; + blendProp.FindPropertyRelative(() => def2.m_Time).floatValue = 2f; + }; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs.meta new file mode 100644 index 0000000..29cc105 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBlenderSettingsEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1ff9d8296ed1f02419bf4f417ff2265e +timeCreated: 1486495673 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs new file mode 100644 index 0000000..20604b6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs @@ -0,0 +1,168 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using Cinemachine.Utility; +using System.IO; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineBrain))] + internal sealed class CinemachineBrainEditor : BaseEditor + { + EmbeddeAssetEditor m_BlendsEditor; + bool mEventsExpanded = false; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_CameraCutEvent)); + excluded.Add(FieldPath(x => x.m_CameraActivatedEvent)); + excluded.Add(FieldPath(x => x.m_CustomBlends)); + return excluded; + } + + private void OnEnable() + { + m_BlendsEditor = new EmbeddeAssetEditor( + FieldPath(x => x.m_CustomBlends), this); + m_BlendsEditor.OnChanged = (CinemachineBlenderSettings b) => + { + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + }; + } + + private void OnDisable() + { + if (m_BlendsEditor != null) + m_BlendsEditor.OnDisable(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + + // Show the active camera and blend + GUI.enabled = false; + ICinemachineCamera vcam = Target.ActiveVirtualCamera; + Transform activeCam = (vcam != null && vcam.VirtualCameraGameObject != null) + ? vcam.VirtualCameraGameObject.transform : null; + EditorGUILayout.ObjectField("Live Camera", activeCam, typeof(Transform), true); + EditorGUILayout.DelayedTextField( + "Live Blend", Target.ActiveBlend != null + ? Target.ActiveBlend.Description : string.Empty); + GUI.enabled = true; + + // Normal properties + DrawRemainingPropertiesInInspector(); + + // Blender + m_BlendsEditor.DrawEditorCombo( + "Create New Blender Asset", + Target.gameObject.name + " Blends", "asset", string.Empty, + "Custom Blends", false); + + mEventsExpanded = EditorGUILayout.Foldout(mEventsExpanded, "Events"); + if (mEventsExpanded) + { + EditorGUILayout.PropertyField(FindProperty(x => x.m_CameraCutEvent)); + EditorGUILayout.PropertyField(FindProperty(x => x.m_CameraActivatedEvent)); + } + serializedObject.ApplyModifiedProperties(); + } + + [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected, typeof(CinemachineBrain))] + private static void DrawBrainGizmos(CinemachineBrain brain, GizmoType drawType) + { + if (brain.OutputCamera != null && brain.m_ShowCameraFrustum) + { + DrawCameraFrustumGizmo( + brain, LensSettings.FromCamera(brain.OutputCamera), + brain.transform.localToWorldMatrix, + Color.white); // GML why is this color hardcoded? + } + } + + internal static void DrawCameraFrustumGizmo( + CinemachineBrain brain, LensSettings lens, + Matrix4x4 transform, Color color) + { + float aspect = 1; + bool ortho = false; + if (brain != null) + { + aspect = brain.OutputCamera.aspect; + ortho = brain.OutputCamera.orthographic; + } + + Matrix4x4 originalMatrix = Gizmos.matrix; + Color originalGizmoColour = Gizmos.color; + Gizmos.color = color; + Gizmos.matrix = transform; + if (ortho) + { + Vector3 size = new Vector3( + aspect * lens.OrthographicSize * 2, + lens.OrthographicSize * 2, + lens.NearClipPlane + lens.FarClipPlane); + Gizmos.DrawWireCube( + new Vector3(0, 0, (size.z / 2) + lens.NearClipPlane), size); + } + else + { + Gizmos.DrawFrustum( + Vector3.zero, lens.FieldOfView, + lens.FarClipPlane, lens.NearClipPlane, aspect); + } + Gizmos.matrix = originalMatrix; + Gizmos.color = originalGizmoColour; + } + + [DrawGizmo(GizmoType.Active | GizmoType.InSelectionHierarchy | GizmoType.Pickable, typeof(CinemachineVirtualCameraBase))] + internal static void DrawVirtualCameraBaseGizmos(CinemachineVirtualCameraBase vcam, GizmoType selectionType) + { + // Don't draw gizmos on hidden stuff + if ((vcam.VirtualCameraGameObject.hideFlags & (HideFlags.HideInHierarchy | HideFlags.HideInInspector)) != 0) + return; + + if (vcam.ParentCamera != null && (selectionType & GizmoType.Active) == 0) + return; + + CameraState state = vcam.State; + Gizmos.DrawIcon(state.FinalPosition, kGizmoFileName, true); + + DrawCameraFrustumGizmo( + CinemachineCore.Instance.FindPotentialTargetBrain(vcam), + state.Lens, + Matrix4x4.TRS( + state.FinalPosition, + UnityQuaternionExtensions.Normalized(state.FinalOrientation), Vector3.one), + CinemachineCore.Instance.IsLive(vcam) + ? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour + : CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour); + } + + static string kGizmoFileName = "Cinemachine/cm_logo_lg.png"; + [InitializeOnLoad] + static class InstallGizmos + { + static InstallGizmos() + { + string srcFile = ScriptableObjectUtility.CinemachineInstallPath + "/Gizmos/" + kGizmoFileName; + if (File.Exists(srcFile)) + { + string dstFile = Application.dataPath + "/Gizmos"; + if (!Directory.Exists(dstFile)) + Directory.CreateDirectory(dstFile); + dstFile += "/" + kGizmoFileName; + if (!File.Exists(dstFile) + || File.GetCreationTime(dstFile) < File.GetCreationTime(srcFile)) + { + if (!Directory.Exists(Path.GetDirectoryName(dstFile))) + Directory.CreateDirectory(Path.GetDirectoryName(dstFile)); + File.Copy(srcFile, dstFile, true); + } + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs.meta new file mode 100644 index 0000000..9e73685 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineBrainEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 711aad28b4057bd4783120e26ff2ee25 +timeCreated: 1483406727 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs new file mode 100644 index 0000000..0068d16 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs @@ -0,0 +1,211 @@ +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineClearShot))] + internal sealed class CinemachineClearShotEditor + : CinemachineVirtualCameraBaseEditor + { + EmbeddeAssetEditor m_BlendsEditor; + ColliderState m_ColliderState; + + private UnityEditorInternal.ReorderableList mChildList; + + protected override void OnEnable() + { + base.OnEnable(); + m_BlendsEditor = new EmbeddeAssetEditor( + FieldPath(x => x.m_CustomBlends), this); + m_BlendsEditor.OnChanged = (CinemachineBlenderSettings b) => + { + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + }; + m_BlendsEditor.OnCreateEditor = (UnityEditor.Editor ed) => + { + CinemachineBlenderSettingsEditor editor = ed as CinemachineBlenderSettingsEditor; + if (editor != null) + editor.GetAllVirtualCameras = () => { return Target.ChildCameras; }; + }; + mChildList = null; + } + + protected override void OnDisable() + { + base.OnDisable(); + if (m_BlendsEditor != null) + m_BlendsEditor.OnDisable(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mChildList == null) + SetupChildList(); + + m_ColliderState = GetColliderState(); + switch (m_ColliderState) + { + case ColliderState.ColliderOnParent: + case ColliderState.ColliderOnAllChildren: + break; + case ColliderState.NoCollider: + EditorGUILayout.HelpBox( + "ClearShot requires a Collider extension to rank the shots. Either add one to the ClearShot itself, or to each of the child cameras.", + MessageType.Warning); + break; + case ColliderState.ColliderOnSomeChildren: + EditorGUILayout.HelpBox( + "Some child cameras do not have a Collider extension. ClearShot requires a Collider on all the child cameras, or alternatively on the ClearShot iself.", + MessageType.Warning); + break; + case ColliderState.ColliderOnChildrenAndParent: + EditorGUILayout.HelpBox( + "There is a Collider extention on the ClearShot camera, and also on some of its child cameras. You can't have both.", + MessageType.Error); + break; + } + + DrawHeaderInInspector(); + DrawPropertyInInspector(FindProperty(x => x.m_Priority)); + DrawTargetsInInspector(FindProperty(x => x.m_Follow), FindProperty(x => x.m_LookAt)); + DrawRemainingPropertiesInInspector(); + + // Blends + m_BlendsEditor.DrawEditorCombo( + "Create New Blender Asset", + Target.gameObject.name + " Blends", "asset", string.Empty, + "Custom Blends", false); + + // vcam children + EditorGUILayout.Separator(); + EditorGUI.BeginChangeCheck(); + mChildList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + + // Extensions + DrawExtensionsWidgetInInspector(); + } + + enum ColliderState + { + NoCollider, + ColliderOnAllChildren, + ColliderOnSomeChildren, + ColliderOnParent, + ColliderOnChildrenAndParent + } + + ColliderState GetColliderState() + { + int numChildren = 0; + int numColliderChildren = 0; + bool colliderOnParent = ObjectHasCollider(Target); + + var children = Target.m_ChildCameras; + numChildren = children == null ? 0 : children.Length; + for (int i = 0; i < numChildren; ++i) + if (ObjectHasCollider(children[i])) + ++numColliderChildren; + if (colliderOnParent) + return (numColliderChildren > 0) + ? ColliderState.ColliderOnChildrenAndParent : ColliderState.ColliderOnParent; + if (numColliderChildren > 0) + return (numColliderChildren == numChildren) + ? ColliderState.ColliderOnAllChildren : ColliderState.ColliderOnSomeChildren; + return ColliderState.NoCollider; + } + + bool ObjectHasCollider(object obj) + { + CinemachineVirtualCameraBase vcam = obj as CinemachineVirtualCameraBase; + var collider = (vcam == null) ? null : vcam.GetComponent(); + return (collider != null && collider.enabled); + } + + void SetupChildList() + { + float vSpace = 2; + float hSpace = 3; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + + mChildList = new UnityEditorInternal.ReorderableList( + serializedObject, FindProperty(x => x.m_ChildCameras), true, true, true, true); + + mChildList.drawHeaderCallback = (Rect rect) => + { + EditorGUI.LabelField(rect, "Virtual Camera Children"); + GUIContent priorityText = new GUIContent("Priority"); + var textDimensions = GUI.skin.label.CalcSize(priorityText); + rect.x += rect.width - textDimensions.x; + rect.width = textDimensions.x; + EditorGUI.LabelField(rect, priorityText); + }; + mChildList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + rect.y += vSpace; + rect.width -= floatFieldWidth + hSpace; + rect.height = EditorGUIUtility.singleLineHeight; + SerializedProperty element = mChildList.serializedProperty.GetArrayElementAtIndex(index); + if (m_ColliderState == ColliderState.ColliderOnSomeChildren + || m_ColliderState == ColliderState.ColliderOnChildrenAndParent) + { + bool hasCollider = ObjectHasCollider(element.objectReferenceValue); + if ((m_ColliderState == ColliderState.ColliderOnSomeChildren && !hasCollider) + || (m_ColliderState == ColliderState.ColliderOnChildrenAndParent && hasCollider)) + { + float width = rect.width; + rect.width = rect.height; + GUIContent label = new GUIContent(""); + label.image = EditorGUIUtility.IconContent("console.warnicon.sml").image; + EditorGUI.LabelField(rect, label); + width -= rect.width; rect.x += rect.width; rect.width = width; + } + } + EditorGUI.PropertyField(rect, element, GUIContent.none); + + SerializedObject obj = new SerializedObject(element.objectReferenceValue); + rect.x += rect.width + hSpace; rect.width = floatFieldWidth; + SerializedProperty priorityProp = obj.FindProperty(() => Target.m_Priority); + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = hSpace * 2; + EditorGUI.PropertyField(rect, priorityProp, new GUIContent(" ")); + EditorGUIUtility.labelWidth = oldWidth; + obj.ApplyModifiedProperties(); + }; + mChildList.onChangedCallback = (UnityEditorInternal.ReorderableList l) => + { + if (l.index < 0 || l.index >= l.serializedProperty.arraySize) + return; + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + vcam.transform.SetSiblingIndex(l.index); + }; + mChildList.onAddCallback = (UnityEditorInternal.ReorderableList l) => + { + var index = l.serializedProperty.arraySize; + var vcam = CinemachineMenu.CreateDefaultVirtualCamera(); + Undo.SetTransformParent(vcam.transform, Target.transform, ""); + var collider = Undo.AddComponent(vcam.gameObject); + collider.m_AvoidObstacles = false; + Undo.RecordObject(collider, "create ClearShot child"); + vcam.transform.SetSiblingIndex(index); + }; + mChildList.onRemoveCallback = (UnityEditorInternal.ReorderableList l) => + { + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + Undo.DestroyObjectImmediate(vcam.gameObject); + }; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs.meta new file mode 100644 index 0000000..26d971a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineClearShotEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6036af5730313e54699c5a693891fe90 +timeCreated: 1484508430 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs new file mode 100644 index 0000000..074b153 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs @@ -0,0 +1,76 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineCollider))] + public sealed class CinemachineColliderEditor : BaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + if (!Target.m_AvoidObstacles) + { + excluded.Add(FieldPath(x => x.m_DistanceLimit)); + excluded.Add(FieldPath(x => x.m_CameraRadius)); + excluded.Add(FieldPath(x => x.m_Strategy)); + excluded.Add(FieldPath(x => x.m_MaximumEffort)); + excluded.Add(FieldPath(x => x.m_Damping)); + } + else if (Target.m_Strategy == CinemachineCollider.ResolutionStrategy.PullCameraForward) + { + excluded.Add(FieldPath(x => x.m_MaximumEffort)); + } + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + + if (Target.m_AvoidObstacles && !Target.VirtualCamera.State.HasLookAt) + EditorGUILayout.HelpBox( + "Preserve Line Of Sight requires a LookAt target.", + MessageType.Warning); + + DrawRemainingPropertiesInInspector(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(CinemachineCollider))] + private static void DrawColliderGizmos(CinemachineCollider collider, GizmoType type) + { + CinemachineVirtualCameraBase vcam = (collider != null) ? collider.VirtualCamera : null; + if (vcam != null && collider.enabled) + { + Color oldColor = Gizmos.color; + Vector3 pos = vcam.State.FinalPosition; + if (collider.m_AvoidObstacles && vcam.State.HasLookAt) + { + Gizmos.color = CinemachineColliderPrefs.FeelerColor; + if (collider.m_CameraRadius > 0) + Gizmos.DrawWireSphere(pos, collider.m_CameraRadius); + + Vector3 forwardFeelerVector = (vcam.State.ReferenceLookAt - pos).normalized; + float distance = collider.m_DistanceLimit; + Gizmos.DrawLine(pos, pos + forwardFeelerVector * distance); + + // Show the avoidance path, for debugging + List> debugPaths = collider.DebugPaths; + foreach (var path in debugPaths) + { + Gizmos.color = CinemachineColliderPrefs.FeelerHitColor; + Vector3 p0 = vcam.State.ReferenceLookAt; + foreach (var p in path) + { + Gizmos.DrawLine(p0, p); + p0 = p; + } + Gizmos.DrawLine(p0, pos); + } + } + Gizmos.color = oldColor; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs.meta new file mode 100644 index 0000000..61eebf6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineColliderEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bf34fbe7a6e71634493d770ed0031f9d +timeCreated: 1486652356 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs new file mode 100644 index 0000000..e0029b9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs @@ -0,0 +1,89 @@ +using UnityEngine; +using UnityEditor; +using Cinemachine.Utility; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineComposer))] + internal class CinemachineComposerEditor : BaseEditor + { + CinemachineScreenComposerGuides mScreenGuideEditor; + + protected virtual void OnEnable() + { + mScreenGuideEditor = new CinemachineScreenComposerGuides(); + mScreenGuideEditor.GetHardGuide = () => { return Target.HardGuideRect; }; + mScreenGuideEditor.GetSoftGuide = () => { return Target.SoftGuideRect; }; + mScreenGuideEditor.SetHardGuide = (Rect r) => { Target.HardGuideRect = r; }; + mScreenGuideEditor.SetSoftGuide = (Rect r) => { Target.SoftGuideRect = r; }; + mScreenGuideEditor.Target = () => { return serializedObject; }; + + Target.OnGUICallback += OnGUI; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + protected virtual void OnDisable() + { + if (Target != null) + Target.OnGUICallback -= OnGUI; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.LookAtTarget == null) + EditorGUILayout.HelpBox( + "A LookAt target is required. Change Aim to Do Nothing if you don't want a LookAt target.", + MessageType.Warning); + + // First snapshot some settings + Rect oldHard = Target.HardGuideRect; + Rect oldSoft = Target.SoftGuideRect; + + // Draw the properties + DrawRemainingPropertiesInInspector(); + mScreenGuideEditor.SetNewBounds(oldHard, oldSoft, Target.HardGuideRect, Target.SoftGuideRect); + } + + protected virtual void OnGUI() + { + // Draw the camera guides + if (!Target.IsValid || !CinemachineSettings.CinemachineCoreSettings.ShowInGameGuides) + return; + + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(Target.VirtualCamera); + if (brain == null || brain.OutputCamera.activeTexture != null) + return; + + bool isLive = CinemachineCore.Instance.IsLive(Target.VirtualCamera); + + // Screen guides + mScreenGuideEditor.OnGUI_DrawGuides(isLive, brain.OutputCamera, Target.VcamState.Lens, true); + + // Draw an on-screen gizmo for the target + if (Target.LookAtTarget != null && isLive) + { + Vector3 targetScreenPosition = brain.OutputCamera.WorldToScreenPoint(Target.TrackedPoint); + if (targetScreenPosition.z > 0) + { + targetScreenPosition.y = Screen.height - targetScreenPosition.y; + + GUI.color = CinemachineSettings.ComposerSettings.TargetColour; + Rect r = new Rect(targetScreenPosition, Vector2.zero); + float size = (CinemachineSettings.ComposerSettings.TargetSize + + CinemachineScreenComposerGuides.kGuideBarWidthPx) / 2; + GUI.DrawTexture(r.Inflated(new Vector2(size, size)), Texture2D.whiteTexture); + size -= CinemachineScreenComposerGuides.kGuideBarWidthPx; + if (size > 0) + { + Vector4 overlayOpacityScalar + = new Vector4(1f, 1f, 1f, CinemachineSettings.ComposerSettings.OverlayOpacity); + GUI.color = Color.black * overlayOpacityScalar; + GUI.DrawTexture(r.Inflated(new Vector2(size, size)), Texture2D.whiteTexture); + } + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs.meta new file mode 100644 index 0000000..cfe0405 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineComposerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2bb09c3bc24a82648a2e4fc008a28d8b +timeCreated: 1484088329 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs new file mode 100644 index 0000000..8fac565 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs @@ -0,0 +1,161 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineConfiner))] + public sealed class CinemachineConfinerEditor : BaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(Target.VirtualCamera); + bool ortho = brain != null ? brain.OutputCamera.orthographic : false; + if (!ortho) + excluded.Add(FieldPath(x => x.m_ConfineScreenEdges)); + if (Target.m_ConfineMode == CinemachineConfiner.Mode.Confine2D) + excluded.Add(FieldPath(x => x.m_BoundingVolume)); + else + excluded.Add(FieldPath(x => x.m_BoundingShape2D)); + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.m_ConfineMode == CinemachineConfiner.Mode.Confine2D) + { + if (Target.m_BoundingShape2D == null) + EditorGUILayout.HelpBox("A Bounding Shape is required.", MessageType.Warning); + else if (Target.m_BoundingShape2D.GetType() != typeof(PolygonCollider2D) + && Target.m_BoundingShape2D.GetType() != typeof(CompositeCollider2D)) + { + EditorGUILayout.HelpBox( + "Must be a PolygonCollider2D or CompositeCollider2D.", + MessageType.Warning); + } + else if (Target.m_BoundingShape2D.GetType() == typeof(CompositeCollider2D)) + { + CompositeCollider2D poly = Target.m_BoundingShape2D as CompositeCollider2D; + if (poly.geometryType != CompositeCollider2D.GeometryType.Polygons) + { + EditorGUILayout.HelpBox( + "CompositeCollider2D geometry type must be Polygons", + MessageType.Warning); + } + } + } + else + { + if (Target.m_BoundingVolume == null) + EditorGUILayout.HelpBox("A Bounding Volume is required.", MessageType.Warning); + else if (Target.m_BoundingVolume.GetType() != typeof(BoxCollider) + && Target.m_BoundingVolume.GetType() != typeof(SphereCollider) + && Target.m_BoundingVolume.GetType() != typeof(CapsuleCollider)) + { + EditorGUILayout.HelpBox( + "Must be a BoxCollider, SphereCollider, or CapsuleCollider.", + MessageType.Warning); + } + } + DrawRemainingPropertiesInInspector(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(CinemachineConfiner))] + private static void DrawColliderGizmos(CinemachineConfiner confiner, GizmoType type) + { + CinemachineVirtualCameraBase vcam = (confiner != null) ? confiner.VirtualCamera : null; + if (vcam != null && confiner.IsValid) + { + Matrix4x4 oldMatrix = Gizmos.matrix; + Color oldColor = Gizmos.color; + Gizmos.color = Color.yellow; + + if (confiner.m_ConfineMode == CinemachineConfiner.Mode.Confine3D) + { + Transform t = confiner.m_BoundingVolume.transform; + Gizmos.matrix = Matrix4x4.TRS(t.position, t.rotation, t.lossyScale); + + Type colliderType = confiner.m_BoundingVolume.GetType(); + if (colliderType == typeof(BoxCollider)) + { + BoxCollider c = confiner.m_BoundingVolume as BoxCollider; + Gizmos.DrawWireCube(c.center, c.size); + } + else if (colliderType == typeof(SphereCollider)) + { + SphereCollider c = confiner.m_BoundingVolume as SphereCollider; + Gizmos.DrawWireSphere(c.center, c.radius); + } + else if (colliderType == typeof(CapsuleCollider)) + { + CapsuleCollider c = confiner.m_BoundingVolume as CapsuleCollider; + Vector3 size = Vector3.one * c.radius * 2; + switch (c.direction) + { + case 0: size.x = c.height; break; + case 1: size.y = c.height; break; + case 2: size.z = c.height; break; + } + Gizmos.DrawWireCube(c.center, size); + } + else if (colliderType == typeof(MeshCollider)) + { + MeshCollider c = confiner.m_BoundingVolume as MeshCollider; + Gizmos.DrawWireMesh(c.sharedMesh); + } + else + { + // Just draw an AABB - not very nice! + Gizmos.matrix = oldMatrix; + Bounds bounds = confiner.m_BoundingVolume.bounds; + Gizmos.DrawWireCube(t.position, bounds.extents * 2); + } + } + else + { + Transform t = confiner.m_BoundingShape2D.transform; + Gizmos.matrix = Matrix4x4.TRS(t.position, t.rotation, t.lossyScale); + + Type colliderType = confiner.m_BoundingShape2D.GetType(); + if (colliderType == typeof(PolygonCollider2D)) + { + PolygonCollider2D poly = confiner.m_BoundingShape2D as PolygonCollider2D; + for (int i = 0; i < poly.pathCount; ++i) + DrawPath(poly.GetPath(i), -1); + } + else if (colliderType == typeof(CompositeCollider2D)) + { + CompositeCollider2D poly = confiner.m_BoundingShape2D as CompositeCollider2D; + Vector2[] path = new Vector2[poly.pointCount]; + for (int i = 0; i < poly.pathCount; ++i) + { + int numPoints = poly.GetPath(i, path); + DrawPath(path, numPoints); + } + } + } + Gizmos.color = oldColor; + Gizmos.matrix = oldMatrix; + } + } + + static void DrawPath(Vector2[] path, int numPoints) + { + if (numPoints < 0) + numPoints = path.Length; + if (numPoints > 0) + { + Vector2 v0 = path[numPoints-1]; + for (int j = 0; j < numPoints; ++j) + { + Vector2 v = path[j]; + Gizmos.DrawLine(v0, v); + v0 = v; + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs.meta new file mode 100644 index 0000000..a25f82f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineConfinerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3f7c779802a73d5448e38af7c39fbaa5 +timeCreated: 1503423096 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs new file mode 100644 index 0000000..083badb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using UnityEditor; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineExternalCamera))] + internal class CinemachineExternalCameraEditor + : CinemachineVirtualCameraBaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add("Extensions"); + return excluded; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs.meta new file mode 100644 index 0000000..0d0d6f6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineExternalCameraEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3226d9f88577be74197693bd17cff8c3 +timeCreated: 1506455627 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs new file mode 100644 index 0000000..8f635dd --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs @@ -0,0 +1,174 @@ +using UnityEngine; +using UnityEditor; +using Cinemachine.Utility; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineFramingTransposer))] + internal class CinemachineFramingTransposerEditor : BaseEditor + { + CinemachineScreenComposerGuides mScreenGuideEditor; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + if (Target.m_UnlimitedSoftZone) + { + excluded.Add(FieldPath(x => x.m_SoftZoneWidth)); + excluded.Add(FieldPath(x => x.m_SoftZoneHeight)); + excluded.Add(FieldPath(x => x.m_BiasX)); + excluded.Add(FieldPath(x => x.m_BiasY)); + } + CinemachineTargetGroup group = Target.TargetGroup; + if (group == null || Target.m_GroupFramingMode == CinemachineFramingTransposer.FramingMode.None) + { + excluded.Add(FieldPath(x => x.m_GroupFramingSize)); + excluded.Add(FieldPath(x => x.m_AdjustmentMode)); + excluded.Add(FieldPath(x => x.m_MaxDollyIn)); + excluded.Add(FieldPath(x => x.m_MaxDollyOut)); + excluded.Add(FieldPath(x => x.m_MinimumDistance)); + excluded.Add(FieldPath(x => x.m_MaximumDistance)); + excluded.Add(FieldPath(x => x.m_MinimumFOV)); + excluded.Add(FieldPath(x => x.m_MaximumFOV)); + excluded.Add(FieldPath(x => x.m_MinimumOrthoSize)); + excluded.Add(FieldPath(x => x.m_MaximumOrthoSize)); + if (group == null) + excluded.Add(FieldPath(x => x.m_GroupFramingMode)); + } + else + { + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(Target.VirtualCamera); + bool ortho = brain != null ? brain.OutputCamera.orthographic : false; + if (ortho) + { + excluded.Add(FieldPath(x => x.m_AdjustmentMode)); + excluded.Add(FieldPath(x => x.m_MaxDollyIn)); + excluded.Add(FieldPath(x => x.m_MaxDollyOut)); + excluded.Add(FieldPath(x => x.m_MinimumDistance)); + excluded.Add(FieldPath(x => x.m_MaximumDistance)); + excluded.Add(FieldPath(x => x.m_MinimumFOV)); + excluded.Add(FieldPath(x => x.m_MaximumFOV)); + } + else + { + excluded.Add(FieldPath(x => x.m_MinimumOrthoSize)); + excluded.Add(FieldPath(x => x.m_MaximumOrthoSize)); + switch (Target.m_AdjustmentMode) + { + case CinemachineFramingTransposer.AdjustmentMode.DollyOnly: + excluded.Add(FieldPath(x => x.m_MinimumFOV)); + excluded.Add(FieldPath(x => x.m_MaximumFOV)); + break; + case CinemachineFramingTransposer.AdjustmentMode.ZoomOnly: + excluded.Add(FieldPath(x => x.m_MaxDollyIn)); + excluded.Add(FieldPath(x => x.m_MaxDollyOut)); + excluded.Add(FieldPath(x => x.m_MinimumDistance)); + excluded.Add(FieldPath(x => x.m_MaximumDistance)); + break; + default: + break; + } + } + } + return excluded; + } + + protected virtual void OnEnable() + { + mScreenGuideEditor = new CinemachineScreenComposerGuides(); + mScreenGuideEditor.GetHardGuide = () => { return Target.HardGuideRect; }; + mScreenGuideEditor.GetSoftGuide = () => { return Target.SoftGuideRect; }; + mScreenGuideEditor.SetHardGuide = (Rect r) => { Target.HardGuideRect = r; }; + mScreenGuideEditor.SetSoftGuide = (Rect r) => { Target.SoftGuideRect = r; }; + mScreenGuideEditor.Target = () => { return serializedObject; }; + + Target.OnGUICallback += OnGUI; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + protected virtual void OnDisable() + { + if (Target != null) + Target.OnGUICallback -= OnGUI; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.FollowTarget == null) + EditorGUILayout.HelpBox( + "Framing Transposer requires a Follow target. Change Body to Do Nothing if you don't want a Follow target.", + MessageType.Warning); + if (Target.LookAtTarget != null) + EditorGUILayout.HelpBox( + "The LookAt target must be null. The Follow target will be used in place of the LookAt target.", + MessageType.Warning); + + // First snapshot some settings + Rect oldHard = Target.HardGuideRect; + Rect oldSoft = Target.SoftGuideRect; + + // Draw the properties + DrawRemainingPropertiesInInspector(); + mScreenGuideEditor.SetNewBounds(oldHard, oldSoft, Target.HardGuideRect, Target.SoftGuideRect); + } + + protected virtual void OnGUI() + { + // Draw the camera guides + if (!Target.IsValid || !CinemachineSettings.CinemachineCoreSettings.ShowInGameGuides) + return; + + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(Target.VirtualCamera); + if (brain == null || brain.OutputCamera.activeTexture != null) + return; + + bool isLive = CinemachineCore.Instance.IsLive(Target.VirtualCamera); + + // Screen guides + mScreenGuideEditor.OnGUI_DrawGuides(isLive, brain.OutputCamera, Target.VcamState.Lens, !Target.m_UnlimitedSoftZone); + + // Draw an on-screen gizmo for the target + if (Target.FollowTarget != null && isLive) + { + Vector3 targetScreenPosition = brain.OutputCamera.WorldToScreenPoint(Target.TrackedPoint); + if (targetScreenPosition.z > 0) + { + targetScreenPosition.y = Screen.height - targetScreenPosition.y; + + GUI.color = CinemachineSettings.ComposerSettings.TargetColour; + Rect r = new Rect(targetScreenPosition, Vector2.zero); + float size = (CinemachineSettings.ComposerSettings.TargetSize + + CinemachineScreenComposerGuides.kGuideBarWidthPx) / 2; + GUI.DrawTexture(r.Inflated(new Vector2(size, size)), Texture2D.whiteTexture); + size -= CinemachineScreenComposerGuides.kGuideBarWidthPx; + if (size > 0) + { + Vector4 overlayOpacityScalar + = new Vector4(1f, 1f, 1f, CinemachineSettings.ComposerSettings.OverlayOpacity); + GUI.color = Color.black * overlayOpacityScalar; + GUI.DrawTexture(r.Inflated(new Vector2(size, size)), Texture2D.whiteTexture); + } + } + } + } + + [DrawGizmo(GizmoType.Active | GizmoType.InSelectionHierarchy, typeof(CinemachineFramingTransposer))] + private static void DrawGroupComposerGizmos(CinemachineFramingTransposer target, GizmoType selectionType) + { + // Show the group bounding box, as viewed from the camera position + CinemachineTargetGroup group = target.TargetGroup; + if (group != null) + { + Matrix4x4 m = Gizmos.matrix; + Bounds b = target.m_LastBounds; + Gizmos.matrix = target.m_lastBoundsMatrix; + Gizmos.color = Color.yellow; + Gizmos.DrawWireCube(b.center, b.size); + Gizmos.matrix = m; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs.meta new file mode 100644 index 0000000..d843e03 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFramingTransposerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 620aee1bd928b2a4981896c6b4e1bf0d +timeCreated: 1502046367 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs new file mode 100644 index 0000000..bb9f6d4 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs @@ -0,0 +1,206 @@ +using UnityEngine; +using UnityEditor; +using Cinemachine.Editor; +using System.Collections.Generic; +using Cinemachine.Utility; + +namespace Cinemachine +{ + [CustomEditor(typeof(CinemachineFreeLook))] + internal sealed class CinemachineFreeLookEditor + : CinemachineVirtualCameraBaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_Orbits)); + if (!Target.m_CommonLens) + excluded.Add(FieldPath(x => x.m_Lens)); + if (Target.m_BindingMode == CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp) + { + excluded.Add(FieldPath(x => x.m_Heading)); + excluded.Add(FieldPath(x => x.m_RecenterToTargetHeading)); + } + return excluded; + } + + protected override void OnDisable() + { + base.OnDisable(); + + // Must destroy child editors or we get exceptions + if (m_editors != null) + foreach (UnityEditor.Editor e in m_editors) + if (e != null) + UnityEngine.Object.DestroyImmediate(e); + } + + public override void OnInspectorGUI() + { + // Ordinary properties + BeginInspector(); + DrawHeaderInInspector(); + DrawPropertyInInspector(FindProperty(x => x.m_Priority)); + DrawTargetsInInspector(FindProperty(x => x.m_Follow), FindProperty(x => x.m_LookAt)); + DrawRemainingPropertiesInInspector(); + + // Orbits + EditorGUI.BeginChangeCheck(); + SerializedProperty orbits = FindProperty(x => x.m_Orbits); + for (int i = 0; i < CinemachineFreeLook.RigNames.Length; ++i) + { + float hSpace = 3; + SerializedProperty orbit = orbits.GetArrayElementAtIndex(i); + Rect rect = EditorGUILayout.GetControlRect(true); + rect = EditorGUI.PrefixLabel(rect, new GUIContent(CinemachineFreeLook.RigNames[i])); + rect.height = EditorGUIUtility.singleLineHeight; + rect.width = rect.width / 2 - hSpace; + + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = rect.width / 2; + SerializedProperty heightProp = orbit.FindPropertyRelative(() => Target.m_Orbits[i].m_Height); + EditorGUI.PropertyField(rect, heightProp, new GUIContent("Height")); + rect.x += rect.width + hSpace; + SerializedProperty radiusProp = orbit.FindPropertyRelative(() => Target.m_Orbits[i].m_Radius); + EditorGUI.PropertyField(rect, radiusProp, new GUIContent("Radius")); + EditorGUIUtility.labelWidth = oldWidth; + } + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + + // Rigs + UpdateRigEditors(); + for (int i = 0; i < m_editors.Length; ++i) + { + if (m_editors[i] == null) + continue; + EditorGUILayout.Separator(); + EditorGUILayout.BeginVertical(GUI.skin.box); + EditorGUILayout.LabelField(RigNames[i], EditorStyles.boldLabel); + ++EditorGUI.indentLevel; + m_editors[i].OnInspectorGUI(); + --EditorGUI.indentLevel; + EditorGUILayout.EndVertical(); + } + + // Extensions + DrawExtensionsWidgetInInspector(); + } + + string[] RigNames; + CinemachineVirtualCameraBase[] m_rigs; + UnityEditor.Editor[] m_editors; + void UpdateRigEditors() + { + RigNames = CinemachineFreeLook.RigNames; + if (m_rigs == null) + m_rigs = new CinemachineVirtualCameraBase[RigNames.Length]; + if (m_editors == null) + m_editors = new UnityEditor.Editor[RigNames.Length]; + for (int i = 0; i < RigNames.Length; ++i) + { + CinemachineVirtualCamera rig = Target.GetRig(i); + if (rig == null || rig != m_rigs[i]) + { + m_rigs[i] = rig; + if (m_editors[i] != null) + UnityEngine.Object.DestroyImmediate(m_editors[i]); + m_editors[i] = null; + if (rig != null) + CreateCachedEditor(rig, null, ref m_editors[i]); + } + } + } + + /// + /// Register with CinemachineFreeLook to create the pipeline in an undo-friendly manner + /// + [InitializeOnLoad] + class CreateRigWithUndo + { + static CreateRigWithUndo() + { + CinemachineFreeLook.CreateRigOverride + = (CinemachineFreeLook vcam, string name, CinemachineVirtualCamera copyFrom) => + { + // Create a new rig with default components + GameObject go = new GameObject(name); + Undo.RegisterCreatedObjectUndo(go, "created rig"); + Undo.SetTransformParent(go.transform, vcam.transform, "parenting rig"); + CinemachineVirtualCamera rig = Undo.AddComponent(go); + Undo.RecordObject(rig, "creating rig"); + if (copyFrom != null) + ReflectionHelpers.CopyFields(copyFrom, rig); + else + { + go = rig.GetComponentOwner().gameObject; + Undo.RecordObject(Undo.AddComponent(go), "creating rig"); + Undo.RecordObject(Undo.AddComponent(go), "creating rig"); + } + return rig; + }; + CinemachineFreeLook.DestroyRigOverride = (GameObject rig) => + { + Undo.DestroyObjectImmediate(rig); + }; + } + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(CinemachineFreeLook))] + private static void DrawFreeLookGizmos(CinemachineFreeLook vcam, GizmoType selectionType) + { + // Standard frustum and logo + CinemachineBrainEditor.DrawVirtualCameraBaseGizmos(vcam, selectionType); + + Color originalGizmoColour = Gizmos.color; + bool isActiveVirtualCam = CinemachineCore.Instance.IsLive(vcam); + Gizmos.color = isActiveVirtualCam + ? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour + : CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour; + + if (vcam.Follow != null) + { + Vector3 pos = vcam.Follow.position; + Vector3 up = Vector3.up; + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(vcam); + if (brain != null) + up = brain.DefaultWorldUp; + + var MiddleRig = vcam.GetRig(1).GetCinemachineComponent(); + Quaternion orient = MiddleRig.GetReferenceOrientation(up); + up = orient * Vector3.up; + float rotation = vcam.m_XAxis.Value + vcam.m_Heading.m_HeadingBias; + orient = Quaternion.AngleAxis(rotation, up) * orient; + + CinemachineOrbitalTransposerEditor.DrawCircleAtPointWithRadius( + pos + up * vcam.m_Orbits[0].m_Height, orient, vcam.m_Orbits[0].m_Radius); + CinemachineOrbitalTransposerEditor.DrawCircleAtPointWithRadius( + pos + up * vcam.m_Orbits[1].m_Height, orient, vcam.m_Orbits[1].m_Radius); + CinemachineOrbitalTransposerEditor.DrawCircleAtPointWithRadius( + pos + up * vcam.m_Orbits[2].m_Height, orient, vcam.m_Orbits[2].m_Radius); + + DrawCameraPath(pos, orient, vcam); + } + + Gizmos.color = originalGizmoColour; + } + + private static void DrawCameraPath(Vector3 atPos, Quaternion orient, CinemachineFreeLook vcam) + { + Matrix4x4 prevMatrix = Gizmos.matrix; + Gizmos.matrix = Matrix4x4.TRS(atPos, orient, Vector3.one); + + const int kNumStepsPerPair = 30; + Vector3 currPos = vcam.GetLocalPositionForCameraFromInput(0f); + for (int i = 1; i < kNumStepsPerPair + 1; ++i) + { + float t = (float)i / (float)kNumStepsPerPair; + Vector3 nextPos = vcam.GetLocalPositionForCameraFromInput(t); + Gizmos.DrawLine(currPos, nextPos); + Gizmos.DrawWireSphere(nextPos, 0.02f); + currPos = nextPos; + } + Gizmos.matrix = prevMatrix; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs.meta new file mode 100644 index 0000000..f66b71a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineFreeLookEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 04e6f1d86089cda409e925cd975436d9 +timeCreated: 1485281953 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs new file mode 100644 index 0000000..42f551b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using UnityEditor; +using UnityEngine; +using Cinemachine.Utility; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineGroupComposer))] + internal class CinemachineGroupComposerEditor : CinemachineComposerEditor + { + // Specialization + private CinemachineGroupComposer MyTarget { get { return target as CinemachineGroupComposer; } } + protected string FieldPath(Expression> expr) + { + return ReflectionHelpers.GetFieldPath(expr); + } + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(MyTarget.VirtualCamera); + bool ortho = brain != null ? brain.OutputCamera.orthographic : false; + if (ortho) + { + excluded.Add(FieldPath(x => x.m_AdjustmentMode)); + excluded.Add(FieldPath(x => x.m_MinimumFOV)); + excluded.Add(FieldPath(x => x.m_MaximumFOV)); + excluded.Add(FieldPath(x => x.m_MaxDollyIn)); + excluded.Add(FieldPath(x => x.m_MaxDollyOut)); + excluded.Add(FieldPath(x => x.m_MinimumDistance)); + excluded.Add(FieldPath(x => x.m_MaximumDistance)); + } + else + { + excluded.Add(FieldPath(x => x.m_MinimumOrthoSize)); + excluded.Add(FieldPath(x => x.m_MaximumOrthoSize)); + switch (MyTarget.m_AdjustmentMode) + { + case CinemachineGroupComposer.AdjustmentMode.DollyOnly: + excluded.Add(FieldPath(x => x.m_MinimumFOV)); + excluded.Add(FieldPath(x => x.m_MaximumFOV)); + break; + case CinemachineGroupComposer.AdjustmentMode.ZoomOnly: + excluded.Add(FieldPath(x => x.m_MaxDollyIn)); + excluded.Add(FieldPath(x => x.m_MaxDollyOut)); + excluded.Add(FieldPath(x => x.m_MinimumDistance)); + excluded.Add(FieldPath(x => x.m_MaximumDistance)); + break; + default: + break; + } + } + return excluded; + } + + public override void OnInspectorGUI() + { + if (MyTarget.IsValid && MyTarget.TargetGroup == null) + EditorGUILayout.HelpBox( + "The Framing settings will be ignored because the LookAt target is not a kind of CinemachineTargetGroup", + MessageType.Info); + + base.OnInspectorGUI(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.InSelectionHierarchy, typeof(CinemachineGroupComposer))] + private static void DrawGroupComposerGizmos(CinemachineGroupComposer target, GizmoType selectionType) + { + // Show the group bounding box, as viewed from the camera position + if (target.TargetGroup != null) + { + Matrix4x4 m = Gizmos.matrix; + Bounds b = target.m_LastBounds; + Gizmos.matrix = target.m_lastBoundsMatrix; + Gizmos.color = Color.yellow; + Gizmos.DrawWireCube(b.center, b.size); + Gizmos.matrix = m; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs.meta new file mode 100644 index 0000000..28056ef --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineGroupComposerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c5da6ce9225f948438f7d6a072499ecd +timeCreated: 1496702989 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs new file mode 100644 index 0000000..d80c828 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs @@ -0,0 +1,23 @@ +using UnityEditor; +using UnityEngine; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineHardLockToTarget))] + public sealed class CinemachineHardLockToTargetEditor : BaseEditor + { + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.FollowTarget == null) + EditorGUILayout.HelpBox( + "Hard Lock requires a Follow Target. Change Body to Do Nothing if you don't want a Follow target.", + MessageType.Warning); + EditorGUI.BeginChangeCheck(); + GUI.enabled = false; + EditorGUILayout.LabelField(" ", "Hard Lock has no settings", EditorStyles.miniLabel); + GUI.enabled = true; + DrawRemainingPropertiesInInspector(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs.meta new file mode 100644 index 0000000..4a383aa --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLockToTargetEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e44b92e217bfdf24d99acb4344918eeb +timeCreated: 1506541599 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs new file mode 100644 index 0000000..c3c1df8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs @@ -0,0 +1,23 @@ +using UnityEditor; +using UnityEngine; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineHardLookAt))] + public sealed class CinemachineHardLookAtEditor : BaseEditor + { + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.LookAtTarget == null) + EditorGUILayout.HelpBox( + "Hard Look At requires a LookAt target. Change Aim to Do Nothing if you don't want a LookAt target.", + MessageType.Warning); + EditorGUI.BeginChangeCheck(); + GUI.enabled = false; + EditorGUILayout.LabelField(" ", "Hard Look At has no settings", EditorStyles.miniLabel); + GUI.enabled = true; + DrawRemainingPropertiesInInspector(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs.meta new file mode 100644 index 0000000..1794560 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineHardLookAtEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9ce16cd7e31794b48b2843381cd87d31 +timeCreated: 1506541599 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs new file mode 100644 index 0000000..0f99c95 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs @@ -0,0 +1,104 @@ +using UnityEditor; +using UnityEngine; +using Cinemachine.Utility; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineMixingCamera))] + internal sealed class CinemachineMixingCameraEditor + : CinemachineVirtualCameraBaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + for (int i = 0; i < CinemachineMixingCamera.MaxCameras; ++i) + excluded.Add(WeightPropertyName(i)); + return excluded; + } + + static string WeightPropertyName(int i) { return "m_Weight" + i; } + + public override void OnInspectorGUI() + { + BeginInspector(); + DrawHeaderInInspector(); + DrawRemainingPropertiesInInspector(); + + float totalWeight = 0; + CinemachineVirtualCameraBase[] children = Target.ChildCameras; + int numCameras = Mathf.Min(CinemachineMixingCamera.MaxCameras, children.Length); + for (int i = 0; i < numCameras; ++i) + if (children[i].isActiveAndEnabled) + totalWeight += Target.GetWeight(i); + + if (numCameras == 0) + EditorGUILayout.HelpBox("There are no Virtual Camera children", MessageType.Warning); + else + { + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Child Camera Weights", EditorStyles.boldLabel); + for (int i = 0; i < numCameras; ++i) + { + SerializedProperty prop = serializedObject.FindProperty(WeightPropertyName(i)); + if (prop != null) + EditorGUILayout.PropertyField(prop, new GUIContent(children[i].Name)); + } + serializedObject.ApplyModifiedProperties(); + + if (totalWeight <= UnityVectorExtensions.Epsilon) + EditorGUILayout.HelpBox("No input channels are active", MessageType.Warning); + + if (children.Length > numCameras) + EditorGUILayout.HelpBox( + "There are " + children.Length + + " child cameras. A maximum of " + numCameras + " is supported.", + MessageType.Warning); + + // Camera proportion indicator + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Mix Result", EditorStyles.boldLabel); + DrawProportionIndicator(children, numCameras, totalWeight); + } + + // Extensions + DrawExtensionsWidgetInInspector(); + } + + void DrawProportionIndicator( + CinemachineVirtualCameraBase[] children, int numCameras, float totalWeight) + { + GUIStyle style = EditorStyles.centeredGreyMiniLabel; + Color bkg = new Color(0.27f, 0.27f, 0.27f); // ack! no better way than this? + Color fg = Color.Lerp(CinemachineBrain.GetSoloGUIColor(), bkg, 0.8f); + float totalHeight = (style.lineHeight + style.margin.vertical) * numCameras; + Rect r = EditorGUILayout.GetControlRect(true, totalHeight); + r.height /= numCameras; r.height -= 1; + float fullWidth = r.width; + for (int i = 0; i < numCameras; ++i) + { + float p = 0; + string label = children[i].Name; + if (totalWeight > UnityVectorExtensions.Epsilon) + { + if (children[i].isActiveAndEnabled) + p = Target.GetWeight(i) / totalWeight; + else + label += " (disabled)"; + } + r.width = fullWidth * p; + EditorGUI.DrawRect(r, fg); + + Rect r2 = r; + r2.x += r.width; + r2.width = fullWidth - r.width; + EditorGUI.DrawRect(r2, bkg); + + r.width = fullWidth; + EditorGUI.LabelField(r, label, style); + + r.y += r.height + 1; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs.meta new file mode 100644 index 0000000..1d7c354 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineMixingCameraEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ad60cb17f7694c43a8190c617281753 +timeCreated: 1502201539 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs new file mode 100644 index 0000000..0064730 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs @@ -0,0 +1,103 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineOrbitalTransposer))] + internal class CinemachineOrbitalTransposerEditor : BaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + if (Target.m_HeadingIsSlave) + { + excluded.Add(FieldPath(x => x.m_FollowOffset)); + excluded.Add(FieldPath(x => x.m_BindingMode)); + excluded.Add(FieldPath(x => x.m_Heading)); + excluded.Add(FieldPath(x => x.m_XAxis)); + excluded.Add(FieldPath(x => x.m_RecenterToTargetHeading)); + } + switch (Target.m_BindingMode) + { + default: + case CinemachineTransposer.BindingMode.LockToTarget: + break; + case CinemachineTransposer.BindingMode.LockToTargetNoRoll: + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.LockToTargetWithWorldUp: + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.LockToTargetOnAssign: + case CinemachineTransposer.BindingMode.WorldSpace: + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_YawDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp: + excluded.Add(FieldPath(x => x.m_XDamping)); + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_YawDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + excluded.Add(FieldPath(x => x.m_Heading)); + excluded.Add(FieldPath(x => x.m_RecenterToTargetHeading)); + break; + } + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.FollowTarget == null) + EditorGUILayout.HelpBox( + "Orbital Transposer requires a Follow target.", + MessageType.Warning); + DrawRemainingPropertiesInInspector(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(CinemachineOrbitalTransposer))] + static void DrawTransposerGizmos(CinemachineOrbitalTransposer target, GizmoType selectionType) + { + if (target.IsValid) + { + Color originalGizmoColour = Gizmos.color; + Gizmos.color = CinemachineCore.Instance.IsLive(target.VirtualCamera) + ? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour + : CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour; + + Vector3 up = Vector3.up; + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(target.VirtualCamera); + if (brain != null) + up = brain.DefaultWorldUp; + Vector3 pos = target.FollowTarget.position; + + Quaternion orient = target.GetReferenceOrientation(up); + up = orient * Vector3.up; + DrawCircleAtPointWithRadius + (pos + up * target.m_FollowOffset.y, orient, target.m_FollowOffset.z); + + Gizmos.color = originalGizmoColour; + } + } + + internal static void DrawCircleAtPointWithRadius(Vector3 point, Quaternion orient, float radius) + { + Matrix4x4 prevMatrix = Gizmos.matrix; + Gizmos.matrix = Matrix4x4.TRS(point, orient, radius * Vector3.one); + + const int kNumPoints = 25; + Vector3 currPoint = Vector3.forward; + Quaternion rot = Quaternion.AngleAxis(360f / (float)kNumPoints, Vector3.up); + for (int i = 0; i < kNumPoints + 1; ++i) + { + Vector3 nextPoint = rot * currPoint; + Gizmos.DrawLine(currPoint, nextPoint); + currPoint = nextPoint; + } + Gizmos.matrix = prevMatrix; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs.meta new file mode 100644 index 0000000..d7f01a4 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineOrbitalTransposerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 247be52eadac5044e9f8b7b4d8d0ada9 +timeCreated: 1485443456 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs new file mode 100644 index 0000000..195a522 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachinePOV))] + public sealed class CinemachinePOVEditor : BaseEditor + { + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs.meta new file mode 100644 index 0000000..80582f5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePOVEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1186b8795dc3fc84e8ec53bd314d8e91 +timeCreated: 1504801965 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs new file mode 100644 index 0000000..b6af44d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs @@ -0,0 +1,387 @@ +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; +using UnityEditorInternal; +using Cinemachine.Utility; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachinePath))] + internal sealed class CinemachinePathEditor : BaseEditor + { + private ReorderableList mWaypointList; + static bool mWaypointsExpanded; + static bool mPreferHandleSelection = true; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_Waypoints)); + return excluded; + } + + void OnEnable() + { + mWaypointList = null; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mWaypointList == null) + SetupWaypointList(); + if (mWaypointList.index >= mWaypointList.count) + mWaypointList.index = mWaypointList.count - 1; + + // Ordinary properties + DrawRemainingPropertiesInInspector(); + + GUILayout.Label(new GUIContent("Selected Waypoint:")); + EditorGUILayout.BeginVertical(GUI.skin.box); + Rect rect = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight * 3 + 10); + if (mWaypointList.index >= 0) + { + DrawWaypointEditor(rect, mWaypointList.index); + serializedObject.ApplyModifiedProperties(); + } + else + { + if (Target.m_Waypoints.Length > 0) + { + EditorGUI.HelpBox(rect, + "Click on a waypoint in the scene view\nor in the Path Details list", + MessageType.Info); + } + else if (GUI.Button(rect, new GUIContent("Add a waypoint to the path"))) + { + InsertWaypointAtIndex(mWaypointList.index); + mWaypointList.index = 0; + } + } + EditorGUILayout.EndVertical(); + + mPreferHandleSelection = EditorGUILayout.Toggle( + new GUIContent("Prefer Tangent Drag", + "When editing the path, if waypoint position and tangent coincide, dragging will apply preferentially to the tangent"), + mPreferHandleSelection); + + mWaypointsExpanded = EditorGUILayout.Foldout(mWaypointsExpanded, "Path Details"); + if (mWaypointsExpanded) + { + EditorGUI.BeginChangeCheck(); + mWaypointList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + } + } + + void SetupWaypointList() + { + mWaypointList = new ReorderableList( + serializedObject, FindProperty(x => x.m_Waypoints), + true, true, true, true); + mWaypointList.elementHeight *= 3; + + mWaypointList.drawHeaderCallback = (Rect rect) => + { + EditorGUI.LabelField(rect, "Waypoints"); + }; + + mWaypointList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + DrawWaypointEditor(rect, index); + }; + + mWaypointList.onAddCallback = (ReorderableList l) => + { + InsertWaypointAtIndex(l.index); + }; + } + + void DrawWaypointEditor(Rect rect, int index) + { + // Needed for accessing string names of fields + CinemachinePath.Waypoint def = new CinemachinePath.Waypoint(); + + Vector2 numberDimension = GUI.skin.button.CalcSize(new GUIContent("999")); + Vector2 labelDimension = GUI.skin.label.CalcSize(new GUIContent("Position")); + Vector2 addButtonDimension = new Vector2(labelDimension.y + 5, labelDimension.y + 1); + float vSpace = 2; + float hSpace = 3; + + SerializedProperty element = mWaypointList.serializedProperty.GetArrayElementAtIndex(index); + rect.y += vSpace / 2; + + Rect r = new Rect(rect.position, numberDimension); + Color color = GUI.color; + // GUI.color = Target.m_Appearance.pathColor; + if (GUI.Button(r, new GUIContent(index.ToString(), "Go to the waypoint in the scene view"))) + { + mWaypointList.index = index; + SceneView.lastActiveSceneView.pivot = Target.EvaluatePosition(index); + SceneView.lastActiveSceneView.size = 3; + SceneView.lastActiveSceneView.Repaint(); + } + GUI.color = color; + + r = new Rect(rect.position, labelDimension); + r.x += hSpace + numberDimension.x; + EditorGUI.LabelField(r, "Position"); + r.x += hSpace + r.width; + r.width = rect.width - (numberDimension.x + hSpace + r.width + hSpace + addButtonDimension.x + hSpace); + EditorGUI.PropertyField(r, element.FindPropertyRelative(() => def.position), GUIContent.none); + r.x += r.width + hSpace; + r.size = addButtonDimension; + GUIContent buttonContent = EditorGUIUtility.IconContent("d_RectTransform Icon"); + buttonContent.tooltip = "Set to scene-view camera position"; + GUIStyle style = new GUIStyle(GUI.skin.label); + style.alignment = TextAnchor.MiddleCenter; + if (GUI.Button(r, buttonContent, style)) + { + Undo.RecordObject(Target, "Set waypoint"); + CinemachinePath.Waypoint wp = Target.m_Waypoints[index]; + Vector3 pos = SceneView.lastActiveSceneView.camera.transform.position; + wp.position = Target.transform.InverseTransformPoint(pos); + Target.m_Waypoints[index] = wp; + } + + r = new Rect(rect.position, labelDimension); + r.y += numberDimension.y + vSpace; + r.x += hSpace + numberDimension.x; r.width = labelDimension.x; + EditorGUI.LabelField(r, "Tangent"); + r.x += hSpace + r.width; + r.width = rect.width - (numberDimension.x + hSpace + r.width + hSpace + addButtonDimension.x + hSpace); + EditorGUI.PropertyField(r, element.FindPropertyRelative(() => def.tangent), GUIContent.none); + r.x += r.width + hSpace; + r.size = addButtonDimension; + buttonContent = EditorGUIUtility.IconContent("ol minus@2x"); + buttonContent.tooltip = "Remove this waypoint"; + if (GUI.Button(r, buttonContent, style)) + { + Undo.RecordObject(Target, "Delete waypoint"); + var list = new List(Target.m_Waypoints); + list.RemoveAt(index); + Target.m_Waypoints = list.ToArray(); + if (index == Target.m_Waypoints.Length) + mWaypointList.index = index - 1; + } + + r = new Rect(rect.position, labelDimension); + r.y += 2 * (numberDimension.y + vSpace); + r.x += hSpace + numberDimension.x; r.width = labelDimension.x; + EditorGUI.LabelField(r, "Roll"); + r.x += hSpace + labelDimension.x; + r.width = rect.width + - (numberDimension.x + hSpace) + - (labelDimension.x + hSpace) + - (addButtonDimension.x + hSpace); + r.width /= 3; + EditorGUI.MultiPropertyField(r, new GUIContent[] { new GUIContent(" ") }, + element.FindPropertyRelative(() => def.roll)); + + r.x = rect.x + rect.width - addButtonDimension.x; + r.size = addButtonDimension; + buttonContent = EditorGUIUtility.IconContent("ol plus@2x"); + buttonContent.tooltip = "Add a new waypoint after this one"; + if (GUI.Button(r, buttonContent, style)) + { + mWaypointList.index = index; + InsertWaypointAtIndex(index); + } + } + + void InsertWaypointAtIndex(int indexA) + { + Vector3 pos = Vector3.forward; + Vector3 tangent = Vector3.right; + float roll = 0; + + // Get new values from the current indexA (if any) + int numWaypoints = Target.m_Waypoints.Length; + if (indexA < 0) + indexA = numWaypoints - 1; + if (indexA >= 0) + { + int indexB = indexA + 1; + if (Target.m_Looped && indexB >= numWaypoints) + indexB = 0; + if (indexB >= numWaypoints) + { + // Extrapolate the end + if (!Target.m_Waypoints[indexA].tangent.AlmostZero()) + tangent = Target.m_Waypoints[indexA].tangent; + pos = Target.m_Waypoints[indexA].position + tangent; + roll = Target.m_Waypoints[indexA].roll; + } + else + { + // Interpolate + pos = Target.transform.InverseTransformPoint( + Target.EvaluatePosition(0.5f + indexA)); + tangent = Target.transform.InverseTransformDirection( + Target.EvaluateTangent(0.5f + indexA).normalized); + roll = Mathf.Lerp( + Target.m_Waypoints[indexA].roll, Target.m_Waypoints[indexB].roll, 0.5f); + } + } + Undo.RecordObject(Target, "Add waypoint"); + var wp = new CinemachinePath.Waypoint(); + wp.position = pos; + wp.tangent = tangent; + wp.roll = roll; + var list = new List(Target.m_Waypoints); + list.Insert(indexA + 1, wp); + Target.m_Waypoints = list.ToArray(); + mWaypointList.index = indexA + 1; // select it + } + + void OnSceneGUI() + { + if (mWaypointList == null) + SetupWaypointList(); + + if (Tools.current == Tool.Move) + { + Matrix4x4 mOld = Handles.matrix; + Color colorOld = Handles.color; + + Handles.matrix = Target.transform.localToWorldMatrix; + for (int i = 0; i < Target.m_Waypoints.Length; ++i) + { + DrawSelectionHandle(i); + if (mWaypointList.index == i) + { + // Waypoint is selected + if (mPreferHandleSelection) + { + DrawPositionControl(i); + DrawTangentControl(i); + } + else + { + DrawTangentControl(i); + DrawPositionControl(i); + } + } + } + Handles.color = colorOld; + Handles.matrix = mOld; + } + } + + void DrawSelectionHandle(int i) + { + if (Event.current.button != 1) + { + Vector3 pos = Target.m_Waypoints[i].position; + float size = HandleUtility.GetHandleSize(pos) * 0.2f; + Handles.color = Color.white; + if (Handles.Button(pos, Quaternion.identity, size, size, Handles.SphereHandleCap) + && mWaypointList.index != i) + { + mWaypointList.index = i; + InternalEditorUtility.RepaintAllViews(); + } + // Label it + Handles.BeginGUI(); + Vector2 labelSize = new Vector2( + EditorGUIUtility.singleLineHeight * 2, EditorGUIUtility.singleLineHeight); + Vector2 labelPos = HandleUtility.WorldToGUIPoint(pos); + labelPos.y -= labelSize.y / 2; + labelPos.x -= labelSize.x / 2; + GUILayout.BeginArea(new Rect(labelPos, labelSize)); + GUIStyle style = new GUIStyle(); + style.normal.textColor = Color.black; + style.alignment = TextAnchor.MiddleCenter; + GUILayout.Label(new GUIContent(i.ToString(), "Waypoint " + i), style); + GUILayout.EndArea(); + Handles.EndGUI(); + } + } + + void DrawTangentControl(int i) + { + CinemachinePath.Waypoint wp = Target.m_Waypoints[i]; + Vector3 hPos = wp.position + wp.tangent; + + Handles.color = Color.yellow; + Handles.DrawLine(wp.position, hPos); + + EditorGUI.BeginChangeCheck(); + Quaternion rotation = (Tools.pivotRotation == PivotRotation.Local) + ? Quaternion.identity : Quaternion.Inverse(Target.transform.rotation); + float size = HandleUtility.GetHandleSize(hPos) * 0.1f; + Handles.SphereHandleCap(0, hPos, rotation, size, EventType.Repaint); + Vector3 newPos = Handles.PositionHandle(hPos, rotation); + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(target, "Change Waypoint Tangent"); + wp.tangent = newPos - wp.position; + Target.m_Waypoints[i] = wp; + Target.InvalidateDistanceCache(); + } + } + + void DrawPositionControl(int i) + { + CinemachinePath.Waypoint wp = Target.m_Waypoints[i]; + EditorGUI.BeginChangeCheck(); + Handles.color = Target.m_Appearance.pathColor; + Quaternion rotation = (Tools.pivotRotation == PivotRotation.Local) + ? Quaternion.identity : Quaternion.Inverse(Target.transform.rotation); + float size = HandleUtility.GetHandleSize(wp.position) * 0.1f; + Handles.SphereHandleCap(0, wp.position, rotation, size, EventType.Repaint); + Vector3 pos = Handles.PositionHandle(wp.position, rotation); + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(target, "Move Waypoint"); + wp.position = pos; + Target.m_Waypoints[i] = wp; + Target.InvalidateDistanceCache(); + } + } + + internal static void DrawPathGizmo(CinemachinePathBase path, Color pathColor) + { + // Draw the path + Color colorOld = Gizmos.color; + Gizmos.color = pathColor; + float step = 1f / path.m_Resolution; + Vector3 lastPos = path.EvaluatePosition(path.MinPos); + Vector3 lastW = (path.EvaluateOrientation(path.MinPos) + * Vector3.right) * path.m_Appearance.width / 2; + for (float t = path.MinPos + step; t <= path.MaxPos + step / 2; t += step) + { + Vector3 p = path.EvaluatePosition(t); + Quaternion q = path.EvaluateOrientation(t); + Vector3 w = (q * Vector3.right) * path.m_Appearance.width / 2; + Vector3 w2 = w * 1.2f; + Vector3 p0 = p - w2; + Vector3 p1 = p + w2; + Gizmos.DrawLine(p0, p1); + Gizmos.DrawLine(lastPos - lastW, p - w); + Gizmos.DrawLine(lastPos + lastW, p + w); +#if false + // Show the normals, for debugging + Gizmos.color = Color.red; + Vector3 y = (q * Vector3.up) * width / 2; + Gizmos.DrawLine(p, p + y); + Gizmos.color = pathColor; +#endif + lastPos = p; + lastW = w; + } + Gizmos.color = colorOld; + } + + [DrawGizmo(GizmoType.Active | GizmoType.NotInSelectionHierarchy + | GizmoType.InSelectionHierarchy | GizmoType.Pickable, typeof(CinemachinePath))] + static void DrawGizmos(CinemachinePath path, GizmoType selectionType) + { + DrawPathGizmo(path, + (Selection.activeGameObject == path.gameObject) + ? path.m_Appearance.pathColor : path.m_Appearance.inactivePathColor); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs.meta new file mode 100644 index 0000000..893e16b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachinePathEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c88d2a04cc828c044b0fcc133fd481e6 +timeCreated: 1493316676 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs new file mode 100644 index 0000000..92fb23c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs @@ -0,0 +1,191 @@ +using UnityEngine; +using UnityEditor; +using Cinemachine.Utility; + +namespace Cinemachine.Editor +{ + internal class CinemachineScreenComposerGuides + { + public delegate Rect RectGetter(); + public delegate void RectSetter(Rect r); + public delegate SerializedObject ObjectGetter(); + + // Clients MUST implement all of these + public RectGetter GetHardGuide; + public RectGetter GetSoftGuide; + public RectSetter SetHardGuide; + public RectSetter SetSoftGuide; + public ObjectGetter Target; + + public const float kGuideBarWidthPx = 3f; + + public void SetNewBounds(Rect oldHard, Rect oldSoft, Rect newHard, Rect newSoft) + { + if ((oldSoft != newSoft) || (oldHard != newHard)) + { + Undo.RecordObject(Target().targetObject, "Composer Bounds"); + if (oldSoft != newSoft) + SetSoftGuide(newSoft); + if (oldHard != newHard) + SetHardGuide(newHard); + Target().ApplyModifiedProperties(); + } + } + + public void OnGUI_DrawGuides(bool isLive, Camera outputCamera, LensSettings lens, bool showHardGuides) + { + Rect cameraRect = outputCamera.pixelRect; + float screenWidth = cameraRect.width; + float screenHeight = cameraRect.height; + cameraRect.yMax = Screen.height - cameraRect.yMin; + cameraRect.yMin = cameraRect.yMax - screenHeight; + + // Rotate the guides along with the dutch + Matrix4x4 oldMatrix = GUI.matrix; + GUI.matrix = Matrix4x4.Translate(cameraRect.min); + GUIUtility.RotateAroundPivot(lens.Dutch, cameraRect.center); + + Color hardBarsColour = CinemachineSettings.ComposerSettings.HardBoundsOverlayColour; + Color softBarsColour = CinemachineSettings.ComposerSettings.SoftBoundsOverlayColour; + float overlayOpacity = CinemachineSettings.ComposerSettings.OverlayOpacity; + if (!isLive) + { + softBarsColour = CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour; + hardBarsColour = Color.Lerp(softBarsColour, Color.black, 0.5f); + overlayOpacity /= 2; + } + hardBarsColour.a *= overlayOpacity; + softBarsColour.a *= overlayOpacity; + + Rect r = showHardGuides ? GetHardGuide() : new Rect(-2, -2, 4, 4); + float hardEdgeLeft = r.xMin * screenWidth; + float hardEdgeTop = r.yMin * screenHeight; + float hardEdgeRight = r.xMax * screenWidth; + float hardEdgeBottom = r.yMax * screenHeight; + + mDragBars[(int)DragBar.HardBarLineLeft] = new Rect(hardEdgeLeft - kGuideBarWidthPx / 2f, 0f, kGuideBarWidthPx, screenHeight); + mDragBars[(int)DragBar.HardBarLineTop] = new Rect(0f, hardEdgeTop - kGuideBarWidthPx / 2f, screenWidth, kGuideBarWidthPx); + mDragBars[(int)DragBar.HardBarLineRight] = new Rect(hardEdgeRight - kGuideBarWidthPx / 2f, 0f, kGuideBarWidthPx, screenHeight); + mDragBars[(int)DragBar.HardBarLineBottom] = new Rect(0f, hardEdgeBottom - kGuideBarWidthPx / 2f, screenWidth, kGuideBarWidthPx); + + r = GetSoftGuide(); + float softEdgeLeft = r.xMin * screenWidth; + float softEdgeTop = r.yMin * screenHeight; + float softEdgeRight = r.xMax * screenWidth; + float softEdgeBottom = r.yMax * screenHeight; + + mDragBars[(int)DragBar.SoftBarLineLeft] = new Rect(softEdgeLeft - kGuideBarWidthPx / 2f, 0f, kGuideBarWidthPx, screenHeight); + mDragBars[(int)DragBar.SoftBarLineTop] = new Rect(0f, softEdgeTop - kGuideBarWidthPx / 2f, screenWidth, kGuideBarWidthPx); + mDragBars[(int)DragBar.SoftBarLineRight] = new Rect(softEdgeRight - kGuideBarWidthPx / 2f, 0f, kGuideBarWidthPx, screenHeight); + mDragBars[(int)DragBar.SoftBarLineBottom] = new Rect(0f, softEdgeBottom - kGuideBarWidthPx / 2f, screenWidth, kGuideBarWidthPx); + + mDragBars[(int)DragBar.Center] = new Rect(softEdgeLeft, softEdgeTop, softEdgeRight - softEdgeLeft, softEdgeBottom - softEdgeTop); + + // Handle dragging bars + if (isLive) + OnGuiHandleBarDragging(screenWidth, screenHeight); + + // Draw the masks + GUI.color = hardBarsColour; + Rect hardBarLeft = new Rect(0, hardEdgeTop, Mathf.Max(0, hardEdgeLeft), hardEdgeBottom - hardEdgeTop); + Rect hardBarRight = new Rect(hardEdgeRight, hardEdgeTop, + Mathf.Max(0, screenWidth - hardEdgeRight), hardEdgeBottom - hardEdgeTop); + Rect hardBarTop = new Rect(Mathf.Min(0, hardEdgeLeft), 0, + Mathf.Max(screenWidth, hardEdgeRight) - Mathf.Min(0, hardEdgeLeft), Mathf.Max(0, hardEdgeTop)); + Rect hardBarBottom = new Rect(Mathf.Min(0, hardEdgeLeft), hardEdgeBottom, + Mathf.Max(screenWidth, hardEdgeRight) - Mathf.Min(0, hardEdgeLeft), + Mathf.Max(0, screenHeight - hardEdgeBottom)); + GUI.DrawTexture(hardBarLeft, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(hardBarTop, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(hardBarRight, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(hardBarBottom, Texture2D.whiteTexture, ScaleMode.StretchToFill); + + GUI.color = softBarsColour; + Rect softBarLeft = new Rect(hardEdgeLeft, softEdgeTop, softEdgeLeft - hardEdgeLeft, softEdgeBottom - softEdgeTop); + Rect softBarTop = new Rect(hardEdgeLeft, hardEdgeTop, hardEdgeRight - hardEdgeLeft, softEdgeTop - hardEdgeTop); + Rect softBarRight = new Rect(softEdgeRight, softEdgeTop, hardEdgeRight - softEdgeRight, softEdgeBottom - softEdgeTop); + Rect softBarBottom = new Rect(hardEdgeLeft, softEdgeBottom, hardEdgeRight - hardEdgeLeft, hardEdgeBottom - softEdgeBottom); + GUI.DrawTexture(softBarLeft, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(softBarTop, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(softBarRight, Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(softBarBottom, Texture2D.whiteTexture, ScaleMode.StretchToFill); + + // Draw the drag bars + GUI.DrawTexture(mDragBars[(int)DragBar.SoftBarLineLeft], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.SoftBarLineTop], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.SoftBarLineRight], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.SoftBarLineBottom], Texture2D.whiteTexture, ScaleMode.StretchToFill); + + GUI.color = hardBarsColour; + GUI.DrawTexture(mDragBars[(int)DragBar.HardBarLineLeft], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.HardBarLineTop], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.HardBarLineRight], Texture2D.whiteTexture, ScaleMode.StretchToFill); + GUI.DrawTexture(mDragBars[(int)DragBar.HardBarLineBottom], Texture2D.whiteTexture, ScaleMode.StretchToFill); + + GUI.matrix = oldMatrix; + } + + // For dragging the bars - order defines precedence + private enum DragBar + { + Center, + SoftBarLineLeft, SoftBarLineTop, SoftBarLineRight, SoftBarLineBottom, + HardBarLineLeft, HardBarLineTop, HardBarLineRight, HardBarLineBottom, + NONE + }; + private DragBar mDragging = DragBar.NONE; + private Rect[] mDragBars = new Rect[9]; + + private void OnGuiHandleBarDragging(float screenWidth, float screenHeight) + { + if (Event.current.type == EventType.MouseUp) + mDragging = DragBar.NONE; + if (Event.current.type == EventType.MouseDown) + { + mDragging = DragBar.NONE; + for (DragBar i = DragBar.Center; i < DragBar.NONE && mDragging == DragBar.NONE; ++i) + { + Vector2 slop = new Vector2(5f, 5f); + if (i == DragBar.Center) + { + if (mDragBars[(int)i].width > 3f * slop.x) + slop.x = -slop.x; + if (mDragBars[(int)i].height > 3f * slop.y) + slop.y = -slop.y; + } + Rect r = mDragBars[(int)i].Inflated(slop); + if (r.Contains(Event.current.mousePosition)) + mDragging = i; + } + } + + if (mDragging != DragBar.NONE && Event.current.type == EventType.MouseDrag) + { + Vector2 d = new Vector2( + Event.current.delta.x / screenWidth, + Event.current.delta.y / screenHeight); + + // First snapshot some settings + Rect newHard = GetHardGuide(); + Rect newSoft = GetSoftGuide(); + Vector2 changed = Vector2.zero; + switch (mDragging) + { + case DragBar.Center: newSoft.position += d; break; + case DragBar.SoftBarLineLeft: newSoft = newSoft.Inflated(new Vector2(-d.x, 0)); break; + case DragBar.SoftBarLineRight: newSoft = newSoft.Inflated(new Vector2(d.x, 0)); break; + case DragBar.SoftBarLineTop: newSoft = newSoft.Inflated(new Vector2(0, -d.y)); break; + case DragBar.SoftBarLineBottom: newSoft = newSoft.Inflated(new Vector2(0, d.y)); break; + case DragBar.HardBarLineLeft: newHard = newHard.Inflated(new Vector2(-d.x, 0)); break; + case DragBar.HardBarLineRight: newHard = newHard.Inflated(new Vector2(d.x, 0)); break; + case DragBar.HardBarLineBottom: newHard = newHard.Inflated(new Vector2(0, d.y)); break; + case DragBar.HardBarLineTop: newHard = newHard.Inflated(new Vector2(0, -d.y)); break; + } + + // Apply the changes, enforcing the bounds + SetNewBounds(GetHardGuide(), GetSoftGuide(), newHard, newSoft); + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs.meta new file mode 100644 index 0000000..1eb4add --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineScreenComposerGuides.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2a15a1e455bcc7543872f50762449739 +timeCreated: 1502028239 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs new file mode 100644 index 0000000..b4d4e12 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs @@ -0,0 +1,225 @@ +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; +using UnityEditorInternal; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineSmoothPath))] + internal sealed class CinemachineSmoothPathEditor : BaseEditor + { + private ReorderableList mWaypointList; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_Waypoints)); + return excluded; + } + + void OnEnable() + { + mWaypointList = null; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mWaypointList == null) + SetupWaypointList(); + + if (mWaypointList.index >= mWaypointList.count) + mWaypointList.index = mWaypointList.count - 1; + + // Ordinary properties + DrawRemainingPropertiesInInspector(); + + // Waypoints + EditorGUI.BeginChangeCheck(); + mWaypointList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + } + + void SetupWaypointList() + { + mWaypointList = new ReorderableList( + serializedObject, FindProperty(x => x.m_Waypoints), + true, true, true, true); + + mWaypointList.drawHeaderCallback = (Rect rect) => + { EditorGUI.LabelField(rect, "Waypoints"); }; + + mWaypointList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { DrawWaypointEditor(rect, index); }; + + mWaypointList.onAddCallback = (ReorderableList l) => + { InsertWaypointAtIndex(l.index); }; + } + + void DrawWaypointEditor(Rect rect, int index) + { + // Needed for accessing string names of fields + CinemachineSmoothPath.Waypoint def = new CinemachineSmoothPath.Waypoint(); + SerializedProperty element = mWaypointList.serializedProperty.GetArrayElementAtIndex(index); + + float hSpace = 3; + rect.width -= hSpace; rect.y += 1; + Vector2 numberDimension = GUI.skin.label.CalcSize(new GUIContent("999")); + Rect r = new Rect(rect.position, numberDimension); + if (GUI.Button(r, new GUIContent(index.ToString(), "Go to the waypoint in the scene view"))) + { + mWaypointList.index = index; + SceneView.lastActiveSceneView.pivot = Target.EvaluatePosition(index); + SceneView.lastActiveSceneView.size = 4; + SceneView.lastActiveSceneView.Repaint(); + } + + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2f; + GUIContent rollLabel = new GUIContent("Roll"); + Vector2 labelDimension = GUI.skin.label.CalcSize(rollLabel); + float rollWidth = labelDimension.x + floatFieldWidth; + r.x += r.width + hSpace; r.width = rect.width - (r.width + hSpace + rollWidth) - (r.height + hSpace); + EditorGUI.PropertyField(r, element.FindPropertyRelative(() => def.position), GUIContent.none); + + r.x += r.width + hSpace; r.width = rollWidth; + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = labelDimension.x; + EditorGUI.PropertyField(r, element.FindPropertyRelative(() => def.roll), rollLabel); + EditorGUIUtility.labelWidth = oldWidth; + + r.x += r.width + hSpace; r.height += 1; r.width = r.height; + GUIContent setButtonContent = EditorGUIUtility.IconContent("d_RectTransform Icon"); + setButtonContent.tooltip = "Set to scene-view camera position"; + if (GUI.Button(r, setButtonContent, GUI.skin.label)) + { + Undo.RecordObject(Target, "Set waypoint"); + CinemachineSmoothPath.Waypoint wp = Target.m_Waypoints[index]; + Vector3 pos = SceneView.lastActiveSceneView.camera.transform.position; + wp.position = Target.transform.InverseTransformPoint(pos); + Target.m_Waypoints[index] = wp; + } + } + + void InsertWaypointAtIndex(int indexA) + { + Vector3 pos = Vector3.right; + float roll = 0; + + // Get new values from the current indexA (if any) + int numWaypoints = Target.m_Waypoints.Length; + if (indexA < 0) + indexA = numWaypoints - 1; + if (indexA >= 0) + { + int indexB = indexA + 1; + if (Target.m_Looped && indexB >= numWaypoints) + indexB = 0; + if (indexB >= numWaypoints) + { + Vector3 delta = Vector3.right; + if (indexA > 0) + delta = Target.m_Waypoints[indexA].position - Target.m_Waypoints[indexA-1].position; + pos = Target.m_Waypoints[indexA].position + delta; + roll = Target.m_Waypoints[indexA].roll; + } + else + { + // Interpolate + pos = Target.transform.InverseTransformPoint(Target.EvaluatePosition(0.5f + indexA)); + roll = Mathf.Lerp(Target.m_Waypoints[indexA].roll, Target.m_Waypoints[indexB].roll, 0.5f); + } + } + Undo.RecordObject(Target, "Add waypoint"); + var wp = new CinemachineSmoothPath.Waypoint(); + wp.position = pos; + wp.roll = roll; + var list = new List(Target.m_Waypoints); + list.Insert(indexA + 1, wp); + Target.m_Waypoints = list.ToArray(); + InternalEditorUtility.RepaintAllViews(); + mWaypointList.index = indexA + 1; // select it + } + + void OnSceneGUI() + { + if (mWaypointList == null) + SetupWaypointList(); + + if (Tools.current == Tool.Move) + { + Matrix4x4 mOld = Handles.matrix; + Color colorOld = Handles.color; + + Handles.matrix = Target.transform.localToWorldMatrix; + for (int i = 0; i < Target.m_Waypoints.Length; ++i) + { + DrawSelectionHandle(i); + if (mWaypointList.index == i) + DrawPositionControl(i); // Waypoint is selected + } + Handles.color = colorOld; + Handles.matrix = mOld; + } + } + + void DrawSelectionHandle(int i) + { + if (Event.current.button != 1) + { + Vector3 pos = Target.m_Waypoints[i].position; + float size = HandleUtility.GetHandleSize(pos) * 0.2f; + Handles.color = Color.white; + if (Handles.Button(pos, Quaternion.identity, size, size, Handles.SphereHandleCap) + && mWaypointList.index != i) + { + mWaypointList.index = i; + InternalEditorUtility.RepaintAllViews(); + } + // Label it + Handles.BeginGUI(); + Vector2 labelSize = new Vector2( + EditorGUIUtility.singleLineHeight * 2, EditorGUIUtility.singleLineHeight); + Vector2 labelPos = HandleUtility.WorldToGUIPoint(pos); + labelPos.y -= labelSize.y / 2; + labelPos.x -= labelSize.x / 2; + GUILayout.BeginArea(new Rect(labelPos, labelSize)); + GUIStyle style = new GUIStyle(); + style.normal.textColor = Color.black; + style.alignment = TextAnchor.MiddleCenter; + GUILayout.Label(new GUIContent(i.ToString(), "Waypoint " + i), style); + GUILayout.EndArea(); + Handles.EndGUI(); + } + } + + void DrawPositionControl(int i) + { + CinemachineSmoothPath.Waypoint wp = Target.m_Waypoints[i]; + EditorGUI.BeginChangeCheck(); + Handles.color = Target.m_Appearance.pathColor; + Quaternion rotation = (Tools.pivotRotation == PivotRotation.Local) + ? Quaternion.identity : Quaternion.Inverse(Target.transform.rotation); + float size = HandleUtility.GetHandleSize(wp.position) * 0.1f; + Handles.SphereHandleCap(0, wp.position, rotation, size, EventType.Repaint); + Vector3 pos = Handles.PositionHandle(wp.position, rotation); + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(target, "Move Waypoint"); + wp.position = pos; + Target.m_Waypoints[i] = wp; + Target.InvalidateDistanceCache(); + } + } + + [DrawGizmo(GizmoType.Active | GizmoType.NotInSelectionHierarchy + | GizmoType.InSelectionHierarchy | GizmoType.Pickable, typeof(CinemachineSmoothPath))] + static void DrawGizmos(CinemachineSmoothPath path, GizmoType selectionType) + { + CinemachinePathEditor.DrawPathGizmo(path, + (Selection.activeGameObject == path.gameObject) + ? path.m_Appearance.pathColor : path.m_Appearance.inactivePathColor); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs.meta new file mode 100644 index 0000000..550b31c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineSmoothPathEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1123a444101eb774ba7490990b50736a +timeCreated: 1505831686 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs new file mode 100644 index 0000000..cab39bb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs @@ -0,0 +1,444 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using UnityEditor.Animations; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineStateDrivenCamera))] + internal sealed class CinemachineStateDrivenCameraEditor + : CinemachineVirtualCameraBaseEditor + { + EmbeddeAssetEditor m_BlendsEditor; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_CustomBlends)); + excluded.Add(FieldPath(x => x.m_Instructions)); + return excluded; + } + + private UnityEditorInternal.ReorderableList mChildList; + private UnityEditorInternal.ReorderableList mInstructionList; + + protected override void OnEnable() + { + base.OnEnable(); + m_BlendsEditor = new EmbeddeAssetEditor( + FieldPath(x => x.m_CustomBlends), this); + m_BlendsEditor.OnChanged = (CinemachineBlenderSettings b) => + { + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + }; + m_BlendsEditor.OnCreateEditor = (UnityEditor.Editor ed) => + { + CinemachineBlenderSettingsEditor editor = ed as CinemachineBlenderSettingsEditor; + if (editor != null) + editor.GetAllVirtualCameras = () => { return Target.ChildCameras; }; + }; + mChildList = null; + mInstructionList = null; + } + + protected override void OnDisable() + { + base.OnDisable(); + if (m_BlendsEditor != null) + m_BlendsEditor.OnDisable(); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (mInstructionList == null) + SetupInstructionList(); + if (mChildList == null) + SetupChildList(); + + if (Target.m_AnimatedTarget == null) + EditorGUILayout.HelpBox("An Animated Target is required", MessageType.Warning); + + // Ordinary properties + DrawHeaderInInspector(); + DrawPropertyInInspector(FindProperty(x => x.m_Priority)); + DrawTargetsInInspector(FindProperty(x => x.m_Follow), FindProperty(x => x.m_LookAt)); + DrawPropertyInInspector(FindProperty(x => x.m_AnimatedTarget)); + + // Layer index + EditorGUI.BeginChangeCheck(); + UpdateTargetStates(); + UpdateCameraCandidates(); + SerializedProperty layerProp = FindAndExcludeProperty(x => x.m_LayerIndex); + int currentLayer = layerProp.intValue; + int layerSelection = EditorGUILayout.Popup("Layer", currentLayer, mLayerNames); + if (currentLayer != layerSelection) + layerProp.intValue = layerSelection; + if (EditorGUI.EndChangeCheck()) + { + serializedObject.ApplyModifiedProperties(); + Target.ValidateInstructions(); + } + + DrawRemainingPropertiesInInspector(); + + // Blends + m_BlendsEditor.DrawEditorCombo( + "Create New Blender Asset", + Target.gameObject.name + " Blends", "asset", string.Empty, + "Custom Blends", false); + + // Instructions + EditorGUI.BeginChangeCheck(); + EditorGUILayout.Separator(); + mInstructionList.DoLayoutList(); + + // vcam children + EditorGUILayout.Separator(); + mChildList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + { + serializedObject.ApplyModifiedProperties(); + Target.ValidateInstructions(); + } + + // Extensions + DrawExtensionsWidgetInInspector(); + } + + private string[] mLayerNames; + private int[] mTargetStates; + private string[] mTargetStateNames; + private Dictionary mStateIndexLookup; + private void UpdateTargetStates() + { + // Scrape the Animator Controller for states + AnimatorController ac = (Target.m_AnimatedTarget == null) + ? null : Target.m_AnimatedTarget.runtimeAnimatorController as AnimatorController; + StateCollector collector = new StateCollector(); + collector.CollectStates(ac, Target.m_LayerIndex); + mTargetStates = collector.mStates.ToArray(); + mTargetStateNames = collector.mStateNames.ToArray(); + mStateIndexLookup = collector.mStateIndexLookup; + + if (ac == null) + mLayerNames = new string[0]; + else + { + mLayerNames = new string[ac.layers.Length]; + for (int i = 0; i < ac.layers.Length; ++i) + mLayerNames[i] = ac.layers[i].name; + } + + // Create the parent map in the target + List parents + = new List(); + foreach (var i in collector.mStateParentLookup) + parents.Add(new CinemachineStateDrivenCamera.ParentHash(i.Key, i.Value)); + Target.m_ParentHash = parents.ToArray(); + } + + class StateCollector + { + public List mStates; + public List mStateNames; + public Dictionary mStateIndexLookup; + public Dictionary mStateParentLookup; + + public void CollectStates(AnimatorController ac, int layerIndex) + { + mStates = new List(); + mStateNames = new List(); + mStateIndexLookup = new Dictionary(); + mStateParentLookup = new Dictionary(); + + mStateIndexLookup[0] = mStates.Count; + mStateNames.Add("(default)"); + mStates.Add(0); + + if (ac != null && layerIndex >= 0 && layerIndex < ac.layers.Length) + { + AnimatorStateMachine fsm = ac.layers[layerIndex].stateMachine; + string name = fsm.name; + int hash = Animator.StringToHash(name); + CollectStatesFromFSM(fsm, name + ".", hash, string.Empty); + } + } + + void CollectStatesFromFSM( + AnimatorStateMachine fsm, string hashPrefix, int parentHash, string displayPrefix) + { + ChildAnimatorState[] states = fsm.states; + for (int i = 0; i < states.Length; i++) + { + AnimatorState state = states[i].state; + int hash = AddState(hashPrefix + state.name, parentHash, displayPrefix + state.name); + + // Also process clips as pseudo-states, if more than 1 is present. + // Since they don't have hashes, we can manufacture some. + List clips = CollectClipNames(state.motion); + if (clips.Count > 1) + { + string substatePrefix = displayPrefix + state.name + "."; + foreach (string name in clips) + AddState( + CinemachineStateDrivenCamera.CreateFakeHashName(hash, name), + hash, substatePrefix + name); + } + } + + ChildAnimatorStateMachine[] fsmChildren = fsm.stateMachines; + foreach (var child in fsmChildren) + { + string name = hashPrefix + child.stateMachine.name; + string displayName = displayPrefix + child.stateMachine.name; + int hash = AddState(name, parentHash, displayName); + CollectStatesFromFSM(child.stateMachine, name + ".", hash, displayName + "."); + } + } + + List CollectClipNames(Motion motion) + { + List names = new List(); + AnimationClip clip = motion as AnimationClip; + if (clip != null) + names.Add(clip.name); + BlendTree tree = motion as BlendTree; + if (tree != null) + { + ChildMotion[] children = tree.children; + foreach (var child in children) + names.AddRange(CollectClipNames(child.motion)); + } + return names; + } + + int AddState(string hashName, int parentHash, string displayName) + { + int hash = Animator.StringToHash(hashName); + if (parentHash != 0) + mStateParentLookup[hash] = parentHash; + mStateIndexLookup[hash] = mStates.Count; + mStateNames.Add(displayName); + mStates.Add(hash); + return hash; + } + } + + private int GetStateHashIndex(int stateHash) + { + if (stateHash == 0) + return 0; + if (!mStateIndexLookup.ContainsKey(stateHash)) + return 0; + return mStateIndexLookup[stateHash]; + } + + private string[] mCameraCandidates; + private Dictionary mCameraIndexLookup; + private void UpdateCameraCandidates() + { + List vcams = new List(); + mCameraIndexLookup = new Dictionary(); + vcams.Add("(none)"); + CinemachineVirtualCameraBase[] children = Target.ChildCameras; + foreach (var c in children) + { + mCameraIndexLookup[c] = vcams.Count; + vcams.Add(c.Name); + } + mCameraCandidates = vcams.ToArray(); + } + + private int GetCameraIndex(Object obj) + { + if (obj == null || mCameraIndexLookup == null) + return 0; + CinemachineVirtualCameraBase vcam = obj as CinemachineVirtualCameraBase; + if (vcam == null) + return 0; + if (!mCameraIndexLookup.ContainsKey(vcam)) + return 0; + return mCameraIndexLookup[vcam]; + } + + void SetupInstructionList() + { + mInstructionList = new UnityEditorInternal.ReorderableList(serializedObject, + serializedObject.FindProperty(() => Target.m_Instructions), + true, true, true, true); + + // Needed for accessing field names as strings + CinemachineStateDrivenCamera.Instruction def = new CinemachineStateDrivenCamera.Instruction(); + + float vSpace = 2; + float hSpace = 3; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + float hBigSpace = EditorGUIUtility.singleLineHeight * 2 / 3; + mInstructionList.drawHeaderCallback = (Rect rect) => + { + float sharedWidth = rect.width - EditorGUIUtility.singleLineHeight + - 2 * (hBigSpace + floatFieldWidth) - hSpace; + rect.x += EditorGUIUtility.singleLineHeight; rect.width = sharedWidth / 2; + EditorGUI.LabelField(rect, "State"); + + rect.x += rect.width + hSpace; + EditorGUI.LabelField(rect, "Camera"); + + rect.x += rect.width + hBigSpace; rect.width = floatFieldWidth; + EditorGUI.LabelField(rect, "Wait"); + + rect.x += rect.width + hBigSpace; + EditorGUI.LabelField(rect, "Min"); + }; + + mInstructionList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + SerializedProperty instProp + = mInstructionList.serializedProperty.GetArrayElementAtIndex(index); + float sharedWidth = rect.width - 2 * (hBigSpace + floatFieldWidth) - hSpace; + rect.y += vSpace; rect.height = EditorGUIUtility.singleLineHeight; + + rect.width = sharedWidth / 2; + SerializedProperty stateSelProp = instProp.FindPropertyRelative(() => def.m_FullHash); + int currentState = GetStateHashIndex(stateSelProp.intValue); + int stateSelection = EditorGUI.Popup(rect, currentState, mTargetStateNames); + if (currentState != stateSelection) + stateSelProp.intValue = mTargetStates[stateSelection]; + + rect.x += rect.width + hSpace; + SerializedProperty vcamSelProp = instProp.FindPropertyRelative(() => def.m_VirtualCamera); + int currentVcam = GetCameraIndex(vcamSelProp.objectReferenceValue); + int vcamSelection = EditorGUI.Popup(rect, currentVcam, mCameraCandidates); + if (currentVcam != vcamSelection) + vcamSelProp.objectReferenceValue = (vcamSelection == 0) + ? null : Target.ChildCameras[vcamSelection - 1]; + + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = hBigSpace; + + rect.x += rect.width; rect.width = floatFieldWidth + hBigSpace; + SerializedProperty activeAfterProp = instProp.FindPropertyRelative(() => def.m_ActivateAfter); + EditorGUI.PropertyField(rect, activeAfterProp, new GUIContent(" ", activeAfterProp.tooltip)); + + rect.x += rect.width; + SerializedProperty minDurationProp = instProp.FindPropertyRelative(() => def.m_MinDuration); + EditorGUI.PropertyField(rect, minDurationProp, new GUIContent(" ", minDurationProp.tooltip)); + + EditorGUIUtility.labelWidth = oldWidth; + }; + + mInstructionList.onAddDropdownCallback = (Rect buttonRect, UnityEditorInternal.ReorderableList l) => + { + var menu = new GenericMenu(); + menu.AddItem(new GUIContent("New State"), + false, (object data) => + { + ++mInstructionList.serializedProperty.arraySize; + serializedObject.ApplyModifiedProperties(); + Target.ValidateInstructions(); + }, + null); + menu.AddItem(new GUIContent("All Unhandled States"), + false, (object data) => + { + CinemachineStateDrivenCamera target = Target; + int len = mInstructionList.serializedProperty.arraySize; + for (int i = 0; i < mTargetStates.Length; ++i) + { + int hash = mTargetStates[i]; + if (hash == 0) + continue; + bool alreadyThere = false; + for (int j = 0; j < len; ++j) + { + if (target.m_Instructions[j].m_FullHash == hash) + { + alreadyThere = true; + break; + } + } + if (!alreadyThere) + { + int index = mInstructionList.serializedProperty.arraySize; + ++mInstructionList.serializedProperty.arraySize; + SerializedProperty p = mInstructionList.serializedProperty.GetArrayElementAtIndex(index); + p.FindPropertyRelative(() => def.m_FullHash).intValue = hash; + } + } + serializedObject.ApplyModifiedProperties(); + Target.ValidateInstructions(); + }, + null); + menu.ShowAsContext(); + }; + } + + void SetupChildList() + { + float vSpace = 2; + float hSpace = 3; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + float hBigSpace = EditorGUIUtility.singleLineHeight * 2 / 3; + + mChildList = new UnityEditorInternal.ReorderableList(serializedObject, + serializedObject.FindProperty(() => Target.m_ChildCameras), + true, true, true, true); + + mChildList.drawHeaderCallback = (Rect rect) => + { + EditorGUI.LabelField(rect, "Virtual Camera Children"); + GUIContent priorityText = new GUIContent("Priority"); + var textDimensions = GUI.skin.label.CalcSize(priorityText); + rect.x += rect.width - textDimensions.x; + rect.width = textDimensions.x; + EditorGUI.LabelField(rect, priorityText); + }; + mChildList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + rect.y += vSpace; rect.height = EditorGUIUtility.singleLineHeight; + rect.width -= floatFieldWidth + hBigSpace; + SerializedProperty element = mChildList.serializedProperty.GetArrayElementAtIndex(index); + EditorGUI.PropertyField(rect, element, GUIContent.none); + + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = hBigSpace; + SerializedObject obj = new SerializedObject(element.objectReferenceValue); + rect.x += rect.width + hSpace; rect.width = floatFieldWidth + hBigSpace; + SerializedProperty priorityProp = obj.FindProperty(() => Target.m_Priority); + EditorGUI.PropertyField(rect, priorityProp, new GUIContent(" ", priorityProp.tooltip)); + EditorGUIUtility.labelWidth = oldWidth; + obj.ApplyModifiedProperties(); + }; + mChildList.onChangedCallback = (UnityEditorInternal.ReorderableList l) => + { + if (l.index < 0 || l.index >= l.serializedProperty.arraySize) + return; + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + vcam.transform.SetSiblingIndex(l.index); + }; + mChildList.onAddCallback = (UnityEditorInternal.ReorderableList l) => + { + var index = l.serializedProperty.arraySize; + var vcam = CinemachineMenu.CreateDefaultVirtualCamera(); + Undo.SetTransformParent(vcam.transform, Target.transform, ""); + vcam.transform.SetSiblingIndex(index); + }; + mChildList.onRemoveCallback = (UnityEditorInternal.ReorderableList l) => + { + Object o = l.serializedProperty.GetArrayElementAtIndex( + l.index).objectReferenceValue; + CinemachineVirtualCameraBase vcam = (o != null) + ? (o as CinemachineVirtualCameraBase) : null; + if (vcam != null) + Undo.DestroyObjectImmediate(vcam.gameObject); + }; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs.meta new file mode 100644 index 0000000..7342b27 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineStateDrivenCameraEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0eb9f23cde3a1734da334cfa0831dd25 +timeCreated: 1486062933 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs new file mode 100644 index 0000000..a10aa72 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs @@ -0,0 +1,94 @@ +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineTargetGroup))] + internal sealed class CinemachineTargetGroupEditor : BaseEditor + { + private UnityEditorInternal.ReorderableList mTargetList; + + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + excluded.Add(FieldPath(x => x.m_Targets)); + return excluded; + } + + void OnEnable() + { + mTargetList = null; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + DrawRemainingPropertiesInInspector(); + + if (mTargetList == null) + SetupTargetList(); + EditorGUI.BeginChangeCheck(); + mTargetList.DoLayoutList(); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + } + + void SetupTargetList() + { + float vSpace = 2; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 3f; + float hBigSpace = EditorGUIUtility.singleLineHeight * 2 / 3; + + mTargetList = new UnityEditorInternal.ReorderableList( + serializedObject, FindProperty(x => x.m_Targets), + true, true, true, true); + + // Needed for accessing field names as strings + CinemachineTargetGroup.Target def = new CinemachineTargetGroup.Target(); + + mTargetList.drawHeaderCallback = (Rect rect) => + { + rect.width -= EditorGUIUtility.singleLineHeight + 2 * (floatFieldWidth + hBigSpace); + Vector2 pos = rect.position; pos.x += EditorGUIUtility.singleLineHeight; + rect.position = pos; + EditorGUI.LabelField(rect, "Target"); + + pos.x += rect.width + hBigSpace; rect.width = floatFieldWidth; rect.position = pos; + EditorGUI.LabelField(rect, "Weight"); + + pos.x += rect.width + hBigSpace; rect.position = pos; + EditorGUI.LabelField(rect, "Radius"); + }; + + mTargetList.drawElementCallback + = (Rect rect, int index, bool isActive, bool isFocused) => + { + SerializedProperty elemProp = mTargetList.serializedProperty.GetArrayElementAtIndex(index); + + rect.y += vSpace; + rect.height = EditorGUIUtility.singleLineHeight; + Vector2 pos = rect.position; + //rect.width -= hSpace + 2 * EditorGUIUtility.singleLineHeight; + rect.width -= 2 * (floatFieldWidth + hBigSpace); + EditorGUI.PropertyField(rect, elemProp.FindPropertyRelative(() => def.target), GUIContent.none); + + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = EditorGUIUtility.singleLineHeight; + pos.x += rect.width; rect.width = floatFieldWidth + hBigSpace; rect.position = pos; + EditorGUI.PropertyField(rect, elemProp.FindPropertyRelative(() => def.weight), new GUIContent(" ")); + pos.x += rect.width; rect.position = pos; + EditorGUI.PropertyField(rect, elemProp.FindPropertyRelative(() => def.radius), new GUIContent(" ")); + EditorGUIUtility.labelWidth = oldWidth; + }; + + mTargetList.onAddCallback = (UnityEditorInternal.ReorderableList l) => + { + var index = l.serializedProperty.arraySize; + ++l.serializedProperty.arraySize; + SerializedProperty elemProp = mTargetList.serializedProperty.GetArrayElementAtIndex(index); + elemProp.FindPropertyRelative(() => def.weight).floatValue = 1; + }; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs.meta new file mode 100644 index 0000000..5c0e49b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTargetGroupEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eb8e037cb3f873743a725427c8c22342 +timeCreated: 1496424406 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs new file mode 100644 index 0000000..6d5738f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineTrackedDolly))] + internal sealed class CinemachineTrackedDollyEditor : BaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + switch (Target.m_CameraUp) + { + default: + break; + case CinemachineTrackedDolly.CameraUpMode.PathNoRoll: + case CinemachineTrackedDolly.CameraUpMode.FollowTargetNoRoll: + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTrackedDolly.CameraUpMode.Default: + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_YawDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + } + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.m_Path == null) + EditorGUILayout.HelpBox("A Path is required", MessageType.Warning); + if (Target.m_AutoDolly.m_Enabled && Target.FollowTarget == null) + EditorGUILayout.HelpBox("AutoDolly requires a Follow Target", MessageType.Warning); + DrawRemainingPropertiesInInspector(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.InSelectionHierarchy, typeof(CinemachineTrackedDolly))] + private static void DrawTrackeDollyGizmos(CinemachineTrackedDolly target, GizmoType selectionType) + { + if (target.IsValid) + { + CinemachinePathBase path = target.m_Path; + if (path != null) + { + CinemachinePathEditor.DrawPathGizmo(path, path.m_Appearance.pathColor); + Vector3 pos = path.EvaluatePositionAtUnit(target.m_PathPosition, target.m_PositionUnits); + Color oldColor = Gizmos.color; + Gizmos.color = CinemachineCore.Instance.IsLive(target.VirtualCamera) + ? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour + : CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour; + Gizmos.DrawLine(pos, target.transform.position); + Gizmos.color = oldColor; + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs.meta new file mode 100644 index 0000000..4d0f07e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTrackedDollyEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d4a408a1b506d0046875061c677944d8 +timeCreated: 1493318518 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs new file mode 100644 index 0000000..37dce4f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs @@ -0,0 +1,73 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineTransposer))] + internal sealed class CinemachineTransposerEditor : BaseEditor + { + protected override List GetExcludedPropertiesInInspector() + { + List excluded = base.GetExcludedPropertiesInInspector(); + switch (Target.m_BindingMode) + { + default: + case CinemachineTransposer.BindingMode.LockToTarget: + break; + case CinemachineTransposer.BindingMode.LockToTargetNoRoll: + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.LockToTargetWithWorldUp: + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.LockToTargetOnAssign: + case CinemachineTransposer.BindingMode.WorldSpace: + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_YawDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + case CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp: + excluded.Add(FieldPath(x => x.m_XDamping)); + excluded.Add(FieldPath(x => x.m_PitchDamping)); + excluded.Add(FieldPath(x => x.m_YawDamping)); + excluded.Add(FieldPath(x => x.m_RollDamping)); + break; + } + return excluded; + } + + public override void OnInspectorGUI() + { + BeginInspector(); + if (Target.FollowTarget == null) + EditorGUILayout.HelpBox( + "Transposer requires a Follow Target. Change Body to Do Nothing if you don't want a Follow target.", + MessageType.Warning); + DrawRemainingPropertiesInInspector(); + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(CinemachineTransposer))] + static void DrawTransposerGizmos(CinemachineTransposer target, GizmoType selectionType) + { + if (target.IsValid) + { + Color originalGizmoColour = Gizmos.color; + Gizmos.color = CinemachineCore.Instance.IsLive(target.VirtualCamera) + ? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour + : CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour; + + Vector3 up = Vector3.up; + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(target.VirtualCamera); + if (brain != null) + up = brain.DefaultWorldUp; + Vector3 targetPos = target.FollowTarget.position; + Vector3 desiredPos = target.GeTargetCameraPosition(up); + Gizmos.DrawLine(targetPos, desiredPos); + Gizmos.DrawWireSphere(desiredPos, HandleUtility.GetHandleSize(desiredPos) / 20); + Gizmos.color = originalGizmoColour; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs.meta new file mode 100644 index 0000000..f057c6a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineTransposerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f34e35dc1dc67c54c841b728548d69cc +timeCreated: 1484088330 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs new file mode 100644 index 0000000..e76a0ad --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs @@ -0,0 +1,202 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; +using Cinemachine.Utility; + +namespace Cinemachine.Editor +{ + /// + /// Base class for virtual camera editors. + /// Handles drawing the header and the basic properties. + /// + public class CinemachineVirtualCameraBaseEditor : BaseEditor where T : CinemachineVirtualCameraBase + { + static Type[] sExtensionTypes; // First entry is null + static string[] sExtensionNames; + + protected override List GetExcludedPropertiesInInspector() + { + var excluded = base.GetExcludedPropertiesInInspector(); + if (Target.m_ExcludedPropertiesInInspector != null) + excluded.AddRange(Target.m_ExcludedPropertiesInInspector); + return excluded; + } + + protected virtual void OnEnable() + { + if (sExtensionTypes == null) + { + // Populate the extension list + List exts = new List(); + List names = new List(); + exts.Add(null); + names.Add("(select)"); + var allExtensions + = ReflectionHelpers.GetTypesInAllLoadedAssemblies( + (Type t) => t.IsSubclassOf(typeof(CinemachineExtension))); + foreach (Type t in allExtensions) + { + exts.Add(t); + names.Add(t.Name); + } + sExtensionTypes = exts.ToArray(); + sExtensionNames = names.ToArray(); + } + } + + protected virtual void OnDisable() + { + if (CinemachineBrain.SoloCamera == (ICinemachineCamera)Target) + { + CinemachineBrain.SoloCamera = null; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + } + + public override void OnInspectorGUI() + { + BeginInspector(); + DrawHeaderInInspector(); + DrawRemainingPropertiesInInspector(); + DrawExtensionsWidgetInInspector(); + } + + protected void DrawHeaderInInspector() + { + List excluded = GetExcludedPropertiesInInspector(); + if (!excluded.Contains("Header")) + { + DrawCameraStatusInInspector(); + DrawGlobalControlsInInspector(); + } + ExcludeProperty("Header"); + } + + protected void DrawTargetsInInspector( + SerializedProperty followTarget, SerializedProperty lookAtTarget) + { + List excluded = GetExcludedPropertiesInInspector(); + EditorGUI.BeginChangeCheck(); + if (!excluded.Contains(followTarget.name)) + { + if (Target.ParentCamera == null || Target.ParentCamera.Follow == null) + EditorGUILayout.PropertyField(followTarget); + else + EditorGUILayout.PropertyField(followTarget, + new GUIContent(followTarget.displayName + " Override")); + ExcludeProperty(followTarget.name); + } + if (!excluded.Contains(lookAtTarget.name)) + { + if (Target.ParentCamera == null || Target.ParentCamera.LookAt == null) + EditorGUILayout.PropertyField(lookAtTarget); + else + EditorGUILayout.PropertyField(lookAtTarget, + new GUIContent(lookAtTarget.displayName + " Override")); + ExcludeProperty(lookAtTarget.name); + } + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + } + + protected void DrawExtensionsWidgetInInspector() + { + List excluded = GetExcludedPropertiesInInspector(); + if (!excluded.Contains("Extensions")) + { + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Extensions", EditorStyles.boldLabel); + Rect rect = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight); + rect = EditorGUI.PrefixLabel(rect, new GUIContent("Add Extension")); + + int selection = EditorGUI.Popup(rect, 0, sExtensionNames); + if (selection > 0) + { + Type extType = sExtensionTypes[selection]; + if (Target.GetComponent(extType) == null) + Undo.AddComponent(Target.gameObject, extType); + } + ExcludeProperty("Extensions"); + } + } + + protected void DrawCameraStatusInInspector() + { + // Is the camera navel-gazing? + CameraState state = Target.State; + if (state.HasLookAt && (state.ReferenceLookAt - state.CorrectedPosition).AlmostZero()) + EditorGUILayout.HelpBox( + "The camera is positioned on the same point at which it is trying to look.", + MessageType.Warning); + + // Active status and Solo button + Rect rect = EditorGUILayout.GetControlRect(true); + Rect rectLabel = new Rect(rect.x, rect.y, EditorGUIUtility.labelWidth, rect.height); + rect.width -= rectLabel.width; + rect.x += rectLabel.width; + + Color color = GUI.color; + bool isSolo = (CinemachineBrain.SoloCamera == (ICinemachineCamera)Target); + if (isSolo) + GUI.color = CinemachineBrain.GetSoloGUIColor(); + + bool isLive = CinemachineCore.Instance.IsLive(Target); + GUI.enabled = isLive; + GUI.Label(rectLabel, isLive ? "Status: Live" + : (Target.isActiveAndEnabled ? "Status: Standby" : "Status: Disabled")); + GUI.enabled = true; + + float labelWidth = 0; + GUIContent updateText = GUIContent.none; + CinemachineCore.UpdateFilter updateMode = CinemachineCore.Instance.GetVcamUpdateStatus(Target); + if (Application.isPlaying) + { + updateText = new GUIContent( + updateMode < CinemachineCore.UpdateFilter.Late ? " Fixed Update" : " Late Update"); + var textDimensions = GUI.skin.label.CalcSize(updateText); + labelWidth = textDimensions.x; + } + rect.width -= labelWidth; + if (GUI.Button(rect, "Solo", "Button")) + { + isSolo = !isSolo; + CinemachineBrain.SoloCamera = isSolo ? Target : null; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + GUI.color = color; + if (isSolo) + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + + if (labelWidth > 0) + { + GUI.enabled = false; + rect.x += rect.width; rect.width = labelWidth; + GUI.Label(rect, updateText); + GUI.enabled = true; + } + } + + protected void DrawGlobalControlsInInspector() + { + CinemachineSettings.CinemachineCoreSettings.ShowInGameGuides + = EditorGUILayout.Toggle( + new GUIContent( + "Game Window Guides", + "Enable the display of overlays in the Game window. You can adjust colours and opacity in Edit/Preferences/Cinemachine."), + CinemachineSettings.CinemachineCoreSettings.ShowInGameGuides); + + SaveDuringPlay.SaveDuringPlay.Enabled + = EditorGUILayout.Toggle( + new GUIContent( + "Save During Play", + "If checked, Virtual Camera settings changes made during Play Mode will be propagated back to the scene when Play Mode is exited."), + SaveDuringPlay.SaveDuringPlay.Enabled); + + if (Application.isPlaying && SaveDuringPlay.SaveDuringPlay.Enabled) + EditorGUILayout.HelpBox( + " Virtual Camera settings changes made during Play Mode will be propagated back to the scene when Play Mode is exited.", + MessageType.Info); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs.meta new file mode 100644 index 0000000..b7912b7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 211d719bb25901043833928f50e9d0ea +timeCreated: 1506603196 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs new file mode 100644 index 0000000..b9f6385 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs @@ -0,0 +1,432 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; +using Cinemachine.Utility; +using System.Reflection; + +namespace Cinemachine.Editor +{ + [CustomEditor(typeof(CinemachineVirtualCamera))] + internal class CinemachineVirtualCameraEditor + : CinemachineVirtualCameraBaseEditor + { + // Static state and caches - Call UpdateStaticData() to refresh this + struct StageData + { + string ExpandedKey { get { return "CNMCN_Core_Vcam_Expanded_" + Name; } } + public bool IsExpanded + { + get { return EditorPrefs.GetBool(ExpandedKey, false); } + set { EditorPrefs.SetBool(ExpandedKey, value); } + } + public string Name; + public Type[] types; // first entry is null + public GUIContent[] PopupOptions; + } + static StageData[] sStageData = null; + + // Instance data - call UpdateInstanceData() to refresh this + int[] m_stageState = null; + bool[] m_stageError = null; + CinemachineComponentBase[] m_components; + UnityEditor.Editor[] m_componentEditors; + + protected override void OnEnable() + { + // Build static menu arrays via reflection + base.OnEnable(); + UpdateStaticData(); + } + + protected override void OnDisable() + { + base.OnDisable(); + // Must destroy editors or we get exceptions + if (m_componentEditors != null) + foreach (UnityEditor.Editor e in m_componentEditors) + if (e != null) + UnityEngine.Object.DestroyImmediate(e); + } + + Vector3 mPreviousPosition; + private void OnSceneGUI() + { + if (!Target.UserIsDragging) + mPreviousPosition = Target.transform.position; + if (Selection.Contains(Target.gameObject) && Tools.current == Tool.Move + && Event.current.type == EventType.MouseDrag) + { + // User might be dragging our position handle + Target.UserIsDragging = true; + Vector3 delta = Target.transform.position - mPreviousPosition; + if (!delta.AlmostZero()) + { + Undo.RegisterFullObjectHierarchyUndo(Target.gameObject, "Camera drag"); + Target.OnPositionDragged(delta); + mPreviousPosition = Target.transform.position; + } + } + else if (GUIUtility.hotControl == 0 && Target.UserIsDragging) + { + // We're not dragging anything now, but we were + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + Target.UserIsDragging = false; + } + } + + public override void OnInspectorGUI() + { + BeginInspector(); + DrawHeaderInInspector(); + DrawPropertyInInspector(FindProperty(x => x.m_Priority)); + DrawTargetsInInspector(FindProperty(x => x.m_Follow), FindProperty(x => x.m_LookAt)); + DrawRemainingPropertiesInInspector(); + DrawPipelineInInspector(); + DrawExtensionsWidgetInInspector(); + } + + protected void DrawPipelineInInspector() + { + UpdateInstanceData(); + foreach (CinemachineCore.Stage stage in Enum.GetValues(typeof(CinemachineCore.Stage))) + { + int index = (int)stage; + + // Skip pipeline stages that have no implementations + if (sStageData[index].PopupOptions.Length <= 1) + continue; + + const float indentOffset = 6; + + GUIStyle stageBoxStyle = GUI.skin.box; + EditorGUILayout.BeginVertical(stageBoxStyle); + Rect rect = EditorGUILayout.GetControlRect(true); + + // Don't use PrefixLabel() because it will link the enabled status of field and label + GUIContent label = new GUIContent(NicifyName(stage.ToString())); + if (m_stageError[index]) + label.image = EditorGUIUtility.IconContent("console.warnicon.sml").image; + float labelWidth = EditorGUIUtility.labelWidth - (indentOffset + EditorGUI.indentLevel * 15); + Rect r = rect; r.width = labelWidth; + EditorGUI.LabelField(r, label); + r = rect; r.width -= labelWidth; r.x += labelWidth; + GUI.enabled = !StageIsLocked(stage); + int newSelection = EditorGUI.Popup(r, m_stageState[index], sStageData[index].PopupOptions); + GUI.enabled = true; + + Type type = sStageData[index].types[newSelection]; + if (newSelection != m_stageState[index]) + { + SetPipelineStage(stage, type); + if (newSelection != 0) + sStageData[index].IsExpanded = true; + UpdateInstanceData(); // because we changed it + return; + } + if (type != null) + { + Rect stageRect = new Rect( + rect.x - indentOffset, rect.y, rect.width + indentOffset, rect.height); + sStageData[index].IsExpanded = EditorGUI.Foldout( + stageRect, sStageData[index].IsExpanded, GUIContent.none); + if (sStageData[index].IsExpanded) + { + // Make the editor for that stage + UnityEditor.Editor e = GetEditorForPipelineStage(stage); + if (e != null) + { + ++EditorGUI.indentLevel; + EditorGUILayout.Separator(); + e.OnInspectorGUI(); + EditorGUILayout.Separator(); + --EditorGUI.indentLevel; + } + } + } + EditorGUILayout.EndVertical(); + } + } + + bool StageIsLocked(CinemachineCore.Stage stage) + { + CinemachineCore.Stage[] locked = Target.m_LockStageInInspector; + if (locked != null) + for (int i = 0; i < locked.Length; ++i) + if (locked[i] == stage) + return true; + return false; + } + + UnityEditor.Editor GetEditorForPipelineStage(CinemachineCore.Stage stage) + { + foreach (UnityEditor.Editor e in m_componentEditors) + { + if (e != null) + { + CinemachineComponentBase c = e.target as CinemachineComponentBase; + if (c != null && c.Stage == stage) + return e; + } + } + return null; + } + + /// + /// Register with CinemachineVirtualCamera to create the pipeline in an undo-friendly manner + /// + [InitializeOnLoad] + class CreatePipelineWithUndo + { + static CreatePipelineWithUndo() + { + CinemachineVirtualCamera.CreatePipelineOverride = + (CinemachineVirtualCamera vcam, string name, CinemachineComponentBase[] copyFrom) => + { + // Create a new pipeline + GameObject go = new GameObject(name); + Undo.RegisterCreatedObjectUndo(go, "created pipeline"); + Undo.SetTransformParent(go.transform, vcam.transform, "parenting pipeline"); + Undo.AddComponent(go); + + // If copying, transfer the components + if (copyFrom != null) + { + foreach (Component c in copyFrom) + { + Component copy = Undo.AddComponent(go, c.GetType()); + Undo.RecordObject(copy, "copying pipeline"); + ReflectionHelpers.CopyFields(c, copy); + } + } + return go.transform; + }; + CinemachineVirtualCamera.DestroyPipelineOverride = (GameObject pipeline) => + { + Undo.DestroyObjectImmediate(pipeline); + }; + } + } + + void SetPipelineStage(CinemachineCore.Stage stage, Type type) + { + Undo.SetCurrentGroupName("Cinemachine pipeline change"); + + // Get the existing components + Transform owner = Target.GetComponentOwner(); + + CinemachineComponentBase[] components = owner.GetComponents(); + if (components == null) + components = new CinemachineComponentBase[0]; + + // Find an appropriate insertion point + int numComponents = components.Length; + int insertPoint = 0; + for (insertPoint = 0; insertPoint < numComponents; ++insertPoint) + if (components[insertPoint].Stage >= stage) + break; + + // Remove the existing components at that stage + for (int i = numComponents - 1; i >= 0; --i) + { + if (components[i].Stage == stage) + { + Undo.DestroyObjectImmediate(components[i]); + components[i] = null; + --numComponents; + if (i < insertPoint) + --insertPoint; + } + } + + // Add the new stage + if (type != null) + { + MonoBehaviour b = Undo.AddComponent(owner.gameObject, type) as MonoBehaviour; + while (numComponents-- > insertPoint) + UnityEditorInternal.ComponentUtility.MoveComponentDown(b); + } + } + + // This code dynamically discovers eligible classes and builds the menu + // data for the various component pipeline stages. + void UpdateStaticData() + { + if (sStageData != null) + return; + sStageData = new StageData[Enum.GetValues(typeof(CinemachineCore.Stage)).Length]; + + var stageTypes = new List[Enum.GetValues(typeof(CinemachineCore.Stage)).Length]; + for (int i = 0; i < stageTypes.Length; ++i) + { + sStageData[i].Name = ((CinemachineCore.Stage)i).ToString(); + stageTypes[i] = new List(); + } + + // Get all ICinemachineComponents + var allTypes + = ReflectionHelpers.GetTypesInAllLoadedAssemblies( + (Type t) => t.IsSubclassOf(typeof(CinemachineComponentBase))); + + // Create a temp game object so we can instance behaviours + GameObject go = new GameObject("Cinemachine Temp Object"); + go.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor; + foreach (Type t in allTypes) + { + MonoBehaviour b = go.AddComponent(t) as MonoBehaviour; + CinemachineComponentBase c = b != null ? (CinemachineComponentBase)b : null; + if (c != null) + { + CinemachineCore.Stage stage = c.Stage; + stageTypes[(int)stage].Add(t); + } + } + GameObject.DestroyImmediate(go); + + // Create the static lists + for (int i = 0; i < stageTypes.Length; ++i) + { + stageTypes[i].Insert(0, null); // first item is "none" + sStageData[i].types = stageTypes[i].ToArray(); + GUIContent[] names = new GUIContent[sStageData[i].types.Length]; + for (int n = 0; n < names.Length; ++n) + { + if (n == 0) + { + bool useSimple + = (i == (int)CinemachineCore.Stage.Aim) + || (i == (int)CinemachineCore.Stage.Body); + names[n] = new GUIContent((useSimple) ? "Do nothing" : "none"); + } + else + names[n] = new GUIContent(NicifyName(sStageData[i].types[n].Name)); + } + sStageData[i].PopupOptions = names; + } + } + + string NicifyName(string name) + { + if (name.StartsWith("Cinemachine")) + name = name.Substring(11); // Trim the prefix + return ObjectNames.NicifyVariableName(name); + } + + void UpdateInstanceData() + { + // Invalidate the target's cache - this is to support Undo + Target.InvalidateComponentPipeline(); + UpdateComponentEditors(); + UpdateStageState(m_components); + } + + // This code dynamically builds editors for the pipeline components. + // Expansion state is cached statically to preserve foldout state. + void UpdateComponentEditors() + { + CinemachineComponentBase[] components = Target.GetComponentPipeline(); + int numComponents = components != null ? components.Length : 0; + if (m_components == null || m_components.Length != numComponents) + m_components = new CinemachineComponentBase[numComponents]; + bool dirty = (numComponents == 0); + for (int i = 0; i < numComponents; ++i) + { + if (components[i] != m_components[i]) + { + dirty = true; + m_components[i] = components[i]; + } + } + if (dirty) + { + // Destroy the subeditors + if (m_componentEditors != null) + foreach (UnityEditor.Editor e in m_componentEditors) + if (e != null) + UnityEngine.Object.DestroyImmediate(e); + + // Create new editors + m_componentEditors = new UnityEditor.Editor[numComponents]; + for (int i = 0; i < numComponents; ++i) + { + MonoBehaviour b = components[i] as MonoBehaviour; + if (b != null) + CreateCachedEditor(b, null, ref m_componentEditors[i]); + } + } + } + + void UpdateStageState(CinemachineComponentBase[] components) + { + m_stageState = new int[Enum.GetValues(typeof(CinemachineCore.Stage)).Length]; + m_stageError = new bool[Enum.GetValues(typeof(CinemachineCore.Stage)).Length]; + foreach (var c in components) + { + CinemachineCore.Stage stage = c.Stage; + int index = 0; + for (index = sStageData[(int)stage].types.Length - 1; index > 0; --index) + if (sStageData[(int)stage].types[index] == c.GetType()) + break; + m_stageState[(int)stage] = index; + m_stageError[(int)stage] = !c.IsValid; + } + } + + // Because the cinemachine components are attached to hidden objects, their + // gizmos don't get drawn by default. We have to do it explicitly. + [InitializeOnLoad] + static class CollectGizmoDrawers + { + static CollectGizmoDrawers() + { + m_GizmoDrawers = new Dictionary(); + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); + foreach (Assembly assembly in assemblies) + { + foreach (var type in assembly.GetTypes()) + { + try + { + bool added = false; + foreach (var method in type.GetMethods( + BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)) + { + if (added) + break; + if (!method.IsStatic) + continue; + var attributes = method.GetCustomAttributes(typeof(DrawGizmo), true) as DrawGizmo[]; + foreach (var a in attributes) + { + if (typeof(CinemachineComponentBase).IsAssignableFrom(a.drawnType)) + { + m_GizmoDrawers.Add(a.drawnType, method); + added = true; + break; + } + } + } + } + catch (System.Exception) + { + // screw it + } + } + } + } + public static Dictionary m_GizmoDrawers; + } + + [DrawGizmo(GizmoType.Active | GizmoType.InSelectionHierarchy, typeof(CinemachineVirtualCamera))] + internal static void DrawVirtualCameraGizmos(CinemachineVirtualCamera vcam, GizmoType selectionType) + { + var pipeline = vcam.GetComponentPipeline(); + foreach (var c in pipeline) + { + MethodInfo method; + if (CollectGizmoDrawers.m_GizmoDrawers.TryGetValue(c.GetType(), out method)) + method.Invoke(null, new object[] { c, selectionType }); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs.meta new file mode 100644 index 0000000..397e74c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Editors/CinemachineVirtualCameraEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a63f9f2267c36684e855add13ad5499f +timeCreated: 1483391371 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Menus.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Menus.meta new file mode 100644 index 0000000..18cb970 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Menus.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d093acf2bada69e4bbbcf0a8b4534919 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs new file mode 100644 index 0000000..b44faa8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs @@ -0,0 +1,248 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.IO; + +namespace Cinemachine.Editor +{ + public static class CinemachineMenu + { + public const string kCinemachineRootMenu = "Assets/Create/Cinemachine/"; + [MenuItem(kCinemachineRootMenu + "Blender/Settings")] + private static void CreateBlenderSettingAsset() + { + ScriptableObjectUtility.Create(); + } + + [MenuItem(kCinemachineRootMenu + "Noise/Settings")] + private static void CreateNoiseSettingAsset() + { + ScriptableObjectUtility.Create(); + } + + [MenuItem("Cinemachine/Create Virtual Camera", false, 1)] + public static CinemachineVirtualCamera CreateVirtualCamera() + { + return InternalCreateVirtualCamera( + "CM vcam", true, typeof(CinemachineComposer), typeof(CinemachineTransposer)); + } + + [MenuItem("Cinemachine/Create FreeLook Camera", false, 1)] + private static void CreateFreeLookCamera() + { + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineFreeLook), "CM FreeLook")); + Undo.RegisterCreatedObjectUndo(go, "create FreeLook"); + Undo.AddComponent(go); + Selection.activeGameObject = go; + } + + [MenuItem("Cinemachine/Create Blend List Camera", false, 1)] + private static void CreateBlendListCamera() + { + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineBlendListCamera), "CM BlendListCamera")); + Undo.RegisterCreatedObjectUndo(go, "create Blend List camera"); + var vcam = Undo.AddComponent(go); + Selection.activeGameObject = go; + + // Give it a couple of children + var child1 = CreateDefaultVirtualCamera(); + Undo.SetTransformParent(child1.transform, go.transform, "create BlendListCam child"); + var child2 = CreateDefaultVirtualCamera(); + child2.m_Lens.FieldOfView = 10; + Undo.SetTransformParent(child2.transform, go.transform, "create BlendListCam child"); + + // Set up initial instruction set + vcam.m_Instructions = new CinemachineBlendListCamera.Instruction[2]; + vcam.m_Instructions[0].m_VirtualCamera = child1; + vcam.m_Instructions[0].m_Hold = 1f; + vcam.m_Instructions[1].m_VirtualCamera = child2; + vcam.m_Instructions[1].m_Blend.m_Style = CinemachineBlendDefinition.Style.EaseInOut; + vcam.m_Instructions[1].m_Blend.m_Time = 2f; + } + + [MenuItem("Cinemachine/Create State-Driven Camera", false, 1)] + private static void CreateStateDivenCamera() + { + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineStateDrivenCamera), "CM StateDrivenCamera")); + Undo.RegisterCreatedObjectUndo(go, "create state driven camera"); + Undo.AddComponent(go); + Selection.activeGameObject = go; + + // Give it a child + Undo.SetTransformParent(CreateDefaultVirtualCamera().transform, go.transform, "create state driven camera"); + } + + [MenuItem("Cinemachine/Create ClearShot Camera", false, 1)] + private static void CreateClearShotVirtualCamera() + { + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineClearShot), "CM ClearShot")); + Undo.RegisterCreatedObjectUndo(go, "create ClearShot camera"); + Undo.AddComponent(go); + Selection.activeGameObject = go; + + // Give it a child + var child = CreateDefaultVirtualCamera(); + Undo.SetTransformParent(child.transform, go.transform, "create ClearShot camera"); + var collider = Undo.AddComponent(child.gameObject); + collider.m_AvoidObstacles = false; + Undo.RecordObject(collider, "create ClearShot camera"); + } + + [MenuItem("Cinemachine/Create Dolly Camera with Track", false, 1)] + private static void CreateDollyCameraWithPath() + { + CinemachineVirtualCamera vcam = InternalCreateVirtualCamera( + "CM vcam", true, typeof(CinemachineComposer), typeof(CinemachineTrackedDolly)); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineSmoothPath), "DollyTrack")); + Undo.RegisterCreatedObjectUndo(go, "create track"); + CinemachineSmoothPath path = Undo.AddComponent(go); + var dolly = vcam.GetCinemachineComponent(); + Undo.RecordObject(dolly, "create track"); + dolly.m_Path = path; + } + + [MenuItem("Cinemachine/Create Target Group Camera", false, 1)] + private static void CreateTargetGroupCamera() + { + CinemachineVirtualCamera vcam = InternalCreateVirtualCamera( + "CM vcam", true, typeof(CinemachineGroupComposer), typeof(CinemachineTransposer)); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineTargetGroup), "TargetGroup"), + typeof(CinemachineTargetGroup)); + Undo.RegisterCreatedObjectUndo(go, "create target group"); + vcam.LookAt = go.transform; + vcam.Follow = go.transform; + } + + [MenuItem("Cinemachine/Create Mixing Camera", false, 1)] + private static void CreateMixingCamera() + { + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineMixingCamera), "CM MixingCamera")); + Undo.RegisterCreatedObjectUndo(go, "create MixingCamera camera"); + Undo.AddComponent(go); + Selection.activeGameObject = go; + + // Give it a couple of children + Undo.SetTransformParent(CreateDefaultVirtualCamera().transform, go.transform, "create MixedCamera child"); + Undo.SetTransformParent(CreateDefaultVirtualCamera().transform, go.transform, "create MixingCamera child"); + } + + [MenuItem("Cinemachine/Create 2D Camera", false, 1)] + private static void Create2DCamera() + { + InternalCreateVirtualCamera("CM vcam", true, typeof(CinemachineFramingTransposer)); + } + + [MenuItem("Cinemachine/Create Dolly Track with Cart", false, 1)] + private static void CreateDollyTrackWithCart() + { + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineSmoothPath), "DollyTrack")); + Undo.RegisterCreatedObjectUndo(go, "create track"); + CinemachineSmoothPath path = Undo.AddComponent(go); + Selection.activeGameObject = go; + + go = new GameObject(GenerateUniqueObjectName(typeof(CinemachineDollyCart), "DollyCart")); + Undo.RegisterCreatedObjectUndo(go, "create cart"); + CinemachineDollyCart cart = Undo.AddComponent(go); + Undo.RecordObject(cart, "create track"); + cart.m_Path = path; + } + + [MenuItem("Cinemachine/Import Example Asset Package")] + private static void ImportExamplePackage() + { + string pkgFile = ScriptableObjectUtility.CinemachineInstallPath + + "/CinemachineExamples.unitypackage"; + if (!File.Exists(pkgFile)) + Debug.LogError("Missing file " + pkgFile); + else + AssetDatabase.ImportPackage(pkgFile, true); + } + + /// + /// Create a default Virtual Camera, with standard components + /// + public static CinemachineVirtualCamera CreateDefaultVirtualCamera() + { + return InternalCreateVirtualCamera( + "CM vcam", false, typeof(CinemachineComposer), typeof(CinemachineTransposer)); + } + + /// + /// Create a Virtual Camera, with components + /// + static CinemachineVirtualCamera InternalCreateVirtualCamera( + string name, bool selectIt, params Type[] components) + { + // Create a new virtual camera + CreateCameraBrainIfAbsent(); + GameObject go = new GameObject( + GenerateUniqueObjectName(typeof(CinemachineVirtualCamera), name)); + Undo.RegisterCreatedObjectUndo(go, "create " + name); + CinemachineVirtualCamera vcam = Undo.AddComponent(go); + GameObject componentOwner = vcam.GetComponentOwner().gameObject; + foreach (Type t in components) + Undo.AddComponent(componentOwner, t); + vcam.InvalidateComponentPipeline(); + if (selectIt) + Selection.activeObject = go; + return vcam; + } + + /// + /// If there is no CinemachineBrain in the scene, try to create one on the main camera + /// + public static void CreateCameraBrainIfAbsent() + { + CinemachineBrain[] brains = UnityEngine.Object.FindObjectsOfType( + typeof(CinemachineBrain)) as CinemachineBrain[]; + if (brains == null || brains.Length == 0) + { + Camera cam = Camera.main; + if (cam == null) + { + Camera[] cams = UnityEngine.Object.FindObjectsOfType( + typeof(Camera)) as Camera[]; + if (cams != null && cams.Length > 0) + cam = cams[0]; + } + if (cam != null) + { + Undo.AddComponent(cam.gameObject); + } + } + } + + /// + /// Generate a unique name with the given prefix by adding a suffix to it + /// + public static string GenerateUniqueObjectName(Type type, string prefix) + { + int count = 0; + UnityEngine.Object[] all = Resources.FindObjectsOfTypeAll(type); + foreach (UnityEngine.Object o in all) + { + if (o != null && o.name.StartsWith(prefix)) + { + string suffix = o.name.Substring(prefix.Length); + int i; + if (Int32.TryParse(suffix, out i) && i > count) + count = i; + } + } + return prefix + (count + 1); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs.meta new file mode 100644 index 0000000..c0ad6a7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Menus/CinemachineMenu.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 54b24e51e2a9fa242b38d80ee11f3b2d +timeCreated: 1481654955 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers.meta new file mode 100644 index 0000000..52ced09 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 31c3ab7d86d07034eb528155d40c016b +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs new file mode 100644 index 0000000..17ac49d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs @@ -0,0 +1,38 @@ +using UnityEngine; +using UnityEditor; + +namespace Cinemachine.Editor +{ + [CustomPropertyDrawer(typeof(CinemachineBlendDefinitionPropertyAttribute))] + public sealed class CinemachineBlendDefinitionPropertyDrawer : PropertyDrawer + { + CinemachineBlendDefinition myClass = new CinemachineBlendDefinition(); // to access name strings + public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) + { + float vSpace = 0; + float floatFieldWidth = EditorGUIUtility.singleLineHeight * 2.5f; + + SerializedProperty timeProp = property.FindPropertyRelative(() => myClass.m_Time); + GUIContent timeText = new GUIContent(" sec ", timeProp.tooltip); + var textDimensions = GUI.skin.label.CalcSize(timeText); + + rect = EditorGUI.PrefixLabel(rect, label); + + rect.y += vSpace; rect.height = EditorGUIUtility.singleLineHeight; + rect.width -= floatFieldWidth + textDimensions.x; + + SerializedProperty styleProp = property.FindPropertyRelative(() => myClass.m_Style); + EditorGUI.PropertyField(rect, styleProp, GUIContent.none); + + if (styleProp.intValue != (int)CinemachineBlendDefinition.Style.Cut) + { + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = textDimensions.x; + rect.x += rect.width; rect.width = floatFieldWidth + EditorGUIUtility.labelWidth; + EditorGUI.PropertyField(rect, timeProp, timeText); + timeProp.floatValue = Mathf.Max(timeProp.floatValue, 0); + EditorGUIUtility.labelWidth = oldWidth; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs.meta new file mode 100644 index 0000000..6a00445 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineBlendDefinitionPropertyDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4a9c464b0191f7d4da1d129d97d8240b +timeCreated: 1486510400 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs new file mode 100644 index 0000000..5fba835 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs @@ -0,0 +1,28 @@ +using UnityEngine; +using UnityEditor; + +namespace Cinemachine.Editor +{ + [CustomPropertyDrawer(typeof(TagFieldAttribute))] + public sealed class CinemachineTagFieldPropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) + { + const float hSpace = 2; + GUIContent clearText = new GUIContent("Clear", "Set the tag to empty"); + var textDimensions = GUI.skin.button.CalcSize(clearText); + + rect.width -= textDimensions.x + hSpace; + string oldValue = property.stringValue; + string newValue = EditorGUI.TagField(rect, label, oldValue); + + rect.x += rect.width; rect.width = textDimensions.x; + GUI.enabled = oldValue.Length > 0; + if (GUI.Button(rect, clearText)) + newValue = string.Empty; + GUI.enabled = true; + if (oldValue != newValue) + property.stringValue = newValue; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs.meta new file mode 100644 index 0000000..b2a73ab --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/CinemachineTagFieldPropertyDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ed3efd28525441947b55ec9b5d68ba31 +timeCreated: 1510677929 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs new file mode 100644 index 0000000..8893a81 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs @@ -0,0 +1 @@ +// This file is intentionally blank. \ No newline at end of file diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs.meta new file mode 100644 index 0000000..420a003 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/GetSetDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e54b95371574a3144b851b0ca93ceb39 +timeCreated: 1493651850 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs new file mode 100644 index 0000000..d1a5165 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs @@ -0,0 +1,61 @@ +using UnityEngine; +using UnityEditor; +using System.Reflection; + +namespace Cinemachine.Editor +{ + [CustomPropertyDrawer(typeof(LensSettingsPropertyAttribute))] + public sealed class LensSettingsPropertyDrawer : PropertyDrawer + { + const int vSpace = 2; + bool mExpanded = true; + LensSettings def = new LensSettings(); // to access name strings + + public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) + { + float height = EditorGUIUtility.singleLineHeight; + rect.height = height; + mExpanded = EditorGUI.Foldout(rect, mExpanded, label); + if (mExpanded) + { + bool ortho = false; + PropertyInfo pi = typeof(LensSettings).GetProperty( + "Orthographic", BindingFlags.NonPublic | BindingFlags.Instance); + if (pi != null) + ortho = bool.Equals(true, pi.GetValue(GetPropertyValue(property), null)); + + ++EditorGUI.indentLevel; + rect.y += height + vSpace; + if (ortho) + EditorGUI.PropertyField(rect, property.FindPropertyRelative(() => def.OrthographicSize)); + else + EditorGUI.PropertyField(rect, property.FindPropertyRelative(() => def.FieldOfView)); + rect.y += height + vSpace; + EditorGUI.PropertyField(rect, property.FindPropertyRelative(() => def.NearClipPlane)); + rect.y += height + vSpace; + EditorGUI.PropertyField(rect, property.FindPropertyRelative(() => def.FarClipPlane)); + rect.y += height + vSpace; + EditorGUI.PropertyField(rect, property.FindPropertyRelative(() => def.Dutch)); + --EditorGUI.indentLevel; + } + } + + object GetPropertyValue(SerializedProperty property) + { + var targetObject = property.serializedObject.targetObject; + var targetObjectClassType = targetObject.GetType(); + var field = targetObjectClassType.GetField(property.propertyPath); + if (field != null) + return field.GetValue(targetObject); + return null; + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + float height = EditorGUIUtility.singleLineHeight + vSpace; + if (mExpanded) + height *= 5; + return height; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs.meta new file mode 100644 index 0000000..b57c746 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2449eb616c871d044adce04ac98030a6 +timeCreated: 1496951835 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs new file mode 100644 index 0000000..8893a81 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs @@ -0,0 +1 @@ +// This file is intentionally blank. \ No newline at end of file diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs.meta new file mode 100644 index 0000000..d7747bd --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/PropertyDrawers/MinDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9d5b46a4a3526d14080bfc4bb247664c +timeCreated: 1493651850 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Resources.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Resources.meta new file mode 100644 index 0000000..064aa28 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 99ab3e8b62cb69145b760fc81e2d18d6 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif new file mode 100644 index 0000000..30b5272 Binary files /dev/null and b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif differ diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif.meta new file mode 100644 index 0000000..bedafe7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/Cinemachine_header.tif.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: 372fe04232d5ed94d8d71524616c1543 +timeCreated: 1503608963 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png new file mode 100644 index 0000000..47f1903 Binary files /dev/null and b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png differ diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png.meta new file mode 100644 index 0000000..54084a6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Resources/cm_logo_sm.png.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: 5f2a108eb023faf43a809979fd3d38f2 +timeCreated: 1481660562 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 1 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility.meta new file mode 100644 index 0000000..ed020a8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 29d58ccb958d24942bf23fafcec87c0b +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs new file mode 100644 index 0000000..88d37ff --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs @@ -0,0 +1,79 @@ +using UnityEditor; +using System; +using System.Collections.Generic; +using Cinemachine.Utility; +using System.Linq.Expressions; + +namespace Cinemachine.Editor +{ + public class BaseEditor : UnityEditor.Editor where T : class + { + protected T Target { get { return target as T; } } + + protected SerializedProperty FindAndExcludeProperty(Expression> expr) + { + SerializedProperty p = FindProperty(expr); + ExcludeProperty(p.name); + return p; + } + + protected SerializedProperty FindProperty(Expression> expr) + { + return serializedObject.FindProperty(FieldPath(expr)); + } + + protected string FieldPath(Expression> expr) + { + return ReflectionHelpers.GetFieldPath(expr); + } + + protected virtual List GetExcludedPropertiesInInspector() + { + var excluded = new List() { "m_Script" }; + if (mAdditionalExcluded != null) + excluded.AddRange(mAdditionalExcluded); + return excluded; + } + + List mAdditionalExcluded; + protected void ExcludeProperty(string propertyName) + { + if (mAdditionalExcluded == null) + mAdditionalExcluded = new List(); + mAdditionalExcluded.Add(propertyName); + } + + public override void OnInspectorGUI() + { + BeginInspector(); + DrawRemainingPropertiesInInspector(); + } + + protected virtual void BeginInspector() + { + mAdditionalExcluded = null; + serializedObject.Update(); + } + + protected virtual void DrawPropertyInInspector(SerializedProperty p) + { + List excluded = GetExcludedPropertiesInInspector(); + if (!excluded.Contains(p.name)) + { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(p); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + ExcludeProperty(p.name); + } + } + + protected void DrawRemainingPropertiesInInspector() + { + EditorGUI.BeginChangeCheck(); + DrawPropertiesExcluding(serializedObject, GetExcludedPropertiesInInspector().ToArray()); + if (EditorGUI.EndChangeCheck()) + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs.meta new file mode 100644 index 0000000..2878dd7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/BaseEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 15ef94834d9e4aa44ac8fe619843346b +timeCreated: 1506620939 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs new file mode 100644 index 0000000..ee99023 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs @@ -0,0 +1,177 @@ +using UnityEngine; +using UnityEditor; +using System; + +namespace Cinemachine.Editor +{ + /// + /// Helper for drawing embedded asset editors + /// + public class EmbeddeAssetEditor where T : ScriptableObject + { + /// + /// Create in OnEnable() + /// + public EmbeddeAssetEditor(string propertyName, UnityEditor.Editor owner) + { + m_PropertyName = propertyName; + m_Owner = owner; + m_DoVersionControlChecks = UnityEditor.VersionControl.Provider.isActive; + m_CreateButtonGUIContent = new GUIContent( + "Create Asset", "Create a new shared settings asset"); + } + + /// + /// Called after the asset editor is created, in case it needs + /// to be customized + /// + public OnCreateEditorDelegate OnCreateEditor; + public delegate void OnCreateEditorDelegate(UnityEditor.Editor editor); + + /// + /// Called when the asset being edited was changed by the user. + /// + public OnChangedDelegate OnChanged; + public delegate void OnChangedDelegate(T obj); + + /// + /// Free the resources in OnDisable() + /// + public void OnDisable() + { + DestroyEditor(); + m_Owner = null; + } + + /// + /// Customize this after creation if you want + /// + public GUIContent m_CreateButtonGUIContent; + + private string m_PropertyName; + private UnityEditor.Editor m_Editor = null; + private UnityEditor.Editor m_Owner = null; + private bool m_DoVersionControlChecks = false; + + const int kIndentOffset = 6; + + /// + /// Call this from OnInspectorGUI. Will draw the asset reference field, and + /// the embedded editor, or a Create Asset button, if no asset is set. + /// + public void DrawEditorCombo( + string title, string defaultName, string extension, string message, + string showLabel, bool indent) + { + SerializedProperty property = m_Owner.serializedObject.FindProperty(m_PropertyName); + if (m_Editor == null) + UpdateEditor(); + if (m_Editor == null) + AssetFieldWithCreateButton(property, title, defaultName, extension, message); + else + { + EditorGUILayout.BeginVertical(GUI.skin.box); + Rect rect = EditorGUILayout.GetControlRect(true); + rect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.BeginChangeCheck(); + EditorGUI.PropertyField(rect, property); + if (EditorGUI.EndChangeCheck()) + { + m_Owner.serializedObject.ApplyModifiedProperties(); + UpdateEditor(); + } + if (m_Editor != null) + { + Rect foldoutRect = new Rect( + rect.x - kIndentOffset, rect.y, rect.width + kIndentOffset, rect.height); + property.isExpanded = EditorGUI.Foldout( + foldoutRect, property.isExpanded, GUIContent.none); + + UnityEditor.VersionControl.Asset targetAsset + = UnityEditor.VersionControl.Provider.GetAssetByPath( + AssetDatabase.GetAssetPath(m_Editor.target)); + bool isLockedFile = m_DoVersionControlChecks + && !targetAsset.IsOneOfStates(new[] { + UnityEditor.VersionControl.Asset.States.CheckedOutLocal, + UnityEditor.VersionControl.Asset.States.AddedLocal, + }); + + GUI.enabled = !isLockedFile; + if (property.isExpanded) + { + EditorGUILayout.Separator(); + EditorGUILayout.HelpBox( + "This is a shared asset. Changes made here will apply to all users of this asset.", + MessageType.Info); + EditorGUI.BeginChangeCheck(); + if (indent) + ++EditorGUI.indentLevel; + m_Editor.OnInspectorGUI(); + if (indent) + --EditorGUI.indentLevel; + if (EditorGUI.EndChangeCheck() && (OnChanged != null)) + OnChanged(property.objectReferenceValue as T); + } + GUI.enabled = true; + if (isLockedFile && GUILayout.Button("Check out")) + { + UnityEditor.VersionControl.Provider.Checkout( + targetAsset, UnityEditor.VersionControl.CheckoutMode.Both); + } + } + EditorGUILayout.EndVertical(); + } + } + + private void AssetFieldWithCreateButton( + SerializedProperty property, + string title, string defaultName, string extension, string message) + { + EditorGUI.BeginChangeCheck(); + + float hSpace = 5; + float buttonWidth = GUI.skin.button.CalcSize(m_CreateButtonGUIContent).x; + Rect r = EditorGUILayout.GetControlRect(true); + r.width -= buttonWidth + hSpace; + EditorGUI.PropertyField(r, property); + r.x += r.width + hSpace; r.width = buttonWidth; + if (GUI.Button(r, m_CreateButtonGUIContent)) + { + string newAssetPath = EditorUtility.SaveFilePanelInProject( + title, defaultName, extension, message); + if (!string.IsNullOrEmpty(newAssetPath)) + { + T asset = ScriptableObjectUtility.CreateAt(newAssetPath); + property.objectReferenceValue = asset; + m_Owner.serializedObject.ApplyModifiedProperties(); + } + } + if (EditorGUI.EndChangeCheck()) + { + m_Owner.serializedObject.ApplyModifiedProperties(); + UpdateEditor(); + } + } + + public void DestroyEditor() + { + if (m_Editor != null) + { + UnityEngine.Object.DestroyImmediate(m_Editor); + m_Editor = null; + } + } + + public void UpdateEditor() + { + DestroyEditor(); + SerializedProperty property = m_Owner.serializedObject.FindProperty(m_PropertyName); + if (property.objectReferenceValue != null) + { + m_Editor = UnityEditor.Editor.CreateEditor(property.objectReferenceValue); + if (OnCreateEditor != null) + OnCreateEditor(m_Editor); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs.meta new file mode 100644 index 0000000..646623c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/EmbeddedAssetHelpers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d30409ab90458e5409807c8b0274ac9c +timeCreated: 1484084529 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs new file mode 100644 index 0000000..e298cd7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs @@ -0,0 +1,529 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace SaveDuringPlay +{ + /// A collection of tools for finding objects + public static class ObjectTreeUtil + { + /// + /// Get the full name of an object, travelling up the transform parents to the root. + /// + public static string GetFullName(GameObject current) + { + if (current == null) + return ""; + if (current.transform.parent == null) + return "/" + current.name; + return GetFullName(current.transform.parent.gameObject) + "/" + current.name; + } + + /// + /// Will find the named object, active or inactive, from the full path. + /// + public static GameObject FindObjectFromFullName(string fullName, GameObject[] roots) + { + if (fullName == null || fullName.Length == 0 || roots == null) + return null; + + string[] path = fullName.Split('/'); + if (path.Length < 2) // skip leading '/' + return null; + + Transform root = null; + for (int i = 0; root == null && i < roots.Length; ++i) + if (roots[i].name == path[1]) + root = roots[i].transform; + + if (root == null) + return null; + + for (int i = 2; i < path.Length; ++i) // skip root + { + bool found = false; + for (int c = 0; c < root.childCount; ++c) + { + Transform child = root.GetChild(c); + if (child.name == path[i]) + { + found = true; + root = child; + break; + } + } + if (!found) + return null; + } + return root.gameObject; + } + + /// Finds all the root objects in a scene, active or not + public static GameObject[] FindAllRootObjectsInScene() + { + return UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects(); + } + + + /// + /// This finds all the behaviours in scene, active or inactive, excluding prefabs + /// + public static T[] FindAllBehavioursInScene() where T : MonoBehaviour + { + List objectsInScene = new List(); + foreach (T b in Resources.FindObjectsOfTypeAll()) + { + GameObject go = b.gameObject; + if (go.hideFlags == HideFlags.NotEditable || go.hideFlags == HideFlags.HideAndDontSave) + continue; + if (EditorUtility.IsPersistent(go.transform.root.gameObject)) + continue; + objectsInScene.Add(b); + } + return objectsInScene.ToArray(); + } + } + + class GameObjectFieldScanner + { + /// + /// Called for each leaf field. Return value should be true if action was taken. + /// It will be propagated back to the caller. + /// + public OnLeafFieldDelegate OnLeafField; + public delegate bool OnLeafFieldDelegate(string fullName, Type type, ref object value); + + /// + /// Called for each field node, if and only if OnLeafField() for it or one + /// of its leaves returned true. + /// + public OnFieldValueChangedDelegate OnFieldValueChanged; + public delegate bool OnFieldValueChangedDelegate( + string fullName, FieldInfo fieldInfo, object fieldOwner, object value); + + /// + /// Called for each field, to test whether to proceed with scanning it. Return true to scan. + /// + public FilterFieldDelegate FilterField; + public delegate bool FilterFieldDelegate(string fullName, FieldInfo fieldInfo); + + /// + /// Which fields will be scanned + /// + public BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance; + + bool ScanFields(string fullName, Type type, ref object obj) + { + bool doneSomething = false; + + // Check if it's a complex type + bool isLeaf = true; + if (obj != null + && !type.IsSubclassOf(typeof(Component)) + && !type.IsSubclassOf(typeof(GameObject))) + { + // Is it an array? + if (type.IsArray) + { + isLeaf = false; + Array array = obj as Array; + object arrayLength = array.Length; + if (OnLeafField != null && OnLeafField( + fullName + ".Length", arrayLength.GetType(), ref arrayLength)) + { + Array newArray = Array.CreateInstance( + array.GetType().GetElementType(), Convert.ToInt32(arrayLength)); + Array.Copy(array, 0, newArray, 0, Math.Min(array.Length, newArray.Length)); + array = newArray; + doneSomething = true; + } + for (int i = 0; i < array.Length; ++i) + { + object element = array.GetValue(i); + if (ScanFields(fullName + "[" + i + "]", array.GetType().GetElementType(), ref element)) + { + array.SetValue(element, i); + doneSomething = true; + } + } + if (doneSomething) + obj = array; + } + else + { + // Check if it's a complex type + FieldInfo[] fields = obj.GetType().GetFields(bindingFlags); + if (fields.Length > 0) + { + isLeaf = false; + for (int i = 0; i < fields.Length; ++i) + { + string name = fullName + "." + fields[i].Name; + if (FilterField == null || FilterField(name, fields[i])) + { + object fieldValue = fields[i].GetValue(obj); + if (ScanFields(name, fields[i].FieldType, ref fieldValue)) + { + doneSomething = true; + if (OnFieldValueChanged != null) + OnFieldValueChanged(name, fields[i], obj, fieldValue); + } + } + } + } + } + } + // If it's a leaf field then call the leaf handler + if (isLeaf && OnLeafField != null) + if (OnLeafField(fullName, type, ref obj)) + doneSomething = true; + + return doneSomething; + } + + public bool ScanFields(string fullName, MonoBehaviour b) + { + bool doneSomething = false; + FieldInfo[] fields = b.GetType().GetFields(bindingFlags); + if (fields.Length > 0) + { + for (int i = 0; i < fields.Length; ++i) + { + string name = fullName + "." + fields[i].Name; + if (FilterField == null || FilterField(name, fields[i])) + { + object fieldValue = fields[i].GetValue(b); + if (ScanFields(name, fields[i].FieldType, ref fieldValue)) + doneSomething = true; + + // If leaf action was taken, propagate it up to the parent node + if (doneSomething && OnFieldValueChanged != null) + OnFieldValueChanged(fullName, fields[i], b, fieldValue); + } + } + } + return doneSomething; + } + + /// + /// Recursively scan the MonoBehaviours of a GameObject and its children. + /// For each leaf field found, call the OnFieldValue delegate. + /// + public bool ScanFields(GameObject go, string prefix = null) + { + bool doneSomething = false; + if (prefix == null) + prefix = ""; + else if (prefix.Length > 0) + prefix += "."; + + MonoBehaviour[] components = go.GetComponents(); + for (int i = 0; i < components.Length; ++i) + { + MonoBehaviour c = components[i]; + if (c != null && ScanFields(prefix + c.GetType().FullName + i, c)) + doneSomething = true; + } + return doneSomething; + } + }; + + + /// + /// Using reflection, this class scans a GameObject (and optionally its children) + /// and records all the field settings. This only works for "nice" field settings + /// within MonoBehaviours. Changes to the behaviour stack made between saving + /// and restoring will fool this class. + /// + class ObjectStateSaver + { + string mObjectFullPath; + + Dictionary mValues = new Dictionary(); + + /// + /// Recursively collect all the field values in the MonoBehaviours + /// owned by this object and its descendants. The values are stored + /// in an internal dictionary. + /// + public void CollectFieldValues(GameObject go) + { + mObjectFullPath = ObjectTreeUtil.GetFullName(go); + GameObjectFieldScanner scanner = new GameObjectFieldScanner(); + scanner.FilterField = FilterField; + scanner.OnLeafField = (string fullName, Type type, ref object value) => + { + // Save the value in the dictionary + mValues[fullName] = StringFromLeafObject(value); + //Debug.Log(mObjectFullPath + "." + fullName + " = " + mValues[fullName]); + return false; + }; + scanner.ScanFields(go); + } + + public GameObject FindSavedGameObject(GameObject[] roots) + { + return ObjectTreeUtil.FindObjectFromFullName(mObjectFullPath, roots); + } + public string ObjetFullPath { get { return mObjectFullPath; } } + + /// + /// Recursively scan the MonoBehaviours of a GameObject and its children. + /// For each field found, look up its value in the internal dictionary. + /// If it's present and its value in the dictionary differs from the actual + /// value in the game object, Set the GameObject's value using the value + /// recorded in the dictionary. + /// + public bool PutFieldValues(GameObject go, GameObject[] roots) + { + GameObjectFieldScanner scanner = new GameObjectFieldScanner(); + scanner.FilterField = FilterField; + scanner.OnLeafField = (string fullName, Type type, ref object value) => + { + // Lookup the value in the dictionary + string savedValue; + if (mValues.TryGetValue(fullName, out savedValue) + && StringFromLeafObject(value) != savedValue) + { + //Debug.Log(mObjectFullPath + "." + fullName + " = " + mValues[fullName]); + value = LeafObjectFromString(type, mValues[fullName].Trim(), roots); + return true; // changed + } + return false; + }; + scanner.OnFieldValueChanged = (fullName, fieldInfo, fieldOwner, value) => + { + fieldInfo.SetValue(fieldOwner, value); + return true; + }; + return scanner.ScanFields(go); + } + + /// Ignore fields marked with the [NoSaveDuringPlay] attribute + bool FilterField(string fullName, FieldInfo fieldInfo) + { + var attrs = fieldInfo.GetCustomAttributes(false); + foreach (var attr in attrs) + if (attr.GetType().Name.Contains("NoSaveDuringPlay")) + return false; + return true; + } + + /// + /// Parse a string to generate an object. + /// Only very limited primitive object types are supported. + /// Enums, Vectors and most other structures are automatically supported, + /// because the reflection system breaks them down into their primitive components. + /// You can add more support here, as needed. + /// + static object LeafObjectFromString(Type type, string value, GameObject[] roots) + { + if (type == typeof(Single)) + return float.Parse(value); + if (type == typeof(Double)) + return double.Parse(value); + if (type == typeof(Boolean)) + return Boolean.Parse(value); + if (type == typeof(string)) + return value; + if (type == typeof(Int32)) + return Int32.Parse(value); + if (type == typeof(UInt32)) + return UInt32.Parse(value); + if (type.IsSubclassOf(typeof(Component))) + { + // Try to find the named game object + GameObject go = ObjectTreeUtil.FindObjectFromFullName(value, roots); + return (go != null) ? go.GetComponent(type) : null; + } + if (type.IsSubclassOf(typeof(GameObject))) + { + // Try to find the named game object + return GameObject.Find(value); + } + return null; + } + + static string StringFromLeafObject(object obj) + { + if (obj == null) + return string.Empty; + + if (obj.GetType().IsSubclassOf(typeof(Component))) + { + Component c = (Component)obj; + if (c == null) // Component overrides the == operator, so we have to check + return string.Empty; + return ObjectTreeUtil.GetFullName(c.gameObject); + } + if (obj.GetType().IsSubclassOf(typeof(GameObject))) + { + GameObject go = (GameObject)obj; + if (go == null) // GameObject overrides the == operator, so we have to check + return string.Empty; + return ObjectTreeUtil.GetFullName(go); + } + return obj.ToString(); + } + }; + + + /// + /// For all registered object types, record their state when exiting Play Mode, + /// and restore that state to the objects in the scene. This is a very limited + /// implementation which has not been rigorously tested with many objects types. + /// It's quite possible that not everything will be saved. + /// + /// This class is expected to become obsolete when Unity implements this functionality + /// in a more general way. + /// + /// To use this class, + /// drop this script into your project, and add the [SaveDuringPlay] attribute to your class. + /// + /// Note: if you want some specific field in your class NOT to be saved during play, + /// add a property attribute whose class name contains the string "NoSaveDuringPlay" + /// and the field will not be saved. + /// + [InitializeOnLoad] + public class SaveDuringPlay + { + public static string kEnabledKey = "SaveDuringPlay_Enabled"; + public static bool Enabled + { + get { return EditorPrefs.GetBool(kEnabledKey, false); } + set + { + if (value != Enabled) + { + EditorPrefs.SetBool(kEnabledKey, value); + } + } + } + + static SaveDuringPlay() + { + // Install our callbacks +#if UNITY_2017_2_OR_NEWER + EditorApplication.playModeStateChanged += OnPlayStateChanged; +#else + EditorApplication.update += OnEditorUpdate; + EditorApplication.playmodeStateChanged += OnPlayStateChanged; +#endif + } + +#if UNITY_2017_2_OR_NEWER + static void OnPlayStateChanged(PlayModeStateChange pmsc) + { + if (Enabled) + { + // If exiting playmode, collect the state of all interesting objects + if (pmsc == PlayModeStateChange.ExitingPlayMode) + SaveAllInterestingStates(); + else if (pmsc == PlayModeStateChange.EnteredEditMode && sSavedStates != null) + RestoreAllInterestingStates(); + } + } +#else + static void OnPlayStateChanged() + { + // If exiting playmode, collect the state of all interesting objects + if (Enabled) + { + if (!EditorApplication.isPlayingOrWillChangePlaymode && EditorApplication.isPlaying) + SaveAllInterestingStates(); + } + } + + static float sWaitStartTime = 0; + static void OnEditorUpdate() + { + if (Enabled && sSavedStates != null && !Application.isPlaying) + { + // Wait a bit for things to settle before applying the saved state + const float WaitTime = 1f; // GML todo: is there a better way to do this? + float time = Time.realtimeSinceStartup; + if (sWaitStartTime == 0) + sWaitStartTime = time; + else if (time - sWaitStartTime > WaitTime) + { + RestoreAllInterestingStates(); + sWaitStartTime = 0; + } + } + } +#endif + + /// + /// If you need to get notified before state is collected for hotsave, this is the place + /// + public static OnHotSaveDelegate OnHotSave; + public delegate void OnHotSaveDelegate(); + + /// Collect all relevant objects, active or not + static Transform[] FindInterestingObjects() + { + List objects = new List(); + MonoBehaviour[] everything = ObjectTreeUtil.FindAllBehavioursInScene(); + foreach (var b in everything) + { + var attrs = b.GetType().GetCustomAttributes(true); + foreach (var attr in attrs) + { + if (attr.GetType().Name.Contains("SaveDuringPlay")) + { + //Debug.Log("Found " + ObjectTreeUtil.GetFullName(b.gameObject) + " for hot-save"); + objects.Add(b.transform); + break; + } + } + } + return objects.ToArray(); + } + + static List sSavedStates = null; + static GameObject sSaveStatesGameObject; + static void SaveAllInterestingStates() + { + //Debug.Log("Exiting play mode: Saving state for all interesting objects"); + if (OnHotSave != null) + OnHotSave(); + + sSavedStates = new List(); + Transform[] objects = FindInterestingObjects(); + foreach (Transform obj in objects) + { + ObjectStateSaver saver = new ObjectStateSaver(); + saver.CollectFieldValues(obj.gameObject); + sSavedStates.Add(saver); + } + if (sSavedStates.Count == 0) + sSavedStates = null; + } + + static void RestoreAllInterestingStates() + { + //Debug.Log("Updating state for all interesting objects"); + bool dirty = false; + GameObject[] roots = ObjectTreeUtil.FindAllRootObjectsInScene(); + foreach (ObjectStateSaver saver in sSavedStates) + { + GameObject go = saver.FindSavedGameObject(roots); + if (go != null) + { + Undo.RegisterFullObjectHierarchyUndo(go, "SaveDuringPlay"); + if (saver.PutFieldValues(go, roots)) + { + //Debug.Log("SaveDuringPlay: updated settings of " + saver.ObjetFullPath); + EditorUtility.SetDirty(go); + dirty = true; + } + } + } + if (dirty) + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + sSavedStates = null; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs.meta new file mode 100644 index 0000000..dd54630 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SaveDuringPlay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 24ec24775a1b45e4ea81ac13002dee32 +timeCreated: 1485895820 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs new file mode 100644 index 0000000..88dac2c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs @@ -0,0 +1,160 @@ +using UnityEngine; +using UnityEditor; +using System.IO; +using System.Linq; +using System; + +namespace Cinemachine.Editor +{ + public class ScriptableObjectUtility : ScriptableObject + { + public static string CinemachineInstallPath + { + get { return Path.GetFullPath(CinemachineInstallAssetPath); } + } + + public static string CinemachineInstallAssetPath + { + get + { + ScriptableObject dummy = ScriptableObject.CreateInstance(); + string path = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(dummy)); + DestroyImmediate(dummy); + path = path.Substring(0, path.LastIndexOf("/Base")); + return path; + } + } + + public static bool CinemachineIsPackage + { + get { return CinemachineInstallAssetPath.StartsWith("Packages"); } + } + + public static bool AddDefineForAllBuildTargets(string k_Define) + { + bool added = false; + var targets = Enum.GetValues(typeof(BuildTargetGroup)) + .Cast() + .Where(x => x != BuildTargetGroup.Unknown) + .Where(x => !BuildTargetIsObsolete(x)); + + foreach (var target in targets) + { + var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim(); + + var list = defines.Split(';', ' ') + .Where(x => !string.IsNullOrEmpty(x)) + .ToList(); + + if (!list.Contains(k_Define)) + { + list.Add(k_Define); + defines = list.Aggregate((a, b) => a + ";" + b); + + PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines); + added = true; + } + } + return added; + } + + static bool BuildTargetIsObsolete(BuildTargetGroup group) + { + var attrs = typeof(BuildTargetGroup) + .GetField(group.ToString()) + .GetCustomAttributes(typeof(ObsoleteAttribute), false); + + return attrs != null && attrs.Length > 0; + } + + public static void Create(bool prependFolderName = false, bool trimName = true) where T : ScriptableObject + { + string className = typeof(T).Name; + string assetName = className; + string folder = GetSelectedAssetFolder(); + + if (trimName) + { + string[] standardNames = new string[] { "Asset", "Attributes", "Container" }; + foreach (string standardName in standardNames) + { + assetName = assetName.Replace(standardName, ""); + } + } + + if (prependFolderName) + { + string folderName = Path.GetFileName(folder); + assetName = (string.IsNullOrEmpty(assetName) ? folderName : string.Format("{0}_{1}", folderName, assetName)); + } + + Create(className, assetName, folder); + } + + public static T CreateAt(string assetPath) where T : ScriptableObject + { + T asset = ScriptableObject.CreateInstance(); + if (asset == null) + { + Debug.LogError("failed to create instance of " + typeof(T).Name); + return null; + } + + AssetDatabase.CreateAsset(asset, assetPath); + + return asset; + } + + private static ScriptableObject Create(string className, string assetName, string folder) + { + ScriptableObject asset = ScriptableObject.CreateInstance(className); + if (asset == null) + { + Debug.LogError("failed to create instance of " + className); + return null; + } + + asset.name = assetName ?? className; + + string assetPath = GetUnusedAssetPath(folder, asset.name); + AssetDatabase.CreateAsset(asset, assetPath); + + return asset; + } + + private static string GetSelectedAssetFolder() + { + if ((Selection.activeObject != null) && AssetDatabase.Contains(Selection.activeObject)) + { + string assetPath = AssetDatabase.GetAssetPath(Selection.activeObject); + string assetPathAbsolute = string.Format("{0}/{1}", Path.GetDirectoryName(Application.dataPath), assetPath); + + if (Directory.Exists(assetPathAbsolute)) + { + return assetPath; + } + else + { + return Path.GetDirectoryName(assetPath); + } + } + + return "Assets"; + } + + private static string GetUnusedAssetPath(string folder, string assetName) + { + for (int n = 0; n < 9999; n++) + { + string assetPath = string.Format("{0}/{1}{2}.asset", folder, assetName, (n == 0 ? "" : n.ToString())); + string existingGUID = AssetDatabase.AssetPathToGUID(assetPath); + if (string.IsNullOrEmpty(existingGUID)) + { + return assetPath; + } + } + + return null; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs.meta new file mode 100644 index 0000000..13a3dc4 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/ScriptableObjectUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ba59c38a116ff2f4fb69f825ba0da3bc +timeCreated: 1481654957 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs new file mode 100644 index 0000000..e93253e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs @@ -0,0 +1,59 @@ +using System; +using System.Linq.Expressions; +using UnityEditor; + +namespace Cinemachine.Editor +{ + public static class SerializedPropertyHelper + { + /// This is a way to get a field name string in such a manner that the compiler will + /// generate errors for invalid fields. Much better than directly using strings. + /// Usage: instead of + /// + /// "m_MyField"; + /// + /// do this: + /// + /// MyClass myclass = null; + /// SerializedPropertyHelper.PropertyName( () => myClass.m_MyField); + /// + public static string PropertyName(Expression> exp) + { + var body = exp.Body as MemberExpression; + if (body == null) + { + var ubody = (UnaryExpression)exp.Body; + body = ubody.Operand as MemberExpression; + } + return body.Member.Name; + } + + /// Usage: instead of + /// + /// mySerializedObject.FindProperty("m_MyField"); + /// + /// do this: + /// + /// MyClass myclass = null; + /// mySerializedObject.FindProperty( () => myClass.m_MyField); + /// + public static SerializedProperty FindProperty(this SerializedObject obj, Expression> exp) + { + return obj.FindProperty(PropertyName(exp)); + } + + /// Usage: instead of + /// + /// mySerializedProperty.FindPropertyRelative("m_MyField"); + /// + /// do this: + /// + /// MyClass myclass = null; + /// mySerializedProperty.FindPropertyRelative( () => myClass.m_MyField); + /// + public static SerializedProperty FindPropertyRelative(this SerializedProperty obj, Expression> exp) + { + return obj.FindPropertyRelative(PropertyName(exp)); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs.meta new file mode 100644 index 0000000..3416613 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Utility/SerializedPropertyHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a60d9407e2bb20e4ea00281b1e33eae7 +timeCreated: 1488400542 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Windows.meta new file mode 100644 index 0000000..a6c112d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9c644b247df49ee47957d373411a85c3 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs new file mode 100644 index 0000000..5d43c02 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs @@ -0,0 +1,149 @@ +using UnityEngine; +using UnityEditor; +using System.IO; + +namespace Cinemachine.Editor +{ + [InitializeOnLoad] + public class AboutWindow : EditorWindow + { + private const string kLastVersionOpened = "CNMCN_Last_Version_Loaded"; + private const string kInvalidVersionNumber = "0.0"; + + private static readonly Vector2 kMinWindowSize = new Vector2(550f, 550f); + + private static string LastVersionLoaded + { + get { return EditorPrefs.GetString(kLastVersionOpened, kInvalidVersionNumber); } + set { EditorPrefs.SetString(kLastVersionOpened, value); } + } + + private GUIStyle mButtonStyle; + private GUIStyle mLabelStyle; + private GUIStyle mHeaderStyle; + private GUIStyle mNotesStyle; + private Vector2 mReleaseNoteScrollPos = Vector2.zero; + + string mReleaseNotes; + + private void OnEnable() + { + string path = ScriptableObjectUtility.CinemachineInstallPath + "/ReleaseNotes.txt"; + try + { + StreamReader reader = new StreamReader(path); + mReleaseNotes = reader.ReadToEnd(); + reader.Close(); + } + catch (System.Exception) + { + mReleaseNotes = path + " not found"; + } + } + + private void OnGUI() + { + if (EditorApplication.isCompiling) + { + Close(); + } + + if (mButtonStyle == null) + { + mButtonStyle = new GUIStyle(GUI.skin.button); + mButtonStyle.richText = true; + } + + if (mLabelStyle == null) + { + mLabelStyle = new GUIStyle(EditorStyles.label); + mLabelStyle.wordWrap = true; + mLabelStyle.richText = true; + } + + if (mHeaderStyle == null) + { + mHeaderStyle = new GUIStyle(EditorStyles.boldLabel); + mHeaderStyle.wordWrap = true; + } + + if (mNotesStyle == null) + { + mNotesStyle = new GUIStyle(EditorStyles.textArea); + mNotesStyle.richText = true; + mNotesStyle.wordWrap = true; + } + + using (var vertScope = new EditorGUILayout.VerticalScope()) + { + if (CinemachineSettings.CinemachineHeader != null) + { + float headerWidth = position.width; + float aspectRatio = (float)CinemachineSettings.CinemachineHeader.height / (float)CinemachineSettings.CinemachineHeader.width; + GUILayout.BeginScrollView(Vector2.zero, false, false, GUILayout.Width(headerWidth), GUILayout.Height(headerWidth * aspectRatio)); + Rect texRect = new Rect(0f, 0f, headerWidth, headerWidth * aspectRatio); + + GUILayout.FlexibleSpace(); + GUILayout.BeginArea(texRect); + GUI.DrawTexture(texRect, CinemachineSettings.CinemachineHeader, ScaleMode.ScaleToFit); + GUILayout.EndArea(); + GUILayout.FlexibleSpace(); + + GUILayout.EndScrollView(); + } + + EditorGUILayout.LabelField("Welcome to Cinemachine!", mLabelStyle); + EditorGUILayout.LabelField("Smart camera tools for passionate creators.", mLabelStyle); + EditorGUILayout.LabelField("Below are links to the forums, please reach out if you have any questions or feedback", mLabelStyle); + + if (GUILayout.Button("Forum\nDiscuss", mButtonStyle)) + { + Application.OpenURL("https://forum.unity3d.com/forums/cinemachine.136/"); + } + + if (GUILayout.Button("Rate it!\nUnity Asset Store", mButtonStyle)) + { + Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/79898"); + } + + if (GUILayout.Button("Documentation\nRead it", mButtonStyle)) + { + string filename = ScriptableObjectUtility.CinemachineInstallPath + + "/CINEMACHINE_install.pdf"; + if (!File.Exists(filename)) + Debug.LogError("Missing file " + filename); + Application.OpenURL("file://" + filename); + } + } + + EditorGUILayout.LabelField("Release Notes", mHeaderStyle); + using (var scrollScope = new EditorGUILayout.ScrollViewScope(mReleaseNoteScrollPos, GUI.skin.box)) + { + mReleaseNoteScrollPos = scrollScope.scrollPosition; + EditorGUILayout.LabelField(mReleaseNotes, mNotesStyle); + } + } + + [MenuItem("Cinemachine/About")] + private static void OpenWindow() + { + EditorApplication.update += ShowWindowDeferred; + } + + private static void ShowWindowDeferred() + { + string loadedVersion = LastVersionLoaded; + if (loadedVersion != CinemachineCore.kVersionString) + LastVersionLoaded = CinemachineCore.kVersionString; + + AboutWindow window = EditorWindow.GetWindow(); + + window.titleContent = new UnityEngine.GUIContent( + "About", CinemachineSettings.CinemachineLogoTexture); + window.minSize = kMinWindowSize; + window.Show(true); + + EditorApplication.update -= ShowWindowDeferred; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs.meta new file mode 100644 index 0000000..704a05e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/AboutWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 829e606f890b35c47aa29643517add2e +timeCreated: 1481654956 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs new file mode 100644 index 0000000..4cc881a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs @@ -0,0 +1,85 @@ +using UnityEngine; +using UnityEditor; + +using Cinemachine.Editor; + +namespace Cinemachine +{ + [InitializeOnLoad] + internal static class CinemachineColliderPrefs + { + private static bool SettingsFoldedOut + { + get { return EditorPrefs.GetBool(kColliderSettingsFoldoutKey, false); } + set + { + if (value != SettingsFoldedOut) + { + EditorPrefs.SetBool(kColliderSettingsFoldoutKey, value); + } + } + } + + public static Color FeelerHitColor + { + get + { + return CinemachineSettings.UnpackColour(EditorPrefs.GetString(kFeelerHitColourKey, CinemachineSettings.PackColor(Color.yellow))); + } + + set + { + if (value != FeelerHitColor) + { + EditorPrefs.SetString(kFeelerHitColourKey, CinemachineSettings.PackColor(value)); + } + } + } + + public static Color FeelerColor + { + get + { + return CinemachineSettings.UnpackColour(EditorPrefs.GetString(kFeelerColourKey, CinemachineSettings.PackColor(Color.gray))); + } + + set + { + if (value != FeelerColor) + { + EditorPrefs.SetString(kFeelerColourKey, CinemachineSettings.PackColor(value)); + } + } + } + + private const string kColliderSettingsFoldoutKey = "CNMCN_Collider_Foldout"; + private const string kFeelerHitColourKey = "CNMCN_Collider_FeelerHit_Colour"; + private const string kFeelerColourKey = "CNMCN_Collider_Feeler_Colour"; + + static CinemachineColliderPrefs() + { + Cinemachine.Editor.CinemachineSettings.AdditionalCategories += DrawColliderSettings; + } + + private static void DrawColliderSettings() + { + SettingsFoldedOut = EditorGUILayout.Foldout(SettingsFoldedOut, "Collider Settings"); + if (SettingsFoldedOut) + { + EditorGUI.indentLevel++; + + EditorGUI.BeginChangeCheck(); + + FeelerHitColor = EditorGUILayout.ColorField("Feeler Hit", FeelerHitColor); + FeelerColor = EditorGUILayout.ColorField("Feeler", FeelerColor); + + if (EditorGUI.EndChangeCheck()) + { + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + EditorGUI.indentLevel--; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs.meta new file mode 100644 index 0000000..0d969fb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineColliderPrefs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aceb1a3f85f55c249bba6eaade29f2aa +timeCreated: 1484415513 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs new file mode 100644 index 0000000..b382b32 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs @@ -0,0 +1,454 @@ +using UnityEngine; +using UnityEditor; +using System; + +namespace Cinemachine.Editor +{ + [InitializeOnLoad] + internal sealed class CinemachineSettings + { + public static class CinemachineCoreSettings + { + private static readonly string hShowInGameGuidesKey = "CNMCN_Core_ShowInGameGuides"; + public static bool ShowInGameGuides + { + get { return EditorPrefs.GetBool(hShowInGameGuidesKey, true); } + set + { + if (ShowInGameGuides != value) + { + EditorPrefs.SetBool(hShowInGameGuidesKey, value); + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + } + } + + private static readonly string kCoreActiveGizmoColourKey = "CNMCN_Core_Active_Gizmo_Colour"; + public static readonly Color kDefaultActiveColour = new Color32(255, 0, 0, 100); + public static Color ActiveGizmoColour + { + get + { + string packedColour = EditorPrefs.GetString(kCoreActiveGizmoColourKey, PackColor(kDefaultActiveColour)); + return UnpackColour(packedColour); + } + + set + { + if (ActiveGizmoColour != value) + { + string packedColour = PackColor(value); + EditorPrefs.SetString(kCoreActiveGizmoColourKey, packedColour); + } + } + } + + private static readonly string kCoreInactiveGizmoColourKey = "CNMCN_Core_Inactive_Gizmo_Colour"; + public static readonly Color kDefaultInactiveColour = new Color32(9, 54, 87, 100); + public static Color InactiveGizmoColour + { + get + { + string packedColour = EditorPrefs.GetString(kCoreInactiveGizmoColourKey, PackColor(kDefaultInactiveColour)); + return UnpackColour(packedColour); + } + + set + { + if (InactiveGizmoColour != value) + { + string packedColour = PackColor(value); + EditorPrefs.SetString(kCoreInactiveGizmoColourKey, packedColour); + } + } + } + } + + public static class ComposerSettings + { + private static readonly string kOverlayOpacityKey = "CNMCN_Overlay_Opacity"; + private static readonly string kComposerHardBoundsColourKey = "CNMCN_Composer_HardBounds_Colour"; + private static readonly string kComposerSoftBoundsColourKey = "CNMCN_Composer_SoftBounds_Colour"; + private static readonly string kComposerTargetColourKey = "CNMCN_Composer_Target_Colour"; + private static readonly string kComposerTargetSizeKey = "CNMCN_Composer_Target_Size"; + + public const float kDefaultOverlayOpacity = 0.15f; + public static readonly Color kDefaultHardBoundsColour = new Color32(255, 0, 72, 255); + public static readonly Color kDefaultSoftBoundsColour = new Color32(0, 194, 255, 255); + public static readonly Color kDefaultTargetColour = new Color32(255, 254, 25, 255); + + public static float OverlayOpacity + { + get { return EditorPrefs.GetFloat(kOverlayOpacityKey, kDefaultOverlayOpacity); } + set + { + if (value != OverlayOpacity) + { + EditorPrefs.SetFloat(kOverlayOpacityKey, value); + } + } + } + + public static Color HardBoundsOverlayColour + { + get + { + string packedColour = EditorPrefs.GetString(kComposerHardBoundsColourKey, PackColor(kDefaultHardBoundsColour)); + return UnpackColour(packedColour); + } + + set + { + if (HardBoundsOverlayColour != value) + { + string packedColour = PackColor(value); + EditorPrefs.SetString(kComposerHardBoundsColourKey, packedColour); + } + } + } + + public static Color SoftBoundsOverlayColour + { + get + { + string packedColour = EditorPrefs.GetString(kComposerSoftBoundsColourKey, PackColor(kDefaultSoftBoundsColour)); + return UnpackColour(packedColour); + } + + set + { + if (SoftBoundsOverlayColour != value) + { + string packedColour = PackColor(value); + EditorPrefs.SetString(kComposerSoftBoundsColourKey, packedColour); + } + } + } + + public static Color TargetColour + { + get + { + string packedColour = EditorPrefs.GetString(kComposerTargetColourKey, PackColor(kDefaultTargetColour)); + return UnpackColour(packedColour); + } + + set + { + if (TargetColour != value) + { + string packedColour = PackColor(value); + EditorPrefs.SetString(kComposerTargetColourKey, packedColour); + } + } + } + + public static float TargetSize + { + get + { + return EditorPrefs.GetFloat(kComposerTargetSizeKey, 5f); + } + + set + { + if (TargetSize != value) + { + EditorPrefs.SetFloat(kComposerTargetSizeKey, value); + } + } + } + } + + private static bool ShowCoreSettings + { + get { return EditorPrefs.GetBool(kCoreSettingsFoldKey, false); } + set + { + if (value != ShowCoreSettings) + { + EditorPrefs.SetBool(kCoreSettingsFoldKey, value); + } + } + } + + private static bool ShowComposerSettings + { + get { return EditorPrefs.GetBool(kComposerSettingsFoldKey, false); } + set + { + if (value != ShowComposerSettings) + { + EditorPrefs.SetBool(kComposerSettingsFoldKey, value); + } + } + } + + private static Texture2D sCinemachineLogoTexture = null; + internal static Texture2D CinemachineLogoTexture + { + get + { + if (sCinemachineLogoTexture == null) + sCinemachineLogoTexture = Resources.Load("cm_logo_sm"); + if (sCinemachineLogoTexture != null) + sCinemachineLogoTexture.hideFlags = HideFlags.DontSaveInEditor; + return sCinemachineLogoTexture; + } + } + + private static Texture2D sCinemachineHeader = null; + internal static Texture2D CinemachineHeader + { + get + { + if (sCinemachineHeader == null) + sCinemachineHeader = Resources.Load("cinemachine_header"); + ; + if (sCinemachineHeader != null) + sCinemachineHeader.hideFlags = HideFlags.DontSaveInEditor; + return sCinemachineHeader; + } + } + + private static readonly string kCoreSettingsFoldKey = "CNMCN_Core_Folded"; + private static readonly string kComposerSettingsFoldKey = "CNMCN_Composer_Folded"; + + internal static event Action AdditionalCategories = null; + + static CinemachineSettings() + { + if (CinemachineLogoTexture != null) + { + EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyGUI; + } + } + + //private static readonly GUIContent sCoreShowHiddenObjectsToggle = new GUIContent("Show Hidden Objects", "If checked, Cinemachine hidden objects will be shown in the inspector. This might be necessary to repair broken script mappings when upgrading from a pre-release version"); + private static readonly GUIContent sCoreActiveGizmosColour = new GUIContent("Active Virtual Camera", "The colour for the active virtual camera's gizmos"); + private static readonly GUIContent sCoreInactiveGizmosColour = new GUIContent("Inactive Virtual Camera", "The colour for all inactive virtual camera gizmos"); + + private static readonly GUIContent sComposerOverlayOpacity = new GUIContent("Overlay Opacity", "The alpha of the composer's overlay when a virtual camera is selected with composer module enabled"); + private static readonly GUIContent sComposerHardBoundsOverlay = new GUIContent("Hard Bounds Overlay", "The colour of the composer overlay's hard bounds region"); + private static readonly GUIContent sComposerSoftBoundsOverlay = new GUIContent("Soft Bounds Overlay", "The colour of the composer overlay's soft bounds region"); + private static readonly GUIContent sComposerTargetOverlay = new GUIContent("Composer Target", "The colour of the composer overlay's target"); + private static readonly GUIContent sComposerTargetOverlayPixels = new GUIContent("Composer Target Size(px)", "The size of the composer overlay's target box in pixels"); + + private const string kCinemachineHeaderPath = "cinemachine_header.tif"; + private const string kCinemachineDocURL = @"http://www.cinemachineimagery.com/documentation/"; + + private static Vector2 sScrollPosition = Vector2.zero; + + [PreferenceItem("Cinemachine")] + private static void OnGUI() + { + if (CinemachineHeader != null) + { + const float kWidth = 350f; + float aspectRatio = (float)CinemachineHeader.height / (float)CinemachineHeader.width; + GUILayout.BeginScrollView(Vector2.zero, false, false, GUILayout.Width(kWidth), GUILayout.Height(kWidth * aspectRatio)); + Rect texRect = new Rect(0f, 0f, kWidth, kWidth * aspectRatio); + + GUILayout.BeginArea(texRect); + GUI.DrawTexture(texRect, CinemachineHeader, ScaleMode.ScaleToFit); + GUILayout.EndArea(); + + GUILayout.EndScrollView(); + } + + sScrollPosition = GUILayout.BeginScrollView(sScrollPosition); + + //CinemachineCore.sShowHiddenObjects + // = EditorGUILayout.Toggle("Show Hidden Objects", CinemachineCore.sShowHiddenObjects); + + ShowCoreSettings = EditorGUILayout.Foldout(ShowCoreSettings, "Runtime Settings"); + if (ShowCoreSettings) + { + EditorGUI.indentLevel++; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + Color newActiveGizmoColour = EditorGUILayout.ColorField(sCoreActiveGizmosColour, CinemachineCoreSettings.ActiveGizmoColour); + + if (EditorGUI.EndChangeCheck()) + { + CinemachineCoreSettings.ActiveGizmoColour = newActiveGizmoColour; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + if (GUILayout.Button("Reset")) + { + CinemachineCoreSettings.ActiveGizmoColour = CinemachineCoreSettings.kDefaultActiveColour; + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + Color newInactiveGizmoColour = EditorGUILayout.ColorField(sCoreInactiveGizmosColour, CinemachineCoreSettings.InactiveGizmoColour); + + if (EditorGUI.EndChangeCheck()) + { + CinemachineCoreSettings.InactiveGizmoColour = newInactiveGizmoColour; + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + + if (GUILayout.Button("Reset")) + { + CinemachineCoreSettings.InactiveGizmoColour = CinemachineCoreSettings.kDefaultInactiveColour; + } + EditorGUILayout.EndHorizontal(); + EditorGUI.indentLevel--; + } + + ShowComposerSettings = EditorGUILayout.Foldout(ShowComposerSettings, "Composer Settings"); + if (ShowComposerSettings) + { + EditorGUI.indentLevel++; + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + + float overlayOpacity = EditorGUILayout.Slider(sComposerOverlayOpacity, ComposerSettings.OverlayOpacity, 0f, 1f); + + if (EditorGUI.EndChangeCheck()) + { + ComposerSettings.OverlayOpacity = overlayOpacity; + } + + if (GUILayout.Button("Reset")) + { + ComposerSettings.OverlayOpacity = ComposerSettings.kDefaultOverlayOpacity; + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + Color newHardEdgeColor = EditorGUILayout.ColorField(sComposerHardBoundsOverlay, ComposerSettings.HardBoundsOverlayColour); + + if (EditorGUI.EndChangeCheck()) + { + ComposerSettings.HardBoundsOverlayColour = newHardEdgeColor; + } + + if (GUILayout.Button("Reset")) + { + ComposerSettings.HardBoundsOverlayColour = ComposerSettings.kDefaultHardBoundsColour; + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + Color newSoftEdgeColor = EditorGUILayout.ColorField(sComposerSoftBoundsOverlay, ComposerSettings.SoftBoundsOverlayColour); + + if (EditorGUI.EndChangeCheck()) + { + ComposerSettings.SoftBoundsOverlayColour = newSoftEdgeColor; + } + + if (GUILayout.Button("Reset")) + { + ComposerSettings.SoftBoundsOverlayColour = ComposerSettings.kDefaultSoftBoundsColour; + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + Color newTargetColour = EditorGUILayout.ColorField(sComposerTargetOverlay, ComposerSettings.TargetColour); + + if (EditorGUI.EndChangeCheck()) + { + ComposerSettings.TargetColour = newTargetColour; + } + + if (GUILayout.Button("Reset")) + { + ComposerSettings.TargetColour = ComposerSettings.kDefaultTargetColour; + } + EditorGUILayout.EndHorizontal(); + + EditorGUI.BeginChangeCheck(); + float targetSide = EditorGUILayout.FloatField(sComposerTargetOverlayPixels, ComposerSettings.TargetSize); + + if (EditorGUI.EndChangeCheck()) + { + ComposerSettings.TargetSize = targetSide; + } + EditorGUI.indentLevel--; + } + + if (AdditionalCategories != null) + { + AdditionalCategories(); + } + + GUILayout.EndScrollView(); + + //if (GUILayout.Button("Open Documentation")) + //{ + // Application.OpenURL(kCinemachineDocURL); + //} + } + + private static void OnHierarchyGUI(int instanceID, Rect selectionRect) + { + GameObject instance = EditorUtility.InstanceIDToObject(instanceID) as GameObject; + if (instance == null) + { + // Object in process of being deleted? + return; + } + + if (instance.GetComponent() != null) + { + Rect texRect = new Rect(selectionRect.xMax - selectionRect.height, selectionRect.yMin, selectionRect.height, selectionRect.height); + GUI.DrawTexture(texRect, CinemachineLogoTexture, ScaleMode.ScaleAndCrop); + } + } + + internal static Color UnpackColour(string str) + { + if (!string.IsNullOrEmpty(str)) + { + byte[] bytes = Base64Decode(str); + + if ((bytes != null) && bytes.Length == 16) + { + float r = BitConverter.ToSingle(bytes, 0); + float g = BitConverter.ToSingle(bytes, 4); + float b = BitConverter.ToSingle(bytes, 8); + float a = BitConverter.ToSingle(bytes, 12); + + return new Color(r, g, b, a); + } + } + + return Color.white; + } + + internal static string PackColor(Color col) + { + byte[] bytes = new byte[16]; + + byte[] rBytes = BitConverter.GetBytes(col.r); + byte[] gBytes = BitConverter.GetBytes(col.g); + byte[] bBytes = BitConverter.GetBytes(col.b); + byte[] aBytes = BitConverter.GetBytes(col.a); + + Buffer.BlockCopy(rBytes, 0, bytes, 0, 4); + Buffer.BlockCopy(gBytes, 0, bytes, 4, 4); + Buffer.BlockCopy(bBytes, 0, bytes, 8, 4); + Buffer.BlockCopy(aBytes, 0, bytes, 12, 4); + + return Base64Encode(bytes); + } + + private static string Base64Encode(byte[] data) + { + return Convert.ToBase64String(data); + } + + private static byte[] Base64Decode(string base64EncodedData) + { + return Convert.FromBase64String(base64EncodedData); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs.meta b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs.meta new file mode 100644 index 0000000..f85d188 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Editor/Windows/CinemachineSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 74d8c4d6e5d0338469ae46c13725f3ce +timeCreated: 1488314898 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime.meta b/Assets/_Vendor/Cinemachine/Base/Runtime.meta new file mode 100644 index 0000000..bf0c377 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e8413e2c94231d544b120f2b71d432e2 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours.meta new file mode 100644 index 0000000..edded5f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fd10c4a322c950342a9d03a14ae879b7 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs new file mode 100644 index 0000000..b380bfa --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs @@ -0,0 +1,341 @@ +using Cinemachine.Utility; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a virtual camera "manager" that owns and manages a collection + /// of child Virtual Cameras. When the camera goes live, these child vcams + /// are enabled, one after another, holding each camera for a designated time. + /// Blends between cameras are specified. + /// The last camera is held indefinitely. + /// + [DocumentationSorting(13, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineBlendListCamera")] + public class CinemachineBlendListCamera : CinemachineVirtualCameraBase + { + /// Default object for the camera children to look at (the aim target), if not specified in a child rig. May be empty + [Tooltip("Default object for the camera children to look at (the aim target), if not specified in a child camera. May be empty if all of the children define targets of their own.")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + /// Default object for the camera children wants to move with (the body target), if not specified in a child rig. May be empty + [Tooltip("Default object for the camera children wants to move with (the body target), if not specified in a child camera. May be empty if all of the children define targets of their own.")] + [NoSaveDuringPlay] + public Transform m_Follow = null; + + /// When enabled, the current camera and blend will be indicated in the game window, for debugging + [Tooltip("When enabled, the current child camera and blend will be indicated in the game window, for debugging")] + public bool m_ShowDebugText = false; + + /// Force all child cameras to be enabled. This is useful if animating them in Timeline, but consumes extra resources. + [Tooltip("Force all child cameras to be enabled. This is useful if animating them in Timeline, but consumes extra resources")] + public bool m_EnableAllChildCameras; + + /// Internal API for the editor. Do not use this field + [SerializeField][HideInInspector][NoSaveDuringPlay] + public CinemachineVirtualCameraBase[] m_ChildCameras = null; + + /// This represents a single entry in the instrunction list of the BlendListCamera. + [Serializable] + public struct Instruction + { + /// The virtual camera to activate when this instruction becomes active + [Tooltip("The virtual camera to activate when this instruction becomes active")] + public CinemachineVirtualCameraBase m_VirtualCamera; + /// How long to wait (in seconds) before activating the next virtual camera in the list (if any) + [Tooltip("How long to wait (in seconds) before activating the next virtual camera in the list (if any)")] + public float m_Hold; + /// How to blend to the next virtual camera in the list (if any) + [CinemachineBlendDefinitionProperty] + [Tooltip("How to blend to the next virtual camera in the list (if any)")] + public CinemachineBlendDefinition m_Blend; + }; + + /// The set of instructions associating virtual cameras with states. + /// The set of instructions for enabling child cameras + [Tooltip("The set of instructions for enabling child cameras.")] + public Instruction[] m_Instructions; + + /// Gets a brief debug description of this virtual camera, for use when displayiong debug info + public override string Description + { + get + { + // Show the active camera and blend + ICinemachineCamera vcam = LiveChild; + if (mActiveBlend == null) + return (vcam != null) ? "[" + vcam.Name + "]": "(none)"; + return mActiveBlend.Description; + } + } + + /// Get the current "best" child virtual camera, that would be chosen + /// if the State Driven Camera were active. + public ICinemachineCamera LiveChild { set; get; } + + /// Return the live child. + public override ICinemachineCamera LiveChildOrSelf { get { return LiveChild; } } + + /// Check whether the vcam a live child of this camera. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public override bool IsLiveChild(ICinemachineCamera vcam) + { + return vcam == LiveChild + || (mActiveBlend != null && (vcam == mActiveBlend.CamA || vcam == mActiveBlend.CamB)); + } + + /// The State of the current live child + public override CameraState State { get { return m_State; } } + + /// Get the current LookAt target. Returns parent's LookAt if parent + /// is non-null and no specific LookAt defined for this camera + override public Transform LookAt + { + get { return ResolveLookAt(m_LookAt); } + set { m_LookAt = value; } + } + + /// Get the current Follow target. Returns parent's Follow if parent + /// is non-null and no specific Follow defined for this camera + override public Transform Follow + { + get { return ResolveFollow(m_Follow); } + set { m_Follow = value; } + } + + /// Remove a Pipeline stage hook callback. + /// Make sure it is removed from all the children. + /// The delegate to remove. + public override void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + base.RemovePostPipelineStageHook(d); + UpdateListOfChildren(); + foreach (var vcam in m_ChildCameras) + vcam.RemovePostPipelineStageHook(d); + } + + /// Notification that this virtual camera is going live. + /// The camera being deactivated. May be null. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public override void OnTransitionFromCamera( + ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) + { + base.OnTransitionFromCamera(fromCam, worldUp, deltaTime); + mActivationTime = Time.time; + mCurrentInstruction = -1; + LiveChild = null; + mActiveBlend = null; + UpdateCameraState(worldUp, deltaTime); + } + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. This implementation + /// updates all the children, chooses the best one, and implements any required blending. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public override void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBlendListCamera.UpdateCameraState"); + if (!PreviousStateIsValid) + deltaTime = -1; + + UpdateListOfChildren(); + + AdvanceCurrentInstruction(); + CinemachineVirtualCameraBase best = null; + if (mCurrentInstruction >= 0 && mCurrentInstruction < m_Instructions.Length) + best = m_Instructions[mCurrentInstruction].m_VirtualCamera; + + if (m_ChildCameras != null) + { + for (int i = 0; i < m_ChildCameras.Length; ++i) + { + CinemachineVirtualCameraBase vcam = m_ChildCameras[i]; + if (vcam != null) + { + bool enableChild = m_EnableAllChildCameras || vcam == best; + if (enableChild != vcam.VirtualCameraGameObject.activeInHierarchy) + { + vcam.gameObject.SetActive(enableChild); + if (enableChild) + CinemachineCore.Instance.UpdateVirtualCamera(vcam, worldUp, deltaTime); + } + } + } + } + + if (best != null) + { + ICinemachineCamera previousCam = LiveChild; + LiveChild = best; + + // Are we transitioning cameras? + if (previousCam != null && LiveChild != null && previousCam != LiveChild && mCurrentInstruction > 0) + { + // Create a blend (will be null if a cut) + mActiveBlend = CreateBlend( + previousCam, LiveChild, + m_Instructions[mCurrentInstruction].m_Blend.BlendCurve, + m_Instructions[mCurrentInstruction].m_Blend.m_Time, mActiveBlend, deltaTime); + + // Notify incoming camera of transition + LiveChild.OnTransitionFromCamera(previousCam, worldUp, deltaTime); + + // Generate Camera Activation event if live + CinemachineCore.Instance.GenerateCameraActivationEvent(LiveChild); + + // If cutting, generate a camera cut event if live + if (mActiveBlend == null) + CinemachineCore.Instance.GenerateCameraCutEvent(LiveChild); + } + } + + // Advance the current blend (if any) + if (mActiveBlend != null) + { + mActiveBlend.TimeInBlend += (deltaTime >= 0) ? deltaTime : mActiveBlend.Duration; + if (mActiveBlend.IsComplete) + mActiveBlend = null; + } + + if (mActiveBlend != null) + { + mActiveBlend.UpdateCameraState(worldUp, deltaTime); + m_State = mActiveBlend.State; + } + else if (LiveChild != null) + m_State = LiveChild.State; + + PreviousStateIsValid = true; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// Makes sure the internal child cache is up to date + protected override void OnEnable() + { + base.OnEnable(); + InvalidateListOfChildren(); + mActiveBlend = null; + } + + /// Makes sure the internal child cache is up to date + public void OnTransformChildrenChanged() + { + InvalidateListOfChildren(); + } + +#if UNITY_EDITOR + /// Displays the current active camera on the game screen, if requested + protected override void OnGUI() + { + base.OnGUI(); + if (!m_ShowDebugText) + CinemachineGameWindowDebug.ReleaseScreenPos(this); + else + { + string text = Name + ": " + Description; + Rect r = CinemachineGameWindowDebug.GetScreenPos(this, text, GUI.skin.box); + GUI.Label(r, text, GUI.skin.box); + } + } +#endif + CameraState m_State = CameraState.Default; + + /// The list of child cameras. These are just the immediate children in the hierarchy. + public CinemachineVirtualCameraBase[] ChildCameras { get { UpdateListOfChildren(); return m_ChildCameras; }} + + /// Is there a blend in progress? + public bool IsBlending { get { return mActiveBlend != null; } } + + /// The time at which the current instruction went live + float mActivationTime = -1; + int mCurrentInstruction = 0; + private CinemachineBlend mActiveBlend = null; + + void InvalidateListOfChildren() { m_ChildCameras = null; LiveChild = null; } + + void UpdateListOfChildren() + { + if (m_ChildCameras != null) + return; + List list = new List(); + CinemachineVirtualCameraBase[] kids = GetComponentsInChildren(true); + foreach (CinemachineVirtualCameraBase k in kids) + if (k.transform.parent == transform) + list.Add(k); + m_ChildCameras = list.ToArray(); + ValidateInstructions(); + } + + /// Internal API for the inspector editor. + /// // GML todo: make this private, part of UpdateListOfChildren() + public void ValidateInstructions() + { + if (m_Instructions == null) + m_Instructions = new Instruction[0]; + for (int i = 0; i < m_Instructions.Length; ++i) + { + if (m_Instructions[i].m_VirtualCamera != null + && m_Instructions[i].m_VirtualCamera.transform.parent != transform) + { + m_Instructions[i].m_VirtualCamera = null; + } + } + mActiveBlend = null; + } + + private void AdvanceCurrentInstruction() + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBlendListCamera.AdvanceCurrentInstruction"); + if (m_ChildCameras == null || m_ChildCameras.Length == 0 + || mActivationTime < 0 || m_Instructions.Length == 0) + { + mActivationTime = -1; + mCurrentInstruction = -1; + mActiveBlend = null; + } + else if (mCurrentInstruction >= m_Instructions.Length - 1) + { + mCurrentInstruction = m_Instructions.Length - 1; + } + else + { + float now = Time.time; + if (mCurrentInstruction < 0) + { + mActivationTime = now; + mCurrentInstruction = 0; + } + else if (now - mActivationTime > Mathf.Max(0, m_Instructions[mCurrentInstruction].m_Hold)) + { + mActivationTime = now; + ++mCurrentInstruction; + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + private CinemachineBlend CreateBlend( + ICinemachineCamera camA, ICinemachineCamera camB, + AnimationCurve blendCurve, float duration, + CinemachineBlend activeBlend, float deltaTime) + { + if (blendCurve == null || duration <= 0 || (camA == null && camB == null)) + return null; + + if (camA == null || activeBlend != null) + { + // Blend from the current camera position + CameraState state = (activeBlend != null) ? activeBlend.State : State; + camA = new StaticPointVirtualCamera(state, (activeBlend != null) ? "Mid-blend" : "(none)"); + } + return new CinemachineBlend(camA, camB, blendCurve,duration, 0); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs.meta new file mode 100644 index 0000000..6f0c492 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBlendListCamera.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 53258ad9ad6e71e48bb8643c9522112e +timeCreated: 1509546373 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs new file mode 100644 index 0000000..36a98e3 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs @@ -0,0 +1,831 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using Cinemachine.Utility; +using UnityEngine.Events; +using System.Collections; + +namespace Cinemachine +{ + /// + /// CinemachineBrain is the link between the Unity Camera and the Cinemachine Virtual + /// Cameras in the scene. It monitors the priority stack to choose the current + /// Virtual Camera, and blend with another if necessary. Finally and most importantly, + /// it applies the Virtual Camera state to the attached Unity Camera. + /// + /// The CinemachineBrain is also the place where rules for blending between virtual cameras + /// are defined. Camera blending is an interpolation over time of one virtual camera + /// position and state to another. If you think of virtual cameras as cameramen, then + /// blending is a little like one cameraman smoothly passing the camera to another cameraman. + /// You can specify the time over which to blend, as well as the blend curve shape. + /// Note that a camera cut is just a zero-time blend. + /// + [DocumentationSorting(0, DocumentationSortingAttribute.Level.UserRef)] +// [RequireComponent(typeof(Camera))] // strange but true: we can live without it + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineBrain")] + [SaveDuringPlay] + public class CinemachineBrain : MonoBehaviour + { + /// + /// When enabled, the current camera and blend will be indicated in the game window, for debugging. + /// + [Tooltip("When enabled, the current camera and blend will be indicated in the game window, for debugging")] + public bool m_ShowDebugText = false; + + /// + /// When enabled, shows the camera's frustum in the scene view. + /// + [Tooltip("When enabled, the camera's frustum will be shown at all times in the scene view")] + public bool m_ShowCameraFrustum = true; + + /// + /// When enabled, the cameras will always respond in real-time to user input and damping, + /// even if the game is running in slow motion + /// + [Tooltip("When enabled, the cameras will always respond in real-time to user input and damping, even if the game is running in slow motion")] + public bool m_IgnoreTimeScale = false; + + /// + /// If set, this object's Y axis will define the worldspace Up vector for all the + /// virtual cameras. This is useful in top-down game environments. If not set, Up is worldspace Y. + /// + [Tooltip("If set, this object's Y axis will define the worldspace Up vector for all the virtual cameras. This is useful for instance in top-down game environments. If not set, Up is worldspace Y. Setting this appropriately is important, because Virtual Cameras don't like looking straight up or straight down.")] + public Transform m_WorldUpOverride; + + /// This enum defines the options available for the update method. + [DocumentationSorting(0.1f, DocumentationSortingAttribute.Level.UserRef)] + public enum UpdateMethod + { + /// Virtual cameras are updated in sync with the Physics module, in FixedUpdate + FixedUpdate, + /// Virtual cameras are updated in MonoBehaviour LateUpdate. + LateUpdate, + /// Virtual cameras are updated according to how the target is updated. + SmartUpdate + }; + + /// Depending on how the target objects are animated, adjust the update method to + /// minimize the potential jitter. Use FixedUpdate if all your targets are animated with for RigidBody animation. + /// SmartUpdate will choose the best method for each virtual camera, depending + /// on how the target is animated. + [Tooltip("Use FixedUpdate if all your targets are animated during FixedUpdate (e.g. RigidBodies), LateUpdate if all your targets are animated during the normal Update loop, and SmartUpdate if you want Cinemachine to do the appropriate thing on a per-target basis. SmartUpdate is the recommended setting")] + public UpdateMethod m_UpdateMethod = UpdateMethod.SmartUpdate; + + /// + /// The blend which is used if you don't explicitly define a blend between two Virtual Cameras. + /// + [CinemachineBlendDefinitionProperty] + [Tooltip("The blend that is used in cases where you haven't explicitly defined a blend between two Virtual Cameras")] + public CinemachineBlendDefinition m_DefaultBlend + = new CinemachineBlendDefinition(CinemachineBlendDefinition.Style.EaseInOut, 2f); + + /// + /// This is the asset which contains custom settings for specific blends. + /// + [Tooltip("This is the asset that contains custom settings for blends between specific virtual cameras in your scene")] + public CinemachineBlenderSettings m_CustomBlends = null; + + /// + /// Get the Unity Camera that is attached to this GameObject. This is the camera + /// that will be controlled by the brain. + /// + public Camera OutputCamera + { + get + { + if (m_OutputCamera == null) + m_OutputCamera = GetComponent(); + return m_OutputCamera; + } + } + private Camera m_OutputCamera = null; // never use directly - use accessor + + /// Event with a CinemachineBrain parameter + [Serializable] public class BrainEvent : UnityEvent {} + + /// Event with a ICinemachineCamera parameter + [Serializable] public class VcamEvent : UnityEvent {} + + /// This event will fire whenever a virtual camera goes live and there is no blend + [Tooltip("This event will fire whenever a virtual camera goes live and there is no blend")] + public BrainEvent m_CameraCutEvent = new BrainEvent(); + + /// This event will fire whenever a virtual camera goes live. If a blend is involved, + /// then the event will fire on the first frame of the blend + [Tooltip("This event will fire whenever a virtual camera goes live. If a blend is involved, then the event will fire on the first frame of the blend.")] + public VcamEvent m_CameraActivatedEvent = new VcamEvent(); + + /// Support for opaque post-processing module + internal Component PostProcessingComponent { get; set; } + + /// + /// Because the PostProcessing package is not guaranteed to be present, + /// we must handle PostFX in this opaque way. This delegate will be called + /// every frame (during LateUpdate) after the camera has been positioned. + /// The intention is that the callback will make the right calls to the PostProcessing module. + /// Cinemachine provides the CinemachinePostFX behaviour that makes use of this delegate. + /// + internal static BrainEvent sPostProcessingHandler = new BrainEvent(); + + /// + /// API for the Unity Editor. + /// Show this camera no matter what. This is static, and so affects all Cinemachine brains. + /// + public static ICinemachineCamera SoloCamera { get; set; } + + /// API for the Unity Editor. + /// Color used to indicate that a camera is in Solo mode. + public static Color GetSoloGUIColor() { return Color.Lerp(Color.red, Color.yellow, 0.8f); } + + /// Get the default world up for the virtual cameras. + public Vector3 DefaultWorldUp + { get { return (m_WorldUpOverride != null) ? m_WorldUpOverride.transform.up : Vector3.up; } } + + private ICinemachineCamera mActiveCameraPreviousFrame; + private ICinemachineCamera mOutgoingCameraPreviousFrame; + private CinemachineBlend mActiveBlend = null; + private bool mPreviousFrameWasOverride = false; + + private class OverrideStackFrame + { + public int id; + public ICinemachineCamera camera; + public CinemachineBlend blend; + public float deltaTime; + public float timeOfOverride; + public bool Active { get { return camera != null; } } + public bool Expired + { + get + { + return !Application.isPlaying + && Time.realtimeSinceStartup - timeOfOverride > Time.maximumDeltaTime; + } + } + } + private List mOverrideStack = new List(); + private int mNextOverrideId = 1; + + /// Get the override if it's present, else insert it + private OverrideStackFrame GetOverrideFrame(int id) + { + int count = mOverrideStack.Count; + for (int i = 0; i < count; ++i) + if (mOverrideStack[i].id == id) + return mOverrideStack[i]; + OverrideStackFrame ovr = new OverrideStackFrame(); + ovr.id = id; + mOverrideStack.Insert(0, ovr); + return ovr; + } + + /// Get the next active blend on the stack. Used when an override blends in from nothing. + private OverrideStackFrame mOverrideBlendFromNothing = new OverrideStackFrame(); + private OverrideStackFrame GetNextActiveFrame(int overrideId) + { + bool pastMine = false; + int count = mOverrideStack.Count; + for (int i = 0; i < count; ++i) + { + if (mOverrideStack[i].id == overrideId) + pastMine = true; + else if (mOverrideStack[i].Active && pastMine) + return mOverrideStack[i]; + } + // Create a frame representing the non-override state (gameplay) + mOverrideBlendFromNothing.camera = TopCameraFromPriorityQueue(); + mOverrideBlendFromNothing.blend = mActiveBlend; + return mOverrideBlendFromNothing; + } + + /// Get the first override that has a camera + private OverrideStackFrame GetActiveOverride() + { + int count = mOverrideStack.Count; + for (int i = 0; i < count; ++i) + if (mOverrideStack[i].Active) + return mOverrideStack[i]; + return null; + } + + /// + /// This API is specifically for Timeline. Do not use it. + /// Override the current camera and current blend. This setting will trump + /// any in-game logic that sets virtual camera priorities and Enabled states. + /// This is the main API for the timeline. + /// + /// Id to represent a specific client. An internal + /// stack is maintained, with the most recent non-empty override taking precenence. + /// This id must be > 0. If you pass -1, a new id will be created, and returned. + /// Use that id for subsequent calls. Don't forget to + /// call ReleaseCameraOverride after all overriding is finished, to + /// free the OverideStack resources. + /// The camera to set, corresponding to weight=0 + /// The camera to set, corresponding to weight=1 + /// The blend weight. 0=camA, 1=camB + /// override for deltaTime. Should be Time.FixedDelta for + /// time-based calculations to be included, -1 otherwise + /// The oiverride ID. Don't forget to call ReleaseCameraOverride + /// after all overriding is finished, to free the OverideStack resources. + internal int SetCameraOverride( + int overrideId, + ICinemachineCamera camA, ICinemachineCamera camB, + float weightB, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBrain.SetCameraOverride"); + if (overrideId < 0) + overrideId = mNextOverrideId++; + + OverrideStackFrame ovr = GetOverrideFrame(overrideId); + ovr.camera = null; + ovr.deltaTime = deltaTime; + ovr.timeOfOverride = Time.realtimeSinceStartup; + if (camA != null || camB != null) + { + if (weightB <= Utility.UnityVectorExtensions.Epsilon) + { + ovr.blend = null; + if (camA != null) + ovr.camera = camA; // no blend + } + else if (weightB >= (1f - Utility.UnityVectorExtensions.Epsilon)) + { + ovr.blend = null; + if (camB != null) + ovr.camera = camB; // no blend + } + else + { + // We have a blend. If one of the supplied cameras is null, + // we use the current active virtual camera (blending in/out of game logic), + // If we do have a null camera, make sure it's the 'from' camera. + // Timeline does not distinguish between from and to cams, but we do. + if (camB == null) + { + // Swap them + ICinemachineCamera c = camB; + camB = camA; + camA = c; + weightB = 1f - weightB; + } + + // Are we blending with something in progress? + if (camA == null) + { + OverrideStackFrame frame = GetNextActiveFrame(overrideId); + if (frame.blend != null) + camA = new BlendSourceVirtualCamera(frame.blend, deltaTime); + else + camA = frame.camera != null ? frame.camera : camB; + } + + // Create the override blend + if (ovr.blend == null) + ovr.blend = new CinemachineBlend( + camA, camB, AnimationCurve.Linear(0, 0, 1, 1), 1, weightB); + ovr.blend.CamA = camA; + ovr.blend.CamB = camB; + ovr.blend.TimeInBlend = weightB; + ovr.camera = camB; + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + return overrideId; + } + + /// + /// This API is specifically for Timeline. Do not use it. + /// Release the resources used for a camera override client. + /// See SetCameraOverride. + /// + /// The ID to released. This is the value that + /// was returned by SetCameraOverride + internal void ReleaseCameraOverride(int overrideId) + { + int count = mOverrideStack.Count; + for (int i = 0; i < count; ++i) + { + if (mOverrideStack[i].id == overrideId) + { + mOverrideStack.RemoveAt(i); + return; + } + } + } + + private void OnEnable() + { + mActiveBlend = null; + mActiveCameraPreviousFrame = null; + mOutgoingCameraPreviousFrame = null; + mPreviousFrameWasOverride = false; + CinemachineCore.Instance.AddActiveBrain(this); + } + + private void OnDisable() + { + CinemachineCore.Instance.RemoveActiveBrain(this); + mActiveBlend = null; + mActiveCameraPreviousFrame = null; + mOutgoingCameraPreviousFrame = null; + mPreviousFrameWasOverride = false; + mOverrideStack.Clear(); + } + + private void Start() + { + UpdateVirtualCameras(CinemachineCore.UpdateFilter.Late, -1f); + + // We check in after the physics system has had a chance to move things + StartCoroutine(AfterPhysics()); + } + +#if UNITY_EDITOR + private void OnGUI() + { + if (!m_ShowDebugText) + CinemachineGameWindowDebug.ReleaseScreenPos(this); + else + { + // Show the active camera and blend + Color color = GUI.color; + ICinemachineCamera vcam = ActiveVirtualCamera; + string text = "CM " + gameObject.name + ": "; + if (SoloCamera != null) + { + text += "SOLO "; + GUI.color = GetSoloGUIColor(); + } + if (ActiveBlend == null) + text += (vcam != null ? "[" + vcam.Name + "]" : "(none)"); + else + text += ActiveBlend.Description; + Rect r = CinemachineGameWindowDebug.GetScreenPos(this, text, GUI.skin.box); + GUI.Label(r, text, GUI.skin.box); + GUI.color = color; + } + } +#endif + + WaitForFixedUpdate mWaitForFixedUpdate = new WaitForFixedUpdate(); + private IEnumerator AfterPhysics() + { + while (true) + { + yield return mWaitForFixedUpdate; + if (m_UpdateMethod == UpdateMethod.SmartUpdate) + { + AddSubframe(); // FixedUpdate can be called multiple times per frame + UpdateVirtualCameras(CinemachineCore.UpdateFilter.Fixed, GetEffectiveDeltaTime(true)); + } + else + { + if (m_UpdateMethod == UpdateMethod.LateUpdate) + msSubframes = 1; + else + { + AddSubframe(); // FixedUpdate can be called multiple times per frame + UpdateVirtualCameras(CinemachineCore.UpdateFilter.ForcedFixed, GetEffectiveDeltaTime(true)); + } + } + } + } + + private void LateUpdate() + { + float deltaTime = GetEffectiveDeltaTime(false); + if (m_UpdateMethod == UpdateMethod.SmartUpdate) + UpdateVirtualCameras(CinemachineCore.UpdateFilter.Late, deltaTime); + else if (m_UpdateMethod == UpdateMethod.LateUpdate) + UpdateVirtualCameras(CinemachineCore.UpdateFilter.ForcedLate, deltaTime); + + // Choose the active vcam and apply it to the Unity camera + ProcessActiveCamera(GetEffectiveDeltaTime(false)); + } + +#if UNITY_EDITOR + /// This is only needed in editor mode to force timeline to call OnGUI while + /// timeline is up and the game is not running, in order to allow dragging + /// the composer guide in the game view. + private void OnPreCull() + { + if (!Application.isPlaying) + { + // Note: this call will cause any screen canvas attached to the camera + // to be painted one frame out of sync. It will only happen in the editor when not playing. + float deltaTime = GetEffectiveDeltaTime(false); + msSubframes = 1; + UpdateVirtualCameras(CinemachineCore.UpdateFilter.Late, deltaTime); + ProcessActiveCamera(GetEffectiveDeltaTime(false)); + } + } + +#endif + private float GetEffectiveDeltaTime(bool fixedDelta) + { + if (SoloCamera != null) + return Time.unscaledDeltaTime; + OverrideStackFrame activeOverride = GetActiveOverride(); + if (activeOverride != null) + return activeOverride.Expired ? -1 : activeOverride.deltaTime; + if (!Application.isPlaying) + return -1; + if (m_IgnoreTimeScale) + return fixedDelta ? Time.fixedDeltaTime : Time.unscaledDeltaTime; + return fixedDelta ? Time.fixedDeltaTime * Time.timeScale : Time.deltaTime; + } + + private void UpdateVirtualCameras(CinemachineCore.UpdateFilter updateFilter, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBrain.UpdateVirtualCameras"); + CinemachineCore.Instance.CurrentUpdateFilter = updateFilter; + + // We always update all active virtual cameras + CinemachineCore.Instance.UpdateAllActiveVirtualCameras(DefaultWorldUp, deltaTime); + + // Make sure that the current live cameras get updated this frame. + // Only cameras that are enabled get automatically updated. + ICinemachineCamera vcam = ActiveVirtualCamera; + if (vcam != null) + CinemachineCore.Instance.UpdateVirtualCamera(vcam, DefaultWorldUp, deltaTime); + CinemachineBlend activeBlend = ActiveBlend; + if (activeBlend != null) + activeBlend.UpdateCameraState(DefaultWorldUp, deltaTime); + + // Restore the filter for general use + CinemachineCore.Instance.CurrentUpdateFilter = CinemachineCore.UpdateFilter.Late; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + private void ProcessActiveCamera(float deltaTime) + { + // This condition should never occur, but let's be defensive + if (!isActiveAndEnabled) + { + mActiveCameraPreviousFrame = null; + mOutgoingCameraPreviousFrame = null; + mPreviousFrameWasOverride = false; + return; + } + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBrain.ProcessActiveCamera"); + + OverrideStackFrame activeOverride = GetActiveOverride(); + ICinemachineCamera activeCamera = ActiveVirtualCamera; + if (activeCamera == null) + mOutgoingCameraPreviousFrame = null; + else + { + // If there is an override, we kill the in-game blend + if (activeOverride != null) + mActiveBlend = null; + CinemachineBlend activeBlend = ActiveBlend; + + // Check for unexpected deletion of the cached mActiveCameraPreviousFrame + if (mActiveCameraPreviousFrame != null && mActiveCameraPreviousFrame.VirtualCameraGameObject == null) + mActiveCameraPreviousFrame = null; + + // Are we transitioning cameras? + if (mActiveCameraPreviousFrame != activeCamera) + { + // Do we need to create a game-play blend? + if (mActiveCameraPreviousFrame != null + && !mPreviousFrameWasOverride + && activeOverride == null + && deltaTime >= 0) + { + // Create a blend (will be null if a cut) + float duration = 0; + AnimationCurve curve = LookupBlendCurve( + mActiveCameraPreviousFrame, activeCamera, out duration); + activeBlend = CreateBlend( + mActiveCameraPreviousFrame, activeCamera, + curve, duration, mActiveBlend); + } + // Need this check because Timeline override sometimes inverts outgoing and incoming + if (activeCamera != mOutgoingCameraPreviousFrame) + { + // Notify incoming camera of transition + activeCamera.OnTransitionFromCamera(mActiveCameraPreviousFrame, DefaultWorldUp, deltaTime); + + // If the incoming camera is disabled, then we must assume + // that it has not been updated properly + if (!activeCamera.VirtualCameraGameObject.activeInHierarchy + && (activeBlend == null || !activeBlend.Uses(activeCamera))) + { + activeCamera.UpdateCameraState(DefaultWorldUp, -1); + } + if (m_CameraActivatedEvent != null) + m_CameraActivatedEvent.Invoke(activeCamera); + } + // If we're cutting without a blend, or no active cameras + // were active last frame, send an event + if (activeBlend == null + || (activeBlend.CamA != mActiveCameraPreviousFrame + && activeBlend.CamB != mActiveCameraPreviousFrame + && activeBlend.CamA != mOutgoingCameraPreviousFrame + && activeBlend.CamB != mOutgoingCameraPreviousFrame)) + { + if (m_CameraCutEvent != null) + m_CameraCutEvent.Invoke(this); + } + } + + // Advance the current blend (if any) + if (activeBlend != null) + { + if (activeOverride == null) + activeBlend.TimeInBlend += (deltaTime >= 0) + ? deltaTime : activeBlend.Duration; + if (activeBlend.IsComplete) + activeBlend = null; + } + if (activeOverride == null) + mActiveBlend = activeBlend; + + // Apply the result to the Unity camera + CameraState state = activeCamera.State; + if (activeBlend != null) + state = activeBlend.State; + PushStateToUnityCamera(state, activeCamera); + + mOutgoingCameraPreviousFrame = null; + if (activeBlend != null) + mOutgoingCameraPreviousFrame = activeBlend.CamB; + } + + mActiveCameraPreviousFrame = activeCamera; + mPreviousFrameWasOverride = activeOverride != null; + + if (mPreviousFrameWasOverride) + { + // Hack: Because we don't know whether blending in or out... grrr... + if (activeOverride.blend != null) + { + if (activeOverride.blend.BlendWeight < 0.5f) + { + mActiveCameraPreviousFrame = activeOverride.blend.CamA; + mOutgoingCameraPreviousFrame = activeOverride.blend.CamB; + } + else + { + mActiveCameraPreviousFrame = activeOverride.blend.CamB; + mOutgoingCameraPreviousFrame = activeOverride.blend.CamA; + } + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// + /// Is there a blend in progress? + /// + public bool IsBlending { get { return ActiveBlend != null && ActiveBlend.IsValid; } } + + /// + /// Get the current blend in progress. Returns null if none. + /// + public CinemachineBlend ActiveBlend + { + get + { + if (SoloCamera != null) + return null; + OverrideStackFrame ovr = GetActiveOverride(); + return (ovr != null && ovr.blend != null) ? ovr.blend : mActiveBlend; + } + } + + /// + /// True if the ICinemachineCamera the current active camera, + /// or part of a current blend, either directly or indirectly because its parents are live. + /// + /// The camera to test whether it is live + /// True if the camera is live (directly or indirectly) + /// or part of a blend in progress. + public bool IsLive(ICinemachineCamera vcam) + { + if (IsLiveItself(vcam)) + return true; + + ICinemachineCamera parent = vcam.ParentCamera; + while (parent != null && parent.IsLiveChild(vcam)) + { + if (IsLiveItself(parent)) + return true; + vcam = parent; + parent = vcam.ParentCamera; + } + return false; + } + + // True if this vcam (not considering parents) actually live. + private bool IsLiveItself(ICinemachineCamera vcam) + { + if (mActiveCameraPreviousFrame == vcam) + return true; + if (ActiveVirtualCamera == vcam) + return true; + if (IsBlending && ActiveBlend.Uses(vcam)) + return true; + return false; + } + + /// + /// Get the current active virtual camera. + /// + public ICinemachineCamera ActiveVirtualCamera + { + get + { + if (SoloCamera != null) + return SoloCamera; + OverrideStackFrame ovr = GetActiveOverride(); + return (ovr != null && ovr.camera != null) + ? ovr.camera : TopCameraFromPriorityQueue(); + } + } + + /// + /// The current state applied to the unity camera (may be the result of a blend) + /// + public CameraState CurrentCameraState { get; private set; } + + /// + /// Get the highest-priority Enabled ICinemachineCamera + /// that is visible to my camera. Culling Mask is used to test visibility. + /// + private ICinemachineCamera TopCameraFromPriorityQueue() + { + Camera outputCamera = OutputCamera; + int mask = outputCamera == null ? ~0 : outputCamera.cullingMask; + int numCameras = CinemachineCore.Instance.VirtualCameraCount; + for (int i = 0; i < numCameras; ++i) + { + ICinemachineCamera cam = CinemachineCore.Instance.GetVirtualCamera(i); + GameObject go = cam != null ? cam.VirtualCameraGameObject : null; + if (go != null && (mask & (1 << go.layer)) != 0) + return cam; + } + return null; + } + + /// + /// Create a blend curve for blending from one ICinemachineCamera to another. + /// If there is a specific blend defined for these cameras it will be used, otherwise + /// a default blend will be created, which could be a cut. + /// + private AnimationCurve LookupBlendCurve( + ICinemachineCamera fromKey, ICinemachineCamera toKey, out float duration) + { + // Get the blend curve that's most appropriate for these cameras + AnimationCurve blendCurve = m_DefaultBlend.BlendCurve; + if (m_CustomBlends != null) + { + string fromCameraName = (fromKey != null) ? fromKey.Name : string.Empty; + string toCameraName = (toKey != null) ? toKey.Name : string.Empty; + blendCurve = m_CustomBlends.GetBlendCurveForVirtualCameras( + fromCameraName, toCameraName, blendCurve); + } + var keys = blendCurve.keys; + duration = (keys == null || keys.Length == 0) ? 0 : keys[keys.Length-1].time; + return blendCurve; + } + + /// + /// Create a blend from one ICinemachineCamera to another, + /// or to/from a point, if we can't do anything else + /// + private CinemachineBlend CreateBlend( + ICinemachineCamera camA, ICinemachineCamera camB, + AnimationCurve blendCurve, float duration, + CinemachineBlend activeBlend) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineTrackedDolly.MutateCameraState"); + if (blendCurve == null || duration <= 0 || (camA == null && camB == null)) + { + //UnityEngine.Profiling.Profiler.EndSample(); + return null; + } + if (camA == null || activeBlend != null) + { + // Blend from the current camera position + CameraState state = CameraState.Default; + if (activeBlend != null) + state = activeBlend.State; + else + { + state.RawPosition = transform.position; + state.RawOrientation = transform.rotation; + state.Lens = LensSettings.FromCamera(OutputCamera); + } + camA = new StaticPointVirtualCamera(state, activeBlend == null ? "(none)" : "Mid-blend"); + } + CinemachineBlend blend = new CinemachineBlend(camA, camB, blendCurve, duration, 0); + //UnityEngine.Profiling.Profiler.EndSample(); + return blend; + } + + /// Apply a cref="CameraState"/> to the game object + private void PushStateToUnityCamera(CameraState state, ICinemachineCamera vcam) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBrain.PushStateToUnityCamera"); + CurrentCameraState = state; + transform.position = state.FinalPosition; + transform.rotation = state.FinalOrientation; + Camera cam = OutputCamera; + if (cam != null) + { + cam.fieldOfView = state.Lens.FieldOfView; + cam.orthographicSize = state.Lens.OrthographicSize; + cam.nearClipPlane = state.Lens.NearClipPlane; + cam.farClipPlane = state.Lens.FarClipPlane; + } + if (sPostProcessingHandler != null) + sPostProcessingHandler.Invoke(this); + //UnityEngine.Profiling.Profiler.EndSample(); + } + + static int msCurrentFrame; + static int msFirstBrainObjectId; + static int msSubframes; + void AddSubframe() + { + int now = Time.frameCount; + if (now == msCurrentFrame) + { + if (msFirstBrainObjectId == GetInstanceID()) + ++msSubframes; + } + else + { + msCurrentFrame = now; + msFirstBrainObjectId = GetInstanceID(); + msSubframes = 1; + } + } + + /// API for CinemachineCore only: Get the number of subframes to + /// update the virtual cameras. + /// Number of subframes registered by the first brain's FixedUpdate + internal static int GetSubframeCount() { return Math.Max(1, msSubframes); } + } + + /// + /// Point source for blending. It's not really a virtual camera, but takes + /// a CameraState and exposes it as a virtual camera for the purposes of blending. + /// + internal class StaticPointVirtualCamera : ICinemachineCamera + { + public StaticPointVirtualCamera(CameraState state, string name) { State = state; Name = name; } + public void SetState(CameraState state) { State = state; } + + public string Name { get; private set; } + public string Description { get { return ""; }} + public int Priority { get; set; } + public Transform LookAt { get; set; } + public Transform Follow { get; set; } + public CameraState State { get; private set; } + public GameObject VirtualCameraGameObject { get { return null; } } + public ICinemachineCamera LiveChildOrSelf { get { return this; } } + public ICinemachineCamera ParentCamera { get { return null; } } + public bool IsLiveChild(ICinemachineCamera vcam) { return false; } + public void UpdateCameraState(Vector3 worldUp, float deltaTime) {} + public void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) {} + } + + /// + /// Blend result source for blending. This exposes a CinemachineBlend object + /// as an ersatz virtual camera for the purposes of blending. This achieves the purpose + /// of blending the result oif a blend. + /// + internal class BlendSourceVirtualCamera : ICinemachineCamera + { + public BlendSourceVirtualCamera(CinemachineBlend blend, float deltaTime) + { + Blend = blend; + UpdateCameraState(blend.CamA.State.ReferenceUp, deltaTime); + } + + public CinemachineBlend Blend { get; private set; } + + public string Name { get { return "Blend"; }} + public string Description { get { return Blend.Description; }} + public int Priority { get; set; } + public Transform LookAt { get; set; } + public Transform Follow { get; set; } + public CameraState State { get; private set; } + public GameObject VirtualCameraGameObject { get { return null; } } + public ICinemachineCamera LiveChildOrSelf { get { return Blend.CamB; } } + public ICinemachineCamera ParentCamera { get { return null; } } + public bool IsLiveChild(ICinemachineCamera vcam) { return vcam == Blend.CamA || vcam == Blend.CamB; } + public CameraState CalculateNewState(float deltaTime) { return State; } + public void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + Blend.UpdateCameraState(worldUp, deltaTime); + State = Blend.State; + } + public void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) {} + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs.meta new file mode 100644 index 0000000..df91cff --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineBrain.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 72ece51f2901e7445ab60da3685d6b5f +timeCreated: 1493069520 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 100 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs new file mode 100644 index 0000000..814f616 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs @@ -0,0 +1,432 @@ +using System.Collections.Generic; +using UnityEngine; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// + /// Cinemachine ClearShot is a "manager camera" that owns and manages a set of + /// Virtual Camera gameObject children. When Live, the ClearShot will check the + /// children, and choose the one with the best quality shot and make it Live. + /// + /// This can be a very powerful tool. If the child cameras have CinemachineCollider + /// extensions, they will analyze the scene for target obstructions, optimal target + /// distance, and other items, and report their assessment of shot quality back to + /// the ClearShot parent, who will then choose the best one. You can use this to set + /// up complex multi-camera coverage of a scene, and be assured that a clear shot of + /// the target will always be available. + /// + /// If multiple child cameras have the same shot quality, the one with the highest + /// priority will be chosen. + /// + /// You can also define custom blends between the ClearShot children. + /// + [DocumentationSorting(12, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineClearShot")] + public class CinemachineClearShot : CinemachineVirtualCameraBase + { + /// Default object for the camera children to look at (the aim target), if not specified in a child camera. May be empty. + [Tooltip("Default object for the camera children to look at (the aim target), if not specified in a child camera. May be empty if all children specify targets of their own.")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + /// Default object for the camera children wants to move with (the body target), if not specified in a child camera. May be empty. + [Tooltip("Default object for the camera children wants to move with (the body target), if not specified in a child camera. May be empty if all children specify targets of their own.")] + [NoSaveDuringPlay] + public Transform m_Follow = null; + + /// When enabled, the current camera and blend will be indicated in the game window, for debugging + [Tooltip("When enabled, the current child camera and blend will be indicated in the game window, for debugging")] + [NoSaveDuringPlay] + public bool m_ShowDebugText = false; + + /// Internal API for the editor. Do not use this filed. + [SerializeField, HideInInspector, NoSaveDuringPlay] + public CinemachineVirtualCameraBase[] m_ChildCameras = null; + + /// Wait this many seconds before activating a new child camera + [Tooltip("Wait this many seconds before activating a new child camera")] + public float m_ActivateAfter; + + /// An active camera must be active for at least this many seconds + [Tooltip("An active camera must be active for at least this many seconds")] + public float m_MinDuration; + + /// If checked, camera choice will be randomized if multiple cameras are equally desirable. Otherwise, child list order will be used + [Tooltip("If checked, camera choice will be randomized if multiple cameras are equally desirable. Otherwise, child list order and child camera priority will be used.")] + public bool m_RandomizeChoice = false; + + /// The blend which is used if you don't explicitly define a blend between two Virtual Cameras + [CinemachineBlendDefinitionProperty] + [Tooltip("The blend which is used if you don't explicitly define a blend between two Virtual Cameras")] + public CinemachineBlendDefinition m_DefaultBlend + = new CinemachineBlendDefinition(CinemachineBlendDefinition.Style.Cut, 0); + + /// This is the asset which contains custom settings for specific blends + [HideInInspector] + public CinemachineBlenderSettings m_CustomBlends = null; + + /// Gets a brief debug description of this virtual camera, for use when displayiong debug info + public override string Description + { + get + { + // Show the active camera and blend + ICinemachineCamera vcam = LiveChild; + if (mActiveBlend == null) + return (vcam != null) ? "[" + vcam.Name + "]" : "(none)"; + return mActiveBlend.Description; + } + } + + /// Get the current "best" child virtual camera, that would be chosen + /// if the ClearShot camera were active. + public ICinemachineCamera LiveChild { set; get; } + + /// The CameraState of the currently live child + public override CameraState State { get { return m_State; } } + + /// Return the live child. + public override ICinemachineCamera LiveChildOrSelf { get { return LiveChild; } } + + /// Check whether the vcam a live child of this camera. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public override bool IsLiveChild(ICinemachineCamera vcam) + { + return vcam == LiveChild + || (mActiveBlend != null && (vcam == mActiveBlend.CamA || vcam == mActiveBlend.CamB)); + } + + /// Get the current LookAt target. Returns parent's LookAt if parent + /// is non-null and no specific LookAt defined for this camera + override public Transform LookAt + { + get { return ResolveLookAt(m_LookAt); } + set { m_LookAt = value; } + } + + /// Get the current Follow target. Returns parent's Follow if parent + /// is non-null and no specific Follow defined for this camera + override public Transform Follow + { + get { return ResolveFollow(m_Follow); } + set { m_Follow = value; } + } + + /// Remove a Pipeline stage hook callback. + /// Make sure it is removed from all the children. + /// The delegate to remove. + public override void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + base.RemovePostPipelineStageHook(d); + UpdateListOfChildren(); + foreach (var vcam in m_ChildCameras) + vcam.RemovePostPipelineStageHook(d); + } + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. This implementation + /// updates all the children, chooses the best one, and implements any required blending. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + public override void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineClearShot.UpdateCameraState"); + if (!PreviousStateIsValid) + deltaTime = -1; + + // Choose the best camera + UpdateListOfChildren(); + ICinemachineCamera previousCam = LiveChild; + LiveChild = ChooseCurrentCamera(worldUp, deltaTime); + + // Are we transitioning cameras? + if (previousCam != null && LiveChild != null && previousCam != LiveChild) + { + // Create a blend (will be null if a cut) + float duration = 0; + AnimationCurve curve = LookupBlendCurve(previousCam, LiveChild, out duration); + mActiveBlend = CreateBlend( + previousCam, LiveChild, + curve, duration, mActiveBlend, deltaTime); + + // Notify incoming camera of transition + LiveChild.OnTransitionFromCamera(previousCam, worldUp, deltaTime); + + // Generate Camera Activation event if live + CinemachineCore.Instance.GenerateCameraActivationEvent(LiveChild); + + // If cutting, generate a camera cut event if live + if (mActiveBlend == null) + CinemachineCore.Instance.GenerateCameraCutEvent(LiveChild); + } + + // Advance the current blend (if any) + if (mActiveBlend != null) + { + mActiveBlend.TimeInBlend += (deltaTime >= 0) + ? deltaTime : mActiveBlend.Duration; + if (mActiveBlend.IsComplete) + mActiveBlend = null; + } + + if (mActiveBlend != null) + { + mActiveBlend.UpdateCameraState(worldUp, deltaTime); + m_State = mActiveBlend.State; + } + else if (LiveChild != null) + m_State = LiveChild.State; + + PreviousStateIsValid = true; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// Makes sure the internal child cache is up to date + protected override void OnEnable() + { + base.OnEnable(); + InvalidateListOfChildren(); + mActiveBlend = null; + } + + /// Makes sure the internal child cache is up to date + public void OnTransformChildrenChanged() + { + InvalidateListOfChildren(); + } + +#if UNITY_EDITOR + /// Displays the current active camera on the game screen, if requested + protected override void OnGUI() + { + base.OnGUI(); + if (!m_ShowDebugText) + CinemachineGameWindowDebug.ReleaseScreenPos(this); + else + { + string text = Name + ": " + Description; + Rect r = CinemachineGameWindowDebug.GetScreenPos(this, text, GUI.skin.box); + GUI.Label(r, text, GUI.skin.box); + } + } +#endif + /// Is there a blend in progress? + public bool IsBlending { get { return mActiveBlend != null; } } + + CameraState m_State = CameraState.Default; + + /// The list of child cameras. These are just the immediate children in the hierarchy. + public CinemachineVirtualCameraBase[] ChildCameras + { + get { UpdateListOfChildren(); return m_ChildCameras; } + } + + float mActivationTime = 0; + float mPendingActivationTime = 0; + ICinemachineCamera mPendingCamera; + private CinemachineBlend mActiveBlend = null; + + void InvalidateListOfChildren() + { + m_ChildCameras = null; + m_RandomizedChilden = null; + LiveChild = null; + } + + /// If RandomizeChoice is enabled, call this to re-randomize the children next frame. + /// This is useful if you want to freshen up the shot. + public void ResetRandomization() + { + m_RandomizedChilden = null; + mRandomizeNow = true; + } + + void UpdateListOfChildren() + { + if (m_ChildCameras != null) + return; + + List list = new List(); + CinemachineVirtualCameraBase[] kids = GetComponentsInChildren(true); + foreach (CinemachineVirtualCameraBase k in kids) + if (k.transform.parent == transform) + list.Add(k); + m_ChildCameras = list.ToArray(); + + // Zap the cached current instructions + mActivationTime = mPendingActivationTime = 0; + mPendingCamera = null; + LiveChild = null; + mActiveBlend = null; + } + + private bool mRandomizeNow = false; + private CinemachineVirtualCameraBase[] m_RandomizedChilden = null; + + private ICinemachineCamera ChooseCurrentCamera(Vector3 worldUp, float deltaTime) + { + if (m_ChildCameras == null || m_ChildCameras.Length == 0) + { + mActivationTime = 0; + return null; + } + + CinemachineVirtualCameraBase[] childCameras = m_ChildCameras; + if (!m_RandomizeChoice) + m_RandomizedChilden = null; + else if (m_ChildCameras.Length > 1) + { + if (m_RandomizedChilden == null) + m_RandomizedChilden = Randomize(m_ChildCameras); + childCameras = m_RandomizedChilden; + } + + if (LiveChild != null && !LiveChild.VirtualCameraGameObject.activeSelf) + LiveChild = null; + ICinemachineCamera best = LiveChild; + for (int i = 0; i < childCameras.Length; ++i) + { + CinemachineVirtualCameraBase vcam = childCameras[i]; + if (vcam != null && vcam.VirtualCameraGameObject.activeInHierarchy) + { + // Choose the first in the list that is better than the current + if (best == null + || vcam.State.ShotQuality > best.State.ShotQuality + || (vcam.State.ShotQuality == best.State.ShotQuality && vcam.Priority > best.Priority) + || (m_RandomizeChoice && mRandomizeNow && (ICinemachineCamera)vcam != LiveChild + && vcam.State.ShotQuality == best.State.ShotQuality + && vcam.Priority == best.Priority)) + { + best = vcam; + } + } + } + mRandomizeNow = false; + + float now = Time.time; + if (mActivationTime != 0) + { + // Is it active now? + if (LiveChild == best) + { + // Yes, cancel any pending + mPendingActivationTime = 0; + mPendingCamera = null; + return best; + } + + // Is it pending? + if (deltaTime >= 0) + { + if (mPendingActivationTime != 0 && mPendingCamera == best) + { + // Has it been pending long enough, and are we allowed to switch away + // from the active action? + if ((now - mPendingActivationTime) > m_ActivateAfter + && (now - mActivationTime) > m_MinDuration) + { + // Yes, activate it now + m_RandomizedChilden = null; // reshuffle the children + mActivationTime = now; + mPendingActivationTime = 0; + mPendingCamera = null; + return best; + } + return LiveChild; + } + } + } + // Neither active nor pending. + mPendingActivationTime = 0; // cancel the pending, if any + mPendingCamera = null; + + // Can we activate it now? + if (deltaTime >= 0 && mActivationTime > 0) + { + if (m_ActivateAfter > 0 + || (now - mActivationTime) < m_MinDuration) + { + // Too early - make it pending + mPendingCamera = best; + mPendingActivationTime = now; + return LiveChild; + } + } + // Activate now + m_RandomizedChilden = null; // reshuffle the children + mActivationTime = now; + return best; + } + + struct Pair { public int a; public float b; } + CinemachineVirtualCameraBase[] Randomize(CinemachineVirtualCameraBase[] src) + { + List pairs = new List(); + for (int i = 0; i < src.Length; ++i) + { + Pair p = new Pair(); p.a = i; p.b = Random.Range(0, 1000f); + pairs.Add(p); + } + pairs.Sort((p1, p2) => (int)p1.b - (int)p2.b); + CinemachineVirtualCameraBase[] dst = new CinemachineVirtualCameraBase[src.Length]; + Pair[] result = pairs.ToArray(); + for (int i = 0; i < src.Length; ++i) + dst[i] = src[result[i].a]; + return dst; + } + + private AnimationCurve LookupBlendCurve( + ICinemachineCamera fromKey, ICinemachineCamera toKey, out float duration) + { + // Get the blend curve that's most appropriate for these cameras + AnimationCurve blendCurve = m_DefaultBlend.BlendCurve; + if (m_CustomBlends != null) + { + string fromCameraName = (fromKey != null) ? fromKey.Name : string.Empty; + string toCameraName = (toKey != null) ? toKey.Name : string.Empty; + blendCurve = m_CustomBlends.GetBlendCurveForVirtualCameras( + fromCameraName, toCameraName, blendCurve); + } + var keys = blendCurve.keys; + duration = (keys == null || keys.Length == 0) ? 0 : keys[keys.Length-1].time; + return blendCurve; + } + + private CinemachineBlend CreateBlend( + ICinemachineCamera camA, ICinemachineCamera camB, + AnimationCurve blendCurve, float duration, + CinemachineBlend activeBlend, float deltaTime) + { + if (blendCurve == null || duration <= 0 || (camA == null && camB == null)) + return null; + + if (camA == null || activeBlend != null) + { + // Blend from the current camera position + CameraState state = (activeBlend != null) ? activeBlend.State : State; + camA = new StaticPointVirtualCamera(state, (activeBlend != null) ? "Mid-blend" : "(none)"); + } + return new CinemachineBlend(camA, camB, blendCurve, duration, 0); + } + + /// Notification that this virtual camera is going live. + /// This implementation resets the child randomization. + /// The camera being deactivated. May be null. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public override void OnTransitionFromCamera( + ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) + { + base.OnTransitionFromCamera(fromCam, worldUp, deltaTime); + if (m_RandomizeChoice && mActiveBlend == null) + { + m_RandomizedChilden = null; + LiveChild = null; + UpdateCameraState(worldUp, deltaTime); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs.meta new file mode 100644 index 0000000..5807c27 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineClearShot.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d62f748f5292bb343be9e6b0c84416d9 +timeCreated: 1489088130 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs new file mode 100644 index 0000000..99e6739 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs @@ -0,0 +1,565 @@ +using UnityEngine; +using System.Collections.Generic; +using Cinemachine.Utility; +using UnityEngine.Serialization; +using System; + +namespace Cinemachine +{ + /// + /// An add-on module for Cinemachine Virtual Camera that post-processes + /// the final position of the virtual camera. Based on the supplied settings, + /// the Collider will attempt to preserve the line of sight + /// with the LookAt target of the virtual camera by moving + /// away from objects that will obstruct the view. + /// + /// Additionally, the Collider can be used to assess the shot quality and + /// report this as a field in the camera State. + /// + [DocumentationSorting(15, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [AddComponentMenu("")] // Hide in menu + [SaveDuringPlay] + public class CinemachineCollider : CinemachineExtension + { + /// The Unity layer mask against which the collider will raycast. + [Header("Obstacle Detection")] + [Tooltip("The Unity layer mask against which the collider will raycast")] + public LayerMask m_CollideAgainst = 1; + + /// Obstacles with this tag will be ignored. It is a good idea to set this field to the target's tag + [TagField] + [Tooltip("Obstacles with this tag will be ignored. It is a good idea to set this field to the target's tag")] + public string m_IgnoreTag = string.Empty; + + /// Obstacles closer to the target than this will be ignored + [Tooltip("Obstacles closer to the target than this will be ignored")] + public float m_MinimumDistanceFromTarget = 0.1f; + + /// + /// When enabled, will attempt to resolve situations where the line of sight to the + /// target is blocked by an obstacle + /// + [Space] + [Tooltip("When enabled, will attempt to resolve situations where the line of sight to the target is blocked by an obstacle")] + [FormerlySerializedAs("m_PreserveLineOfSight")] + public bool m_AvoidObstacles = true; + + /// + /// The raycast distance to test for when checking if the line of sight to this camera's target is clear. + /// + [Tooltip("The maximum raycast distance when checking if the line of sight to this camera's target is clear. If the setting is 0 or less, the current actual distance to target will be used.")] + [FormerlySerializedAs("m_LineOfSightFeelerDistance")] + public float m_DistanceLimit = 0f; + + /// + /// Camera will try to maintain this distance from any obstacle. + /// Increase this value if you are seeing inside obstacles due to a large + /// FOV on the camera. + /// + [Tooltip("Camera will try to maintain this distance from any obstacle. Try to keep this value small. Increase it if you are seeing inside obstacles due to a large FOV on the camera.")] + public float m_CameraRadius = 0.1f; + + /// The way in which the Collider will attempt to preserve sight of the target. + public enum ResolutionStrategy + { + /// Camera will be pulled forward along its Z axis until it is in front of + /// the nearest obstacle + PullCameraForward, + /// In addition to pulling the camera forward, an effort will be made to + /// return the camera to its original height + PreserveCameraHeight, + /// In addition to pulling the camera forward, an effort will be made to + /// return the camera to its original distance from the target + PreserveCameraDistance + }; + /// The way in which the Collider will attempt to preserve sight of the target. + [Tooltip("The way in which the Collider will attempt to preserve sight of the target.")] + public ResolutionStrategy m_Strategy = ResolutionStrategy.PreserveCameraHeight; + + /// + /// Upper limit on how many obstacle hits to process. Higher numbers may impact performance. + /// In most environments, 4 is enough. + /// + [Range(1, 10)] + [Tooltip("Upper limit on how many obstacle hits to process. Higher numbers may impact performance. In most environments, 4 is enough.")] + public int m_MaximumEffort = 4; + + /// + /// The gradualness of collision resolution. Higher numbers will move the + /// camera more gradually away from obstructions. + /// + [Range(0, 10)] + [Tooltip("The gradualness of collision resolution. Higher numbers will move the camera more gradually away from obstructions.")] + [FormerlySerializedAs("m_Smoothing")] + public float m_Damping = 0; + + /// If greater than zero, a higher score will be given to shots when the target is closer to + /// this distance. Set this to zero to disable this feature + [Header("Shot Evaluation")] + [Tooltip("If greater than zero, a higher score will be given to shots when the target is closer to this distance. Set this to zero to disable this feature.")] + public float m_OptimalTargetDistance = 0; + + /// See wheter an object is blocking the camera's view of the target + /// The virtual camera in question. This might be different from the + /// virtual camera that owns the collider, in the event that the camera has children + /// True if something is blocking the view + public bool IsTargetObscured(ICinemachineCamera vcam) + { + return GetExtraState(vcam).targetObscured; + } + + /// See whether the virtual camera has been moved nby the collider + /// The virtual camera in question. This might be different from the + /// virtual camera that owns the collider, in the event that the camera has children + /// True if the virtual camera has been displaced due to collision or + /// target obstruction + public bool CameraWasDisplaced(CinemachineVirtualCameraBase vcam) + { + return GetExtraState(vcam).colliderDisplacement > 0; + } + + private void OnValidate() + { + m_DistanceLimit = Mathf.Max(0, m_DistanceLimit); + m_CameraRadius = Mathf.Max(0, m_CameraRadius); + m_MinimumDistanceFromTarget = Mathf.Max(0.01f, m_MinimumDistanceFromTarget); + m_OptimalTargetDistance = Mathf.Max(0, m_OptimalTargetDistance); + } + + /// Cleanup + protected override void OnDestroy() + { + base.OnDestroy(); + CleanupCameraCollider(); + } + + /// This must be small but greater than 0 - reduces false results due to precision + const float PrecisionSlush = 0.001f; + + // Per-vcam extra state info + class VcamExtraState + { + public Vector3 m_previousDisplacement; + public float colliderDisplacement; + public bool targetObscured; + public List debugResolutionPath; + + public void AddPointToDebugPath(Vector3 p) + { +#if UNITY_EDITOR + if (debugResolutionPath == null) + debugResolutionPath = new List(); + debugResolutionPath.Add(p); +#endif + } + }; + + /// Inspector API for debugging collision resolution path + public List> DebugPaths + { + get + { + List> list = new List>(); + List extraStates = GetAllExtraStates(); + foreach (var v in extraStates) + if (v.debugResolutionPath != null) + list.Add(v.debugResolutionPath); + return list; + } + } + + /// Callcack to to the collision resolution and shot evaluation + protected override void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime) + { + VcamExtraState extra = null; + if (stage == CinemachineCore.Stage.Body) + { + extra = GetExtraState(vcam); + extra.targetObscured = false; + extra.colliderDisplacement = 0; + extra.debugResolutionPath = null; + } + + // Move the body before the Aim is calculated + if (stage == CinemachineCore.Stage.Body) + { + if (m_AvoidObstacles) + { + Vector3 displacement = PreserveLignOfSight(ref state, ref extra); + if (m_Damping > 0 && deltaTime >= 0) + { + Vector3 delta = displacement - extra.m_previousDisplacement; + delta = Damper.Damp(delta, m_Damping, deltaTime); + displacement = extra.m_previousDisplacement + delta; + } + extra.m_previousDisplacement = displacement; + state.PositionCorrection += displacement; + extra.colliderDisplacement += displacement.magnitude; + } + } + // Rate the shot after the aim was set + if (stage == CinemachineCore.Stage.Aim) + { + extra = GetExtraState(vcam); + extra.targetObscured = CheckForTargetObstructions(state); + + // GML these values are an initial arbitrary attempt at rating quality + if (extra.targetObscured) + state.ShotQuality *= 0.2f; + if (extra.colliderDisplacement > 0) + state.ShotQuality *= 0.8f; + + float nearnessBoost = 0; + const float kMaxNearBoost = 0.2f; + if (m_OptimalTargetDistance > 0 && state.HasLookAt) + { + float distance = Vector3.Magnitude(state.ReferenceLookAt - state.FinalPosition); + if (distance <= m_OptimalTargetDistance) + { + float threshold = m_OptimalTargetDistance / 2; + if (distance >= threshold) + nearnessBoost = kMaxNearBoost * (distance - threshold) + / (m_OptimalTargetDistance - threshold); + } + else + { + distance -= m_OptimalTargetDistance; + float threshold = m_OptimalTargetDistance * 3; + if (distance < threshold) + nearnessBoost = kMaxNearBoost * (1f - (distance / threshold)); + } + state.ShotQuality *= (1f + nearnessBoost); + } + } + } + + private Vector3 PreserveLignOfSight(ref CameraState state, ref VcamExtraState extra) + { + Vector3 displacement = Vector3.zero; + if (state.HasLookAt) + { + Vector3 cameraPos = state.CorrectedPosition; + Vector3 lookAtPos = state.ReferenceLookAt; + Vector3 pos = cameraPos; + Vector3 dir = pos - lookAtPos; + float targetDistance = dir.magnitude; + float minDistanceFromTarget = Mathf.Max(m_MinimumDistanceFromTarget, Epsilon); + if (targetDistance > minDistanceFromTarget) + { + dir.Normalize(); + float rayLength = targetDistance - minDistanceFromTarget; + if (m_DistanceLimit > Epsilon) + rayLength = Mathf.Min(m_DistanceLimit, rayLength); + + // Make a ray that looks towards the camera, to get the most distant obstruction + Ray ray = new Ray(pos - rayLength * dir, dir); + rayLength += PrecisionSlush; + if (rayLength > Epsilon) + { + RaycastHit hitInfo; + if (RaycastIgnoreTag(ray, out hitInfo, rayLength)) + { + // Pull camera forward in front of obstacle + float adjustment = Mathf.Max(0, hitInfo.distance - PrecisionSlush); + pos = ray.GetPoint(adjustment); + extra.AddPointToDebugPath(pos); + if (m_Strategy != ResolutionStrategy.PullCameraForward) + { + pos = PushCameraBack( + pos, dir, hitInfo, lookAtPos, + new Plane(state.ReferenceUp, cameraPos), + targetDistance, m_MaximumEffort, ref extra); + } + } + } + } + if (m_CameraRadius > Epsilon) + pos += RespectCameraRadius(pos, state.ReferenceLookAt); + else if (mCameraColliderGameObject != null) + CleanupCameraCollider(); + displacement = pos - cameraPos; + } + return displacement; + } + + private bool RaycastIgnoreTag(Ray ray, out RaycastHit hitInfo, float rayLength) + { + while (Physics.Raycast( + ray, out hitInfo, rayLength, m_CollideAgainst.value, + QueryTriggerInteraction.Ignore)) + { + if (m_IgnoreTag.Length == 0 || !hitInfo.collider.CompareTag(m_IgnoreTag)) + return true; + + // Pull ray origin forward in front of tagged obstacle + Ray inverseRay = new Ray(ray.GetPoint(rayLength), -ray.direction); + if (!hitInfo.collider.Raycast(inverseRay, out hitInfo, rayLength)) + break; // should never happen! + rayLength = hitInfo.distance - PrecisionSlush; + if (rayLength < Epsilon) + break; + ray.origin = inverseRay.GetPoint(rayLength); + } + return false; + } + + private Vector3 PushCameraBack( + Vector3 currentPos, Vector3 pushDir, RaycastHit obstacle, + Vector3 lookAtPos, Plane startPlane, float targetDistance, int iterations, + ref VcamExtraState extra) + { + // Take a step along the wall. + Vector3 pos = currentPos; + Vector3 dir = Vector3.zero; + if (!GetWalkingDirection(pos, pushDir, obstacle, ref dir)) + return pos; + + Ray ray = new Ray(pos, dir); + float distance = GetPushBackDistance(ray, startPlane, targetDistance, lookAtPos); + if (distance <= Epsilon) + return pos; + + // Check only as far as the obstacle bounds + float clampedDistance = ClampRayToBounds(ray, distance, obstacle.collider.bounds); + distance = Mathf.Min(distance, clampedDistance + PrecisionSlush); + + RaycastHit hitInfo; + if (RaycastIgnoreTag(ray, out hitInfo, distance)) + { + // We hit something. Stop there and take a step along that wall. + float adjustment = hitInfo.distance - PrecisionSlush; + pos = ray.GetPoint(adjustment); + extra.AddPointToDebugPath(pos); + if (iterations > 1) + pos = PushCameraBack( + pos, dir, hitInfo, + lookAtPos, startPlane, + targetDistance, iterations-1, ref extra); + + return pos; + } + + // Didn't hit anything. Can we push back all the way now? + pos = ray.GetPoint(distance); + + // First check if we can still see the target. If not, abort + dir = pos - lookAtPos; + float d = dir.magnitude; + RaycastHit hitInfo2; + if (d < Epsilon || RaycastIgnoreTag(new Ray(lookAtPos, dir), out hitInfo2, d - PrecisionSlush)) + return currentPos; + + // All clear + ray = new Ray(pos, dir); + extra.AddPointToDebugPath(pos); + distance = GetPushBackDistance(ray, startPlane, targetDistance, lookAtPos); + if (distance > Epsilon) + { + if (!RaycastIgnoreTag(ray, out hitInfo, distance)) + { + pos = ray.GetPoint(distance); // no obstacles - all good + extra.AddPointToDebugPath(pos); + } + else + { + // We hit something. Stop there and maybe take a step along that wall + float adjustment = hitInfo.distance - PrecisionSlush; + pos = ray.GetPoint(adjustment); + extra.AddPointToDebugPath(pos); + if (iterations > 1) + pos = PushCameraBack( + pos, dir, hitInfo, lookAtPos, startPlane, + targetDistance, iterations-1, ref extra); + } + } + return pos; + } + + private RaycastHit[] m_CornerBuffer = new RaycastHit[4]; + private bool GetWalkingDirection( + Vector3 pos, Vector3 pushDir, RaycastHit obstacle, ref Vector3 outDir) + { + Vector3 normal2 = obstacle.normal; + + // Check for nearby obstacles. Are we in a corner? + float nearbyDistance = PrecisionSlush * 5; + int numFound = Physics.SphereCastNonAlloc( + pos, nearbyDistance, pushDir.normalized, m_CornerBuffer, 0, + m_CollideAgainst.value, QueryTriggerInteraction.Ignore); + if (numFound > 1) + { + // Calculate the second normal + for (int i = 0; i < numFound; ++i) + { + if (m_IgnoreTag.Length > 0 && m_CornerBuffer[i].collider.CompareTag(m_IgnoreTag)) + continue; + Type type = m_CornerBuffer[i].collider.GetType(); + if (type == typeof(BoxCollider) + || type == typeof(SphereCollider) + || type == typeof(CapsuleCollider)) + { + Vector3 p = m_CornerBuffer[i].collider.ClosestPoint(pos); + Vector3 d = p - pos; + if (d.magnitude > Vector3.kEpsilon) + { + if (m_CornerBuffer[i].collider.Raycast( + new Ray(pos, d), out m_CornerBuffer[i], nearbyDistance)) + { + if (!(m_CornerBuffer[i].normal - obstacle.normal).AlmostZero()) + normal2 = m_CornerBuffer[i].normal; + break; + } + } + } + } + } + + // Walk along the wall. If we're in a corner, walk their intersecting line + Vector3 dir = Vector3.Cross(obstacle.normal, normal2); + if (dir.AlmostZero()) + dir = Vector3.ProjectOnPlane(pushDir, obstacle.normal); + else + { + float dot = Vector3.Dot(dir, pushDir); + if (Mathf.Abs(dot) < Epsilon) + return false; + if (dot < 0) + dir = -dir; + } + if (dir.AlmostZero()) + return false; + + outDir = dir.normalized; + return true; + } + + const float AngleThreshold = 0.1f; + float GetPushBackDistance(Ray ray, Plane startPlane, float targetDistance, Vector3 lookAtPos) + { + float maxDistance = targetDistance - (ray.origin - lookAtPos).magnitude; + if (maxDistance < Epsilon) + return 0; + if (m_Strategy == ResolutionStrategy.PreserveCameraDistance) + return maxDistance; + + float distance; + if (!startPlane.Raycast(ray, out distance)) + distance = 0; + distance = Mathf.Min(maxDistance, distance); + if (distance < Epsilon) + return 0; + + // If we are close to parallel to the plane, we have to take special action + float angle = Mathf.Abs(Vector3.Angle(startPlane.normal, ray.direction) - 90); + if (angle < AngleThreshold) + distance = Mathf.Lerp(0, distance, angle / AngleThreshold); + return distance; + } + + float ClampRayToBounds(Ray ray, float distance, Bounds bounds) + { + float d; + if (Vector3.Dot(ray.direction, Vector3.up) > 0) + { + if (new Plane(Vector3.down, bounds.max).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + else if (Vector3.Dot(ray.direction, Vector3.down) > 0) + { + if (new Plane(Vector3.up, bounds.min).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + + if (Vector3.Dot(ray.direction, Vector3.right) > 0) + { + if (new Plane(Vector3.left, bounds.max).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + else if (Vector3.Dot(ray.direction, Vector3.left) > 0) + { + if (new Plane(Vector3.right, bounds.min).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + + if (Vector3.Dot(ray.direction, Vector3.forward) > 0) + { + if (new Plane(Vector3.back, bounds.max).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + else if (Vector3.Dot(ray.direction, Vector3.back) > 0) + { + if (new Plane(Vector3.forward, bounds.min).Raycast(ray, out d) && d > Epsilon) + distance = Mathf.Min(distance, d); + } + return distance; + } + + private Collider[] mColliderBuffer = new Collider[5]; + private SphereCollider mCameraCollider; + private GameObject mCameraColliderGameObject; + private Vector3 RespectCameraRadius(Vector3 cameraPos, Vector3 lookAtPos) + { + Vector3 result = Vector3.zero; + int numObstacles = Physics.OverlapSphereNonAlloc( + cameraPos, m_CameraRadius, mColliderBuffer, + m_CollideAgainst, QueryTriggerInteraction.Ignore); + if (numObstacles > 0) + { + if (mCameraColliderGameObject == null) + { + mCameraColliderGameObject = new GameObject("Cinemachine Collider Collider"); + mCameraColliderGameObject.hideFlags = HideFlags.HideAndDontSave; + mCameraColliderGameObject.transform.position = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); + mCameraColliderGameObject.SetActive(true); + mCameraCollider = mCameraColliderGameObject.AddComponent(); + } + mCameraCollider.radius = m_CameraRadius; + for (int i = 0; i < numObstacles; ++i) + { + Collider c = mColliderBuffer[i]; + if (m_IgnoreTag.Length > 0 && c.CompareTag(m_IgnoreTag)) + continue; + Vector3 dir; + float distance; + if (Physics.ComputePenetration( + mCameraCollider, cameraPos, Quaternion.identity, + c, c.transform.position, c.transform.rotation, + out dir, out distance)) + { + result += dir * distance; // naive, but maybe enough + } + } + } + return result; + } + + private void CleanupCameraCollider() + { + if (mCameraColliderGameObject != null) + DestroyImmediate(mCameraColliderGameObject); + mCameraColliderGameObject = null; + mCameraCollider = null; + } + + private bool CheckForTargetObstructions(CameraState state) + { + if (state.HasLookAt) + { + Vector3 lookAtPos = state.ReferenceLookAt; + Vector3 pos = state.CorrectedPosition; + Vector3 dir = lookAtPos - pos; + float distance = dir.magnitude; + if (distance < Mathf.Max(m_MinimumDistanceFromTarget, Epsilon)) + return true; + Ray ray = new Ray(pos, dir.normalized); + RaycastHit hitInfo; + if (RaycastIgnoreTag(ray, out hitInfo, distance - m_MinimumDistanceFromTarget)) + return true; + } + return false; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs.meta new file mode 100644 index 0000000..64be66f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineCollider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e501d18bb52cf8c40b1853ca4904654f +timeCreated: 1491854845 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs new file mode 100644 index 0000000..f4ff41b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs @@ -0,0 +1,222 @@ +using UnityEngine; +using System.Collections.Generic; +using Cinemachine.Utility; +using System; + +namespace Cinemachine +{ + /// + /// An add-on module for Cinemachine Virtual Camera that post-processes + /// the final position of the virtual camera. It will confine the virtual + /// camera's position to the volume specified in the Bounding Volume field. + /// + [DocumentationSorting(22, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [AddComponentMenu("")] // Hide in menu + [SaveDuringPlay] + public class CinemachineConfiner : CinemachineExtension + { + /// The confiner can operate using a 2D bounding shape or a 3D bounding volume + public enum Mode + { + Confine2D, + Confine3D + }; + /// The confiner can operate using a 2D bounding shape or a 3D bounding volume + [Tooltip("The confiner can operate using a 2D bounding shape or a 3D bounding volume")] + public Mode m_ConfineMode; + + /// The volume within which the camera is to be contained. + [Tooltip("The volume within which the camera is to be contained")] + public Collider m_BoundingVolume; + + /// The 2D shape within which the camera is to be contained. + [Tooltip("The 2D shape within which the camera is to be contained")] + public Collider2D m_BoundingShape2D; + + /// If camera is orthographic, screen edges will be confined to the volume. + [Tooltip("If camera is orthographic, screen edges will be confined to the volume. If not checked, then only the camera center will be confined")] + public bool m_ConfineScreenEdges = true; + + /// How gradually to return the camera to the bounding volume if it goes beyond the borders + [Tooltip("How gradually to return the camera to the bounding volume if it goes beyond the borders. Higher numbers are more gradual.")] + [Range(0, 10)] + public float m_Damping = 0; + + /// See whether the virtual camera has been moved by the confiner + /// The virtual camera in question. This might be different from the + /// virtual camera that owns the confiner, in the event that the camera has children + /// True if the virtual camera has been repositioned + public bool CameraWasDisplaced(CinemachineVirtualCameraBase vcam) + { + return GetExtraState(vcam).confinerDisplacement > 0; + } + + private void OnValidate() + { + m_Damping = Mathf.Max(0, m_Damping); + } + + class VcamExtraState + { + public Vector3 m_previousDisplacement; + public float confinerDisplacement; + }; + + /// Check if the bounding volume is defined + public bool IsValid + { + get + { + return ((m_ConfineMode == Mode.Confine3D && m_BoundingVolume != null) + || (m_ConfineMode == Mode.Confine2D && m_BoundingShape2D != null)); + } + } + + /// Callback to to the camera confining + protected override void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime) + { + if (IsValid) + { + // Move the body before the Aim is calculated + if (stage == CinemachineCore.Stage.Body) + { + Vector3 displacement; + if (m_ConfineScreenEdges && state.Lens.Orthographic) + displacement = ConfineScreenEdges(vcam, ref state); + else + displacement = ConfinePoint(state.CorrectedPosition); + + VcamExtraState extra = GetExtraState(vcam); + if (m_Damping > 0 && deltaTime >= 0) + { + Vector3 delta = displacement - extra.m_previousDisplacement; + delta = Damper.Damp(delta, m_Damping, deltaTime); + displacement = extra.m_previousDisplacement + delta; + } + extra.m_previousDisplacement = displacement; + state.PositionCorrection += displacement; + extra.confinerDisplacement = displacement.magnitude; + } + } + } + + private List> m_pathCache; + + /// Call this if the bounding shape's points change at runtime + public void InvalidatePathCache() { m_pathCache = null; } + + bool ValidatePathCache() + { + Type colliderType = m_BoundingShape2D == null ? null: m_BoundingShape2D.GetType(); + if (colliderType == typeof(PolygonCollider2D)) + { + PolygonCollider2D poly = m_BoundingShape2D as PolygonCollider2D; + if (m_pathCache == null || m_pathCache.Count != poly.pathCount) + { + m_pathCache = new List>(); + for (int i = 0; i < poly.pathCount; ++i) + { + Vector2[] path = poly.GetPath(i); + List dst = new List(); + for (int j = 0; j < path.Length; ++j) + dst.Add(path[j]); + m_pathCache.Add(dst); + } + } + return true; + } + else if (colliderType == typeof(CompositeCollider2D)) + { + CompositeCollider2D poly = m_BoundingShape2D as CompositeCollider2D; + if (m_pathCache == null || m_pathCache.Count != poly.pathCount) + { + m_pathCache = new List>(); + Vector2[] path = new Vector2[poly.pointCount]; + for (int i = 0; i < poly.pathCount; ++i) + { + int numPoints = poly.GetPath(i, path); + List dst = new List(); + for (int j = 0; j < numPoints; ++j) + dst.Add(path[j]); + m_pathCache.Add(dst); + } + } + return true; + } + InvalidatePathCache(); + return false; + } + + private Vector3 ConfinePoint(Vector3 camPos) + { + // 3D version + if (m_ConfineMode == Mode.Confine3D) + return m_BoundingVolume.ClosestPoint(camPos) - camPos; + + // 2D version + if (m_BoundingShape2D.OverlapPoint(camPos)) + return Vector3.zero; + + // Find the nearest point on the shape's boundary + if (!ValidatePathCache()) + return Vector3.zero; + + Vector2 p = camPos; + Vector2 closest = p; + float bestDistance = float.MaxValue; + for (int i = 0; i < m_pathCache.Count; ++i) + { + int numPoints = m_pathCache[i].Count; + if (numPoints > 0) + { + Vector2 v0 = m_BoundingShape2D.transform.TransformPoint(m_pathCache[i][numPoints-1]); + for (int j = 0; j < numPoints; ++j) + { + Vector2 v = m_BoundingShape2D.transform.TransformPoint(m_pathCache[i][j]); + Vector2 c = Vector2.Lerp(v0, v, p.ClosestPointOnSegment(v0, v)); + float d = Vector2.SqrMagnitude(p - c); + if (d < bestDistance) + { + bestDistance = d; + closest = c; + } + v0 = v; + } + } + } + return closest - p; + } + + // Camera must be orthographic + private Vector3 ConfineScreenEdges(CinemachineVirtualCameraBase vcam, ref CameraState state) + { + Quaternion rot = Quaternion.Inverse(state.CorrectedOrientation); + float dy = state.Lens.OrthographicSize; + float dx = dy * state.Lens.Aspect; + Vector3 vx = (rot * Vector3.right) * dx; + Vector3 vy = (rot * Vector3.up) * dy; + + Vector3 displacement = Vector3.zero; + Vector3 camPos = state.CorrectedPosition; + const int kMaxIter = 12; + for (int i = 0; i < kMaxIter; ++i) + { + Vector3 d = ConfinePoint((camPos - vy) - vx); + if (d.AlmostZero()) + d = ConfinePoint((camPos - vy) + vx); + if (d.AlmostZero()) + d = ConfinePoint((camPos + vy) - vx); + if (d.AlmostZero()) + d = ConfinePoint((camPos + vy) + vx); + if (d.AlmostZero()) + break; + displacement += d; + camPos += d; + } + return displacement; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs.meta new file mode 100644 index 0000000..00eb9ad --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineConfiner.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a2fba25a5cd15594e8f050a11e386c80 +timeCreated: 1503419997 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs new file mode 100644 index 0000000..42e97cf --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// This is a very simple behaviour that constrains its transform to a CinemachinePath. + /// It can be used to animate any objects along a path, or as a Follow target for + /// Cinemachine Virtual Cameras. + /// + [DocumentationSorting(21f, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + public class CinemachineDollyCart : MonoBehaviour + { + /// The path to follow + [Tooltip("The path to follow")] + public CinemachinePathBase m_Path; + + /// This enum defines the options available for the update method. + public enum UpdateMethod + { + /// Updated in normal MonoBehaviour Update. + Update, + /// Updated in sync with the Physics module, in FixedUpdate + FixedUpdate + }; + + /// When to move the cart, if Velocity is non-zero + [Tooltip("When to move the cart, if Velocity is non-zero")] + public UpdateMethod m_UpdateMethod = UpdateMethod.Update; + + /// How to interpret the Path Position + [Tooltip("How to interpret the Path Position. If set to Path Units, values are as follows: 0 represents the first waypoint on the path, 1 is the second, and so on. Values in-between are points on the path in between the waypoints. If set to Distance, then Path Position represents distance along the path.")] + public CinemachinePathBase.PositionUnits m_PositionUnits = CinemachinePathBase.PositionUnits.Distance; + + /// Move the cart with this speed + [Tooltip("Move the cart with this speed along the path. The value is interpreted according to the Position Units setting.")] + [FormerlySerializedAs("m_Velocity")] + public float m_Speed; + + /// The cart's current position on the path, in distance units + [Tooltip("The position along the path at which the cart will be placed. This can be animated directly or, if the velocity is non-zero, will be updated automatically. The value is interpreted according to the Position Units setting.")] + [FormerlySerializedAs("m_CurrentDistance")] + public float m_Position; + + void FixedUpdate() + { + if (m_UpdateMethod == UpdateMethod.FixedUpdate) + SetCartPosition(m_Position += m_Speed * Time.deltaTime); + } + + void Update() + { + if (!Application.isPlaying) + SetCartPosition(m_Position); + else if (m_UpdateMethod == UpdateMethod.Update) + SetCartPosition(m_Position += m_Speed * Time.deltaTime); + } + + void SetCartPosition(float distanceAlongPath) + { + if (m_Path != null) + { + m_Position = m_Path.NormalizeUnit(distanceAlongPath, m_PositionUnits); + transform.position = m_Path.EvaluatePositionAtUnit(m_Position, m_PositionUnits); + transform.rotation = m_Path.EvaluateOrientationAtUnit(m_Position, m_PositionUnits); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs.meta new file mode 100644 index 0000000..e9225fc --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineDollyCart.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 99a9c787e5d1bbf48a389834c4a9641c +timeCreated: 1502981597 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs new file mode 100644 index 0000000..9417b59 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs @@ -0,0 +1,61 @@ +using Cinemachine.Utility; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This component will expose a non-cinemachine camera to the cinemachine system, + /// allowing it to participate in blends. + /// Just add it as a component alongside an existing Unity Camera component. + /// + [DocumentationSorting(14, DocumentationSortingAttribute.Level.UserRef)] + [RequireComponent(typeof(Camera)), DisallowMultipleComponent, ExecuteInEditMode] + [AddComponentMenu("Cinemachine/CinemachineExternalCamera")] + public class CinemachineExternalCamera : CinemachineVirtualCameraBase + { + /// The object that the camera is looking at. + [Tooltip("The object that the camera is looking at. Setting this will improve the quality of the blends to and from this camera")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + private Camera m_Camera; + private CameraState m_State = CameraState.Default; + + /// Get the CameraState, as we are able to construct one from the Unity Camera + public override CameraState State { get { return m_State; } } + + /// The object that the camera is looking at + override public Transform LookAt + { + get { return m_LookAt; } + set { m_LookAt = value; } + } + + /// This vcam defines no targets + override public Transform Follow { get; set; } + + /// Construct a CameraState object from the Unity Camera + public override void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + // Get the state from the camera + if (m_Camera == null) + m_Camera = GetComponent(); + + m_State = CameraState.Default; + m_State.RawPosition = transform.position; + m_State.RawOrientation = transform.rotation; + m_State.ReferenceUp = m_State.RawOrientation * Vector3.up; + if (m_Camera != null) + m_State.Lens = LensSettings.FromCamera(m_Camera); + + if (m_LookAt != null) + { + m_State.ReferenceLookAt = m_LookAt.transform.position; + Vector3 dir = m_State.ReferenceLookAt - State.RawPosition; + if (!dir.AlmostZero()) + m_State.ReferenceLookAt = m_State.RawPosition + Vector3.Project( + dir, State.RawOrientation * Vector3.forward); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs.meta new file mode 100644 index 0000000..5d3953a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineExternalCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 57744762d9079934292f57896d8193e0 +timeCreated: 1489441713 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs new file mode 100644 index 0000000..cf14dc6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs @@ -0,0 +1,91 @@ +using UnityEngine; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// + /// An add-on module for Cinemachine Virtual Camera that adjusts + /// the FOV of the lens to keep the target object at a constant size on the screen, + /// regardless of camera and target position. + /// + [DocumentationSorting(16, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [AddComponentMenu("")] // Hide in menu + [SaveDuringPlay] + public class CinemachineFollowZoom : CinemachineExtension + { + /// The shot width to maintain, in world units, at target distance. + /// FOV will be adusted as far as possible to maintain this width at the + /// target distance from the camera. + [Tooltip("The shot width to maintain, in world units, at target distance.")] + public float m_Width = 2f; + + /// Increase this value to soften the aggressiveness of the follow-zoom. + /// Small numbers are more responsive, larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("Increase this value to soften the aggressiveness of the follow-zoom. Small numbers are more responsive, larger numbers give a more heavy slowly responding camera.")] + public float m_Damping = 1f; + + /// Will not generate an FOV smaller than this. + [Range(1f, 179f)] + [Tooltip("Lower limit for the FOV that this behaviour will generate.")] + public float m_MinFOV = 3f; + + /// Will not generate an FOV larget than this. + [Range(1f, 179f)] + [Tooltip("Upper limit for the FOV that this behaviour will generate.")] + public float m_MaxFOV = 60f; + + private void OnValidate() + { + m_Width = Mathf.Max(0, m_Width); + m_MaxFOV = Mathf.Clamp(m_MaxFOV, 1, 179); + m_MinFOV = Mathf.Clamp(m_MinFOV, 1, m_MaxFOV); + } + + class VcamExtraState + { + public float m_previousFrameZoom = 0; + } + + /// Callback to preform the zoom adjustment + protected override void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime) + { + VcamExtraState extra = GetExtraState(vcam); + if (!enabled || deltaTime < 0) + extra.m_previousFrameZoom = state.Lens.FieldOfView; + + // Set the zoom after the body has been positioned, but before the aim, + // so that composer can compose using the updated fov. + if (stage == CinemachineCore.Stage.Body) + { + // Try to reproduce the target width + float targetWidth = Mathf.Max(m_Width, 0); + float fov = 179f; + float d = Vector3.Distance(state.CorrectedPosition, state.ReferenceLookAt); + if (d > UnityVectorExtensions.Epsilon) + { + // Clamp targetWidth to FOV min/max + float minW = d * 2f * Mathf.Tan(m_MinFOV * Mathf.Deg2Rad / 2f); + float maxW = d * 2f * Mathf.Tan(m_MaxFOV * Mathf.Deg2Rad / 2f); + targetWidth = Mathf.Clamp(targetWidth, minW, maxW); + + // Apply damping + if (deltaTime >= 0 && m_Damping > 0) + { + float currentWidth = d * 2f * Mathf.Tan(extra.m_previousFrameZoom * Mathf.Deg2Rad / 2f); + float delta = targetWidth - currentWidth; + delta = Damper.Damp(delta, m_Damping, deltaTime); + targetWidth = currentWidth + delta; + } + fov = 2f * Mathf.Atan(targetWidth / (2 * d)) * Mathf.Rad2Deg; + } + LensSettings lens = state.Lens; + lens.FieldOfView = extra.m_previousFrameZoom = Mathf.Clamp(fov, m_MinFOV, m_MaxFOV); + state.Lens = lens; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs.meta new file mode 100644 index 0000000..386862d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFollowZoom.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4700f9f03ad19f94baf0367cb7a9c988 +timeCreated: 1491854845 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs new file mode 100644 index 0000000..69d8f56 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs @@ -0,0 +1,673 @@ +using UnityEngine; +using Cinemachine.Utility; +using UnityEngine.Serialization; +using System; + +namespace Cinemachine +{ + /// + /// A Cinemachine Camera geared towards a 3rd person camera experience. + /// The camera orbits around its subject with three separate camera rigs defining + /// rings around the target. Each rig has its own radius, height offset, composer, + /// and lens settings. + /// Depending on the camera's position along the spline connecting these three rigs, + /// these settings are interpolated to give the final camera position and state. + /// + [DocumentationSorting(11, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineFreeLook")] + public class CinemachineFreeLook : CinemachineVirtualCameraBase + { + /// Object for the camera children to look at (the aim target) + [Tooltip("Object for the camera children to look at (the aim target).")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + /// Object for the camera children wants to move with (the body target) + [Tooltip("Object for the camera children wants to move with (the body target).")] + [NoSaveDuringPlay] + public Transform m_Follow = null; + + /// If enabled, this lens setting will apply to all three child rigs, otherwise the child rig lens settings will be used + [Tooltip("If enabled, this lens setting will apply to all three child rigs, otherwise the child rig lens settings will be used")] + [FormerlySerializedAs("m_UseCommonLensSetting")] + public bool m_CommonLens = true; + + /// Specifies the lens properties of this Virtual Camera. + /// This generally mirrors the Unity Camera's lens settings, and will be used to drive + /// the Unity camera when the vcam is active + [FormerlySerializedAs("m_LensAttributes")] + [Tooltip("Specifies the lens properties of this Virtual Camera. This generally mirrors the Unity Camera's lens settings, and will be used to drive the Unity camera when the vcam is active")] + [LensSettingsProperty] + public LensSettings m_Lens = LensSettings.Default; + + /// The Vertical axis. Value is 0..1. Chooses how to blend the child rigs + [Header("Axis Control")] + [Tooltip("The Vertical axis. Value is 0..1. Chooses how to blend the child rigs")] + public AxisState m_YAxis = new AxisState(2f, 0.2f, 0.1f, 0.5f, "Mouse Y", false); + + /// The Horizontal axis. Value is 0..359. This is passed on to the rigs' OrbitalTransposer component + [Tooltip("The Horizontal axis. Value is 0..359. This is passed on to the rigs' OrbitalTransposer component")] + public AxisState m_XAxis = new AxisState(300f, 0.1f, 0.1f, 0f, "Mouse X", true); + + /// The definition of Forward. Camera will follow behind + [Tooltip("The definition of Forward. Camera will follow behind.")] + public CinemachineOrbitalTransposer.Heading m_Heading + = new CinemachineOrbitalTransposer.Heading( + CinemachineOrbitalTransposer.Heading.HeadingDefinition.TargetForward, 4, 0); + + /// Controls how automatic recentering of the X axis is accomplished + [Tooltip("Controls how automatic recentering of the X axis is accomplished")] + public CinemachineOrbitalTransposer.Recentering m_RecenterToTargetHeading + = new CinemachineOrbitalTransposer.Recentering(false, 1, 2); + + /// The coordinate space to use when interpreting the offset from the target + [Header("Orbits")] + [Tooltip("The coordinate space to use when interpreting the offset from the target. This is also used to set the camera's Up vector, which will be maintained when aiming the camera.")] + public CinemachineOrbitalTransposer.BindingMode m_BindingMode + = CinemachineOrbitalTransposer.BindingMode.SimpleFollowWithWorldUp; + + /// + [Tooltip("Controls how taut is the line that connects the rigs' orbits, which determines final placement on the Y axis")] + [Range(0f, 1f)] + [FormerlySerializedAs("m_SplineTension")] + public float m_SplineCurvature = 0.2f; + + /// Defines the height and radius of the Rig orbit + [Serializable] + public struct Orbit + { + /// Height relative to target + public float m_Height; + /// Radius of orbit + public float m_Radius; + /// Constructor with specific values + public Orbit(float h, float r) { m_Height = h; m_Radius = r; } + } + + /// The radius and height of the three orbiting rigs + [Tooltip("The radius and height of the three orbiting rigs.")] + public Orbit[] m_Orbits = new Orbit[3] + { + // These are the default orbits + new Orbit(4.5f, 1.75f), + new Orbit(2.5f, 3f), + new Orbit(0.4f, 1.3f) + }; + + // Legacy support + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_HeadingBias")] + private float m_LegacyHeadingBias = float.MaxValue; + bool mUseLegacyRigDefinitions = false; + + /// Enforce bounds for fields, when changed in inspector. + protected override void OnValidate() + { + base.OnValidate(); + + // Upgrade after a legacy deserialize + if (m_LegacyHeadingBias != float.MaxValue) + { + m_Heading.m_HeadingBias = m_LegacyHeadingBias; + m_LegacyHeadingBias = float.MaxValue; + m_RecenterToTargetHeading.LegacyUpgrade( + ref m_Heading.m_HeadingDefinition, ref m_Heading.m_VelocityFilterStrength); + mUseLegacyRigDefinitions = true; + } + m_YAxis.Validate(); + m_XAxis.Validate(); + m_RecenterToTargetHeading.Validate(); + m_Lens.Validate(); + + InvalidateRigCache(); + } + + /// Get a child rig + /// Rig index. Can be 0, 1, or 2 + /// The rig, or null if index is bad. + public CinemachineVirtualCamera GetRig(int i) + { + UpdateRigCache(); + return (i < 0 || i > 2) ? null : m_Rigs[i]; + } + + /// Names of the 3 child rigs + public static string[] RigNames { get { return new string[] { "TopRig", "MiddleRig", "BottomRig" }; } } + + bool mIsDestroyed = false; + + /// Updates the child rig cache + protected override void OnEnable() + { + mIsDestroyed = false; + base.OnEnable(); + InvalidateRigCache(); + } + + /// Makes sure that the child rigs get destroyed in an undo-firndly manner. + /// Invalidates the rig cache. + protected override void OnDestroy() + { + // Make the rigs visible instead of destroying - this is to keep Undo happy + if (m_Rigs != null) + foreach (var rig in m_Rigs) + if (rig != null && rig.gameObject != null) + rig.gameObject.hideFlags + &= ~(HideFlags.HideInHierarchy | HideFlags.HideInInspector); + + mIsDestroyed = true; + base.OnDestroy(); + } + + /// Invalidates the rig cache + void OnTransformChildrenChanged() + { + InvalidateRigCache(); + } + + void Reset() + { + DestroyRigs(); + } + + /// The cacmera state, which will be a blend of the child rig states + override public CameraState State { get { return m_State; } } + + /// Get the current LookAt target. Returns parent's LookAt if parent + /// is non-null and no specific LookAt defined for this camera + override public Transform LookAt + { + get { return ResolveLookAt(m_LookAt); } + set { m_LookAt = value; } + } + + /// Get the current Follow target. Returns parent's Follow if parent + /// is non-null and no specific Follow defined for this camera + override public Transform Follow + { + get { return ResolveFollow(m_Follow); } + set { m_Follow = value; } + } + + /// Returns the rig with the greatest weight + public override ICinemachineCamera LiveChildOrSelf + { + get + { + // Do not update the rig cache here or there will be infinite loop at creation time + if (m_Rigs == null || m_Rigs.Length != 3) + return this; + if (m_YAxis.Value < 0.33f) + return m_Rigs[2]; + if (m_YAxis.Value > 0.66f) + return m_Rigs[0]; + return m_Rigs[1]; + } + } + + /// Check whether the vcam a live child of this camera. + /// Returns true if the child is currently contributing actively to the camera state. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public override bool IsLiveChild(ICinemachineCamera vcam) + { + // Do not update the rig cache here or there will be infinite loop at creation time + if (m_Rigs == null || m_Rigs.Length != 3) + return false; + + if (m_YAxis.Value < 0.33f) + return vcam == (ICinemachineCamera)m_Rigs[2]; + if (m_YAxis.Value > 0.66f) + return vcam == (ICinemachineCamera)m_Rigs[0]; + return vcam == (ICinemachineCamera)m_Rigs[1]; + } + + /// Remove a Pipeline stage hook callback. + /// Make sure it is removed from all the children. + /// The delegate to remove. + public override void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + base.RemovePostPipelineStageHook(d); + UpdateRigCache(); + if (m_Rigs != null) + foreach (var vcam in m_Rigs) + if (vcam != null) + vcam.RemovePostPipelineStageHook(d); + } + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. All 3 child rigs are updated, + /// and a blend calculated, depending on the value of the Y axis. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + override public void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.UpdateCameraState"); + if (!PreviousStateIsValid) + deltaTime = -1; + + UpdateRigCache(); + + // Reset the base camera state, in case the game object got moved in the editor + if (deltaTime < 0) + m_State = PullStateFromVirtualCamera(worldUp); // Not in gameplay + + // Update the current state by invoking the component pipeline + m_State = CalculateNewState(worldUp, deltaTime); + + // Push the raw position back to the game object's transform, so it + // moves along with the camera. Leave the orientation alone, because it + // screws up camera dragging when there is a LookAt behaviour. + if (Follow != null) + { + Vector3 delta = State.RawPosition - transform.position; + transform.position = State.RawPosition; + m_Rigs[0].transform.position -= delta; + m_Rigs[1].transform.position -= delta; + m_Rigs[2].transform.position -= delta; + } + + PreviousStateIsValid = true; + + // Set up for next frame + bool activeCam = (deltaTime >= 0) || CinemachineCore.Instance.IsLive(this); + if (activeCam) + m_YAxis.Update(deltaTime); + + PushSettingsToRigs(); + + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// If we are transitioning from another FreeLook, grab the axis values from it. + /// The camera being deactivated. May be null. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public override void OnTransitionFromCamera( + ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) + { + base.OnTransitionFromCamera(fromCam, worldUp, deltaTime); + if ((fromCam != null) && (fromCam is CinemachineFreeLook)) + { + CinemachineFreeLook freeLookFrom = fromCam as CinemachineFreeLook; + if (freeLookFrom.Follow == Follow) + { + m_XAxis.Value = freeLookFrom.m_XAxis.Value; + m_YAxis.Value = freeLookFrom.m_YAxis.Value; + UpdateCameraState(worldUp, deltaTime); + } + } + } + + CameraState m_State = CameraState.Default; // Current state this frame + + /// Serialized in order to support copy/paste + [SerializeField][HideInInspector][NoSaveDuringPlay] private CinemachineVirtualCamera[] m_Rigs + = new CinemachineVirtualCamera[3]; + + void InvalidateRigCache() { mOrbitals = null; } + CinemachineOrbitalTransposer[] mOrbitals = null; + CinemachineBlend mBlendA; + CinemachineBlend mBlendB; + + /// + /// Override component pipeline creation. + /// This needs to be done by the editor to support Undo. + /// The override must do exactly the same thing as the CreatePipeline method in this class. + /// + public static CreateRigDelegate CreateRigOverride; + + /// + /// Override component pipeline creation. + /// This needs to be done by the editor to support Undo. + /// The override must do exactly the same thing as the CreatePipeline method in this class. + /// + public delegate CinemachineVirtualCamera CreateRigDelegate( + CinemachineFreeLook vcam, string name, CinemachineVirtualCamera copyFrom); + + /// + /// Override component pipeline destruction. + /// This needs to be done by the editor to support Undo. + /// + public static DestroyRigDelegate DestroyRigOverride; + + /// + /// Override component pipeline destruction. + /// This needs to be done by the editor to support Undo. + /// + public delegate void DestroyRigDelegate(GameObject rig); + + private void DestroyRigs() + { + CinemachineVirtualCamera[] oldRigs = new CinemachineVirtualCamera[RigNames.Length]; + for (int i = 0; i < RigNames.Length; ++i) + { + foreach (Transform child in transform) + if (child.gameObject.name == RigNames[i]) + oldRigs[i] = child.GetComponent(); + } + for (int i = 0; i < oldRigs.Length; ++i) + { + if (oldRigs[i] != null) + { + if (DestroyRigOverride != null) + DestroyRigOverride(oldRigs[i].gameObject); + else + Destroy(oldRigs[i].gameObject); + } + } + m_Rigs = null; + mOrbitals = null; + } + + private CinemachineVirtualCamera[] CreateRigs(CinemachineVirtualCamera[] copyFrom) + { + // Invalidate the cache + mOrbitals = null; + float[] softCenterDefaultsV = new float[] { 0.5f, 0.55f, 0.6f }; + CinemachineVirtualCamera[] newRigs = new CinemachineVirtualCamera[3]; + for (int i = 0; i < RigNames.Length; ++i) + { + CinemachineVirtualCamera src = null; + if (copyFrom != null && copyFrom.Length > i) + src = copyFrom[i]; + + if (CreateRigOverride != null) + newRigs[i] = CreateRigOverride(this, RigNames[i], src); + else + { + // Create a new rig with default components + GameObject go = new GameObject(RigNames[i]); + go.transform.parent = transform; + newRigs[i] = go.AddComponent(); + if (src != null) + ReflectionHelpers.CopyFields(src, newRigs[i]); + else + { + go = newRigs[i].GetComponentOwner().gameObject; + go.AddComponent(); + go.AddComponent(); + } + } + + // Set up the defaults + newRigs[i].InvalidateComponentPipeline(); + CinemachineOrbitalTransposer orbital = newRigs[i].GetCinemachineComponent(); + if (orbital == null) + orbital = newRigs[i].AddCinemachineComponent(); // should not happen + if (src == null) + { + // Only set defaults if not copying + orbital.m_YawDamping = 0; + CinemachineComposer composer = newRigs[i].GetCinemachineComponent(); + if (composer != null) + { + composer.m_HorizontalDamping = composer.m_VerticalDamping = 0; + composer.m_ScreenX = 0.5f; + composer.m_ScreenY = softCenterDefaultsV[i]; + composer.m_DeadZoneWidth = composer.m_DeadZoneHeight = 0.1f; + composer.m_SoftZoneWidth = composer.m_SoftZoneHeight = 0.8f; + composer.m_BiasX = composer.m_BiasY = 0; + } + } + } + return newRigs; + } + + private void UpdateRigCache() + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.UpdateRigCache"); + if (mIsDestroyed) + { + //UnityEngine.Profiling.Profiler.EndSample(); + return; + } + + // Special condition: Did we just get copy/pasted? + if (m_Rigs != null && m_Rigs.Length == 3 && m_Rigs[0] != null && m_Rigs[0].transform.parent != transform) + { + DestroyRigs(); + m_Rigs = CreateRigs(m_Rigs); + } + + // Early out if we're up to date + if (mOrbitals != null && mOrbitals.Length == 3) + { + //UnityEngine.Profiling.Profiler.EndSample(); + return; + } + + // Locate existing rigs, and recreate them if any are missing + if (LocateExistingRigs(RigNames, false) != 3) + { + DestroyRigs(); + m_Rigs = CreateRigs(null); + LocateExistingRigs(RigNames, true); + } + + foreach (var rig in m_Rigs) + { + // Configure the UI + rig.m_ExcludedPropertiesInInspector = m_CommonLens + ? new string[] { "m_Script", "Header", "Extensions", "m_Priority", "m_Follow", "m_Lens" } + : new string[] { "m_Script", "Header", "Extensions", "m_Priority", "m_Follow" }; + rig.m_LockStageInInspector = new CinemachineCore.Stage[] { CinemachineCore.Stage.Body }; + } + + // Create the blend objects + mBlendA = new CinemachineBlend(m_Rigs[1], m_Rigs[0], AnimationCurve.Linear(0, 0, 1, 1), 1, 0); + mBlendB = new CinemachineBlend(m_Rigs[2], m_Rigs[1], AnimationCurve.Linear(0, 0, 1, 1), 1, 0); + + // Horizontal rotation clamped to [0,360] (with wraparound) + m_XAxis.SetThresholds(0f, 360f, true); + + // Vertical rotation cleamped to [0,1] as it is a t-value for the + // catmull-rom spline going through the 3 points on the rig + m_YAxis.SetThresholds(0f, 1f, false); + //UnityEngine.Profiling.Profiler.EndSample(); + } + + private int LocateExistingRigs(string[] rigNames, bool forceOrbital) + { + mOrbitals = new CinemachineOrbitalTransposer[rigNames.Length]; + m_Rigs = new CinemachineVirtualCamera[rigNames.Length]; + int rigsFound = 0; + foreach (Transform child in transform) + { + CinemachineVirtualCamera vcam = child.GetComponent(); + if (vcam != null) + { + GameObject go = child.gameObject; + for (int i = 0; i < rigNames.Length; ++i) + { + if (mOrbitals[i] == null && go.name == rigNames[i]) + { + // Must have an orbital transposer or it's no good + mOrbitals[i] = vcam.GetCinemachineComponent(); + if (mOrbitals[i] == null && forceOrbital) + mOrbitals[i] = vcam.AddCinemachineComponent(); + if (mOrbitals[i] != null) + { + mOrbitals[i].m_HeadingIsSlave = true; + if (i == 0) + mOrbitals[i].HeadingUpdater + = (CinemachineOrbitalTransposer orbital, float deltaTime, Vector3 up) + => { return orbital.UpdateHeading(deltaTime, up, ref m_XAxis); }; + m_Rigs[i] = vcam; + ++rigsFound; + } + } + } + } + } + return rigsFound; + } + + void PushSettingsToRigs() + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs"); + UpdateRigCache(); + for (int i = 0; i < m_Rigs.Length; ++i) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs.m_Rigs[i] == null"); + if (m_Rigs[i] == null) + { + //UnityEngine.Profiling.Profiler.EndSample(); + continue; + } + //UnityEngine.Profiling.Profiler.EndSample(); + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs.m_CommonLens"); + if (m_CommonLens) + m_Rigs[i].m_Lens = m_Lens; + //UnityEngine.Profiling.Profiler.EndSample(); + + // If we just deserialized from a legacy version, + // pull the orbits and targets from the rigs + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs.mUseLegacyRigDefinitions"); + if (mUseLegacyRigDefinitions) + { + mUseLegacyRigDefinitions = false; + m_Orbits[i].m_Height = mOrbitals[i].m_FollowOffset.y; + m_Orbits[i].m_Radius = -mOrbitals[i].m_FollowOffset.z; + if (m_Rigs[i].Follow != null) + Follow = m_Rigs[i].Follow; + } + m_Rigs[i].Follow = null; + //UnityEngine.Profiling.Profiler.EndSample(); + + // Hide the rigs from prying eyes + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs.Hide the rigs"); + if (CinemachineCore.sShowHiddenObjects) + m_Rigs[i].gameObject.hideFlags + &= ~(HideFlags.HideInHierarchy | HideFlags.HideInInspector); + else + m_Rigs[i].gameObject.hideFlags + |= (HideFlags.HideInHierarchy | HideFlags.HideInInspector); + //UnityEngine.Profiling.Profiler.EndSample(); + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.PushSettingsToRigs.Push"); + mOrbitals[i].m_FollowOffset = GetLocalPositionForCameraFromInput(m_YAxis.Value); + mOrbitals[i].m_BindingMode = m_BindingMode; + mOrbitals[i].m_Heading = m_Heading; + mOrbitals[i].m_XAxis = m_XAxis; + mOrbitals[i].m_RecenterToTargetHeading = m_RecenterToTargetHeading; + if (i > 0) + mOrbitals[i].m_RecenterToTargetHeading.m_enabled = false; + + // Hack to get SimpleFollow with heterogeneous dampings to work + if (m_BindingMode == CinemachineTransposer.BindingMode.SimpleFollowWithWorldUp) + m_Rigs[i].SetStateRawPosition(State.RawPosition); + + //UnityEngine.Profiling.Profiler.EndSample(); + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + private CameraState CalculateNewState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.CalculateNewState"); + CameraState state = PullStateFromVirtualCamera(worldUp); + + // Blend from the appropriate rigs + float t = m_YAxis.Value; + if (t > 0.5f) + { + if (mBlendA != null) + { + mBlendA.TimeInBlend = (t - 0.5f) * 2f; + mBlendA.UpdateCameraState(worldUp, deltaTime); + state = mBlendA.State; + } + } + else + { + if (mBlendB != null) + { + mBlendB.TimeInBlend = t * 2f; + mBlendB.UpdateCameraState(worldUp, deltaTime); + state = mBlendB.State; + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + return state; + } + + private CameraState PullStateFromVirtualCamera(Vector3 worldUp) + { + CameraState state = CameraState.Default; + state.RawPosition = transform.position; + state.RawOrientation = transform.rotation; + state.ReferenceUp = worldUp; + + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(this); + m_Lens.Aspect = brain != null ? brain.OutputCamera.aspect : 1; + m_Lens.Orthographic = brain != null ? brain.OutputCamera.orthographic : false; + state.Lens = m_Lens; + + return state; + } + + /// + /// Returns the local position of the camera along the spline used to connect the + /// three camera rigs. Does not take into account the current heading of the + /// camera (or its target) + /// + /// The t-value for the camera on its spline. Internally clamped to + /// the value [0,1] + /// The local offset (back + up) of the camera WRT its target based on the + /// supplied t-value + public Vector3 GetLocalPositionForCameraFromInput(float t) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.GetLocalPositionForCameraFromInput"); + if (mOrbitals == null) + { + //UnityEngine.Profiling.Profiler.EndSample(); + return Vector3.zero; + } + UpdateCachedSpline(); + int n = 1; + if (t > 0.5f) + { + t -= 0.5f; + n = 2; + } + //UnityEngine.Profiling.Profiler.EndSample(); + return SplineHelpers.Bezier3( + t * 2f, m_CachedKnots[n], m_CachedCtrl1[n], m_CachedCtrl2[n], m_CachedKnots[n+1]); + } + + Orbit[] m_CachedOrbits; + float m_CachedTension; + Vector4[] m_CachedKnots; + Vector4[] m_CachedCtrl1; + Vector4[] m_CachedCtrl2; + void UpdateCachedSpline() + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFreeLook.UpdateCachedSpline"); + bool cacheIsValid = (m_CachedOrbits != null && m_CachedTension == m_SplineCurvature); + for (int i = 0; i < 3 && cacheIsValid; ++i) + cacheIsValid = (m_CachedOrbits[i].m_Height == m_Orbits[i].m_Height + && m_CachedOrbits[i].m_Radius == m_Orbits[i].m_Radius); + if (!cacheIsValid) + { + float t = m_SplineCurvature; + m_CachedKnots = new Vector4[5]; + m_CachedCtrl1 = new Vector4[5]; + m_CachedCtrl2 = new Vector4[5]; + m_CachedKnots[1] = new Vector4(0, m_Orbits[2].m_Height, -m_Orbits[2].m_Radius, 0); + m_CachedKnots[2] = new Vector4(0, m_Orbits[1].m_Height, -m_Orbits[1].m_Radius, 0); + m_CachedKnots[3] = new Vector4(0, m_Orbits[0].m_Height, -m_Orbits[0].m_Radius, 0); + m_CachedKnots[0] = Vector4.Lerp(m_CachedKnots[1], Vector4.zero, t); + m_CachedKnots[4] = Vector4.Lerp(m_CachedKnots[3], Vector4.zero, t); + SplineHelpers.ComputeSmoothControlPoints( + ref m_CachedKnots, ref m_CachedCtrl1, ref m_CachedCtrl2); + m_CachedOrbits = new Orbit[3]; + for (int i = 0; i < 3; ++i) + m_CachedOrbits[i] = m_Orbits[i]; + m_CachedTension = m_SplineCurvature; + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs.meta new file mode 100644 index 0000000..ad46301 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineFreeLook.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 319d2fe34a804e245819465c9505ea59 +timeCreated: 1496775487 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs new file mode 100644 index 0000000..57d3ccb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs @@ -0,0 +1,262 @@ +using UnityEngine; +using Cinemachine.Utility; +using System.Collections.Generic; + +namespace Cinemachine +{ + /// + /// CinemachineMixingCamera is a "manager camera" that takes on the state of + /// the weighted average of the states of its child virtual cameras. + /// + /// A fixed number of slots are made available for cameras, rather than a dynamic array. + /// We do it this way in order to support weight animation from the Timeline. + /// Timeline cannot animate array elements. + /// + [DocumentationSorting(20, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineMixingCamera")] + public class CinemachineMixingCamera : CinemachineVirtualCameraBase + { + /// The maximum number of tracked cameras. If you want to add + /// more cameras, do it here in the source code, and be sure to add the + /// extra member variables and to make the appropriate changes in + /// GetWeight() and SetWeight(). + /// The inspector will figure itself out based on this value. + public const int MaxCameras = 8; + + /// Weight of the first tracked camera + [Tooltip("The weight of the first tracked camera")] + public float m_Weight0 = 0.5f; + /// Weight of the second tracked camera + [Tooltip("The weight of the second tracked camera")] + public float m_Weight1 = 0.5f; + /// Weight of the third tracked camera + [Tooltip("The weight of the third tracked camera")] + public float m_Weight2 = 0.5f; + /// Weight of the fourth tracked camera + [Tooltip("The weight of the fourth tracked camera")] + public float m_Weight3 = 0.5f; + /// Weight of the fifth tracked camera + [Tooltip("The weight of the fifth tracked camera")] + public float m_Weight4 = 0.5f; + /// Weight of the sixth tracked camera + [Tooltip("The weight of the sixth tracked camera")] + public float m_Weight5 = 0.5f; + /// Weight of the seventh tracked camera + [Tooltip("The weight of the seventh tracked camera")] + public float m_Weight6 = 0.5f; + /// Weight of the eighth tracked camera + [Tooltip("The weight of the eighth tracked camera")] + public float m_Weight7 = 0.5f; + + /// Get the weight of the child at an index. + /// The child index. Only immediate CinemachineVirtualCameraBase + /// children are counted. + /// The weight of the camera. Valid only if camera is active and enabled. + public float GetWeight(int index) + { + switch (index) + { + case 0: return m_Weight0; + case 1: return m_Weight1; + case 2: return m_Weight2; + case 3: return m_Weight3; + case 4: return m_Weight4; + case 5: return m_Weight5; + case 6: return m_Weight6; + case 7: return m_Weight7; + } + Debug.LogError("CinemachineMixingCamera: Invalid index: " + index); + return 0; + } + + /// Set the weight of the child at an index. + /// The child index. Only immediate CinemachineVirtualCameraBase + /// children are counted. + /// The weight to set. Can be any non-negative number. + public void SetWeight(int index, float w) + { + switch (index) + { + case 0: m_Weight0 = w; return; + case 1: m_Weight1 = w; return; + case 2: m_Weight2 = w; return; + case 3: m_Weight3 = w; return; + case 4: m_Weight4 = w; return; + case 5: m_Weight5 = w; return; + case 6: m_Weight6 = w; return; + case 7: m_Weight7 = w; return; + } + Debug.LogError("CinemachineMixingCamera: Invalid index: " + index); + } + + /// Get the weight of the child CinemachineVirtualCameraBase. + /// The child camera. + /// The weight of the camera. Valid only if camera is active and enabled. + public float GetWeight(CinemachineVirtualCameraBase vcam) + { + int index; + if (m_indexMap.TryGetValue(vcam, out index)) + return GetWeight(index); + Debug.LogError("CinemachineMixingCamera: Invalid child: " + + ((vcam != null) ? vcam.Name : "(null)")); + return 0; + } + + /// Set the weight of the child CinemachineVirtualCameraBase. + /// The child camera. + /// The weight to set. Can be any non-negative number. + public void SetWeight(CinemachineVirtualCameraBase vcam, float w) + { + int index; + if (m_indexMap.TryGetValue(vcam, out index)) + SetWeight(index, w); + else + Debug.LogError("CinemachineMixingCamera: Invalid child: " + + ((vcam != null) ? vcam.Name : "(null)")); + } + + /// Blended camera state + private CameraState m_State = CameraState.Default; + + /// Get the current "best" child virtual camera, which is nominally + /// the one with the greatest weight. + private ICinemachineCamera LiveChild { set; get; } + + /// The blended CameraState + public override CameraState State { get { return m_State; } } + + /// Not used + override public Transform LookAt { get; set; } + + /// Not used + override public Transform Follow { get; set; } + + /// Return the live child. + public override ICinemachineCamera LiveChildOrSelf { get { return LiveChild; } } + + /// Remove a Pipeline stage hook callback. + /// Make sure it is removed from all the children. + /// The delegate to remove. + public override void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + base.RemovePostPipelineStageHook(d); + ValidateListOfChildren(); + foreach (var vcam in m_ChildCameras) + vcam.RemovePostPipelineStageHook(d); + } + + /// Makes sure the internal child cache is up to date + protected override void OnEnable() + { + base.OnEnable(); + InvalidateListOfChildren(); + } + + /// Makes sure the internal child cache is up to date + public void OnTransformChildrenChanged() + { + InvalidateListOfChildren(); + } + + /// Makes sure the weights are non-negative + protected override void OnValidate() + { + base.OnValidate(); + for (int i = 0; i < MaxCameras; ++i) + SetWeight(i, Mathf.Max(0, GetWeight(i))); + } + + /// Check whether the vcam a live child of this camera. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public override bool IsLiveChild(ICinemachineCamera vcam) + { + CinemachineVirtualCameraBase[] children = ChildCameras; + for (int i = 0; i < MaxCameras && i < children.Length; ++i) + if ((ICinemachineCamera)children[i] == vcam) + return GetWeight(i) > UnityVectorExtensions.Epsilon && children[i].isActiveAndEnabled; + return false; + } + + private CinemachineVirtualCameraBase[] m_ChildCameras; + private Dictionary m_indexMap; + + /// Get the cached list of child cameras. + /// These are just the immediate children in the hierarchy. + /// Note: only the first entries of this list participate in the + /// final blend, up to MaxCameras + public CinemachineVirtualCameraBase[] ChildCameras + { + get { ValidateListOfChildren(); return m_ChildCameras; } + } + + /// Invalidate the cached list of child cameras. + protected void InvalidateListOfChildren() + { + m_ChildCameras = null; + m_indexMap = null; + LiveChild = null; + } + + /// Rebuild the cached list of child cameras. + protected void ValidateListOfChildren() + { + if (m_ChildCameras != null) + return; + + m_indexMap = new Dictionary(); + List list = new List(); + CinemachineVirtualCameraBase[] kids + = GetComponentsInChildren(true); + foreach (CinemachineVirtualCameraBase k in kids) + { + if (k.transform.parent == transform) + { + int index = list.Count; + list.Add(k); + if (index < MaxCameras) + m_indexMap.Add(k, index); + } + } + m_ChildCameras = list.ToArray(); + } + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. This implementation + /// computes and caches the weighted blend of the tracked cameras. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + public override void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineMixingCamera.UpdateCameraState"); + CinemachineVirtualCameraBase[] children = ChildCameras; + LiveChild = null; + float highestWeight = 0; + float totalWeight = 0; + for (int i = 0; i < MaxCameras && i < children.Length; ++i) + { + CinemachineVirtualCameraBase vcam = children[i]; + if (vcam.isActiveAndEnabled) + { + float weight = Mathf.Max(0, GetWeight(i)); + if (weight > UnityVectorExtensions.Epsilon) + { + totalWeight += weight; + if (totalWeight == weight) + m_State = vcam.State; + else + m_State = CameraState.Lerp(m_State, vcam.State, weight / totalWeight); + + if (weight > highestWeight) + { + highestWeight = weight; + LiveChild = vcam; + } + } + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs.meta new file mode 100644 index 0000000..d4856d5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineMixingCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6c26251a3e1f5ac41afa5ffb404c5f71 +timeCreated: 1502201564 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs new file mode 100644 index 0000000..b050d2f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs @@ -0,0 +1,180 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// Defines a world-space path, consisting of an array of waypoints, + /// each of which has position, tangent, and roll settings. Bezier interpolation + /// is performed between the waypoints, to get a smooth and continuous path. + [DocumentationSorting(18, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("Cinemachine/CinemachinePath")] + [SaveDuringPlay] + public class CinemachinePath : CinemachinePathBase + { + /// A waypoint along the path + [DocumentationSorting(18.2f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] public struct Waypoint + { + /// Position in path-local space + [Tooltip("Position in path-local space")] + public Vector3 position; + + /// Offset from the position, which defines the tangent of the curve at the waypoint. + /// The length of the tangent encodes the strength of the bezier handle. + /// The same handle is used symmetrically on both sides of the waypoint, to ensure smoothness. + [Tooltip("Offset from the position, which defines the tangent of the curve at the waypoint. The length of the tangent encodes the strength of the bezier handle. The same handle is used symmetrically on both sides of the waypoint, to ensure smoothness.")] + public Vector3 tangent; + + /// Defines the roll of the path at this waypoint. + /// The other orientation axes are inferred from the tangent and world up. + [Tooltip("Defines the roll of the path at this waypoint. The other orientation axes are inferred from the tangent and world up.")] + public float roll; + } + + /// If checked, then the path ends are joined to form a continuous loop + [Tooltip("If checked, then the path ends are joined to form a continuous loop.")] + public bool m_Looped; + + /// The waypoints that define the path. + /// They will be interpolated using a bezier curve + [Tooltip("The waypoints that define the path. They will be interpolated using a bezier curve.")] + public Waypoint[] m_Waypoints = new Waypoint[0]; + + /// The minimum value for the path position + public override float MinPos { get { return 0; } } + + /// The maximum value for the path position + public override float MaxPos + { + get + { + int count = m_Waypoints.Length - 1; + if (count < 1) + return 0; + return m_Looped ? count + 1 : count; + } + } + /// True if the path ends are joined to form a continuous loop + public override bool Looped { get { return m_Looped; } } + + /// When calculating the distance cache, sample the path this many + /// times between points + public override int DistanceCacheSampleStepsPerSegment { get { return m_Resolution; } } + + /// Returns normalized position + float GetBoundingIndices(float pos, out int indexA, out int indexB) + { + pos = NormalizePos(pos); + int rounded = Mathf.RoundToInt(pos); + if (Mathf.Abs(pos - rounded) < UnityVectorExtensions.Epsilon) + indexA = indexB = (rounded == m_Waypoints.Length) ? 0 : rounded; + else + { + indexA = Mathf.FloorToInt(pos); + if (indexA >= m_Waypoints.Length) + { + pos -= MaxPos; + indexA = 0; + } + indexB = Mathf.CeilToInt(pos); + if (indexB >= m_Waypoints.Length) + indexB = 0; + } + return pos; + } + + /// Get a worldspace position of a point along the path + /// Postion along the path. Need not be normalized. + /// World-space position of the point along at path at pos + public override Vector3 EvaluatePosition(float pos) + { + Vector3 result = new Vector3(); + if (m_Waypoints.Length == 0) + result = transform.position; + else + { + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (indexA == indexB) + result = m_Waypoints[indexA].position; + else + { + // interpolate + Waypoint wpA = m_Waypoints[indexA]; + Waypoint wpB = m_Waypoints[indexB]; + result = SplineHelpers.Bezier3(pos - indexA, + m_Waypoints[indexA].position, wpA.position + wpA.tangent, + wpB.position - wpB.tangent, wpB.position); + } + } + return transform.TransformPoint(result); + } + + /// Get the tangent of the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space direction of the path tangent. + /// Length of the vector represents the tangent strength + public override Vector3 EvaluateTangent(float pos) + { + Vector3 result = new Vector3(); + if (m_Waypoints.Length == 0) + result = transform.rotation * Vector3.forward; + else + { + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (indexA == indexB) + result = m_Waypoints[indexA].tangent; + else + { + Waypoint wpA = m_Waypoints[indexA]; + Waypoint wpB = m_Waypoints[indexB]; + result = SplineHelpers.BezierTangent3(pos - indexA, + m_Waypoints[indexA].position, wpA.position + wpA.tangent, + wpB.position - wpB.tangent, wpB.position); + } + } + return transform.TransformDirection(result); + } + + /// Get the orientation the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space orientation of the path, as defined by tangent, up, and roll. + public override Quaternion EvaluateOrientation(float pos) + { + Quaternion result = transform.rotation; + if (m_Waypoints.Length > 0) + { + float roll = 0; + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (indexA == indexB) + roll = m_Waypoints[indexA].roll; + else + { + float rollA = m_Waypoints[indexA].roll; + float rollB = m_Waypoints[indexB].roll; + if (indexB == 0) + { + // Special handling at the wraparound - cancel the spins + rollA = rollA % 360; + rollB = rollB % 360; + } + roll = Mathf.Lerp(rollA, rollB, pos - indexA); + } + + Vector3 fwd = EvaluateTangent(pos); + if (!fwd.AlmostZero()) + { + Vector3 up = transform.rotation * Vector3.up; + Quaternion q = Quaternion.LookRotation(fwd, up); + result = q * Quaternion.AngleAxis(roll, Vector3.forward); + } + } + return result; + } + + private void OnValidate() { InvalidateDistanceCache(); } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs.meta new file mode 100644 index 0000000..f32f1eb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePath.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2d37e5385efd7064cb1d54c94960acae +timeCreated: 1496785107 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs new file mode 100644 index 0000000..5474e7c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// Internal container for CinemachineComponentBase. Does nothing but contain. + /// + [AddComponentMenu("")] // Don't display in add component menu + public sealed class CinemachinePipeline : MonoBehaviour + { + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs.meta new file mode 100644 index 0000000..0da8cf5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachinePipeline.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ac0b09e7857660247b1477e93731de29 +timeCreated: 1489088253 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs new file mode 100644 index 0000000..5eef99e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs @@ -0,0 +1,224 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// Defines a world-space path, consisting of an array of waypoints, + /// each of which has position and roll settings. Bezier interpolation + /// is performed between the waypoints, to get a smooth and continuous path. + /// The path will pass through all waypoints, and (unlike CinemachinePath) first + /// and second order continuity is guaranteed + [DocumentationSorting(18.5f, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("Cinemachine/CinemachineSmoothPath")] + [SaveDuringPlay] + public class CinemachineSmoothPath : CinemachinePathBase + { + /// If checked, then the path ends are joined to form a continuous loop + [Tooltip("If checked, then the path ends are joined to form a continuous loop.")] + public bool m_Looped; + + /// A waypoint along the path + [DocumentationSorting(18.7f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] public struct Waypoint + { + /// Position in path-local space + [Tooltip("Position in path-local space")] + public Vector3 position; + + /// Defines the roll of the path at this waypoint. + /// The other orientation axes are inferred from the tangent and world up. + [Tooltip("Defines the roll of the path at this waypoint. The other orientation axes are inferred from the tangent and world up.")] + public float roll; + + /// Representation as Vector4 + internal Vector4 AsVector4 + { + get { return new Vector4(position.x, position.y, position.z, roll); } + } + + internal static Waypoint FromVector4(Vector4 v) + { + Waypoint wp = new Waypoint(); + wp.position = new Vector3(v[0], v[1], v[2]); + wp.roll = v[3]; + return wp; + } + } + + /// The waypoints that define the path. + /// They will be interpolated using a bezier curve + [Tooltip("The waypoints that define the path. They will be interpolated using a bezier curve.")] + public Waypoint[] m_Waypoints = new Waypoint[0]; + + /// The minimum value for the path position + public override float MinPos { get { return 0; } } + + /// The maximum value for the path position + public override float MaxPos + { + get + { + int count = m_Waypoints.Length - 1; + if (count < 1) + return 0; + return m_Looped ? count + 1 : count; + } + } + /// True if the path ends are joined to form a continuous loop + public override bool Looped { get { return m_Looped; } } + + /// When calculating the distance cache, sample the path this many + /// times between points + public override int DistanceCacheSampleStepsPerSegment { get { return m_Resolution; } } + + private void OnValidate() { InvalidateDistanceCache(); } + + /// Call this if the path changes in such a way as to affect distances + /// or other cached path elements + public override void InvalidateDistanceCache() + { + base.InvalidateDistanceCache(); + m_ControlPoints1 = null; + m_ControlPoints2 = null; + } + + Waypoint[] m_ControlPoints1; + Waypoint[] m_ControlPoints2; + bool m_IsLoopedCache; + + void UpdateControlPoints() + { + int numPoints = (m_Waypoints == null) ? 0 : m_Waypoints.Length; + if (numPoints > 1 + && (Looped != m_IsLoopedCache + || m_ControlPoints1 == null || m_ControlPoints1.Length != numPoints + || m_ControlPoints2 == null || m_ControlPoints2.Length != numPoints)) + { + Vector4[] p1 = new Vector4[numPoints]; + Vector4[] p2 = new Vector4[numPoints]; + Vector4[] K = new Vector4[numPoints]; + for (int i = 0; i < numPoints; ++i) + K[i] = m_Waypoints[i].AsVector4; + if (Looped) + SplineHelpers.ComputeSmoothControlPointsLooped(ref K, ref p1, ref p2); + else + SplineHelpers.ComputeSmoothControlPoints(ref K, ref p1, ref p2); + + m_ControlPoints1 = new Waypoint[numPoints]; + m_ControlPoints2 = new Waypoint[numPoints]; + for (int i = 0; i < numPoints; ++i) + { + m_ControlPoints1[i] = Waypoint.FromVector4(p1[i]); + m_ControlPoints2[i] = Waypoint.FromVector4(p2[i]); + } + m_IsLoopedCache = Looped; + } + } + + /// Returns normalized position + float GetBoundingIndices(float pos, out int indexA, out int indexB) + { + pos = NormalizePos(pos); + int numWaypoints = m_Waypoints.Length; + if (numWaypoints < 2) + indexA = indexB = 0; + else + { + indexA = Mathf.FloorToInt(pos); + if (indexA >= numWaypoints) + { + // Only true if looped + pos -= MaxPos; + indexA = 0; + } + indexB = indexA + 1; + if (indexB == numWaypoints) + { + if (Looped) + indexB = 0; + else + { + --indexB; + --indexA; + } + } + } + return pos; + } + + /// Get a worldspace position of a point along the path + /// Postion along the path. Need not be normalized. + /// World-space position of the point along at path at pos + public override Vector3 EvaluatePosition(float pos) + { + Vector3 result = Vector3.zero; + if (m_Waypoints.Length > 0) + { + UpdateControlPoints(); + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (indexA == indexB) + result = m_Waypoints[indexA].position; + else + result = SplineHelpers.Bezier3(pos - indexA, + m_Waypoints[indexA].position, m_ControlPoints1[indexA].position, + m_ControlPoints2[indexA].position, m_Waypoints[indexB].position); + } + return transform.TransformPoint(result); + } + + /// Get the tangent of the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space direction of the path tangent. + /// Length of the vector represents the tangent strength + public override Vector3 EvaluateTangent(float pos) + { + Vector3 result = transform.rotation * Vector3.forward; + if (m_Waypoints.Length > 1) + { + UpdateControlPoints(); + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (!Looped && indexA == m_Waypoints.Length - 1) + --indexA; + result = SplineHelpers.BezierTangent3(pos - indexA, + m_Waypoints[indexA].position, m_ControlPoints1[indexA].position, + m_ControlPoints2[indexA].position, m_Waypoints[indexB].position); + } + return transform.TransformDirection(result); + } + + /// Get the orientation the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space orientation of the path, as defined by tangent, up, and roll. + public override Quaternion EvaluateOrientation(float pos) + { + Quaternion result = transform.rotation; + if (m_Waypoints.Length > 0) + { + float roll = 0; + int indexA, indexB; + pos = GetBoundingIndices(pos, out indexA, out indexB); + if (indexA == indexB) + roll = m_Waypoints[indexA].roll; + else + { + UpdateControlPoints(); + roll = SplineHelpers.Bezier1(pos - indexA, + m_Waypoints[indexA].roll, m_ControlPoints1[indexA].roll, + m_ControlPoints2[indexA].roll, m_Waypoints[indexB].roll); + } + + Vector3 fwd = EvaluateTangent(pos); + if (!fwd.AlmostZero()) + { + Vector3 up = transform.rotation * Vector3.up; + Quaternion q = Quaternion.LookRotation(fwd, up); + result = q * Quaternion.AngleAxis(roll, Vector3.forward); + } + } + return result; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs.meta new file mode 100644 index 0000000..4dd2554 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoothPath.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a200b19ca1a9685429ed7e043c28e904 +timeCreated: 1505831686 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs new file mode 100644 index 0000000..f0b5290 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs @@ -0,0 +1,103 @@ +#if false // GML We disable smoother because people are too tempted to use it. It won't give good results. +using UnityEngine; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// + /// An add-on module for Cinemachine Virtual Camera which post-processes + /// the final position and orientation of the virtual camera, as a kind of low-pass filter. + /// + [DocumentationSorting(17, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [AddComponentMenu("")] // Hide in menu + [SaveDuringPlay] + public class CinemachineSmoother : CinemachineExtension + { + /// + /// The strength of the smoothing for position. This is applied after the vcam cas calculated its state. + /// + [Range(0f, 10f)] + [Tooltip("The strength of the smoothing for position. Higher numbers smooth more but reduce performance and introduce lag.")] + public float m_PositionSmoothing = 1; + + /// + /// The strength of the smoothing for the LookAt target. This is applied after the vcam cas calculated its state. + /// + [Range(0f, 10f)] + [Tooltip("The strength of the smoothing for the LookAt target. Higher numbers smooth more but reduce performance and introduce lag.")] + public float m_LookAtSmoothing = 1; + + /// + /// The strength of the smoothing for rotation. This is applied after the vcam cas calculated its state. + /// + [Range(0f, 10f)] + [Tooltip("The strength of the smoothing for rotation. Higher numbers smooth more but reduce performance and introduce lag.")] + public float m_RotationSmoothing = 1; + + protected override void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime) + { + if (stage == CinemachineCore.Stage.Body) + { + VcamExtraState extra = GetExtraState(vcam); + if (m_PositionSmoothing > 0) + { + if (deltaTime < 0) + extra.mSmoothingFilter = null; // reset the filter + state.PositionCorrection + += ApplySmoothing(vcam, state.CorrectedPosition, extra) - state.CorrectedPosition; + } + if (m_LookAtSmoothing > 0 && state.HasLookAt) + { + if (deltaTime < 0) + extra.mSmoothingFilterLookAt = null; // reset the filter + state.ReferenceLookAt = ApplySmoothingLookAt(vcam, state.ReferenceLookAt, extra); + } + } + if (stage == CinemachineCore.Stage.Aim) + { + if (m_RotationSmoothing > 0) + { + VcamExtraState extra = GetExtraState(vcam); + if (deltaTime < 0) + extra.mSmoothingFilterRotation = null; // reset the filter + Quaternion q = Quaternion.Inverse(state.CorrectedOrientation) + * ApplySmoothing(vcam, state.CorrectedOrientation, state.ReferenceUp, extra); + state.OrientationCorrection = state.OrientationCorrection * q; + } + } + } + + class VcamExtraState + { + public GaussianWindow1D_Vector3 mSmoothingFilter; + public GaussianWindow1D_Vector3 mSmoothingFilterLookAt; + public GaussianWindow1D_CameraRotation mSmoothingFilterRotation; + }; + + private Vector3 ApplySmoothing(CinemachineVirtualCameraBase vcam, Vector3 pos, VcamExtraState extra) + { + if (extra.mSmoothingFilter == null || extra.mSmoothingFilter.Sigma != m_PositionSmoothing) + extra.mSmoothingFilter = new GaussianWindow1D_Vector3(m_PositionSmoothing); + return extra.mSmoothingFilter.Filter(pos); + } + + private Vector3 ApplySmoothingLookAt(CinemachineVirtualCameraBase vcam, Vector3 pos, VcamExtraState extra) + { + if (extra.mSmoothingFilterLookAt == null || extra.mSmoothingFilterLookAt.Sigma != m_LookAtSmoothing) + extra.mSmoothingFilterLookAt = new GaussianWindow1D_Vector3(m_LookAtSmoothing); + return extra.mSmoothingFilterLookAt.Filter(pos); + } + + private Quaternion ApplySmoothing(CinemachineVirtualCameraBase vcam, Quaternion rot, Vector3 up, VcamExtraState extra) + { + if (extra.mSmoothingFilterRotation == null || extra.mSmoothingFilterRotation.Sigma != m_RotationSmoothing) + extra.mSmoothingFilterRotation = new GaussianWindow1D_CameraRotation(m_RotationSmoothing); + Vector3 camRot = Quaternion.identity.GetCameraRotationToTarget(rot * Vector3.forward, up); + return Quaternion.identity.ApplyCameraRotation(extra.mSmoothingFilterRotation.Filter(camRot), up); + } + } +} +#endif diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs.meta new file mode 100644 index 0000000..1b213cb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineSmoother.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f497b01325ac7a041bd6e365a9ea0e93 +timeCreated: 1490724540 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs new file mode 100644 index 0000000..50d3d34 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs @@ -0,0 +1,512 @@ +using Cinemachine.Utility; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a virtual camera "manager" that owns and manages a collection + /// of child Virtual Cameras. These child vcams are mapped to individual states in + /// an animation state machine, allowing you to associate specific vcams to specific + /// animation states. When that state is active in the state machine, then the + /// associated camera will be activated. + /// + /// You can define custom blends and transitions between child cameras. + /// + /// In order to use this behaviour, you must have an animated target (i.e. an object + /// animated with a state machine) to drive the behaviour. + /// + [DocumentationSorting(13, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineStateDrivenCamera")] + public class CinemachineStateDrivenCamera : CinemachineVirtualCameraBase + { + /// Default object for the camera children to look at (the aim target), if not specified in a child rig. May be empty + [Tooltip("Default object for the camera children to look at (the aim target), if not specified in a child camera. May be empty if all of the children define targets of their own.")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + /// Default object for the camera children wants to move with (the body target), if not specified in a child rig. May be empty + [Tooltip("Default object for the camera children wants to move with (the body target), if not specified in a child camera. May be empty if all of the children define targets of their own.")] + [NoSaveDuringPlay] + public Transform m_Follow = null; + + /// The state machine whose state changes will drive this camera's choice of active child + [Space] + [Tooltip("The state machine whose state changes will drive this camera's choice of active child")] + public Animator m_AnimatedTarget; + + /// Which layer in the target FSM to observe + [Tooltip("Which layer in the target state machine to observe")] + public int m_LayerIndex; + + /// When enabled, the current camera and blend will be indicated in the game window, for debugging + [Tooltip("When enabled, the current child camera and blend will be indicated in the game window, for debugging")] + public bool m_ShowDebugText = false; + + /// Force all child cameras to be enabled. This is useful if animating them in Timeline, but consumes extra resources. + [Tooltip("Force all child cameras to be enabled. This is useful if animating them in Timeline, but consumes extra resources")] + public bool m_EnableAllChildCameras; + + /// Internal API for the editor. Do not use this field + [SerializeField][HideInInspector][NoSaveDuringPlay] + public CinemachineVirtualCameraBase[] m_ChildCameras = null; + + /// This represents a single instrunction to the StateDrivenCamera. It associates + /// an state from the state machine with a child Virtual Camera, and also holds + /// activation tuning parameters. + [Serializable] + public struct Instruction + { + /// The full hash of the animation state + [Tooltip("The full hash of the animation state")] + public int m_FullHash; + /// The virtual camera to activate whrn the animation state becomes active + [Tooltip("The virtual camera to activate whrn the animation state becomes active")] + public CinemachineVirtualCameraBase m_VirtualCamera; + /// How long to wait (in seconds) before activating the virtual camera. + /// This filters out very short state durations + [Tooltip("How long to wait (in seconds) before activating the virtual camera. This filters out very short state durations")] + public float m_ActivateAfter; + /// The minimum length of time (in seconds) to keep a virtual camera active + [Tooltip("The minimum length of time (in seconds) to keep a virtual camera active")] + public float m_MinDuration; + }; + + /// The set of instructions associating virtual cameras with states. + /// These instructions are used to choose the live child at any given moment + [Tooltip("The set of instructions associating virtual cameras with states. These instructions are used to choose the live child at any given moment")] + public Instruction[] m_Instructions; + + /// + /// The blend which is used if you don't explicitly define a blend between two Virtual Camera children. + /// + [CinemachineBlendDefinitionProperty] + [Tooltip("The blend which is used if you don't explicitly define a blend between two Virtual Camera children")] + public CinemachineBlendDefinition m_DefaultBlend + = new CinemachineBlendDefinition(CinemachineBlendDefinition.Style.EaseInOut, 0.5f); + + /// + /// This is the asset which contains custom settings for specific child blends. + /// + [Tooltip("This is the asset which contains custom settings for specific child blends")] + public CinemachineBlenderSettings m_CustomBlends = null; + + /// Internal API for the Inspector editor. This implements nested states. + [Serializable] + [DocumentationSorting(13.2f, DocumentationSortingAttribute.Level.Undoc)] + public struct ParentHash + { + /// Internal API for the Inspector editor + public int m_Hash; + /// Internal API for the Inspector editor + public int m_ParentHash; + /// Internal API for the Inspector editor + public ParentHash(int h, int p) { m_Hash = h; m_ParentHash = p; } + } + /// Internal API for the Inspector editor + [HideInInspector][SerializeField] public ParentHash[] m_ParentHash = null; + + /// Gets a brief debug description of this virtual camera, for use when displayiong debug info + public override string Description + { + get + { + // Show the active camera and blend + ICinemachineCamera vcam = LiveChild; + if (mActiveBlend == null) + return (vcam != null) ? "[" + vcam.Name + "]" : "(none)"; + return mActiveBlend.Description; + } + } + + /// Get the current "best" child virtual camera, that would be chosen + /// if the State Driven Camera were active. + public ICinemachineCamera LiveChild { set; get; } + + /// Return the live child. + public override ICinemachineCamera LiveChildOrSelf { get { return LiveChild; } } + + /// Check whether the vcam a live child of this camera. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public override bool IsLiveChild(ICinemachineCamera vcam) + { + return vcam == LiveChild + || (mActiveBlend != null && (vcam == mActiveBlend.CamA || vcam == mActiveBlend.CamB)); + } + + /// The State of the current live child + public override CameraState State { get { return m_State; } } + + /// Get the current LookAt target. Returns parent's LookAt if parent + /// is non-null and no specific LookAt defined for this camera + override public Transform LookAt + { + get { return ResolveLookAt(m_LookAt); } + set { m_LookAt = value; } + } + + /// Get the current Follow target. Returns parent's Follow if parent + /// is non-null and no specific Follow defined for this camera + override public Transform Follow + { + get { return ResolveFollow(m_Follow); } + set { m_Follow = value; } + } + + /// Remove a Pipeline stage hook callback. + /// Make sure it is removed from all the children. + /// The delegate to remove. + public override void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + base.RemovePostPipelineStageHook(d); + UpdateListOfChildren(); + foreach (var vcam in m_ChildCameras) + vcam.RemovePostPipelineStageHook(d); + } + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. This implementation + /// updates all the children, chooses the best one, and implements any required blending. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public override void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineStateDrivenCamera.UpdateCameraState"); + if (!PreviousStateIsValid) + deltaTime = -1; + + UpdateListOfChildren(); + CinemachineVirtualCameraBase best = ChooseCurrentCamera(deltaTime); + if (m_ChildCameras != null) + { + for (int i = 0; i < m_ChildCameras.Length; ++i) + { + CinemachineVirtualCameraBase vcam = m_ChildCameras[i]; + if (vcam != null) + { + bool enableChild = m_EnableAllChildCameras || vcam == best; + if (enableChild != vcam.VirtualCameraGameObject.activeInHierarchy) + { + vcam.gameObject.SetActive(enableChild); + if (enableChild) + CinemachineCore.Instance.UpdateVirtualCamera(vcam, worldUp, deltaTime); + } + } + } + } + + ICinemachineCamera previousCam = LiveChild; + LiveChild = best; + + // Are we transitioning cameras? + if (previousCam != null && LiveChild != null && previousCam != LiveChild) + { + // Create a blend (will be null if a cut) + float duration = 0; + AnimationCurve curve = LookupBlendCurve(previousCam, LiveChild, out duration); + mActiveBlend = CreateBlend( + previousCam, LiveChild, + curve, duration, mActiveBlend, deltaTime); + + // Notify incoming camera of transition + LiveChild.OnTransitionFromCamera(previousCam, worldUp, deltaTime); + + // Generate Camera Activation event if live + CinemachineCore.Instance.GenerateCameraActivationEvent(LiveChild); + + // If cutting, generate a camera cut event if live + if (mActiveBlend == null) + CinemachineCore.Instance.GenerateCameraCutEvent(LiveChild); + } + + // Advance the current blend (if any) + if (mActiveBlend != null) + { + mActiveBlend.TimeInBlend += (deltaTime >= 0) + ? deltaTime : mActiveBlend.Duration; + if (mActiveBlend.IsComplete) + mActiveBlend = null; + } + + if (mActiveBlend != null) + { + mActiveBlend.UpdateCameraState(worldUp, deltaTime); + m_State = mActiveBlend.State; + } + else if (LiveChild != null) + m_State = LiveChild.State; + + PreviousStateIsValid = true; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// Makes sure the internal child cache is up to date + protected override void OnEnable() + { + base.OnEnable(); + InvalidateListOfChildren(); + mActiveBlend = null; + } + + /// Makes sure the internal child cache is up to date + public void OnTransformChildrenChanged() + { + InvalidateListOfChildren(); + } + +#if UNITY_EDITOR + /// Displays the current active camera on the game screen, if requested + protected override void OnGUI() + { + base.OnGUI(); + if (!m_ShowDebugText) + CinemachineGameWindowDebug.ReleaseScreenPos(this); + else + { + string text = Name + ": " + Description; + Rect r = CinemachineGameWindowDebug.GetScreenPos(this, text, GUI.skin.box); + GUI.Label(r, text, GUI.skin.box); + } + } +#endif + CameraState m_State = CameraState.Default; + + /// The list of child cameras. These are just the immediate children in the hierarchy. + public CinemachineVirtualCameraBase[] ChildCameras { get { UpdateListOfChildren(); return m_ChildCameras; }} + + /// Is there a blend in progress? + public bool IsBlending { get { return mActiveBlend != null; } } + + /// API for the inspector editor. Animation module does not have hashes + /// for state parents, so we have to invent them in order to implement nested state + /// handling + public static string CreateFakeHashName(int parentHash, string stateName) + { return parentHash.ToString() + "_" + stateName; } + + float mActivationTime = 0; + Instruction mActiveInstruction; + float mPendingActivationTime = 0; + Instruction mPendingInstruction; + private CinemachineBlend mActiveBlend = null; + + void InvalidateListOfChildren() { m_ChildCameras = null; LiveChild = null; } + + void UpdateListOfChildren() + { + if (m_ChildCameras != null && mInstructionDictionary != null && mStateParentLookup != null) + return; + List list = new List(); + CinemachineVirtualCameraBase[] kids = GetComponentsInChildren(true); + foreach (CinemachineVirtualCameraBase k in kids) + if (k.transform.parent == transform) + list.Add(k); + m_ChildCameras = list.ToArray(); + ValidateInstructions(); + } + + private Dictionary mInstructionDictionary; + private Dictionary mStateParentLookup; + /// Internal API for the inspector editor. + public void ValidateInstructions() + { + if (m_Instructions == null) + m_Instructions = new Instruction[0]; + mInstructionDictionary = new Dictionary(); + for (int i = 0; i < m_Instructions.Length; ++i) + { + if (m_Instructions[i].m_VirtualCamera != null + && m_Instructions[i].m_VirtualCamera.transform.parent != transform) + { + m_Instructions[i].m_VirtualCamera = null; + } + mInstructionDictionary[m_Instructions[i].m_FullHash] = i; + } + + // Create the parent lookup + mStateParentLookup = new Dictionary(); + if (m_ParentHash != null) + foreach (var i in m_ParentHash) + mStateParentLookup[i.m_Hash] = i.m_ParentHash; + + // Zap the cached current instructions + mActivationTime = mPendingActivationTime = 0; + mActiveBlend = null; + } + + List m_clipInfoList = new List(); + private CinemachineVirtualCameraBase ChooseCurrentCamera(float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineStateDrivenCamera.ChooseCurrentCamera"); + if (m_ChildCameras == null || m_ChildCameras.Length == 0) + { + mActivationTime = 0; + //UnityEngine.Profiling.Profiler.EndSample(); + return null; + } + CinemachineVirtualCameraBase defaultCam = m_ChildCameras[0]; + if (m_AnimatedTarget == null || !m_AnimatedTarget.gameObject.activeSelf + || m_AnimatedTarget.runtimeAnimatorController == null + || m_LayerIndex < 0 || m_LayerIndex >= m_AnimatedTarget.layerCount) + { + mActivationTime = 0; + //UnityEngine.Profiling.Profiler.EndSample(); + return defaultCam; + } + + // Get the current state + int hash; + if (m_AnimatedTarget.IsInTransition(m_LayerIndex)) + { + // Force "current" state to be the state we're transitionaing to + AnimatorStateInfo info = m_AnimatedTarget.GetNextAnimatorStateInfo(m_LayerIndex); + hash = info.fullPathHash; + if (m_AnimatedTarget.GetNextAnimatorClipInfoCount(m_LayerIndex) > 1) + { + m_AnimatedTarget.GetNextAnimatorClipInfo(m_LayerIndex, m_clipInfoList); + hash = GetClipHash(info.fullPathHash, m_clipInfoList); + } + } + else + { + AnimatorStateInfo info = m_AnimatedTarget.GetCurrentAnimatorStateInfo(m_LayerIndex); + hash = info.fullPathHash; + if (m_AnimatedTarget.GetCurrentAnimatorClipInfoCount(m_LayerIndex) > 1) + { + m_AnimatedTarget.GetCurrentAnimatorClipInfo(m_LayerIndex, m_clipInfoList); + hash = GetClipHash(info.fullPathHash, m_clipInfoList); + } + } + + // If we don't have an instruction for this state, find a suitable default + while (hash != 0 && !mInstructionDictionary.ContainsKey(hash)) + hash = mStateParentLookup.ContainsKey(hash) ? mStateParentLookup[hash] : 0; + + float now = Time.time; + if (mActivationTime != 0) + { + // Is it active now? + if (mActiveInstruction.m_FullHash == hash) + { + // Yes, cancel any pending + mPendingActivationTime = 0; + //UnityEngine.Profiling.Profiler.EndSample(); + return mActiveInstruction.m_VirtualCamera; + } + + // Is it pending? + if (deltaTime >= 0) + { + if (mPendingActivationTime != 0 && mPendingInstruction.m_FullHash == hash) + { + // Has it been pending long enough, and are we allowed to switch away + // from the active action? + if ((now - mPendingActivationTime) > mPendingInstruction.m_ActivateAfter + && ((now - mActivationTime) > mActiveInstruction.m_MinDuration + || mPendingInstruction.m_VirtualCamera.Priority + > mActiveInstruction.m_VirtualCamera.Priority)) + { + // Yes, activate it now + mActiveInstruction = mPendingInstruction; + mActivationTime = now; + mPendingActivationTime = 0; + } + //UnityEngine.Profiling.Profiler.EndSample(); + return mActiveInstruction.m_VirtualCamera; + } + } + } + // Neither active nor pending. + mPendingActivationTime = 0; // cancel the pending, if any + + if (!mInstructionDictionary.ContainsKey(hash)) + { + // No defaults set, we just ignore this state + if (mActivationTime != 0) + return mActiveInstruction.m_VirtualCamera; + //UnityEngine.Profiling.Profiler.EndSample(); + return defaultCam; + } + + // Can we activate it now? + Instruction newInstr = m_Instructions[mInstructionDictionary[hash]]; + if (newInstr.m_VirtualCamera == null) + newInstr.m_VirtualCamera = defaultCam; + if (deltaTime >= 0 && mActivationTime > 0) + { + if (newInstr.m_ActivateAfter > 0 + || ((now - mActivationTime) < mActiveInstruction.m_MinDuration + && newInstr.m_VirtualCamera.Priority + <= mActiveInstruction.m_VirtualCamera.Priority)) + { + // Too early - make it pending + mPendingInstruction = newInstr; + mPendingActivationTime = now; + if (mActivationTime != 0) + return mActiveInstruction.m_VirtualCamera; + //UnityEngine.Profiling.Profiler.EndSample(); + return defaultCam; + } + } + // Activate now + mActiveInstruction = newInstr; + mActivationTime = now; + //UnityEngine.Profiling.Profiler.EndSample(); + return mActiveInstruction.m_VirtualCamera; + } + + int GetClipHash(int hash, List clips) + { + // Is there an animation clip substate? + if (clips.Count > 1) + { + // Find the strongest-weighted one + int bestClip = -1; + for (int i = 0; i < clips.Count; ++i) + if (bestClip < 0 || clips[i].weight > clips[bestClip].weight) + bestClip = i; + + // Use its hash + if (bestClip >= 0 && clips[bestClip].weight > 0) + hash = Animator.StringToHash(CreateFakeHashName(hash, clips[bestClip].clip.name)); + } + return hash; + } + + private AnimationCurve LookupBlendCurve( + ICinemachineCamera fromKey, ICinemachineCamera toKey, out float duration) + { + // Get the blend curve that's most appropriate for these cameras + AnimationCurve blendCurve = m_DefaultBlend.BlendCurve; + if (m_CustomBlends != null) + { + string fromCameraName = (fromKey != null) ? fromKey.Name : string.Empty; + string toCameraName = (toKey != null) ? toKey.Name : string.Empty; + blendCurve = m_CustomBlends.GetBlendCurveForVirtualCameras( + fromCameraName, toCameraName, blendCurve); + } + var keys = blendCurve.keys; + duration = (keys == null || keys.Length == 0) ? 0 : keys[keys.Length-1].time; + return blendCurve; + } + + private CinemachineBlend CreateBlend( + ICinemachineCamera camA, ICinemachineCamera camB, + AnimationCurve blendCurve, float duration, + CinemachineBlend activeBlend, float deltaTime) + { + if (blendCurve == null || duration <= 0 || (camA == null && camB == null)) + return null; + + if (camA == null || activeBlend != null) + { + // Blend from the current camera position + CameraState state = (activeBlend != null) ? activeBlend.State : State; + camA = new StaticPointVirtualCamera(state, (activeBlend != null) ? "Mid-blend" : "(none)"); + } + return new CinemachineBlend(camA, camB, blendCurve,duration, 0); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs.meta new file mode 100644 index 0000000..03f5eff --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineStateDrivenCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 325a6a3050a061e4b8aa51386c30e8e1 +timeCreated: 1489088095 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs new file mode 100644 index 0000000..b26065a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs @@ -0,0 +1,269 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// Defines a group of target objects, each with a radius and a weight. + /// The weight is used when calculating the average position of the target group. + /// Higher-weighted members of the group will count more. + /// The bounding box is calculated by taking the member positions, weight, + /// and radii into account. + /// + [DocumentationSorting(19, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("Cinemachine/CinemachineTargetGroup")] + [SaveDuringPlay] + [ExecuteInEditMode] + public class CinemachineTargetGroup : MonoBehaviour + { + /// Holds the information that represents a member of the group + [DocumentationSorting(19.1f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] public struct Target + { + /// The target objects. This object's position and orientation will contribute to the + /// group's average position and orientation, in accordance with its weight + [Tooltip("The target objects. This object's position and orientation will contribute to the group's average position and orientation, in accordance with its weight")] + public Transform target; + /// How much weight to give the target when averaging. Cannot be negative + [Tooltip("How much weight to give the target when averaging. Cannot be negative")] + public float weight; + /// The radius of the target, used for calculating the bounding box. Cannot be negative + [Tooltip("The radius of the target, used for calculating the bounding box. Cannot be negative")] + public float radius; + } + + /// How the group's position is calculated + [DocumentationSorting(19.2f, DocumentationSortingAttribute.Level.UserRef)] + public enum PositionMode + { + ///Group position will be the center of the group's axis-aligned bounding box + GroupCenter, + /// Group position will be the weighted average of the positions of the members + GroupAverage + } + + /// How the group's position is calculated + [Tooltip("How the group's position is calculated. Select GroupCenter for the center of the bounding box, and GroupAverage for a weighted average of the positions of the members.")] + public PositionMode m_PositionMode = PositionMode.GroupCenter; + + /// How the group's orientation is calculated + [DocumentationSorting(19.3f, DocumentationSortingAttribute.Level.UserRef)] + public enum RotationMode + { + /// Manually set in the group's transform + Manual, + /// Weighted average of the orientation of its members. + GroupAverage + } + + /// How the group's orientation is calculated + [Tooltip("How the group's rotation is calculated. Select Manual to use the value in the group's transform, and GroupAverage for a weighted average of the orientations of the members.")] + public RotationMode m_RotationMode = RotationMode.Manual; + + /// This enum defines the options available for the update method. + public enum UpdateMethod + { + /// Updated in normal MonoBehaviour Update. + Update, + /// Updated in sync with the Physics module, in FixedUpdate + FixedUpdate, + /// Updated in MonoBehaviour LateUpdate. + LateUpdate + }; + + /// When to update the group's transform based on the position of the group members + [Tooltip("When to update the group's transform based on the position of the group members")] + public UpdateMethod m_UpdateMethod = UpdateMethod.LateUpdate; + + /// The target objects, together with their weights and radii, that will + /// contribute to the group's average position, orientation, and size + [NoSaveDuringPlay] + [Tooltip("The target objects, together with their weights and radii, that will contribute to the group's average position, orientation, and size.")] + public Target[] m_Targets = new Target[0]; + + /// Cache of the last valid radius + private float m_lastRadius = 0; + + /// The axis-aligned bounding box of the group, computed using the + /// targets positions and radii + public Bounds BoundingBox + { + get + { + float averageWeight; + Vector3 center = CalculateAveragePosition(out averageWeight); + bool gotOne = false; + Bounds b = new Bounds(center, new Vector3(m_lastRadius*2, m_lastRadius*2, m_lastRadius*2)); + if (averageWeight > UnityVectorExtensions.Epsilon) + { + for (int i = 0; i < m_Targets.Length; ++i) + { + if (m_Targets[i].target != null) + { + float w = m_Targets[i].weight; + if (w < averageWeight - UnityVectorExtensions.Epsilon) + w = w / averageWeight; + else + w = 1; + float d = m_Targets[i].radius * 2 * w; + Vector3 p = Vector3.Lerp(center, m_Targets[i].target.position, w); + Bounds b2 = new Bounds(p, new Vector3(d, d, d)); + if (!gotOne) + b = b2; + else + b.Encapsulate(b2); + gotOne = true; + } + } + } + Vector3 r = b.extents; + m_lastRadius = Mathf.Max(r.x, Mathf.Max(r.y, r.z)); + return b; + } + } + + /// Return true if there are no members with weight > 0 + public bool IsEmpty + { + get + { + for (int i = 0; i < m_Targets.Length; ++i) + if (m_Targets[i].target != null && m_Targets[i].weight > UnityVectorExtensions.Epsilon) + return false; + return true; + } + } + + /// The axis-aligned bounding box of the group, in a specific reference frame + /// The frame of reference in which to compute the bounding box + /// The axis-aligned bounding box of the group, in the desired frame of reference + public Bounds GetViewSpaceBoundingBox(Matrix4x4 mView) + { + Matrix4x4 inverseView = mView.inverse; + float averageWeight; + Vector3 center = inverseView.MultiplyPoint3x4(CalculateAveragePosition(out averageWeight)); + bool gotOne = false; + Bounds b = new Bounds(center, new Vector3(m_lastRadius*2, m_lastRadius*2, m_lastRadius*2)); + if (averageWeight > UnityVectorExtensions.Epsilon) + { + for (int i = 0; i < m_Targets.Length; ++i) + { + if (m_Targets[i].target != null) + { + float w = m_Targets[i].weight; + if (w < averageWeight - UnityVectorExtensions.Epsilon) + w = w / averageWeight; + else + w = 1; + float d = m_Targets[i].radius * 2; + Vector4 p = inverseView.MultiplyPoint3x4(m_Targets[i].target.position); + p = Vector3.Lerp(center, p, w); + Bounds b2 = new Bounds(p, new Vector3(d, d, d)); + if (!gotOne) + b = b2; + else + b.Encapsulate(b2); + gotOne = true; + } + } + } + Vector3 r = b.extents; + m_lastRadius = Mathf.Max(r.x, Mathf.Max(r.y, r.z)); + return b; + } + + Vector3 CalculateAveragePosition(out float averageWeight) + { + Vector3 pos = Vector3.zero; + float weight = 0; + int numTargets = 0; + for (int i = 0; i < m_Targets.Length; ++i) + { + if (m_Targets[i].target != null && m_Targets[i].weight > UnityVectorExtensions.Epsilon) + { + ++numTargets; + weight += m_Targets[i].weight; + pos += m_Targets[i].target.position * m_Targets[i].weight; + } + } + if (weight > UnityVectorExtensions.Epsilon) + pos /= weight; + if (numTargets == 0) + { + averageWeight = 0; + return transform.position; + } + averageWeight = weight / numTargets; + return pos; + } + + Quaternion CalculateAverageOrientation() + { + Quaternion r = Quaternion.identity; + for (int i = 0; i < m_Targets.Length; ++i) + { + if (m_Targets[i].target != null) + { + float w = m_Targets[i].weight; + Quaternion q = m_Targets[i].target.rotation; + // This is probably bogus + r = new Quaternion(r.x + q.x * w, r.y + q.y * w, r.z + q.z * w, r.w + q.w * w); + } + } + return r.Normalized(); + } + + private void OnValidate() + { + for (int i = 0; i < m_Targets.Length; ++i) + { + if (m_Targets[i].weight < 0) + m_Targets[i].weight = 0; + if (m_Targets[i].radius < 0) + m_Targets[i].radius = 0; + } + } + + void FixedUpdate() + { + if (m_UpdateMethod == UpdateMethod.FixedUpdate) + UpdateTransform(); + } + + void Update() + { + if (!Application.isPlaying || m_UpdateMethod == UpdateMethod.Update) + UpdateTransform(); + } + + void LateUpdate() + { + if (m_UpdateMethod == UpdateMethod.LateUpdate) + UpdateTransform(); + } + + void UpdateTransform() + { + if (IsEmpty) + return; + switch (m_PositionMode) + { + case PositionMode.GroupCenter: + transform.position = BoundingBox.center; + break; + case PositionMode.GroupAverage: + float averageWeight; + transform.position = CalculateAveragePosition(out averageWeight); + break; + } + switch (m_RotationMode) + { + case RotationMode.Manual: + break; + case RotationMode.GroupAverage: + transform.rotation = CalculateAverageOrientation(); + break; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs.meta new file mode 100644 index 0000000..72e50c9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineTargetGroup.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e5eb80d8e62d9d145bb50fb783c0f731 +timeCreated: 1496785096 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs new file mode 100644 index 0000000..5d5fe64 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs @@ -0,0 +1,464 @@ +using Cinemachine.Utility; +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// This behaviour is intended to be attached to an empty Transform GameObject, + /// and it represents a Virtual Camera within the Unity scene. + /// + /// The Virtual Camera will animate its Transform according to the rules contained + /// in its CinemachineComponent pipeline (Aim, Body, and Noise). When the virtual + /// camera is Live, the Unity camera will assume the position and orientation + /// of the virtual camera. + /// + /// A virtual camera is not a camera. Instead, it can be thought of as a camera controller, + /// not unlike a cameraman. It can drive the Unity Camera and control its position, + /// orientation, lens settings, and PostProcessing effects. Each Virtual Camera owns + /// its own Cinemachine Component Pipeline, through which you provide the instructions + /// for dynamically tracking specific game objects. + /// + /// A virtual camera is very lightweight, and does no rendering of its own. It merely + /// tracks interesting GameObjects, and positions itself accordingly. A typical game + /// can have dozens of virtual cameras, each set up to follow a particular character + /// or capture a particular event. + /// + /// A Virtual Camera can be in any of three states: + /// + /// * **Live**: The virtual camera is actively controlling the Unity Camera. The + /// virtual camera is tracking its targets and being updated every frame. + /// * **Standby**: The virtual camera is tracking its targets and being updated + /// every frame, but no Unity Camera is actively being controlled by it. This is + /// the state of a virtual camera that is enabled in the scene but perhaps at a + /// lower priority than the Live virtual camera. + /// * **Disabled**: The virtual camera is present but disabled in the scene. It is + /// not actively tracking its targets and so consumes no processing power. However, + /// the virtual camera can be made live from the Timeline. + /// + /// The Unity Camera can be driven by any virtual camera in the scene. The game + /// logic can choose the virtual camera to make live by manipulating the virtual + /// cameras' enabled flags and their priorities, based on game logic. + /// + /// In order to be driven by a virtual camera, the Unity Camera must have a CinemachineBrain + /// behaviour, which will select the most eligible virtual camera based on its priority + /// or on other criteria, and will manage blending. + /// + /// + /// + /// + /// + /// + [DocumentationSorting(1, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode, DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachineVirtualCamera")] + public class CinemachineVirtualCamera : CinemachineVirtualCameraBase + { + /// The object that the camera wants to look at (the Aim target). + /// The Aim component of the CinemachineComponent pipeline + /// will refer to this target and orient the vcam in accordance with rules and + /// settings that are provided to it. + /// If this is null, then the vcam's Transform orientation will be used. + [Tooltip("The object that the camera wants to look at (the Aim target). If this is null, then the vcam's Transform orientation will define the camera's orientation.")] + [NoSaveDuringPlay] + public Transform m_LookAt = null; + + /// The object that the camera wants to move with (the Body target). + /// The Body component of the CinemachineComponent pipeline + /// will refer to this target and position the vcam in accordance with rules and + /// settings that are provided to it. + /// If this is null, then the vcam's Transform position will be used. + [Tooltip("The object that the camera wants to move with (the Body target). If this is null, then the vcam's Transform position will define the camera's position.")] + [NoSaveDuringPlay] + public Transform m_Follow = null; + + /// Specifies the LensSettings of this Virtual Camera. + /// These settings will be transferred to the Unity camera when the vcam is live. + [FormerlySerializedAs("m_LensAttributes")] + [Tooltip("Specifies the lens properties of this Virtual Camera. This generally mirrors the Unity Camera's lens settings, and will be used to drive the Unity camera when the vcam is active.")] + [LensSettingsProperty] + public LensSettings m_Lens = LensSettings.Default; + + /// This is the name of the hidden GameObject that will be created as a child object + /// of the virtual camera. This hidden game object acts as a container for the polymorphic + /// CinemachineComponent pipeline. The Inspector UI for the Virtual Camera + /// provides access to this pipleline, as do the CinemachineComponent-family of + /// public methods in this class. + /// The lifecycle of the pipeline GameObject is managed automatically. + public const string PipelineName = "cm"; + + /// The CameraState object holds all of the information + /// necessary to position the Unity camera. It is the output of this class. + override public CameraState State { get { return m_State; } } + + /// Get the LookAt target for the Aim component in the CinemachinePipeline. + /// If this vcam is a part of a meta-camera collection, then the owner's target + /// will be used if the local target is null. + override public Transform LookAt + { + get { return ResolveLookAt(m_LookAt); } + set { m_LookAt = value; } + } + + /// Get the Follow target for the Body component in the CinemachinePipeline. + /// If this vcam is a part of a meta-camera collection, then the owner's target + /// will be used if the local target is null. + override public Transform Follow + { + get { return ResolveFollow(m_Follow); } + set { m_Follow = value; } + } + + /// Called by CinemachineCore at LateUpdate time + /// so the vcam can position itself and track its targets. This class will + /// invoke its pipeline and generate a CameraState for this frame. + override public void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineVirtualCamera.UpdateCameraState"); + if (!PreviousStateIsValid) + deltaTime = -1; + + // Reset the base camera state, in case the game object got moved in the editor + if (deltaTime < 0) + m_State = PullStateFromVirtualCamera(worldUp); // not in gameplay + + // Update the state by invoking the component pipeline + m_State = CalculateNewState(worldUp, deltaTime); + + // Push the raw position back to the game object's transform, so it + // moves along with the camera. + if (!UserIsDragging) + { + if (Follow != null) + transform.position = State.RawPosition; + if (LookAt != null) + transform.rotation = State.RawOrientation; + } + PreviousStateIsValid = true; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// Make sure that the pipeline cache is up-to-date. + override protected void OnEnable() + { + base.OnEnable(); + InvalidateComponentPipeline(); + + // Can't add components during OnValidate + if (ValidatingStreamVersion < 20170927) + { + if (Follow != null && GetCinemachineComponent(CinemachineCore.Stage.Body) == null) + AddCinemachineComponent(); + if (LookAt != null && GetCinemachineComponent(CinemachineCore.Stage.Aim) == null) + AddCinemachineComponent(); + } + } + + /// Calls the DestroyPipelineDelegate for destroying the hidden + /// child object, to support undo. + protected override void OnDestroy() + { + // Make the pipeline visible instead of destroying - this is to keep Undo happy + foreach (Transform child in transform) + if (child.GetComponent() != null) + child.gameObject.hideFlags + &= ~(HideFlags.HideInHierarchy | HideFlags.HideInInspector); + + base.OnDestroy(); + } + + /// Enforce bounds for fields, when changed in inspector. + protected override void OnValidate() + { + base.OnValidate(); + m_Lens.Validate(); + } + + void OnTransformChildrenChanged() + { + InvalidateComponentPipeline(); + } + + void Reset() + { + DestroyPipeline(); + } + + /// + /// Override component pipeline creation. + /// This needs to be done by the editor to support Undo. + /// The override must do exactly the same thing as the CreatePipeline method in this class. + /// + public static CreatePipelineDelegate CreatePipelineOverride; + + /// + /// Override component pipeline creation. + /// This needs to be done by the editor to support Undo. + /// The override must do exactly the same thing as the CreatePipeline method in + /// the CinemachineVirtualCamera class. + /// + public delegate Transform CreatePipelineDelegate( + CinemachineVirtualCamera vcam, string name, CinemachineComponentBase[] copyFrom); + + /// + /// Override component pipeline destruction. + /// This needs to be done by the editor to support Undo. + /// + public static DestroyPipelineDelegate DestroyPipelineOverride; + + /// + /// Override component pipeline destruction. + /// This needs to be done by the editor to support Undo. + /// + public delegate void DestroyPipelineDelegate(GameObject pipeline); + + /// Destroy any existing pipeline container. + private void DestroyPipeline() + { + List oldPipeline = new List(); + foreach (Transform child in transform) + if (child.GetComponent() != null) + oldPipeline.Add(child); + + foreach (Transform child in oldPipeline) + { + if (DestroyPipelineOverride != null) + DestroyPipelineOverride(child.gameObject); + else + Destroy(child.gameObject); + } + m_ComponentOwner = null; + PreviousStateIsValid = false; + } + + /// Create a default pipeline container. + private Transform CreatePipeline(CinemachineVirtualCamera copyFrom) + { + CinemachineComponentBase[] components = null; + if (copyFrom != null) + { + copyFrom.InvalidateComponentPipeline(); // make sure it's up to date + components = copyFrom.GetComponentPipeline(); + } + + Transform newPipeline = null; + if (CreatePipelineOverride != null) + newPipeline = CreatePipelineOverride(this, PipelineName, components); + else + { + GameObject go = new GameObject(PipelineName); + go.transform.parent = transform; + go.AddComponent(); + newPipeline = go.transform; + + // If copying, transfer the components + if (components != null) + foreach (Component c in components) + ReflectionHelpers.CopyFields(c, go.AddComponent(c.GetType())); + } + PreviousStateIsValid = false; + return newPipeline; + } + + /// + /// Editor API: Call this when changing the pipeline from the editor. + /// Will force a rebuild of the pipeline cache. + /// + public void InvalidateComponentPipeline() { m_ComponentPipeline = null; } + + /// Get the hidden CinemachinePipeline child object. + public Transform GetComponentOwner() { UpdateComponentPipeline(); return m_ComponentOwner; } + + /// Get the component pipeline owned by the hidden child pipline container. + /// For most purposes, it is preferable to use the GetCinemachineComponent method. + public CinemachineComponentBase[] GetComponentPipeline() { UpdateComponentPipeline(); return m_ComponentPipeline; } + + /// Get the component set for a specific stage. + /// The stage for which we want the component + /// The Cinemachine component for that stage, or null if not defined + public CinemachineComponentBase GetCinemachineComponent(CinemachineCore.Stage stage) + { + CinemachineComponentBase[] components = GetComponentPipeline(); + if (components != null) + foreach (var c in components) + if (c.Stage == stage) + return c; + return null; + } + + /// Get an existing component of a specific type from the cinemachine pipeline. + public T GetCinemachineComponent() where T : CinemachineComponentBase + { + CinemachineComponentBase[] components = GetComponentPipeline(); + if (components != null) + foreach (var c in components) + if (c is T) + return c as T; + return null; + } + + /// Add a component to the cinemachine pipeline. + public T AddCinemachineComponent() where T : CinemachineComponentBase + { + // Get the existing components + Transform owner = GetComponentOwner(); + CinemachineComponentBase[] components = owner.GetComponents(); + + T component = owner.gameObject.AddComponent(); + if (component != null && components != null) + { + // Remove the existing components at that stage + CinemachineCore.Stage stage = component.Stage; + for (int i = components.Length - 1; i >= 0; --i) + { + if (components[i].Stage == stage) + { + components[i].enabled = false; + DestroyImmediate(components[i]); + } + } + } + InvalidateComponentPipeline(); + return component; + } + + /// Remove a component from the cinemachine pipeline. + public void DestroyCinemachineComponent() where T : CinemachineComponentBase + { + CinemachineComponentBase[] components = GetComponentPipeline(); + if (components != null) + { + foreach (var c in components) + { + if (c is T) + { + c.enabled = false; + DestroyImmediate(c); + InvalidateComponentPipeline(); + } + } + } + } + + /// API for the editor, to make the dragging of position handles behave better. + public bool UserIsDragging { get; set; } + + /// API for the editor, to process a position drag from the user. + public void OnPositionDragged(Vector3 delta) + { + CinemachineComponentBase[] components = GetComponentPipeline(); + if (components != null) + for (int i = 0; i < components.Length; ++i) + components[i].OnPositionDragged(delta); + } + + CameraState m_State = CameraState.Default; // Current state this frame + + CinemachineComponentBase[] m_ComponentPipeline = null; + [SerializeField][HideInInspector] private Transform m_ComponentOwner = null; // serialized to handle copy/paste + void UpdateComponentPipeline() + { + // Did we just get copy/pasted? + if (m_ComponentOwner != null && m_ComponentOwner.parent != transform) + { + CinemachineVirtualCamera copyFrom = (m_ComponentOwner.parent != null) + ? m_ComponentOwner.parent.gameObject.GetComponent() : null; + DestroyPipeline(); + m_ComponentOwner = CreatePipeline(copyFrom); + } + + // Early out if we're up-to-date + if (m_ComponentOwner != null && m_ComponentPipeline != null) + return; + + m_ComponentOwner = null; + List list = new List(); + foreach (Transform child in transform) + { + if (child.GetComponent() != null) + { + m_ComponentOwner = child; + CinemachineComponentBase[] components = child.GetComponents(); + foreach (CinemachineComponentBase c in components) + list.Add(c); + } + } + + // Make sure we have a pipeline owner + if (m_ComponentOwner == null) + m_ComponentOwner = CreatePipeline(null); + + // Make sure the pipeline stays hidden, even through prefab + if (CinemachineCore.sShowHiddenObjects) + m_ComponentOwner.gameObject.hideFlags + &= ~(HideFlags.HideInHierarchy | HideFlags.HideInInspector); + else + m_ComponentOwner.gameObject.hideFlags + |= (HideFlags.HideInHierarchy | HideFlags.HideInInspector); + + // Sort the pipeline + list.Sort((c1, c2) => (int)c1.Stage - (int)c2.Stage); + m_ComponentPipeline = list.ToArray(); + } + + private CameraState CalculateNewState(Vector3 worldUp, float deltaTime) + { + // Initialize the camera state, in case the game object got moved in the editor + CameraState state = PullStateFromVirtualCamera(worldUp); + + if (LookAt != null) + state.ReferenceLookAt = LookAt.position; + + // Update the state by invoking the component pipeline + CinemachineCore.Stage curStage = CinemachineCore.Stage.Body; + UpdateComponentPipeline(); // avoid GetComponentPipeline() here because of GC + if (m_ComponentPipeline != null) + { + for (int i = 0; i < m_ComponentPipeline.Length; ++i) + m_ComponentPipeline[i].PrePipelineMutateCameraState(ref state); + + for (int i = 0; i < m_ComponentPipeline.Length; ++i) + { + curStage = AdvancePipelineStage( + ref state, deltaTime, curStage, (int)m_ComponentPipeline[i].Stage); + m_ComponentPipeline[i].MutateCameraState(ref state, deltaTime); + } + } + int numStages = 3; //Enum.GetValues(typeof(CinemachineCore.Stage)).Length; + AdvancePipelineStage(ref state, deltaTime, curStage, numStages); + return state; + } + + private CinemachineCore.Stage AdvancePipelineStage( + ref CameraState state, float deltaTime, + CinemachineCore.Stage curStage, int maxStage) + { + while ((int)curStage < maxStage) + { + InvokePostPipelineStageCallback(this, curStage, ref state, deltaTime); + ++curStage; + } + return curStage; + } + + private CameraState PullStateFromVirtualCamera(Vector3 worldUp) + { + CameraState state = CameraState.Default; + state.RawPosition = transform.position; + state.RawOrientation = transform.rotation; + state.ReferenceUp = worldUp; + + CinemachineBrain brain = CinemachineCore.Instance.FindPotentialTargetBrain(this); + m_Lens.Aspect = brain != null ? brain.OutputCamera.aspect : 1; + m_Lens.Orthographic = brain != null ? brain.OutputCamera.orthographic : false; + state.Lens = m_Lens; + + return state; + } + + // This is a hack for FreeLook rigs - to be removed + internal void SetStateRawPosition(Vector3 pos) { m_State.RawPosition = pos; } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs.meta new file mode 100644 index 0000000..c1e38c6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Behaviours/CinemachineVirtualCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 45e653bab7fb20e499bda25e1b646fea +timeCreated: 1496775476 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components.meta new file mode 100644 index 0000000..2c26f6d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0fafdc3d4f989ff48803e7d870539b41 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs new file mode 100644 index 0000000..6b43df1 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs @@ -0,0 +1,113 @@ +using UnityEngine; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// As a part of the Cinemachine Pipeline implementing the Noise stage, this + /// component adds Perlin Noise to the Camera state, in the Correction + /// channel of the CameraState. + /// + /// The noise is created by using a predefined noise profile asset. This defines the + /// shape of the noise over time. You can scale this in amplitude or in time, to produce + /// a large family of different noises using the same profile. + /// + /// + [DocumentationSorting(8, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineBasicMultiChannelPerlin : CinemachineComponentBase + { + /// + /// Serialized property for referencing a NoiseSettings asset + /// + [HideInInspector] + [Tooltip("The asset containing the Noise Profile. Define the frequencies and amplitudes there to make a characteristic noise profile. Make your own or just use one of the many presets.")] + [FormerlySerializedAs("m_Definition")] + public NoiseSettings m_NoiseProfile; + + /// + /// Gain to apply to the amplitudes defined in the settings asset. + /// + [Tooltip("Gain to apply to the amplitudes defined in the NoiseSettings asset. 1 is normal. Setting this to 0 completely mutes the noise.")] + public float m_AmplitudeGain = 1f; + + /// + /// Scale factor to apply to the frequencies defined in the settings asset. + /// + [Tooltip("Scale factor to apply to the frequencies defined in the NoiseSettings asset. 1 is normal. Larger magnitudes will make the noise shake more rapidly.")] + public float m_FrequencyGain = 1f; + + /// True if the component is valid, i.e. it has a noise definition and is enabled. + public override bool IsValid { get { return enabled && m_NoiseProfile != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Noise stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Noise; } } + + /// Applies noise to the Correction channel of the CameraState if the + /// delta time is greater than 0. Otherwise, does nothing. + /// The current camera state + /// How much to advance the perlin noise generator. + /// Noise is only applied if this value is greater than or equal to 0 + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (!IsValid || deltaTime < 0) + return; + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineBasicMultiChannelPerlin.MutateCameraState"); + if (!mInitialized) + Initialize(); + + mNoiseTime += deltaTime * m_FrequencyGain; + curState.PositionCorrection += curState.CorrectedOrientation * GetCombinedFilterResults( + m_NoiseProfile.PositionNoise, mNoiseTime, mNoiseOffsets) * m_AmplitudeGain; + Quaternion rotNoise = Quaternion.Euler(GetCombinedFilterResults( + m_NoiseProfile.OrientationNoise, mNoiseTime, mNoiseOffsets) * m_AmplitudeGain); + curState.OrientationCorrection = curState.OrientationCorrection * rotNoise; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + private bool mInitialized = false; + private float mNoiseTime = 0; + private Vector3 mNoiseOffsets = Vector3.zero; + + void Initialize() + { + mInitialized = true; + mNoiseTime = 0; + mNoiseOffsets = new Vector3( + UnityEngine.Random.Range(-10000f, 10000f), + UnityEngine.Random.Range(-10000f, 10000f), + UnityEngine.Random.Range(-10000f, 10000f)); + } + + static Vector3 GetCombinedFilterResults( + NoiseSettings.TransformNoiseParams[] noiseParams, float time, Vector3 noiseOffsets) + { + float xPos = 0f; + float yPos = 0f; + float zPos = 0f; + if (noiseParams != null) + { + for (int i = 0; i < noiseParams.Length; ++i) + { + NoiseSettings.TransformNoiseParams param = noiseParams[i]; + Vector3 timeVal = new Vector3(param.X.Frequency, param.Y.Frequency, param.Z.Frequency) * time; + timeVal += noiseOffsets; + + Vector3 noise = new Vector3( + Mathf.PerlinNoise(timeVal.x, 0f) - 0.5f, + Mathf.PerlinNoise(timeVal.y, 0f) - 0.5f, + Mathf.PerlinNoise(timeVal.z, 0f) - 0.5f); + + xPos += noise.x * param.X.Amplitude; + yPos += noise.y * param.Y.Amplitude; + zPos += noise.z * param.Z.Amplitude; + } + } + return new Vector3(xPos, yPos, zPos); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs.meta new file mode 100644 index 0000000..aa065b7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineBasicMultiChannelPerlin.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 68bb026fafb42b14791938953eaace77 +timeCreated: 1484001117 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs new file mode 100644 index 0000000..41125a6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs @@ -0,0 +1,391 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to aim the camera at the vcam's LookAt target object, with + /// configurable offsets, damping, and composition rules. + /// + /// The composer does not change the camera's position. It will only pan and tilt the + /// camera where it is, in order to get the desired framing. To move the camera, you have + /// to use the virtual camera's Body section. + /// + [DocumentationSorting(3, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] // for OnGUI + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineComposer : CinemachineComponentBase + { + /// Used by the Inspector Editor to display on-screen guides. + [NoSaveDuringPlay, HideInInspector] + public Action OnGUICallback = null; + + /// Target offset from the object's center in LOCAL space which + /// the Composer tracks. Use this to fine-tune the tracking target position + /// when the desired area is not in the tracked object's center + [Tooltip("Target offset from the target object's center in target-local space. Use this to fine-tune the tracking target position when the desired area is not the tracked object's center.")] + public Vector3 m_TrackedObjectOffset = Vector3.zero; + + /// This setting will instruct the composer to adjust its target offset based + /// on the motion of the target. The composer will look at a point where it estimates + /// the target will be this many seconds into the future. Note that this setting is sensitive + /// to noisy animation, and can amplify the noise, resulting in undesirable camera jitter. + /// If the camera jitters unacceptably when the target is in motion, turn down this setting, + /// or animate the target more smoothly. + [Tooltip("This setting will instruct the composer to adjust its target offset based on the motion of the target. The composer will look at a point where it estimates the target will be this many seconds into the future. Note that this setting is sensitive to noisy animation, and can amplify the noise, resulting in undesirable camera jitter. If the camera jitters unacceptably when the target is in motion, turn down this setting, or animate the target more smoothly.")] + [Range(0f, 1f)] + public float m_LookaheadTime = 0; + + /// Controls the smoothness of the lookahead algorithm. Larger values smooth out + /// jittery predictions and also increase prediction lag + [Tooltip("Controls the smoothness of the lookahead algorithm. Larger values smooth out jittery predictions and also increase prediction lag")] + [Range(3, 30)] + public float m_LookaheadSmoothing = 10; + + /// How aggressively the camera tries to follow the target in the screen-horizontal direction. + /// Small numbers are more responsive, rapidly orienting the camera to keep the target in + /// the dead zone. Larger numbers give a more heavy slowly responding camera. + /// Using different vertical and horizontal settings can yield a wide range of camera behaviors. + [Space] + [Range(0f, 20)] + [Tooltip("How aggressively the camera tries to follow the target in the screen-horizontal direction. Small numbers are more responsive, rapidly orienting the camera to keep the target in the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical and horizontal settings can yield a wide range of camera behaviors.")] + public float m_HorizontalDamping = 0.5f; + + /// How aggressively the camera tries to follow the target in the screen-vertical direction. + /// Small numbers are more responsive, rapidly orienting the camera to keep the target in + /// the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical + /// and horizontal settings can yield a wide range of camera behaviors. + [Range(0f, 20)] + [Tooltip("How aggressively the camera tries to follow the target in the screen-vertical direction. Small numbers are more responsive, rapidly orienting the camera to keep the target in the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical and horizontal settings can yield a wide range of camera behaviors.")] + public float m_VerticalDamping = 0.5f; + + /// Horizontal screen position for target. The camera will rotate to the position the tracked object here + [Space] + [Range(0f, 1f)] + [Tooltip("Horizontal screen position for target. The camera will rotate to position the tracked object here.")] + public float m_ScreenX = 0.5f; + + /// Vertical screen position for target, The camera will rotate to to position the tracked object here + [Range(0f, 1f)] + [Tooltip("Vertical screen position for target, The camera will rotate to position the tracked object here.")] + public float m_ScreenY = 0.5f; + + /// Camera will not rotate horizontally if the target is within this range of the position + [Range(0f, 1f)] + [Tooltip("Camera will not rotate horizontally if the target is within this range of the position.")] + public float m_DeadZoneWidth = 0.1f; + + /// Camera will not rotate vertically if the target is within this range of the position + [Range(0f, 1f)] + [Tooltip("Camera will not rotate vertically if the target is within this range of the position.")] + public float m_DeadZoneHeight = 0.1f; + + /// When target is within this region, camera will gradually move to re-align + /// towards the desired position, depending onm the damping speed + [Range(0f, 2f)] + [Tooltip("When target is within this region, camera will gradually rotate horizontally to re-align towards the desired position, depending on the damping speed.")] + public float m_SoftZoneWidth = 0.8f; + + /// When target is within this region, camera will gradually move to re-align + /// towards the desired position, depending onm the damping speed + [Range(0f, 2f)] + [Tooltip("When target is within this region, camera will gradually rotate vertically to re-align towards the desired position, depending on the damping speed.")] + public float m_SoftZoneHeight = 0.8f; + + /// A non-zero bias will move the targt position away from the center of the soft zone + [Range(-0.5f, 0.5f)] + [Tooltip("A non-zero bias will move the target position horizontally away from the center of the soft zone.")] + public float m_BiasX = 0f; + + /// A non-zero bias will move the targt position away from the center of the soft zone + [Range(-0.5f, 0.5f)] + [Tooltip("A non-zero bias will move the target position vertically away from the center of the soft zone.")] + public float m_BiasY = 0f; + + /// True if component is enabled and has a LookAt defined + public override bool IsValid { get { return enabled && LookAtTarget != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Aim stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Aim; } } + + /// Internal API for inspector + public Vector3 TrackedPoint { get; private set; } + + /// Apply the target offsets to the target location. + /// Also set the TrackedPoint property, taking lookahead into account. + /// The unoffset LookAt point + /// The LookAt point with the offset applied + protected virtual Vector3 GetLookAtPointAndSetTrackedPoint(Vector3 lookAt) + { + Vector3 pos = lookAt; + if (LookAtTarget != null) + pos += LookAtTarget.transform.rotation * m_TrackedObjectOffset; + + m_Predictor.Smoothing = m_LookaheadSmoothing; + m_Predictor.AddPosition(pos); + TrackedPoint = (m_LookaheadTime > 0) + ? m_Predictor.PredictPosition(m_LookaheadTime) : pos; + + return pos; + } + +#if UNITY_EDITOR + private void OnGUI() { if (OnGUICallback != null) OnGUICallback(); } +#endif + + /// State information for damping + Vector3 m_CameraPosPrevFrame = Vector3.zero; + Vector3 m_LookAtPrevFrame = Vector3.zero; + Vector2 m_ScreenOffsetPrevFrame = Vector2.zero; + Quaternion m_CameraOrientationPrevFrame = Quaternion.identity; + PositionPredictor m_Predictor = new PositionPredictor(); + + public override void PrePipelineMutateCameraState(ref CameraState curState) + { + if (IsValid && curState.HasLookAt) + curState.ReferenceLookAt = GetLookAtPointAndSetTrackedPoint(curState.ReferenceLookAt); + } + + /// Applies the composer rules and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. If less than + /// zero, then target will snap to the center of the dead zone. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + // Initialize the state for previous frame if appropriate + if (deltaTime < 0) + m_Predictor.Reset(); + + if (!IsValid || !curState.HasLookAt) + return; + + float targetDistance = (TrackedPoint - curState.CorrectedPosition).magnitude; + if (targetDistance < Epsilon) + { + if (deltaTime >= 0) + curState.RawOrientation = m_CameraOrientationPrevFrame; + return; // navel-gazing, get outa here + } + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineComposer.MutateCameraState"); + float fov, fovH; + if (curState.Lens.Orthographic) + { + // Calculate effective fov - fake it for ortho based on target distance + fov = Mathf.Rad2Deg * 2 * Mathf.Atan(curState.Lens.OrthographicSize / targetDistance); + fovH = Mathf.Rad2Deg * 2 * Mathf.Atan( + curState.Lens.Aspect * curState.Lens.OrthographicSize / targetDistance); + } + else + { + fov = curState.Lens.FieldOfView; + double radHFOV = 2 * Math.Atan(Math.Tan(fov * Mathf.Deg2Rad / 2) * curState.Lens.Aspect); + fovH = (float)(Mathf.Rad2Deg * radHFOV); + } + + Quaternion rigOrientation = curState.RawOrientation; + Rect softGuideFOV = ScreenToFOV(SoftGuideRect, fov, fovH, curState.Lens.Aspect); + if (deltaTime < 0) + { + // No damping, just snap to central bounds, skipping the soft zone + Rect rect = new Rect(softGuideFOV.center, Vector2.zero); // Force to center + RotateToScreenBounds(ref curState, rect, ref rigOrientation, fov, fovH, -1); + } + else + { + // Start with previous frame's orientation (but with current up) + Vector3 dir = m_LookAtPrevFrame - (m_CameraPosPrevFrame + curState.PositionDampingBypass); + if (dir.AlmostZero()) + rigOrientation = Quaternion.LookRotation( + m_CameraOrientationPrevFrame * Vector3.forward, curState.ReferenceUp); + else + { + rigOrientation = Quaternion.LookRotation(dir, curState.ReferenceUp); + rigOrientation = rigOrientation.ApplyCameraRotation( + -m_ScreenOffsetPrevFrame, curState.ReferenceUp); + } + + // First force the previous rotation into the hard bounds, no damping, + // then Now move it through the soft zone, with damping + Rect hardGuideFOV = ScreenToFOV(HardGuideRect, fov, fovH, curState.Lens.Aspect); + if (!RotateToScreenBounds(ref curState, hardGuideFOV, ref rigOrientation, fov, fovH, -1)) + RotateToScreenBounds(ref curState, softGuideFOV, ref rigOrientation, fov, fovH, deltaTime); + } + m_CameraPosPrevFrame = curState.CorrectedPosition; + m_LookAtPrevFrame = TrackedPoint; + m_CameraOrientationPrevFrame = UnityQuaternionExtensions.Normalized(rigOrientation); + m_ScreenOffsetPrevFrame = m_CameraOrientationPrevFrame.GetCameraRotationToTarget( + m_LookAtPrevFrame - curState.CorrectedPosition, curState.ReferenceUp); + + curState.RawOrientation = m_CameraOrientationPrevFrame; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// Internal API for the inspector editor + public Rect SoftGuideRect + { + get + { + return new Rect( + m_ScreenX - m_DeadZoneWidth / 2, m_ScreenY - m_DeadZoneHeight / 2, + m_DeadZoneWidth, m_DeadZoneHeight); + } + set + { + m_DeadZoneWidth = Mathf.Clamp01(value.width); + m_DeadZoneHeight = Mathf.Clamp01(value.height); + m_ScreenX = Mathf.Clamp01(value.x + m_DeadZoneWidth / 2); + m_ScreenY = Mathf.Clamp01(value.y + m_DeadZoneHeight / 2); + m_SoftZoneWidth = Mathf.Max(m_SoftZoneWidth, m_DeadZoneWidth); + m_SoftZoneHeight = Mathf.Max(m_SoftZoneHeight, m_DeadZoneHeight); + } + } + + /// Internal API for the inspector editor + public Rect HardGuideRect + { + get + { + Rect r = new Rect( + m_ScreenX - m_SoftZoneWidth / 2, m_ScreenY - m_SoftZoneHeight / 2, + m_SoftZoneWidth, m_SoftZoneHeight); + r.position += new Vector2( + m_BiasX * (m_SoftZoneWidth - m_DeadZoneWidth), + m_BiasY * (m_SoftZoneHeight - m_DeadZoneHeight)); + return r; + } + set + { + m_SoftZoneWidth = Mathf.Clamp(value.width, 0, 2f); + m_SoftZoneHeight = Mathf.Clamp(value.height, 0, 2f); + m_DeadZoneWidth = Mathf.Min(m_DeadZoneWidth, m_SoftZoneWidth); + m_DeadZoneHeight = Mathf.Min(m_DeadZoneHeight, m_SoftZoneHeight); + + Vector2 center = value.center; + Vector2 bias = center - new Vector2(m_ScreenX, m_ScreenY); + float biasWidth = Mathf.Max(0, m_SoftZoneWidth - m_DeadZoneWidth); + float biasHeight = Mathf.Max(0, m_SoftZoneHeight - m_DeadZoneHeight); + m_BiasX = biasWidth < Epsilon ? 0 : Mathf.Clamp(bias.x / biasWidth, -0.5f, 0.5f); + m_BiasY = biasHeight < Epsilon ? 0 : Mathf.Clamp(bias.y / biasHeight, -0.5f, 0.5f); + } + } + + // Convert from screen coords to normalized FOV angular coords + private Rect ScreenToFOV(Rect rScreen, float fov, float fovH, float aspect) + { + Rect r = new Rect(rScreen); + Matrix4x4 persp = Matrix4x4.Perspective(fov, aspect, 0.01f, 10000f).inverse; + + Vector3 p = persp.MultiplyPoint(new Vector3(0, (r.yMin * 2f) - 1f, 0.1f)); p.z = -p.z; + float angle = UnityVectorExtensions.SignedAngle(Vector3.forward, p, Vector3.left); + r.yMin = ((fov / 2) + angle) / fov; + + p = persp.MultiplyPoint(new Vector3(0, (r.yMax * 2f) - 1f, 0.1f)); p.z = -p.z; + angle = UnityVectorExtensions.SignedAngle(Vector3.forward, p, Vector3.left); + r.yMax = ((fov / 2) + angle) / fov; + + p = persp.MultiplyPoint(new Vector3((r.xMin * 2f) - 1f, 0, 0.1f)); p.z = -p.z; + angle = UnityVectorExtensions.SignedAngle(Vector3.forward, p, Vector3.up); + r.xMin = ((fovH / 2) + angle) / fovH; + + p = persp.MultiplyPoint(new Vector3((r.xMax * 2f) - 1f, 0, 0.1f)); p.z = -p.z; + angle = UnityVectorExtensions.SignedAngle(Vector3.forward, p, Vector3.up); + r.xMax = ((fovH / 2) + angle) / fovH; + return r; + } + + /// + /// Adjust the rigOrientation to put the camera within the screen bounds. + /// If deltaTime >= 0 then damping will be applied. + /// Assumes that currentOrientation fwd is such that input rigOrientation's + /// local up is NEVER NEVER NEVER pointing downwards, relative to + /// state.ReferenceUp. If this condition is violated + /// then you will see crazy spinning. That's the symptom. + /// + private bool RotateToScreenBounds( + ref CameraState state, Rect screenRect, + ref Quaternion rigOrientation, float fov, float fovH, float deltaTime) + { + Vector3 targetDir = TrackedPoint - state.CorrectedPosition; + Vector2 rotToRect = rigOrientation.GetCameraRotationToTarget(targetDir, state.ReferenceUp); + + // Bring it to the edge of screenRect, if outside. Leave it alone if inside. + ClampVerticalBounds(ref screenRect, targetDir, state.ReferenceUp, fov); + float min = (screenRect.yMin - 0.5f) * fov; + float max = (screenRect.yMax - 0.5f) * fov; + if (rotToRect.x < min) + rotToRect.x -= min; + else if (rotToRect.x > max) + rotToRect.x -= max; + else + rotToRect.x = 0; + + min = (screenRect.xMin - 0.5f) * fovH; + max = (screenRect.xMax - 0.5f) * fovH; + if (rotToRect.y < min) + rotToRect.y -= min; + else if (rotToRect.y > max) + rotToRect.y -= max; + else + rotToRect.y = 0; + + // Apply damping + if (deltaTime >= 0) + { + rotToRect.x = Damper.Damp(rotToRect.x, m_VerticalDamping, deltaTime); + rotToRect.y = Damper.Damp(rotToRect.y, m_HorizontalDamping, deltaTime); + } + + // Rotate + rigOrientation = rigOrientation.ApplyCameraRotation(rotToRect, state.ReferenceUp); +#if false + // GML this gives false positives when the camera is moving. + // The way to address this would be to grow the hard rect by the amount + // that it would be damped + return Mathf.Abs(rotToRect.x) > Epsilon || Mathf.Abs(rotToRect.y) > Epsilon; +#else + return false; +#endif + } + + /// + /// Prevent upside-down camera situation. This can happen if we have a high + /// camera pitch combined with composer settings that cause the camera to tilt + /// beyond the vertical in order to produce the desired framing. We prevent this by + /// clamping the composer's vertical settings so that this situation can't happen. + /// + private bool ClampVerticalBounds(ref Rect r, Vector3 dir, Vector3 up, float fov) + { + float angle = Vector3.Angle(dir, up); + float halfFov = (fov / 2f) + 1; // give it a little extra to accommodate precision errors + if (angle < halfFov) + { + // looking up + float maxY = 1f - (halfFov - angle) / fov; + if (r.yMax > maxY) + { + r.yMin = Mathf.Min(r.yMin, maxY); + r.yMax = Mathf.Min(r.yMax, maxY); + return true; + } + } + if (angle > (180 - halfFov)) + { + // looking down + float minY = (angle - (180 - halfFov)) / fov; + if (minY > r.yMin) + { + r.yMin = Mathf.Max(r.yMin, minY); + r.yMax = Mathf.Max(r.yMax, minY); + return true; + } + } + return false; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs.meta new file mode 100644 index 0000000..eaa21d1 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f4044717213e31446939f7bd49c896ea +timeCreated: 1488314898 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs new file mode 100644 index 0000000..32ca9b3 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs @@ -0,0 +1,497 @@ +using System; +using Cinemachine.Utility; +using UnityEngine; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// This is a Cinemachine Component in the Body section of the component pipeline. + /// Its job is to position the camera in a fixed screen-space relationship to + /// the vcam's Follow target object, with offsets and damping. + /// + /// The camera will be first moved along the camera Z axis until the Follow target + /// is at the desired distance from the camera's X-Y plane. The camera will then + /// be moved in its XY plane until the Follow target is at the desired point on + /// the camera's screen. + /// + /// The FramingTansposer will only change the camera's position in space. It will not + /// re-orient or otherwise aim the camera. + /// + /// For this component to work properly, the vcam's LookAt target must be null. + /// The Follow target will define what the camera is looking at. + /// + /// If the Follow target is a CinemachineTargetGroup, then additional controls will + /// be available to dynamically adjust the camera’s view in order to frame the entire group. + /// + /// Although this component was designed for orthographic cameras, it works equally + /// well with persective cameras and can be used in 3D environments. + /// + [DocumentationSorting(5.5f, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] // for OnGUI + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineFramingTransposer : CinemachineComponentBase + { + /// Used by the Inspector Editor to display on-screen guides. + [NoSaveDuringPlay, HideInInspector] + public Action OnGUICallback = null; + + /// This setting will instruct the composer to adjust its target offset based + /// on the motion of the target. The composer will look at a point where it estimates + /// the target will be this many seconds into the future. Note that this setting is sensitive + /// to noisy animation, and can amplify the noise, resulting in undesirable camera jitter. + /// If the camera jitters unacceptably when the target is in motion, turn down this setting, + /// or animate the target more smoothly. + [Tooltip("This setting will instruct the composer to adjust its target offset based on the motion of the target. The composer will look at a point where it estimates the target will be this many seconds into the future. Note that this setting is sensitive to noisy animation, and can amplify the noise, resulting in undesirable camera jitter. If the camera jitters unacceptably when the target is in motion, turn down this setting, or animate the target more smoothly.")] + [Range(0f, 1f)] + public float m_LookaheadTime = 0; + + /// Controls the smoothness of the lookahead algorithm. Larger values smooth out + /// jittery predictions and also increase prediction lag + [Tooltip("Controls the smoothness of the lookahead algorithm. Larger values smooth out jittery predictions and also increase prediction lag")] + [Range(3, 30)] + public float m_LookaheadSmoothing = 10; + + /// How aggressively the camera tries to maintain the offset in the X-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// x-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the X-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's x-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_XDamping = 1f; + + /// How aggressively the camera tries to maintain the offset in the Y-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// y-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the Y-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's y-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_YDamping = 1f; + + /// How aggressively the camera tries to maintain the offset in the Z-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the + /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the Z-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's z-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_ZDamping = 1f; + + /// Horizontal screen position for target. The camera will move to position the tracked object here + [Space] + [Range(0f, 1f)] + [Tooltip("Horizontal screen position for target. The camera will move to position the tracked object here.")] + public float m_ScreenX = 0.5f; + + /// Vertical screen position for target, The camera will move to to position the tracked object here + [Range(0f, 1f)] + [Tooltip("Vertical screen position for target, The camera will move to position the tracked object here.")] + public float m_ScreenY = 0.5f; + + /// The distance along the camera axis that will be maintained from the Follow target + [Tooltip("The distance along the camera axis that will be maintained from the Follow target")] + public float m_CameraDistance = 10f; + + /// Camera will not move horizontally if the target is within this range of the position + [Space] + [Range(0f, 1f)] + [Tooltip("Camera will not move horizontally if the target is within this range of the position.")] + public float m_DeadZoneWidth = 0.1f; + + /// Camera will not move vertically if the target is within this range of the position + [Range(0f, 1f)] + [Tooltip("Camera will not move vertically if the target is within this range of the position.")] + public float m_DeadZoneHeight = 0.1f; + + /// The camera will not move along its z-axis if the Follow target is within this distance of the specified camera distance + [Tooltip("The camera will not move along its z-axis if the Follow target is within this distance of the specified camera distance")] + [FormerlySerializedAs("m_DistanceDeadZoneSize")] + public float m_DeadZoneDepth = 0; + + [Space] + /// If checked, then then soft zone will be unlimited in size + [Tooltip("If checked, then then soft zone will be unlimited in size.")] + public bool m_UnlimitedSoftZone = false; + + /// When target is within this region, camera will gradually move to re-align + /// towards the desired position, depending onm the damping speed + [Range(0f, 2f)] + [Tooltip("When target is within this region, camera will gradually move horizontally to re-align towards the desired position, depending on the damping speed.")] + public float m_SoftZoneWidth = 0.8f; + + /// When target is within this region, camera will gradually move to re-align + /// towards the desired position, depending onm the damping speed + [Range(0f, 2f)] + [Tooltip("When target is within this region, camera will gradually move vertically to re-align towards the desired position, depending on the damping speed.")] + public float m_SoftZoneHeight = 0.8f; + + /// A non-zero bias will move the targt position away from the center of the soft zone + [Range(-0.5f, 0.5f)] + [Tooltip("A non-zero bias will move the target position horizontally away from the center of the soft zone.")] + public float m_BiasX = 0f; + + /// A non-zero bias will move the targt position away from the center of the soft zone + [Range(-0.5f, 0.5f)] + [Tooltip("A non-zero bias will move the target position vertically away from the center of the soft zone.")] + public float m_BiasY = 0f; + + /// What screen dimensions to consider when framing + [DocumentationSorting(4.01f, DocumentationSortingAttribute.Level.UserRef)] + public enum FramingMode + { + /// Consider only the horizontal dimension. Vertical framing is ignored. + Horizontal, + /// Consider only the vertical dimension. Horizontal framing is ignored. + Vertical, + /// The larger of the horizontal and vertical dimensions will dominate, to get the best fit. + HorizontalAndVertical, + /// Don't do any framing adjustment + None + }; + + /// What screen dimensions to consider when framing + [Space] + [Tooltip("What screen dimensions to consider when framing. Can be Horizontal, Vertical, or both")] + [FormerlySerializedAs("m_FramingMode")] + public FramingMode m_GroupFramingMode = FramingMode.HorizontalAndVertical; + + /// How to adjust the camera to get the desired framing + public enum AdjustmentMode + { + /// Do not move the camera, only adjust the FOV. + ZoomOnly, + /// Just move the camera, don't change the FOV. + DollyOnly, + /// Move the camera as much as permitted by the ranges, then + /// adjust the FOV if necessary to make the shot. + DollyThenZoom + }; + + /// How to adjust the camera to get the desired framing + [Tooltip("How to adjust the camera to get the desired framing. You can zoom, dolly in/out, or do both.")] + public AdjustmentMode m_AdjustmentMode = AdjustmentMode.DollyThenZoom; + + /// How much of the screen to fill with the bounding box of the targets. + [Tooltip("The bounding box of the targets should occupy this amount of the screen space. 1 means fill the whole screen. 0.5 means fill half the screen, etc.")] + public float m_GroupFramingSize = 0.8f; + + /// How much closer to the target can the camera go? + [Tooltip("The maximum distance toward the target that this behaviour is allowed to move the camera.")] + public float m_MaxDollyIn = 5000f; + + /// How much farther from the target can the camera go? + [Tooltip("The maximum distance away the target that this behaviour is allowed to move the camera.")] + public float m_MaxDollyOut = 5000f; + + /// Set this to limit how close to the target the camera can get + [Tooltip("Set this to limit how close to the target the camera can get.")] + public float m_MinimumDistance = 1; + + /// Set this to limit how far from the taregt the camera can get + [Tooltip("Set this to limit how far from the target the camera can get.")] + public float m_MaximumDistance = 5000f; + + /// If adjusting FOV, will not set the FOV lower than this + [Range(1, 179)] + [Tooltip("If adjusting FOV, will not set the FOV lower than this.")] + public float m_MinimumFOV = 3; + + /// If adjusting FOV, will not set the FOV higher than this + [Range(1, 179)] + [Tooltip("If adjusting FOV, will not set the FOV higher than this.")] + public float m_MaximumFOV = 60; + + /// If adjusting Orthographic Size, will not set it lower than this + [Tooltip("If adjusting Orthographic Size, will not set it lower than this.")] + public float m_MinimumOrthoSize = 1; + + /// If adjusting Orthographic Size, will not set it higher than this + [Tooltip("If adjusting Orthographic Size, will not set it higher than this.")] + public float m_MaximumOrthoSize = 100; + + /// Internal API for the inspector editor + public Rect SoftGuideRect + { + get + { + return new Rect( + m_ScreenX - m_DeadZoneWidth / 2, m_ScreenY - m_DeadZoneHeight / 2, + m_DeadZoneWidth, m_DeadZoneHeight); + } + set + { + m_DeadZoneWidth = Mathf.Clamp01(value.width); + m_DeadZoneHeight = Mathf.Clamp01(value.height); + m_ScreenX = Mathf.Clamp01(value.x + m_DeadZoneWidth / 2); + m_ScreenY = Mathf.Clamp01(value.y + m_DeadZoneHeight / 2); + m_SoftZoneWidth = Mathf.Max(m_SoftZoneWidth, m_DeadZoneWidth); + m_SoftZoneHeight = Mathf.Max(m_SoftZoneHeight, m_DeadZoneHeight); + } + } + + /// Internal API for the inspector editor + public Rect HardGuideRect + { + get + { + Rect r = new Rect( + m_ScreenX - m_SoftZoneWidth / 2, m_ScreenY - m_SoftZoneHeight / 2, + m_SoftZoneWidth, m_SoftZoneHeight); + r.position += new Vector2( + m_BiasX * (m_SoftZoneWidth - m_DeadZoneWidth), + m_BiasY * (m_SoftZoneHeight - m_DeadZoneHeight)); + return r; + } + set + { + m_SoftZoneWidth = Mathf.Clamp(value.width, 0, 2f); + m_SoftZoneHeight = Mathf.Clamp(value.height, 0, 2f); + m_DeadZoneWidth = Mathf.Min(m_DeadZoneWidth, m_SoftZoneWidth); + m_DeadZoneHeight = Mathf.Min(m_DeadZoneHeight, m_SoftZoneHeight); + + Vector2 center = value.center; + Vector2 bias = center - new Vector2(m_ScreenX, m_ScreenY); + float biasWidth = Mathf.Max(0, m_SoftZoneWidth - m_DeadZoneWidth); + float biasHeight = Mathf.Max(0, m_SoftZoneHeight - m_DeadZoneHeight); + m_BiasX = biasWidth < Epsilon ? 0 : Mathf.Clamp(bias.x / biasWidth, -0.5f, 0.5f); + m_BiasY = biasHeight < Epsilon ? 0 : Mathf.Clamp(bias.y / biasHeight, -0.5f, 0.5f); + } + } + + private void OnValidate() + { + m_CameraDistance = Mathf.Max(m_CameraDistance, kMinimumCameraDistance); + m_DeadZoneDepth = Mathf.Max(m_DeadZoneDepth, 0); + + m_GroupFramingSize = Mathf.Max(Epsilon, m_GroupFramingSize); + m_MaxDollyIn = Mathf.Max(0, m_MaxDollyIn); + m_MaxDollyOut = Mathf.Max(0, m_MaxDollyOut); + m_MinimumDistance = Mathf.Max(0, m_MinimumDistance); + m_MaximumDistance = Mathf.Max(m_MinimumDistance, m_MaximumDistance); + m_MinimumFOV = Mathf.Max(1, m_MinimumFOV); + m_MaximumFOV = Mathf.Clamp(m_MaximumFOV, m_MinimumFOV, 179); + m_MinimumOrthoSize = Mathf.Max(0.01f, m_MinimumOrthoSize); + m_MaximumOrthoSize = Mathf.Max(m_MinimumOrthoSize, m_MaximumOrthoSize); + } + +#if UNITY_EDITOR + private void OnGUI() { if (OnGUICallback != null) OnGUICallback(); } +#endif + + /// True if component is enabled and has a valid Follow target + public override bool IsValid { get { return enabled && FollowTarget != null && LookAtTarget == null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Body stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Body; } } + + const float kMinimumCameraDistance = 0.01f; + + /// State information for damping + Vector3 m_PreviousCameraPosition = Vector3.zero; + PositionPredictor m_Predictor = new PositionPredictor(); + + /// Internal API for inspector + public Vector3 TrackedPoint { get; private set; } + + /// Positions the virtual camera according to the transposer rules. + /// The current camera state + /// Used for damping. If less than 0, no damping is done. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (deltaTime < 0) + { + m_Predictor.Reset(); + m_PreviousCameraPosition = curState.RawPosition + + (curState.RawOrientation * Vector3.back) * m_CameraDistance; + } + if (!IsValid) + return; + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineFramingTransposer.MutateCameraState"); + Vector3 camPosWorld = m_PreviousCameraPosition; + curState.ReferenceLookAt = FollowTarget.position; + m_Predictor.Smoothing = m_LookaheadSmoothing; + m_Predictor.AddPosition(curState.ReferenceLookAt); + TrackedPoint = (m_LookaheadTime > 0) + ? m_Predictor.PredictPosition(m_LookaheadTime) : curState.ReferenceLookAt; + + // Work in camera-local space + Quaternion localToWorld = curState.RawOrientation; + Quaternion worldToLocal = Quaternion.Inverse(localToWorld); + Vector3 cameraPos = worldToLocal * camPosWorld; + Vector3 targetPos = (worldToLocal * TrackedPoint) - cameraPos; + + // Move along camera z + Vector3 cameraOffset = Vector3.zero; + float cameraMin = Mathf.Max(kMinimumCameraDistance, m_CameraDistance - m_DeadZoneDepth/2); + float cameraMax = Mathf.Max(cameraMin, m_CameraDistance + m_DeadZoneDepth/2); + if (targetPos.z < cameraMin) + cameraOffset.z = targetPos.z - cameraMin; + if (targetPos.z > cameraMax) + cameraOffset.z = targetPos.z - cameraMax; + + // Adjust for group framing + CinemachineTargetGroup group = TargetGroup; + if (group != null && m_GroupFramingMode != FramingMode.None) + cameraOffset.z += AdjustCameraDepthAndLensForGroupFraming( + group, targetPos.z - cameraOffset.z, ref curState, deltaTime); + + // Move along the XY plane + targetPos.z -= cameraOffset.z; + float screenSize = curState.Lens.Orthographic + ? curState.Lens.OrthographicSize + : Mathf.Tan(0.5f * curState.Lens.FieldOfView * Mathf.Deg2Rad) * targetPos.z; + Rect softGuideOrtho = ScreenToOrtho(SoftGuideRect, screenSize, curState.Lens.Aspect); + if (deltaTime < 0) + { + // No damping or hard bounds, just snap to central bounds, skipping the soft zone + Rect rect = new Rect(softGuideOrtho.center, Vector2.zero); // Force to center + cameraOffset += OrthoOffsetToScreenBounds(targetPos, rect); + } + else + { + // Move it through the soft zone + cameraOffset += OrthoOffsetToScreenBounds(targetPos, softGuideOrtho); + + // Find where it intersects the hard zone + Vector3 hard = Vector3.zero; + if (!m_UnlimitedSoftZone) + { + Rect hardGuideOrtho = ScreenToOrtho(HardGuideRect, screenSize, curState.Lens.Aspect); + hard = OrthoOffsetToScreenBounds(targetPos, hardGuideOrtho); + float t = Mathf.Max(hard.x / (cameraOffset.x + Epsilon), hard.y / (cameraOffset.y + Epsilon)); + hard = cameraOffset * t; + } + // Apply damping, but only to the portion of the move that's inside the hard zone + cameraOffset = hard + Damper.Damp( + cameraOffset - hard, new Vector3(m_XDamping, m_YDamping, m_ZDamping), deltaTime); + } + curState.RawPosition = m_PreviousCameraPosition = localToWorld * (cameraPos + cameraOffset); + //UnityEngine.Profiling.Profiler.EndSample(); + } + + // Convert from screen coords to normalized orthographic distance coords + private Rect ScreenToOrtho(Rect rScreen, float orthoSize, float aspect) + { + Rect r = new Rect(); + r.yMax = 2 * orthoSize * ((1f-rScreen.yMin) - 0.5f); + r.yMin = 2 * orthoSize * ((1f-rScreen.yMax) - 0.5f); + r.xMin = 2 * orthoSize * aspect * (rScreen.xMin - 0.5f); + r.xMax = 2 * orthoSize * aspect * (rScreen.xMax - 0.5f); + return r; + } + + private Vector3 OrthoOffsetToScreenBounds(Vector3 targetPos2D, Rect screenRect) + { + // Bring it to the edge of screenRect, if outside. Leave it alone if inside. + Vector3 delta = Vector3.zero; + if (targetPos2D.x < screenRect.xMin) + delta.x += targetPos2D.x - screenRect.xMin; + if (targetPos2D.x > screenRect.xMax) + delta.x += targetPos2D.x - screenRect.xMax; + if (targetPos2D.y < screenRect.yMin) + delta.y += targetPos2D.y - screenRect.yMin; + if (targetPos2D.y > screenRect.yMax) + delta.y += targetPos2D.y - screenRect.yMax; + return delta; + } + + float m_prevTargetHeight; // State for frame damping + + /// For editor visulaization of the calculated bounding box of the group + public Bounds m_LastBounds { get; private set; } + + /// For editor visualization of the calculated bounding box of the group + public Matrix4x4 m_lastBoundsMatrix { get; private set; } + + /// Get Follow target as CinemachineTargetGroup, or null if target is not a group + public CinemachineTargetGroup TargetGroup + { + get + { + Transform follow = FollowTarget; + if (follow != null) + return follow.GetComponent(); + return null; + } + } + + float AdjustCameraDepthAndLensForGroupFraming( + CinemachineTargetGroup group, float targetZ, + ref CameraState curState, float deltaTime) + { + float cameraOffset = 0; + + // Get the bounding box from that POV in view space, and find its height + Bounds bounds = group.BoundingBox; + Vector3 fwd = curState.RawOrientation * Vector3.forward; + m_lastBoundsMatrix = Matrix4x4.TRS( + bounds.center - (fwd * bounds.extents.magnitude), + curState.RawOrientation, Vector3.one); + m_LastBounds = group.GetViewSpaceBoundingBox(m_lastBoundsMatrix); + float targetHeight = GetTargetHeight(m_LastBounds); + + // Apply damping + if (deltaTime >= 0) + { + float delta = targetHeight - m_prevTargetHeight; + delta = Damper.Damp(delta, m_ZDamping, deltaTime); + targetHeight = m_prevTargetHeight + delta; + } + m_prevTargetHeight = targetHeight; + + // Move the camera + if (!curState.Lens.Orthographic && m_AdjustmentMode != AdjustmentMode.ZoomOnly) + { + // What distance would be needed to get the target height, at the current FOV + float desiredDistance + = targetHeight / (2f * Mathf.Tan(curState.Lens.FieldOfView * Mathf.Deg2Rad / 2f)); + + // target the near surface of the bounding box + desiredDistance += m_LastBounds.extents.z; + + // Clamp to respect min/max distance settings + desiredDistance = Mathf.Clamp( + desiredDistance, targetZ - m_MaxDollyIn, targetZ + m_MaxDollyOut); + desiredDistance = Mathf.Clamp(desiredDistance, m_MinimumDistance, m_MaximumDistance); + + // Apply + cameraOffset += desiredDistance - targetZ; + } + + // Apply zoom + if (curState.Lens.Orthographic || m_AdjustmentMode != AdjustmentMode.DollyOnly) + { + float nearBoundsDistance = (targetZ + cameraOffset) - m_LastBounds.extents.z; + float currentFOV = 179; + if (nearBoundsDistance > Epsilon) + currentFOV = 2f * Mathf.Atan(targetHeight / (2 * nearBoundsDistance)) * Mathf.Rad2Deg; + + LensSettings lens = curState.Lens; + lens.FieldOfView = Mathf.Clamp(currentFOV, m_MinimumFOV, m_MaximumFOV); + lens.OrthographicSize = Mathf.Clamp(targetHeight / 2, m_MinimumOrthoSize, m_MaximumOrthoSize); + curState.Lens = lens; + } + return -cameraOffset; + } + + float GetTargetHeight(Bounds b) + { + float framingSize = Mathf.Max(Epsilon, m_GroupFramingSize); + switch (m_GroupFramingMode) + { + case FramingMode.Horizontal: + return b.size.x / (framingSize * VcamState.Lens.Aspect); + case FramingMode.Vertical: + return b.size.y / framingSize; + default: + case FramingMode.HorizontalAndVertical: + return Mathf.Max( + b.size.x / (framingSize * VcamState.Lens.Aspect), + b.size.y / framingSize); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs.meta new file mode 100644 index 0000000..c3713e2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineFramingTransposer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6ad980451443d70438faac0bc6c235a0 +timeCreated: 1502038595 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs new file mode 100644 index 0000000..fc59a4a --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs @@ -0,0 +1,237 @@ +using UnityEngine; +using Cinemachine.Utility; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to aim the camera at a target object, with configurable offsets, damping, + /// and composition rules. + /// + /// In addition, if the target is a CinemachineTargetGroup, the behaviour + /// will adjust the FOV and the camera distance to ensure that the entire group of targets + /// is framed properly. + /// + [DocumentationSorting(4, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] // for OnGUI + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineGroupComposer : CinemachineComposer + { + /// How much of the screen to fill with the bounding box of the targets. + [Space] + [Tooltip("The bounding box of the targets should occupy this amount of the screen space. 1 means fill the whole screen. 0.5 means fill half the screen, etc.")] + public float m_GroupFramingSize = 0.8f; + + /// What screen dimensions to consider when framing + [DocumentationSorting(4.01f, DocumentationSortingAttribute.Level.UserRef)] + public enum FramingMode + { + /// Consider only the horizontal dimension. Vertical framing is ignored. + Horizontal, + /// Consider only the vertical dimension. Horizontal framing is ignored. + Vertical, + /// The larger of the horizontal and vertical dimensions will dominate, to get the best fit. + HorizontalAndVertical + }; + + /// What screen dimensions to consider when framing + [Tooltip("What screen dimensions to consider when framing. Can be Horizontal, Vertical, or both")] + public FramingMode m_FramingMode = FramingMode.HorizontalAndVertical; + + /// How aggressively the camera tries to frame the group. + /// Small numbers are more responsive + [Range(0, 20)] + [Tooltip("How aggressively the camera tries to frame the group. Small numbers are more responsive, rapidly adjusting the camera to keep the group in the frame. Larger numbers give a more heavy slowly responding camera.")] + public float m_FrameDamping = 2f; + + /// How to adjust the camera to get the desired framing + public enum AdjustmentMode + { + /// Do not move the camera, only adjust the FOV. + ZoomOnly, + /// Just move the camera, don't change the FOV. + DollyOnly, + /// Move the camera as much as permitted by the ranges, then + /// adjust the FOV if necessary to make the shot. + DollyThenZoom + }; + + /// How to adjust the camera to get the desired framing + [Tooltip("How to adjust the camera to get the desired framing. You can zoom, dolly in/out, or do both.")] + public AdjustmentMode m_AdjustmentMode = AdjustmentMode.DollyThenZoom; + + /// How much closer to the target can the camera go? + [Tooltip("The maximum distance toward the target that this behaviour is allowed to move the camera.")] + public float m_MaxDollyIn = 5000f; + + /// How much farther from the target can the camera go? + [Tooltip("The maximum distance away the target that this behaviour is allowed to move the camera.")] + public float m_MaxDollyOut = 5000f; + + /// Set this to limit how close to the target the camera can get + [Tooltip("Set this to limit how close to the target the camera can get.")] + public float m_MinimumDistance = 1; + + /// Set this to limit how far from the taregt the camera can get + [Tooltip("Set this to limit how far from the target the camera can get.")] + public float m_MaximumDistance = 5000f; + + /// If adjusting FOV, will not set the FOV lower than this + [Range(1, 179)] + [Tooltip("If adjusting FOV, will not set the FOV lower than this.")] + public float m_MinimumFOV = 3; + + /// If adjusting FOV, will not set the FOV higher than this + [Range(1, 179)] + [Tooltip("If adjusting FOV, will not set the FOV higher than this.")] + public float m_MaximumFOV = 60; + + /// If adjusting Orthographic Size, will not set it lower than this + [Tooltip("If adjusting Orthographic Size, will not set it lower than this.")] + public float m_MinimumOrthoSize = 1; + + /// If adjusting Orthographic Size, will not set it higher than this + [Tooltip("If adjusting Orthographic Size, will not set it higher than this.")] + public float m_MaximumOrthoSize = 100; + + private void OnValidate() + { + m_GroupFramingSize = Mathf.Max(Epsilon, m_GroupFramingSize); + m_MaxDollyIn = Mathf.Max(0, m_MaxDollyIn); + m_MaxDollyOut = Mathf.Max(0, m_MaxDollyOut); + m_MinimumDistance = Mathf.Max(0, m_MinimumDistance); + m_MaximumDistance = Mathf.Max(m_MinimumDistance, m_MaximumDistance); + m_MinimumFOV = Mathf.Max(1, m_MinimumFOV); + m_MaximumFOV = Mathf.Clamp(m_MaximumFOV, m_MinimumFOV, 179); + m_MinimumOrthoSize = Mathf.Max(0.01f, m_MinimumOrthoSize); + m_MaximumOrthoSize = Mathf.Max(m_MinimumOrthoSize, m_MaximumOrthoSize); + } + + /// Get LookAt target as CinemachineTargetGroup, or null if target is not a group + public CinemachineTargetGroup TargetGroup + { + get + { + Transform lookAt = LookAtTarget; + if (lookAt != null) + return lookAt.GetComponent(); + return null; + } + } + + /// Applies the composer rules and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. If less than + /// zero, then target will snap to the center of the dead zone. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + // Can't do anything without a group to look at + CinemachineTargetGroup group = TargetGroup; + if (group == null) + { + base.MutateCameraState(ref curState, deltaTime); + return; + } + + if (!IsValid || !curState.HasLookAt) + { + m_prevTargetHeight = 0; + return; + } + + curState.ReferenceLookAt = GetLookAtPointAndSetTrackedPoint(group.transform.position); + Vector3 currentOffset = TrackedPoint - curState.RawPosition; + float currentDistance = currentOffset.magnitude; + if (currentDistance < Epsilon) + return; // navel-gazing, get outa here + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineGroupComposer.MutateCameraState"); + + // Get the camera axis + Vector3 fwd = currentOffset.AlmostZero() ? Vector3.forward : currentOffset.normalized; + + // Get the bounding box from that POV in view space, and find its width + Bounds bounds = group.BoundingBox; + m_lastBoundsMatrix = Matrix4x4.TRS( + bounds.center - (fwd * bounds.extents.magnitude), + Quaternion.LookRotation(fwd, curState.ReferenceUp), Vector3.one); + m_LastBounds = group.GetViewSpaceBoundingBox(m_lastBoundsMatrix); + float targetHeight = GetTargetHeight(m_LastBounds); + Vector3 targetPos = m_lastBoundsMatrix.MultiplyPoint3x4(m_LastBounds.center); + + // Apply damping + if (deltaTime >= 0) + { + float delta = targetHeight - m_prevTargetHeight; + delta = Damper.Damp(delta, m_FrameDamping, deltaTime); + targetHeight = m_prevTargetHeight + delta; + } + m_prevTargetHeight = targetHeight; + + // Move the camera + if (!curState.Lens.Orthographic && m_AdjustmentMode != AdjustmentMode.ZoomOnly) + { + // What distance would be needed to get the target height, at the current FOV + float currentFOV = curState.Lens.FieldOfView; + float targetDistance = targetHeight / (2f * Mathf.Tan(currentFOV * Mathf.Deg2Rad / 2f)); + + // target the near surface of the bounding box + float cameraDistance = targetDistance + m_LastBounds.extents.z; + + // Clamp to respect min/max distance settings + cameraDistance = Mathf.Clamp( + cameraDistance, currentDistance - m_MaxDollyIn, currentDistance + m_MaxDollyOut); + cameraDistance = Mathf.Clamp(cameraDistance, m_MinimumDistance, m_MaximumDistance); + + // Apply + curState.PositionCorrection += targetPos - fwd * cameraDistance - curState.RawPosition; + } + + // Apply zoom + if (curState.Lens.Orthographic || m_AdjustmentMode != AdjustmentMode.DollyOnly) + { + float nearBoundsDistance = (TrackedPoint - curState.CorrectedPosition).magnitude + - m_LastBounds.extents.z; + float currentFOV = 179; + if (nearBoundsDistance > Epsilon) + currentFOV = 2f * Mathf.Atan(targetHeight / (2 * nearBoundsDistance)) * Mathf.Rad2Deg; + + LensSettings lens = curState.Lens; + lens.FieldOfView = Mathf.Clamp(currentFOV, m_MinimumFOV, m_MaximumFOV); + lens.OrthographicSize = Mathf.Clamp(targetHeight / 2, m_MinimumOrthoSize, m_MaximumOrthoSize); + curState.Lens = lens; + } + + // Now compose normally + base.MutateCameraState(ref curState, deltaTime); + //UnityEngine.Profiling.Profiler.EndSample(); + } + + float m_prevTargetHeight; // State for damping + + /// For editor visulaization of the calculated bounding box of the group + public Bounds m_LastBounds { get; private set; } + + /// For editor visualization of the calculated bounding box of the group + public Matrix4x4 m_lastBoundsMatrix { get; private set; } + + float GetTargetHeight(Bounds b) + { + float framingSize = Mathf.Max(Epsilon, m_GroupFramingSize); + switch (m_FramingMode) + { + case FramingMode.Horizontal: + return Mathf.Max(Epsilon, b.size.x )/ (framingSize * VcamState.Lens.Aspect); + case FramingMode.Vertical: + return Mathf.Max(Epsilon, b.size.y) / framingSize; + default: + case FramingMode.HorizontalAndVertical: + return Mathf.Max( + Mathf.Max(Epsilon, b.size.x) / (framingSize * VcamState.Lens.Aspect), + Mathf.Max(Epsilon, b.size.y) / framingSize); + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs.meta new file mode 100644 index 0000000..f7bb484 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineGroupComposer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0f7633c93f0364a418841eeb8b058634 +timeCreated: 1496696780 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs new file mode 100644 index 0000000..e53ed32 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to place the camera on the Follow Target. + /// + [DocumentationSorting(23, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineHardLockToTarget : CinemachineComponentBase + { + /// True if component is enabled and has a LookAt defined + public override bool IsValid { get { return enabled && FollowTarget != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Aim stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Body; } } + + /// Applies the composer rules and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. If less than + /// zero, then target will snap to the center of the dead zone. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (IsValid) + curState.RawPosition = FollowTarget.position; + } + } +} + diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs.meta new file mode 100644 index 0000000..da28d51 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLockToTarget.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 36d1163fa822e8b418a0a603ec078d5c +timeCreated: 1506531396 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs new file mode 100644 index 0000000..dfb3855 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to aim the camera hard at the LookAt target. + /// + [DocumentationSorting(23, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineHardLookAt : CinemachineComponentBase + { + /// True if component is enabled and has a LookAt defined + public override bool IsValid { get { return enabled && LookAtTarget != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Aim stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Aim; } } + + /// Applies the composer rules and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. If less than + /// zero, then target will snap to the center of the dead zone. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (IsValid && curState.HasLookAt) + { + Vector3 dir = (curState.ReferenceLookAt - curState.CorrectedPosition); + if (dir.magnitude > Epsilon) + { + if (Vector3.Cross(dir.normalized, curState.ReferenceUp).magnitude < Epsilon) + curState.RawOrientation = Quaternion.FromToRotation(Vector3.forward, dir); + else + curState.RawOrientation = Quaternion.LookRotation(dir, curState.ReferenceUp); + } + } + } + } +} + diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs.meta new file mode 100644 index 0000000..6330854 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineHardLookAt.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1e8b78ac948f05a46a6d8339a503172b +timeCreated: 1506531396 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs new file mode 100644 index 0000000..b0363d4 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs @@ -0,0 +1,530 @@ +using System; +using UnityEngine; +using Cinemachine.Utility; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the the Body section of the component pipeline. + /// Its job is to position the camera in a variable relationship to a the vcam's + /// Follow target object, with offsets and damping. + /// + /// This component is typically used to implement a camera that follows its target. + /// It can accept player input from an input device, which allows the player to + /// dynamically control the relationship between the camera and the target, + /// for example with a joystick. + /// + /// The OrbitalTransposer introduces the concept of __Heading__, which is the direction + /// in which the target is moving, and the OrbitalTransposer will attempt to position + /// the camera in relationship to the heading, which is by default directly behind the target. + /// You can control the default relationship by adjusting the Heading Bias setting. + /// + /// If you attach an input controller to the OrbitalTransposer, then the player can also + /// control the way the camera positions itself in relation to the target heading. This allows + /// the camera to move to any spot on an orbit around the target. + /// + [DocumentationSorting(6, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineOrbitalTransposer : CinemachineTransposer + { + /// + /// How the "forward" direction is defined. Orbital offset is in relation to the forward + /// direction. + /// + [DocumentationSorting(6.2f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct Heading + { + /// + /// Sets the algorithm for determining the target's heading for purposes + /// of re-centering the camera + /// + [DocumentationSorting(6.21f, DocumentationSortingAttribute.Level.UserRef)] + public enum HeadingDefinition + { + /// + /// Target heading calculated from the difference between its position on + /// the last update and current frame. + /// + PositionDelta, + /// + /// Target heading calculated from its Rigidbody's velocity. + /// If no Rigidbody exists, it will fall back + /// to HeadingDerivationMode.PositionDelta + /// + Velocity, + /// + /// Target heading calculated from the Target Transform's euler Y angle + /// + TargetForward, + /// + /// Default heading is a constant world space heading. + /// + WorldForward, + } + /// The method by which the 'default heading' is calculated if + /// recentering to target heading is enabled + [Tooltip("How 'forward' is defined. The camera will be placed by default behind the target. PositionDelta will consider 'forward' to be the direction in which the target is moving.")] + public HeadingDefinition m_HeadingDefinition; + + /// Size of the velocity sampling window for target heading filter. + /// Used only if deriving heading from target's movement + [Range(0, 10)] + [Tooltip("Size of the velocity sampling window for target heading filter. This filters out irregularities in the target's movement. Used only if deriving heading from target's movement (PositionDelta or Velocity)")] + public int m_VelocityFilterStrength; + + /// Additional Y rotation applied to the target heading. + /// When this value is 0, the camera will be placed behind the target + [Range(-180f, 180f)] + [Tooltip("Where the camera is placed when the X-axis value is zero. This is a rotation in degrees around the Y axis. When this value is 0, the camera will be placed behind the target. Nonzero offsets will rotate the zero position around the target.")] + public float m_HeadingBias; + + /// Constructor + public Heading(HeadingDefinition def, int filterStrength, float bias) + { + m_HeadingDefinition = def; + m_VelocityFilterStrength = filterStrength; + m_HeadingBias = bias; + } + }; + + /// The definition of Forward. Camera will follow behind. + [Space] + [Tooltip("The definition of Forward. Camera will follow behind.")] + public Heading m_Heading = new Heading(Heading.HeadingDefinition.TargetForward, 4, 0); + + /// Controls how automatic orbit recentering occurs + [DocumentationSorting(6.5f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct Recentering + { + /// If checked, will enable automatic recentering of the + /// camera based on the heading calculation mode. If FALSE, recenting is disabled. + [Tooltip("If checked, will enable automatic recentering of the camera based on the heading definition. If unchecked, recenting is disabled.")] + public bool m_enabled; + + /// If no input has been detected, the camera will wait + /// this long in seconds before moving its heading to the default heading. + [Tooltip("If no input has been detected, the camera will wait this long in seconds before moving its heading to the zero position.")] + public float m_RecenterWaitTime; + + /// Maximum angular speed of recentering. Will accelerate into and decelerate out of this + [Tooltip("Maximum angular speed of recentering. Will accelerate into and decelerate out of this.")] + public float m_RecenteringTime; + + /// Constructor with specific field values + public Recentering(bool enabled, float recenterWaitTime, float recenteringSpeed) + { + m_enabled = enabled; + m_RecenterWaitTime = recenterWaitTime; + m_RecenteringTime = recenteringSpeed; + m_LegacyHeadingDefinition = m_LegacyVelocityFilterStrength = -1; + } + + /// Call this from OnValidate() + public void Validate() + { + m_RecenterWaitTime = Mathf.Max(0, m_RecenterWaitTime); + m_RecenteringTime = Mathf.Max(0, m_RecenteringTime); + } + + // Legacy support + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_HeadingDefinition")] private int m_LegacyHeadingDefinition; + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_VelocityFilterStrength")] private int m_LegacyVelocityFilterStrength; + internal bool LegacyUpgrade(ref Heading.HeadingDefinition heading, ref int velocityFilter) + { + if (m_LegacyHeadingDefinition != -1 && m_LegacyVelocityFilterStrength != -1) + { + heading = (Heading.HeadingDefinition)m_LegacyHeadingDefinition; + velocityFilter = m_LegacyVelocityFilterStrength; + m_LegacyHeadingDefinition = m_LegacyVelocityFilterStrength = -1; + return true; + } + return false; + } + }; + + /// Parameters that control Automating Heading Recentering + [Tooltip("Automatic heading recentering. The settings here defines how the camera will reposition itself in the absence of player input.")] + public Recentering m_RecenterToTargetHeading = new Recentering(true, 1, 2); + + /// Axis representing the current heading. Value is in degrees + /// and represents a rotation about the up vector + [Tooltip("Heading Control. The settings here control the behaviour of the camera in response to the player's input.")] + public AxisState m_XAxis = new AxisState(300f, 2f, 1f, 0f, "Mouse X", true); + + // Legacy support + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_Radius")] private float m_LegacyRadius = float.MaxValue; + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_HeightOffset")] private float m_LegacyHeightOffset = float.MaxValue; + [SerializeField] [HideInInspector] [FormerlySerializedAs("m_HeadingBias")] private float m_LegacyHeadingBias = float.MaxValue; + protected override void OnValidate() + { + // Upgrade after a legacy deserialize + if (m_LegacyRadius != float.MaxValue + && m_LegacyHeightOffset != float.MaxValue + && m_LegacyHeadingBias != float.MaxValue) + { + m_FollowOffset = new Vector3(0, m_LegacyHeightOffset, -m_LegacyRadius); + m_LegacyHeightOffset = m_LegacyRadius = float.MaxValue; + + m_Heading.m_HeadingBias = m_LegacyHeadingBias; + m_XAxis.m_MaxSpeed /= 10; + m_XAxis.m_AccelTime /= 10; + m_XAxis.m_DecelTime /= 10; + m_LegacyHeadingBias = float.MaxValue; + m_RecenterToTargetHeading.LegacyUpgrade( + ref m_Heading.m_HeadingDefinition, ref m_Heading.m_VelocityFilterStrength); + } + m_XAxis.Validate(); + m_RecenterToTargetHeading.Validate(); + + base.OnValidate(); + } + + /// + /// Drive the x-axis setting programmatically. + /// Automatic heading updating will be disabled. + /// + [HideInInspector, NoSaveDuringPlay] + public bool m_HeadingIsSlave = false; + + /// + /// Delegate that allows the the m_XAxis object to be replaced with another one. + /// + internal delegate float UpdateHeadingDelegate( + CinemachineOrbitalTransposer orbital, float deltaTime, Vector3 up); + + /// + /// Delegate that allows the the XAxis object to be replaced with another one. + /// To use it, just call orbital.UpdateHeading() with a reference to a + /// private AxisState object, and that AxisState object will be updated and + /// used to calculate the heading. + /// + internal UpdateHeadingDelegate HeadingUpdater + = (CinemachineOrbitalTransposer orbital, float deltaTime, Vector3 up) + => { return orbital.UpdateHeading(deltaTime, up, ref orbital.m_XAxis); }; + + /// + /// Update the X axis and calculate the heading. This can be called by a delegate + /// with a custom axis. + /// Used for damping. If less than 0, no damping is done. + /// World Up, set by the CinemachineBrain + /// + /// Axis value + /// + public float UpdateHeading(float deltaTime, Vector3 up, ref AxisState axis) + { + // Only read joystick when game is playing + if (deltaTime >= 0 || CinemachineCore.Instance.IsLive(VirtualCamera)) + { + bool xAxisInput = false; + xAxisInput |= axis.Update(deltaTime); + if (xAxisInput) + { + mLastHeadingAxisInputTime = Time.time; + mHeadingRecenteringVelocity = 0; + } + } + float targetHeading = GetTargetHeading(axis.Value, GetReferenceOrientation(up), deltaTime); + if (deltaTime < 0) + { + mHeadingRecenteringVelocity = 0; + if (m_RecenterToTargetHeading.m_enabled) + axis.Value = targetHeading; + } + else + { + // Recentering + if (m_BindingMode != BindingMode.SimpleFollowWithWorldUp + && m_RecenterToTargetHeading.m_enabled + && (Time.time > (mLastHeadingAxisInputTime + m_RecenterToTargetHeading.m_RecenterWaitTime))) + { + // Scale value determined heuristically, to account for accel/decel + float recenterTime = m_RecenterToTargetHeading.m_RecenteringTime / 3f; + if (recenterTime <= deltaTime) + axis.Value = targetHeading; + else + { + float headingError = Mathf.DeltaAngle(axis.Value, targetHeading); + float absHeadingError = Mathf.Abs(headingError); + if (absHeadingError < UnityVectorExtensions.Epsilon) + { + axis.Value = targetHeading; + mHeadingRecenteringVelocity = 0; + } + else + { + float scale = deltaTime / recenterTime; + float desiredVelocity = Mathf.Sign(headingError) + * Mathf.Min(absHeadingError, absHeadingError * scale); + // Accelerate to the desired velocity + float accel = desiredVelocity - mHeadingRecenteringVelocity; + if ((desiredVelocity < 0 && accel < 0) || (desiredVelocity > 0 && accel > 0)) + desiredVelocity = mHeadingRecenteringVelocity + desiredVelocity * scale; + axis.Value += desiredVelocity; + mHeadingRecenteringVelocity = desiredVelocity; + } + } + } + } + float finalHeading = axis.Value; + if (m_BindingMode == BindingMode.SimpleFollowWithWorldUp) + axis.Value = 0; + return finalHeading; + } + + private void OnEnable() + { + m_XAxis.SetThresholds(0f, 360f, true); + PreviousTarget = null; + mLastTargetPosition = Vector3.zero; + } + + private float mLastHeadingAxisInputTime = 0f; + private float mHeadingRecenteringVelocity = 0f; + private Vector3 mLastTargetPosition = Vector3.zero; + private HeadingTracker mHeadingTracker; + private Rigidbody mTargetRigidBody = null; + private Transform PreviousTarget { get; set; } + private Quaternion mHeadingPrevFrame = Quaternion.identity; + private Vector3 mOffsetPrevFrame = Vector3.zero; + + /// Positions the virtual camera according to the transposer rules. + /// The current camera state + /// Used for damping. If less than 0, no damping is done. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineOrbitalTransposer.MutateCameraState"); + InitPrevFrameStateInfo(ref curState, deltaTime); + + // Update the heading + if (FollowTarget != PreviousTarget) + { + PreviousTarget = FollowTarget; + mTargetRigidBody = (PreviousTarget == null) ? null : PreviousTarget.GetComponent(); + mLastTargetPosition = (PreviousTarget == null) ? Vector3.zero : PreviousTarget.position; + mHeadingTracker = null; + } + float heading = HeadingUpdater(this, deltaTime, curState.ReferenceUp); + + if (IsValid) + { + mLastTargetPosition = FollowTarget.position; + + // Calculate the heading + if (m_BindingMode != BindingMode.SimpleFollowWithWorldUp) + heading += m_Heading.m_HeadingBias; + Quaternion headingRot = Quaternion.AngleAxis(heading, curState.ReferenceUp); + + // Track the target, with damping + Vector3 offset = EffectiveOffset; + Vector3 pos; + Quaternion orient; + TrackTarget(deltaTime, curState.ReferenceUp, headingRot * offset, out pos, out orient); + + // Place the camera + curState.ReferenceUp = orient * Vector3.up; + if (deltaTime >= 0) + { + Vector3 bypass = (headingRot * offset) - mHeadingPrevFrame * mOffsetPrevFrame; + bypass = orient * bypass; + curState.PositionDampingBypass = bypass; + } + orient = orient * headingRot; + curState.RawPosition = pos + orient * offset; + + mHeadingPrevFrame = (m_BindingMode == BindingMode.SimpleFollowWithWorldUp) ? Quaternion.identity : headingRot; + mOffsetPrevFrame = offset; + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// API for the editor, to process a position drag from the user. + /// This implementation adds the delta to the follow offset, after zeroing out local x. + /// The amount dragged this frame + public override void OnPositionDragged(Vector3 delta) + { + Quaternion targetOrientation = GetReferenceOrientation(VcamState.ReferenceUp); + Vector3 localOffset = Quaternion.Inverse(targetOrientation) * delta; + localOffset.x = 0; + m_FollowOffset += localOffset; + m_FollowOffset = EffectiveOffset; + } + + static string GetFullName(GameObject current) + { + if (current == null) + return ""; + if (current.transform.parent == null) + return "/" + current.name; + return GetFullName(current.transform.parent.gameObject) + "/" + current.name; + } + + // Make sure this is calld only once per frame + private float GetTargetHeading( + float currentHeading, Quaternion targetOrientation, float deltaTime) + { + if (m_BindingMode == BindingMode.SimpleFollowWithWorldUp) + return 0; + if (FollowTarget == null) + return currentHeading; + + if (m_Heading.m_HeadingDefinition == Heading.HeadingDefinition.Velocity + && mTargetRigidBody == null) + { + Debug.Log(string.Format( + "Attempted to use HeadingDerivationMode.Velocity to calculate heading for {0}. No RigidBody was present on '{1}'. Defaulting to position delta", + GetFullName(VirtualCamera.VirtualCameraGameObject), FollowTarget)); + m_Heading.m_HeadingDefinition = Heading.HeadingDefinition.PositionDelta; + } + + Vector3 velocity = Vector3.zero; + switch (m_Heading.m_HeadingDefinition) + { + case Heading.HeadingDefinition.PositionDelta: + velocity = FollowTarget.position - mLastTargetPosition; + break; + case Heading.HeadingDefinition.Velocity: + velocity = mTargetRigidBody.velocity; + break; + case Heading.HeadingDefinition.TargetForward: + velocity = FollowTarget.forward; + break; + default: + case Heading.HeadingDefinition.WorldForward: + return 0; + } + + // Process the velocity and derive the heading from it. + int filterSize = m_Heading.m_VelocityFilterStrength * 5; + if (mHeadingTracker == null || mHeadingTracker.FilterSize != filterSize) + mHeadingTracker = new HeadingTracker(filterSize); + mHeadingTracker.DecayHistory(); + Vector3 up = targetOrientation * Vector3.up; + velocity = velocity.ProjectOntoPlane(up); + if (!velocity.AlmostZero()) + mHeadingTracker.Add(velocity); + + velocity = mHeadingTracker.GetReliableHeading(); + if (!velocity.AlmostZero()) + return UnityVectorExtensions.SignedAngle(targetOrientation * Vector3.forward, velocity, up); + + // If no reliable heading, then stay where we are. + return currentHeading; + } + + class HeadingTracker + { + struct Item + { + public Vector3 velocity; + public float weight; + public float time; + }; + Item[] mHistory; + int mTop; + int mBottom; + int mCount; + + Vector3 mHeadingSum; + float mWeightSum = 0; + float mWeightTime = 0; + + Vector3 mLastGoodHeading = Vector3.zero; + + public HeadingTracker(int filterSize) + { + mHistory = new Item[filterSize]; + float historyHalfLife = filterSize / 5f; // somewhat arbitrarily + mDecayExponent = -Mathf.Log(2f) / historyHalfLife; + ClearHistory(); + } + + public int FilterSize { get { return mHistory.Length; } } + + void ClearHistory() + { + mTop = mBottom = mCount = 0; + mWeightSum = 0; + mHeadingSum = Vector3.zero; + } + + static float mDecayExponent; + static float Decay(float time) { return Mathf.Exp(time * mDecayExponent); } + + public void Add(Vector3 velocity) + { + if (FilterSize == 0) + { + mLastGoodHeading = velocity; + return; + } + float weight = velocity.magnitude; + if (weight > UnityVectorExtensions.Epsilon) + { + Item item = new Item(); + item.velocity = velocity; + item.weight = weight; + item.time = Time.time; + if (mCount == FilterSize) + PopBottom(); + ++mCount; + mHistory[mTop] = item; + if (++mTop == FilterSize) + mTop = 0; + + mWeightSum *= Decay(item.time - mWeightTime); + mWeightTime = item.time; + mWeightSum += weight; + mHeadingSum += item.velocity; + } + } + + void PopBottom() + { + if (mCount > 0) + { + float time = Time.time; + Item item = mHistory[mBottom]; + if (++mBottom == FilterSize) + mBottom = 0; + --mCount; + + float decay = Decay(time - item.time); + mWeightSum -= item.weight * decay; + mHeadingSum -= item.velocity * decay; + if (mWeightSum <= UnityVectorExtensions.Epsilon || mCount == 0) + ClearHistory(); + } + } + + public void DecayHistory() + { + float time = Time.time; + float decay = Decay(time - mWeightTime); + mWeightSum *= decay; + mWeightTime = time; + if (mWeightSum < UnityVectorExtensions.Epsilon) + ClearHistory(); + else + mHeadingSum = mHeadingSum * decay; + } + + public Vector3 GetReliableHeading() + { + // Update Last Good Heading + if (mWeightSum > UnityVectorExtensions.Epsilon + && (mCount == mHistory.Length || mLastGoodHeading.AlmostZero())) + { + Vector3 h = mHeadingSum / mWeightSum; + if (!h.AlmostZero()) + mLastGoodHeading = h.normalized; + } + return mLastGoodHeading; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs.meta new file mode 100644 index 0000000..46d7ca2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineOrbitalTransposer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9384ab8608cdc3d479fe89cd51eed48f +timeCreated: 1485281954 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs new file mode 100644 index 0000000..ebd357d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs @@ -0,0 +1,70 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to aim the camera in response to the user's mouse or joystick input. + /// + /// The composer does not change the camera's position. It will only pan and tilt the + /// camera where it is, in order to get the desired framing. To move the camera, you have + /// to use the virtual camera's Body section. + /// + [DocumentationSorting(23, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachinePOV : CinemachineComponentBase + { + /// The Vertical axis. Value is -90..90. Controls the vertical orientation + [Tooltip("The Vertical axis. Value is -90..90. Controls the vertical orientation")] + public AxisState m_VerticalAxis = new AxisState(300f, 0.1f, 0.1f, 0f, "Mouse Y", true); + + /// The Horizontal axis. Value is -180..180. Controls the horizontal orientation + [Tooltip("The Horizontal axis. Value is -180..180. Controls the horizontal orientation")] + public AxisState m_HorizontalAxis = new AxisState(300f, 0.1f, 0.1f, 0f, "Mouse X", false); + + /// True if component is enabled and has a LookAt defined + public override bool IsValid { get { return enabled; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Aim stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Aim; } } + + private void OnValidate() + { + m_HorizontalAxis.Validate(); + m_VerticalAxis.Validate(); + } + + private void OnEnable() + { + m_HorizontalAxis.SetThresholds(-180f, 180f, true); + m_VerticalAxis.SetThresholds(-90, 90, false); + } + + /// Applies the axis values and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. Not used. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (!IsValid) + return; + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachinePOV.MutateCameraState"); + + // Only read joystick when game is playing + if (deltaTime >= 0 || CinemachineCore.Instance.IsLive(VirtualCamera)) + { + m_HorizontalAxis.Update(deltaTime); + m_VerticalAxis.Update(deltaTime); + } + Quaternion rot = Quaternion.Euler(m_VerticalAxis.Value, m_HorizontalAxis.Value, 0); + rot = rot * Quaternion.FromToRotation(Vector3.up, curState.ReferenceUp); + curState.OrientationCorrection = curState.OrientationCorrection * rot; + + //UnityEngine.Profiling.Profiler.EndSample(); + } + } +} + diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs.meta new file mode 100644 index 0000000..e673e0e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachinePOV.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3c9beda531928fc40968802117a5d256 +timeCreated: 1504204894 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs new file mode 100644 index 0000000..9d1e410 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Aim section of the component pipeline. + /// Its job is to aim the camera hard at the LookAt target. + /// + [DocumentationSorting(27, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineSameAsFollowObject : CinemachineComponentBase + { + /// True if component is enabled and has a Follow target defined + public override bool IsValid { get { return enabled && FollowTarget != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Aim stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Aim; } } + + /// Applies the composer rules and orients the camera accordingly + /// The current camera state + /// Used for calculating damping. If less than + /// zero, then target will snap to the center of the dead zone. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + if (IsValid) + curState.RawOrientation = FollowTarget.transform.rotation; + } + } +} + diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs.meta new file mode 100644 index 0000000..2309dcd --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineSameAsFollowObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a4c41ac9245b87c4192012080077d830 +timeCreated: 1511551300 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs new file mode 100644 index 0000000..3ce9b14 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs @@ -0,0 +1,312 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// A Cinemachine Virtual Camera Body component that constrains camera motion + /// to a CinemachinePath. The camera can move along the path. + /// + /// This behaviour can operate in two modes: manual positioning, and Auto-Dolly positioning. + /// In Manual mode, the camera's position is specified by animating the Path Position field. + /// In Auto-Dolly mode, the Path Position field is animated automatically every frame by finding + /// the position on the path that's closest to the virtual camera's Follow target. + /// + [DocumentationSorting(7, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineTrackedDolly : CinemachineComponentBase + { + /// The path to which the camera will be constrained. This must be non-null. + [Tooltip("The path to which the camera will be constrained. This must be non-null.")] + public CinemachinePathBase m_Path; + + /// The position along the path at which the camera will be placed. + /// This can be animated directly, or set automatically by the Auto-Dolly feature + /// to get as close as possible to the Follow target. + [Tooltip("The position along the path at which the camera will be placed. This can be animated directly, or set automatically by the Auto-Dolly feature to get as close as possible to the Follow target. The value is interpreted according to the Position Units setting.")] + public float m_PathPosition; + + /// How to interpret the Path Position + [Tooltip("How to interpret Path Position. If set to Path Units, values are as follows: 0 represents the first waypoint on the path, 1 is the second, and so on. Values in-between are points on the path in between the waypoints. If set to Distance, then Path Position represents distance along the path.")] + public CinemachinePathBase.PositionUnits m_PositionUnits = CinemachinePathBase.PositionUnits.PathUnits; + + /// Where to put the camera realtive to the path postion. X is perpendicular to the path, Y is up, and Z is parallel to the path. + [Tooltip("Where to put the camera relative to the path position. X is perpendicular to the path, Y is up, and Z is parallel to the path. This allows the camera to be offset from the path itself (as if on a tripod, for example).")] + public Vector3 m_PathOffset = Vector3.zero; + + /// How aggressively the camera tries to maintain the offset perpendicular to the path. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// x-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain its position in a direction perpendicular to the path. Small numbers are more responsive, rapidly translating the camera to keep the target's x-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_XDamping = 0f; + + /// How aggressively the camera tries to maintain the offset in the path-local up direction. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// y-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain its position in the path-local up direction. Small numbers are more responsive, rapidly translating the camera to keep the target's y-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_YDamping = 0f; + + /// How aggressively the camera tries to maintain the offset parallel to the path. + /// Small numbers are more responsive, rapidly translating the camera to keep the + /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain its position in a direction parallel to the path. Small numbers are more responsive, rapidly translating the camera to keep the target's z-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_ZDamping = 1f; + + /// Different ways to set the camera's up vector + [DocumentationSorting(7.1f, DocumentationSortingAttribute.Level.UserRef)] + public enum CameraUpMode + { + /// Leave the camera's up vector alone. It will be set according to the Brain's WorldUp. + Default, + /// Take the up vector from the path's up vector at the current point + Path, + /// Take the up vector from the path's up vector at the current point, but with the roll zeroed out + PathNoRoll, + /// Take the up vector from the Follow target's up vector + FollowTarget, + /// Take the up vector from the Follow target's up vector, but with the roll zeroed out + FollowTargetNoRoll, + }; + + /// How to set the virtual camera's Up vector. This will affect the screen composition. + [Tooltip("How to set the virtual camera's Up vector. This will affect the screen composition, because the camera Aim behaviours will always try to respect the Up direction.")] + public CameraUpMode m_CameraUp = CameraUpMode.Default; + + /// "How aggressively the camera tries to track the target rotation's X angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's X angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_PitchDamping = 0; + + /// How aggressively the camera tries to track the target rotation's Y angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's Y angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_YawDamping = 0; + + /// How aggressively the camera tries to track the target rotation's Z angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's Z angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_RollDamping = 0f; + + /// Controls how automatic dollying occurs + [DocumentationSorting(7.2f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct AutoDolly + { + /// If checked, will enable automatic dolly, which chooses a path position + /// that is as close as possible to the Follow target. + [Tooltip("If checked, will enable automatic dolly, which chooses a path position that is as close as possible to the Follow target. Note: this can have significant performance impact")] + public bool m_Enabled; + + /// Offset, in current position units, from the closest point on the path to the follow target. + [Tooltip("Offset, in current position units, from the closest point on the path to the follow target")] + public float m_PositionOffset; + + /// Search up to how many waypoints on either side of the current position. Use 0 for Entire path + [Tooltip("Search up to how many waypoints on either side of the current position. Use 0 for Entire path.")] + public int m_SearchRadius; + + /// We search between waypoints by dividing the segment into this many straight pieces. + /// The higher the number, the more accurate the result, but performance is + /// proportionally slower for higher numbers + [FormerlySerializedAs("m_StepsPerSegment")] + [Tooltip("We search between waypoints by dividing the segment into this many straight pieces. The higher the number, the more accurate the result, but performance is proportionally slower for higher numbers")] + public int m_SearchResolution; + + /// Constructor with specific field values + public AutoDolly(bool enabled, float positionOffset, int searchRadius, int stepsPerSegment) + { + m_Enabled = enabled; + m_PositionOffset = positionOffset; + m_SearchRadius = searchRadius; + m_SearchResolution = stepsPerSegment; + } + }; + + /// Controls how automatic dollying occurs + [Tooltip("Controls how automatic dollying occurs. A Follow target is necessary to use this feature.")] + public AutoDolly m_AutoDolly = new AutoDolly(false, 0, 2, 5); + + /// True if component is enabled and has a path + public override bool IsValid { get { return enabled && m_Path != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Body stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Body; } } + + /// Positions the virtual camera according to the transposer rules. + /// The current camera state + /// Used for damping. If less that 0, no damping is done. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + // Init previous frame state info + if (deltaTime < 0) + { + m_PreviousPathPosition = m_PathPosition; + m_PreviousCameraPosition = curState.RawPosition; + } + + if (!IsValid) + return; + + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineTrackedDolly.MutateCameraState"); + // Get the new ideal path base position + if (m_AutoDolly.m_Enabled && FollowTarget != null) + { + float prevPos = m_PreviousPathPosition; + if (m_PositionUnits == CinemachinePathBase.PositionUnits.Distance) + prevPos = m_Path.GetPathPositionFromDistance(prevPos); + // This works in path units + m_PathPosition = m_Path.FindClosestPoint( + FollowTarget.transform.position, + Mathf.FloorToInt(prevPos), + (deltaTime < 0 || m_AutoDolly.m_SearchRadius <= 0) + ? -1 : m_AutoDolly.m_SearchRadius, + m_AutoDolly.m_SearchResolution); + if (m_PositionUnits == CinemachinePathBase.PositionUnits.Distance) + m_PathPosition = m_Path.GetPathDistanceFromPosition(m_PathPosition); + + // Apply the path position offset + m_PathPosition += m_AutoDolly.m_PositionOffset; + } + float newPathPosition = m_PathPosition; + + if (deltaTime >= 0) + { + // Normalize previous position to find the shortest path + float maxUnit = m_Path.MaxUnit(m_PositionUnits); + if (maxUnit > 0) + { + float prev = m_Path.NormalizeUnit(m_PreviousPathPosition, m_PositionUnits); + float next = m_Path.NormalizeUnit(newPathPosition, m_PositionUnits); + if (m_Path.Looped && Mathf.Abs(next - prev) > maxUnit / 2) + { + if (next > prev) + prev += maxUnit; + else + prev -= maxUnit; + } + m_PreviousPathPosition = prev; + newPathPosition = next; + } + + // Apply damping along the path direction + float offset = m_PreviousPathPosition - newPathPosition; + offset = Damper.Damp(offset, m_ZDamping, deltaTime); + newPathPosition = m_PreviousPathPosition - offset; + } + m_PreviousPathPosition = newPathPosition; + Quaternion newPathOrientation = m_Path.EvaluateOrientationAtUnit(newPathPosition, m_PositionUnits); + + // Apply the offset to get the new camera position + Vector3 newCameraPos = m_Path.EvaluatePositionAtUnit(newPathPosition, m_PositionUnits); + Vector3 offsetX = newPathOrientation * Vector3.right; + Vector3 offsetY = newPathOrientation * Vector3.up; + Vector3 offsetZ = newPathOrientation * Vector3.forward; + newCameraPos += m_PathOffset.x * offsetX; + newCameraPos += m_PathOffset.y * offsetY; + newCameraPos += m_PathOffset.z * offsetZ; + + // Apply damping to the remaining directions + if (deltaTime >= 0) + { + Vector3 currentCameraPos = m_PreviousCameraPosition; + Vector3 delta = (currentCameraPos - newCameraPos); + Vector3 delta1 = Vector3.Dot(delta, offsetY) * offsetY; + Vector3 delta0 = delta - delta1; + delta0 = Damper.Damp(delta0, m_XDamping, deltaTime); + delta1 = Damper.Damp(delta1, m_YDamping, deltaTime); + newCameraPos = currentCameraPos - (delta0 + delta1); + } + curState.RawPosition = m_PreviousCameraPosition = newCameraPos; + + // Set the orientation and up + Quaternion newOrientation + = GetTargetOrientationAtPathPoint(newPathOrientation, curState.ReferenceUp); + if (deltaTime < 0) + m_PreviousOrientation = newOrientation; + else + { + if (deltaTime >= 0) + { + Vector3 relative = (Quaternion.Inverse(m_PreviousOrientation) + * newOrientation).eulerAngles; + for (int i = 0; i < 3; ++i) + if (relative[i] > 180) + relative[i] -= 360; + relative = Damper.Damp(relative, AngularDamping, deltaTime); + newOrientation = m_PreviousOrientation * Quaternion.Euler(relative); + } + m_PreviousOrientation = newOrientation; + } + + curState.RawOrientation = newOrientation; + curState.ReferenceUp = curState.RawOrientation * Vector3.up; + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// API for the editor, to process a position drag from the user. + /// This implementation adds the delta to the follow offset. + /// The amount dragged this frame + public override void OnPositionDragged(Vector3 delta) + { + Quaternion targetOrientation = m_Path.EvaluateOrientationAtUnit(m_PathPosition, m_PositionUnits); + Vector3 localOffset = Quaternion.Inverse(targetOrientation) * delta; + m_PathOffset += localOffset; + } + + private Quaternion GetTargetOrientationAtPathPoint(Quaternion pathOrientation, Vector3 up) + { + switch (m_CameraUp) + { + default: + case CameraUpMode.Default: break; + case CameraUpMode.Path: return pathOrientation; + case CameraUpMode.PathNoRoll: + return Quaternion.LookRotation(pathOrientation * Vector3.forward, up); + case CameraUpMode.FollowTarget: + if (FollowTarget != null) + return FollowTarget.rotation; + break; + case CameraUpMode.FollowTargetNoRoll: + if (FollowTarget != null) + return Quaternion.LookRotation(FollowTarget.rotation * Vector3.forward, up); + break; + } + return Quaternion.LookRotation(transform.rotation * Vector3.forward, up); + } + + private Vector3 AngularDamping + { + get + { + switch (m_CameraUp) + { + case CameraUpMode.PathNoRoll: + case CameraUpMode.FollowTargetNoRoll: + return new Vector3(m_PitchDamping, m_YawDamping, 0); + case CameraUpMode.Default: + return Vector3.zero; + default: + return new Vector3(m_PitchDamping, m_YawDamping, m_RollDamping); + } + } + } + + private float m_PreviousPathPosition = 0; + Quaternion m_PreviousOrientation = Quaternion.identity; + private Vector3 m_PreviousCameraPosition = Vector3.zero; + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs.meta new file mode 100644 index 0000000..4530830 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTrackedDolly.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 418e42c7d0405cc48a7b83f63ea53bb3 +timeCreated: 1493213884 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs new file mode 100644 index 0000000..9537d58 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs @@ -0,0 +1,310 @@ +using Cinemachine.Utility; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// This is a CinemachineComponent in the Body section of the component pipeline. + /// Its job is to position the camera in a fixed relationship to the vcam's Follow + /// target object, with offsets and damping. + /// + /// The Tansposer will only change the camera's position in space. It will not + /// re-orient or otherwise aim the camera. To to that, you need to instruct + /// the vcam in the Aim section of its pipeline. + /// + [DocumentationSorting(5, DocumentationSortingAttribute.Level.UserRef)] + [AddComponentMenu("")] // Don't display in add component menu + [RequireComponent(typeof(CinemachinePipeline))] + [SaveDuringPlay] + public class CinemachineTransposer : CinemachineComponentBase + { + /// + /// The coordinate space to use when interpreting the offset from the target + /// + [DocumentationSorting(5.01f, DocumentationSortingAttribute.Level.UserRef)] + public enum BindingMode + { + /// + /// Camera will be bound to the Follow target using a frame of reference consisting + /// of the target's local frame at the moment when the virtual camera was enabled, + /// or when the target was assigned. + /// + LockToTargetOnAssign = 0, + /// + /// Camera will be bound to the Follow target using a frame of reference consisting + /// of the target's local frame, with the tilt and roll zeroed out. + /// + LockToTargetWithWorldUp = 1, + /// + /// Camera will be bound to the Follow target using a frame of reference consisting + /// of the target's local frame, with the roll zeroed out. + /// + LockToTargetNoRoll = 2, + /// + /// Camera will be bound to the Follow target using the target's local frame. + /// + LockToTarget = 3, + /// Camera will be bound to the Follow target using a world space offset. + WorldSpace = 4, + /// Offsets will be calculated relative to the target, using Camera-local axes + SimpleFollowWithWorldUp = 5 + } + /// The coordinate space to use when interpreting the offset from the target + [Tooltip("The coordinate space to use when interpreting the offset from the target. This is also used to set the camera's Up vector, which will be maintained when aiming the camera.")] + public BindingMode m_BindingMode = BindingMode.LockToTargetWithWorldUp; + + /// The distance which the transposer will attempt to maintain from the transposer subject + [Tooltip("The distance vector that the transposer will attempt to maintain from the Follow target")] + public Vector3 m_FollowOffset = Vector3.back * 10f; + + /// How aggressively the camera tries to maintain the offset in the X-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// x-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the X-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's x-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_XDamping = 1f; + + /// How aggressively the camera tries to maintain the offset in the Y-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the target's + /// y-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the Y-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's y-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_YDamping = 1f; + + /// How aggressively the camera tries to maintain the offset in the Z-axis. + /// Small numbers are more responsive, rapidly translating the camera to keep the + /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. + /// Using different settings per axis can yield a wide range of camera behaviors + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to maintain the offset in the Z-axis. Small numbers are more responsive, rapidly translating the camera to keep the target's z-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.")] + public float m_ZDamping = 1f; + + /// How aggressively the camera tries to track the target rotation's X angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's X angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_PitchDamping = 0; + + /// How aggressively the camera tries to track the target rotation's Y angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's Y angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_YawDamping = 0; + + /// How aggressively the camera tries to track the target rotation's Z angle. + /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. + [Range(0f, 20f)] + [Tooltip("How aggressively the camera tries to track the target rotation's Z angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] + public float m_RollDamping = 0f; + + protected virtual void OnValidate() + { + m_FollowOffset = EffectiveOffset; + } + + /// Get the target offset, with sanitization + protected Vector3 EffectiveOffset + { + get + { + Vector3 offset = m_FollowOffset; + if (m_BindingMode == BindingMode.SimpleFollowWithWorldUp) + { + offset.x = 0; + offset.z = -Mathf.Abs(offset.z); + } + return offset; + } + } + + /// True if component is enabled and has a valid Follow target + public override bool IsValid { get { return enabled && FollowTarget != null; } } + + /// Get the Cinemachine Pipeline stage that this component implements. + /// Always returns the Body stage + public override CinemachineCore.Stage Stage { get { return CinemachineCore.Stage.Body; } } + + /// Positions the virtual camera according to the transposer rules. + /// The current camera state + /// Used for damping. If less than 0, no damping is done. + public override void MutateCameraState(ref CameraState curState, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineTransposer.MutateCameraState"); + InitPrevFrameStateInfo(ref curState, deltaTime); + if (IsValid) + { + Vector3 pos; + Quaternion orient; + Vector3 offset = EffectiveOffset; + TrackTarget(deltaTime, curState.ReferenceUp, offset, out pos, out orient); + curState.RawPosition = pos + orient * offset; + curState.ReferenceUp = orient * Vector3.up; + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// API for the editor, to process a position drag from the user. + /// This implementation adds the delta to the follow offset. + /// The amount dragged this frame + public override void OnPositionDragged(Vector3 delta) + { + Quaternion targetOrientation = GetReferenceOrientation(VcamState.ReferenceUp); + Vector3 localOffset = Quaternion.Inverse(targetOrientation) * delta; + m_FollowOffset += localOffset; + m_FollowOffset = EffectiveOffset; + } + + /// Initializes the state for previous frame if appropriate. + protected void InitPrevFrameStateInfo( + ref CameraState curState, float deltaTime) + { + if (m_previousTarget != FollowTarget || deltaTime < 0) + { + m_previousTarget = FollowTarget; + m_targetOrientationOnAssign + = (m_previousTarget == null) ? Quaternion.identity : FollowTarget.rotation; + } + if (deltaTime < 0) + { + m_PreviousTargetPosition = curState.RawPosition; + m_PreviousReferenceOrientation = GetReferenceOrientation(curState.ReferenceUp); + } + } + + /// Positions the virtual camera according to the transposer rules. + /// Used for damping. If less than 0, no damping is done. + /// Current camera up + /// Where we want to put the camera relative to the follow target + /// Resulting camera position + /// Damped target orientation + protected void TrackTarget( + float deltaTime, Vector3 up, Vector3 desiredCameraOffset, + out Vector3 outTargetPosition, out Quaternion outTargetOrient) + { + Quaternion targetOrientation = GetReferenceOrientation(up); + Quaternion dampedOrientation = targetOrientation; + if (deltaTime >= 0) + { + Vector3 relative = (Quaternion.Inverse(m_PreviousReferenceOrientation) + * targetOrientation).eulerAngles; + for (int i = 0; i < 3; ++i) + if (relative[i] > 180) + relative[i] -= 360; + relative = Damper.Damp(relative, AngularDamping, deltaTime); + dampedOrientation = m_PreviousReferenceOrientation * Quaternion.Euler(relative); + } + m_PreviousReferenceOrientation = dampedOrientation; + + Vector3 targetPosition = FollowTarget.position; + Vector3 currentPosition = m_PreviousTargetPosition; + Vector3 worldOffset = targetPosition - currentPosition; + + // Adjust for damping, which is done in camera-offset-local coords + if (deltaTime >= 0) + { + Quaternion dampingSpace; + if (desiredCameraOffset.AlmostZero()) + dampingSpace = VcamState.RawOrientation; + else + dampingSpace = Quaternion.LookRotation(dampedOrientation * desiredCameraOffset.normalized, up); + Vector3 localOffset = Quaternion.Inverse(dampingSpace) * worldOffset; + localOffset = Damper.Damp(localOffset, Damping, deltaTime); + worldOffset = dampingSpace * localOffset; + } + outTargetPosition = m_PreviousTargetPosition = currentPosition + worldOffset; + outTargetOrient = dampedOrientation; + } + + /// + /// Damping speeds for each of the 3 axes of the offset from target + /// + protected Vector3 Damping + { + get + { + switch (m_BindingMode) + { + case BindingMode.SimpleFollowWithWorldUp: + return new Vector3(0, m_YDamping, m_ZDamping); + default: + return new Vector3(m_XDamping, m_YDamping, m_ZDamping); + } + } + } + + /// + /// Damping speeds for each of the 3 axes of the target's rotation + /// + protected Vector3 AngularDamping + { + get + { + switch (m_BindingMode) + { + case BindingMode.LockToTargetNoRoll: + return new Vector3(m_PitchDamping, m_YawDamping, 0); + case BindingMode.LockToTargetWithWorldUp: + return new Vector3(0, m_YawDamping, 0); + case BindingMode.LockToTargetOnAssign: + case BindingMode.WorldSpace: + case BindingMode.SimpleFollowWithWorldUp: + return Vector3.zero; + default: + return new Vector3(m_PitchDamping, m_YawDamping, m_RollDamping); + } + } + } + + /// Internal API for the Inspector Editor, so it can draw a marker at the target + public Vector3 GeTargetCameraPosition(Vector3 worldUp) + { + if (!IsValid) + return Vector3.zero; + return FollowTarget.position + GetReferenceOrientation(worldUp) * EffectiveOffset; + } + + /// State information for damping + Vector3 m_PreviousTargetPosition = Vector3.zero; + Quaternion m_PreviousReferenceOrientation = Quaternion.identity; + Quaternion m_targetOrientationOnAssign = Quaternion.identity; + Transform m_previousTarget = null; + + /// Internal API for the Inspector Editor, so it can draw a marker at the target + public Quaternion GetReferenceOrientation(Vector3 worldUp) + { + if (FollowTarget != null) + { + Quaternion targetOrientation = FollowTarget.rotation; + switch (m_BindingMode) + { + case BindingMode.LockToTargetOnAssign: + return m_targetOrientationOnAssign; + case BindingMode.LockToTargetWithWorldUp: + return Uppify(targetOrientation, worldUp); + case BindingMode.LockToTargetNoRoll: + return Quaternion.LookRotation(targetOrientation * Vector3.forward, worldUp); + case BindingMode.LockToTarget: + return targetOrientation; + case BindingMode.SimpleFollowWithWorldUp: + { + Vector3 dir = FollowTarget.position - VcamState.RawPosition; + if (dir.AlmostZero()) + break; + return Uppify(Quaternion.LookRotation(dir, worldUp), worldUp); + } + default: + break; + } + } + return Quaternion.identity; + } + + static Quaternion Uppify(Quaternion q, Vector3 up) + { + Quaternion r = Quaternion.FromToRotation(q * Vector3.up, up); + return r * q; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs.meta new file mode 100644 index 0000000..08c5af4 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Components/CinemachineTransposer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fa7155796051b734daa718462081dc5f +timeCreated: 1484001119 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core.meta new file mode 100644 index 0000000..25d813b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3d53800f587b60a4191877d7713cd17c +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs new file mode 100644 index 0000000..bad769f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs @@ -0,0 +1,200 @@ +using UnityEngine; +using System; +using Cinemachine.Utility; +using UnityEngine.Serialization; + +namespace Cinemachine +{ + /// + /// Axis state for defining to react to player input. + /// The settings here control the responsiveness of the axis to player input. + /// + [DocumentationSorting(6.4f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct AxisState + { + /// The current value of the axis + [NoSaveDuringPlay] + [Tooltip("The current value of the axis.")] + public float Value; + + /// How fast the axis value can travel. Increasing this number + /// makes the behaviour more responsive to joystick input + [Tooltip("The maximum speed of this axis in units/second")] + public float m_MaxSpeed; + + /// The amount of time in seconds it takes to accelerate to + /// MaxSpeed with the supplied Axis at its maximum value + [Tooltip("The amount of time in seconds it takes to accelerate to MaxSpeed with the supplied Axis at its maximum value")] + public float m_AccelTime; + + /// The amount of time in seconds it takes to decelerate + /// the axis to zero if the supplied axis is in a neutral position + [Tooltip("The amount of time in seconds it takes to decelerate the axis to zero if the supplied axis is in a neutral position")] + public float m_DecelTime; + + /// The name of this axis as specified in Unity Input manager. + /// Setting to an empty string will disable the automatic updating of this axis + [FormerlySerializedAs("m_AxisName")] + [Tooltip("The name of this axis as specified in Unity Input manager. Setting to an empty string will disable the automatic updating of this axis")] + public string m_InputAxisName; + + /// The value of the input axis. A value of 0 means no input + /// You can drive this directly from a + /// custom input system, or you can set the Axis Name and have the value + /// driven by the internal Input Manager + [NoSaveDuringPlay] + [Tooltip("The value of the input axis. A value of 0 means no input. You can drive this directly from a custom input system, or you can set the Axis Name and have the value driven by the internal Input Manager")] + public float m_InputAxisValue; + + /// If checked, then the raw value of the input axis will be inverted + /// before it is used. + [NoSaveDuringPlay] + [Tooltip("If checked, then the raw value of the input axis will be inverted before it is used")] + public bool m_InvertAxis; + + private float mCurrentSpeed; + private float mMinValue; + private float mMaxValue; + private bool mWrapAround; + + /// Constructor with specific values + public AxisState( + float maxSpeed, float accelTime, float decelTime, float val, string name, bool invert) + { + m_MaxSpeed = maxSpeed; + m_AccelTime = accelTime; + m_DecelTime = decelTime; + Value = val; + m_InputAxisName = name; + m_InputAxisValue = 0; + m_InvertAxis = invert; + + mCurrentSpeed = 0f; + mMinValue = 0f; + mMaxValue = 0f; + mWrapAround = false; + } + + /// Call from OnValidate: Make sure the fields are sensible + public void Validate() + { + m_MaxSpeed = Mathf.Max(0, m_MaxSpeed); + m_AccelTime = Mathf.Max(0, m_AccelTime); + m_DecelTime = Mathf.Max(0, m_DecelTime); + } + + /// + /// Sets the constraints by which this axis will operate on + /// + /// The lowest value this axis can achieve + /// The highest value this axis can achieve + /// If true, values commanded greater + /// than mMaxValue or less than mMinValue will wrap around. + /// If false, the value will be clamped within the range. + public void SetThresholds(float minValue, float maxValue, bool wrapAround) + { + mMinValue = minValue; + mMaxValue = maxValue; + mWrapAround = wrapAround; + } + + const float Epsilon = UnityVectorExtensions.Epsilon; + + /// + /// Updates the state of this axis based on the axis defined + /// by AxisState.m_AxisName + /// + /// Delta time in seconds + /// Returns true if this axis' input was non-zero this Update, + /// flase otherwise + public bool Update(float deltaTime) + { + if (!string.IsNullOrEmpty(m_InputAxisName)) + { + try + { + m_InputAxisValue = CinemachineCore.GetInputAxis(m_InputAxisName); + } + catch (ArgumentException e) + { + Debug.LogError(e.ToString()); + } + } + + float input = m_InputAxisValue; + if (m_InvertAxis) + input *= -1f; + + if (m_MaxSpeed > Epsilon) + { + float targetSpeed = input * m_MaxSpeed; + if (Mathf.Abs(targetSpeed) < Epsilon + || (Mathf.Sign(mCurrentSpeed) == Mathf.Sign(targetSpeed) + && Mathf.Abs(targetSpeed) < Mathf.Abs(mCurrentSpeed))) + { + // Need to decelerate + float a = Mathf.Abs(targetSpeed - mCurrentSpeed) / Mathf.Max(Epsilon, m_DecelTime); + float delta = Mathf.Min(a * deltaTime, Mathf.Abs(mCurrentSpeed)); + mCurrentSpeed -= Mathf.Sign(mCurrentSpeed) * delta; + } + else + { + // Accelerate to the target speed + float a = Mathf.Abs(targetSpeed - mCurrentSpeed) / Mathf.Max(Epsilon, m_AccelTime); + mCurrentSpeed += Mathf.Sign(targetSpeed) * a * deltaTime; + if (Mathf.Sign(mCurrentSpeed) == Mathf.Sign(targetSpeed) + && Mathf.Abs(mCurrentSpeed) > Mathf.Abs(targetSpeed)) + { + mCurrentSpeed = targetSpeed; + } + } + } + + // Clamp our max speeds so we don't go crazy + float maxSpeed = GetMaxSpeed(); + mCurrentSpeed = Mathf.Clamp(mCurrentSpeed, -maxSpeed, maxSpeed); + + Value += mCurrentSpeed * deltaTime; + bool isOutOfRange = (Value > mMaxValue) || (Value < mMinValue); + if (isOutOfRange) + { + if (mWrapAround) + { + if (Value > mMaxValue) + Value = mMinValue + (Value - mMaxValue); + else + Value = mMaxValue + (Value - mMinValue); + } + else + { + Value = Mathf.Clamp(Value, mMinValue, mMaxValue); + mCurrentSpeed = 0f; + } + } + return Mathf.Abs(input) > Epsilon; + } + + // MaxSpeed may be limited as we approach the range ends, in order + // to prevent a hard bump + private float GetMaxSpeed() + { + float range = mMaxValue - mMinValue; + if (!mWrapAround && range > 0) + { + float threshold = range / 10f; + if (mCurrentSpeed > 0 && (mMaxValue - Value) < threshold) + { + float t = (mMaxValue - Value) / threshold; + return Mathf.Lerp(0, m_MaxSpeed, t); + } + else if (mCurrentSpeed < 0 && (Value - mMinValue) < threshold) + { + float t = (Value - mMinValue) / threshold; + return Mathf.Lerp(0, m_MaxSpeed, t); + } + } + return m_MaxSpeed; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs.meta new file mode 100644 index 0000000..d86b4b8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/AxisState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 557c6f70a7173744abaa3967b6da6f5d +timeCreated: 1504195334 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs new file mode 100644 index 0000000..bfd9851 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs @@ -0,0 +1,352 @@ +using UnityEngine; +using Cinemachine.Utility; +using System.Collections.Generic; + +namespace Cinemachine +{ + /// + /// The output of the Cinemachine engine for a specific virtual camera. The information + /// in this struct can be blended, and provides what is needed to calculate an + /// appropriate camera position, orientation, and lens setting. + /// + /// Raw values are what the Cinemachine behaviours generate. The correction channel + /// holds perturbations to the raw values - e.g. noise or smoothing, or obstacle + /// avoidance corrections. Coirrections are not considered when making time-based + /// calculations such as damping. + /// + /// The Final position and orientation is the comination of the raw values and + /// their corrections. + /// + public struct CameraState + { + /// + /// Camera Lens Settings. + /// + public LensSettings Lens { get; set; } + + /// + /// Which way is up. World space unit vector. + /// + public Vector3 ReferenceUp { get; set; } + + /// + /// The world space focus point of the camera. What the camera wants to look at. + /// There is a special constant define to represent "nothing". Be careful to + /// check for that (or check the HasLookAt property). + /// + public Vector3 ReferenceLookAt { get; set; } + + /// + /// Returns true if this state has a valid ReferenceLookAt value. + /// + public bool HasLookAt { get { return ReferenceLookAt == ReferenceLookAt; } } // will be false if NaN + + /// + /// This constant represents "no point in space" or "no direction". + /// + public static Vector3 kNoPoint = new Vector3(float.NaN, float.NaN, float.NaN); + + /// + /// Raw (un-corrected) world space position of this camera + /// + public Vector3 RawPosition { get; set; } + + /// + /// Raw (un-corrected) world space orientation of this camera + /// + public Quaternion RawOrientation { get; set; } + + /// This is a way for the Body component to bypass aim damping, + /// useful for when the body need to rotate its point of view, but does not + /// want interference from the aim damping + internal Vector3 PositionDampingBypass { get; set; } + + /// + /// Subjective estimation of how "good" the shot is. + /// Larger values mean better quality. Default is 1. + /// + public float ShotQuality { get; set; } + + /// + /// Position correction. This will be added to the raw position. + /// This value doesn't get fed back into the system when calculating the next frame. + /// Can be noise, or smoothing, or both, or something else. + /// + public Vector3 PositionCorrection { get; set; } + + /// + /// Orientation correction. This will be added to the raw orientation. + /// This value doesn't get fed back into the system when calculating the next frame. + /// Can be noise, or smoothing, or both, or something else. + /// + public Quaternion OrientationCorrection { get; set; } + + /// + /// Position with correction applied. + /// + public Vector3 CorrectedPosition { get { return RawPosition + PositionCorrection; } } + + /// + /// Orientation with correction applied. + /// + public Quaternion CorrectedOrientation { get { return RawOrientation * OrientationCorrection; } } + + /// + /// Position with correction applied. This is what the final camera gets. + /// + public Vector3 FinalPosition { get { return RawPosition + PositionCorrection; } } + + /// + /// Orientation with correction and dutch applied. This is what the final camera gets. + /// + public Quaternion FinalOrientation + { + get + { + if (Mathf.Abs(Lens.Dutch) > UnityVectorExtensions.Epsilon) + return CorrectedOrientation * Quaternion.AngleAxis(Lens.Dutch, Vector3.forward); + return CorrectedOrientation; + } + } + + /// + /// State with default values + /// + public static CameraState Default + { + get + { + CameraState state = new CameraState(); + state.Lens = LensSettings.Default; + state.ReferenceUp = Vector3.up; + state.ReferenceLookAt = kNoPoint; + state.RawPosition = Vector3.zero; + state.RawOrientation = Quaternion.identity; + state.ShotQuality = 1; + state.PositionCorrection = Vector3.zero; + state.OrientationCorrection = Quaternion.identity; + state.PositionDampingBypass = Vector3.zero; + return state; + } + } + + /// Opaque structure represent extra blendable stuff and its weight. + /// The base system ignores this data - it is intended for extension modules + public struct CustomBlendable + { + /// The custom stuff that the extention module will consider + public Object m_Custom; + /// The weight of the custom stuff. Must be 0...1 + public float m_Weight; + + /// Constructor with specific values + /// The custom stuff that the extention module will consider + /// The weight of the custom stuff. Must be 0...1 + public CustomBlendable(Object custom, float weight) + { m_Custom = custom; m_Weight = weight; } + }; + + // This is to avoid excessive GC allocs + CustomBlendable mCustom0; + CustomBlendable mCustom1; + CustomBlendable mCustom2; + CustomBlendable mCustom3; + List m_CustomOverflow; + + /// The number of custom blendables that will be applied to the camera. + /// The base system manages but otherwise ignores this data - it is intended for + /// extension modules + public int NumCustomBlendables { get; private set; } + + /// Get a custom blendable that will be applied to the camera. + /// The base system manages but otherwise ignores this data - it is intended for + /// extension modules + /// Which one to get. Must be in range [0...NumCustomBlendables) + /// The custom blendable at the specified index. + public CustomBlendable GetCustomBlendable(int index) + { + switch (index) + { + case 0: return mCustom0; + case 1: return mCustom1; + case 2: return mCustom2; + case 3: return mCustom3; + default: + { + index -= 4; + if (m_CustomOverflow != null && index < m_CustomOverflow.Count) + return m_CustomOverflow[index]; + return new CustomBlendable(null, 0); + } + } + } + + int FindCustomBlendable(Object custom) + { + if (mCustom0.m_Custom == custom) + return 0; + if (mCustom1.m_Custom == custom) + return 1; + if (mCustom2.m_Custom == custom) + return 2; + if (mCustom3.m_Custom == custom) + return 3; + if (m_CustomOverflow != null) + { + for (int i = 0; i < m_CustomOverflow.Count; ++i) + if (m_CustomOverflow[i].m_Custom == custom) + return i + 4; + } + return -1; + } + + /// Add a custom blendable to the pot for eventual application to the camera. + /// The base system manages but otherwise ignores this data - it is intended for + /// extension modules + /// The custom blendable to add. If b.m_Custom is the same as an + /// already-added custom blendable, then they will be merged and the weights combined. + public void AddCustomBlendable(CustomBlendable b) + { + // Attempt to merge common blendables to avoid growth + int index = FindCustomBlendable(b.m_Custom); + if (index >= 0) + b.m_Weight += GetCustomBlendable(index).m_Weight; + else + { + index = NumCustomBlendables; + NumCustomBlendables = index + 1; + } + switch (index) + { + case 0: mCustom0 = b; break; + case 1: mCustom1 = b; break; + case 2: mCustom2 = b; break; + case 3: mCustom3 = b; break; + default: + { + if (m_CustomOverflow == null) + m_CustomOverflow = new List(); + m_CustomOverflow.Add(b); + break; + } + } + } + + /// Intelligently blend the contents of two states. + /// The first state, corresponding to t=0 + /// The second state, corresponding to t=1 + /// How much to interpolate. Internally clamped to 0..1 + /// Linearly interpolated CameraState + public static CameraState Lerp(CameraState stateA, CameraState stateB, float t) + { + t = Mathf.Clamp01(t); + float adjustedT = t; + + CameraState state = new CameraState(); + state.Lens = LensSettings.Lerp(stateA.Lens, stateB.Lens, t); + state.ReferenceUp = Vector3.Slerp(stateA.ReferenceUp, stateB.ReferenceUp, t); + state.RawPosition = Vector3.Lerp(stateA.RawPosition, stateB.RawPosition, t); + + state.ShotQuality = Mathf.Lerp(stateA.ShotQuality, stateB.ShotQuality, t); + state.PositionCorrection = Vector3.Lerp( + stateA.PositionCorrection, stateB.PositionCorrection, t); + // GML todo: is this right? Can it introduce a roll? + state.OrientationCorrection = Quaternion.Slerp( + stateA.OrientationCorrection, stateB.OrientationCorrection, t); + + Vector3 dirTarget = Vector3.zero; + if (!stateA.HasLookAt || !stateB.HasLookAt) + state.ReferenceLookAt = kNoPoint; // can't interpolate if undefined + else + { + // Re-interpolate FOV to preserve target composition, if possible + float fovA = stateA.Lens.FieldOfView; + float fovB = stateB.Lens.FieldOfView; + if (!state.Lens.Orthographic && !Mathf.Approximately(fovA, fovB)) + { + LensSettings lens = state.Lens; + lens.FieldOfView = state.InterpolateFOV( + fovA, fovB, + Mathf.Max((stateA.ReferenceLookAt - stateA.CorrectedPosition).magnitude, stateA.Lens.NearClipPlane), + Mathf.Max((stateB.ReferenceLookAt - stateB.CorrectedPosition).magnitude, stateB.Lens.NearClipPlane), t); + state.Lens = lens; + + // Make sure we preserve the screen composition through FOV changes + adjustedT = Mathf.Abs((lens.FieldOfView - fovA) / (fovB - fovA)); + } + + // Linear interpolation of lookAt target point + state.ReferenceLookAt = Vector3.Lerp( + stateA.ReferenceLookAt, stateB.ReferenceLookAt, adjustedT); + + // If orientations are different, use LookAt to blend them + float angle = Quaternion.Angle(stateA.RawOrientation, stateB.RawOrientation); + if (angle > UnityVectorExtensions.Epsilon) + dirTarget = state.ReferenceLookAt - state.CorrectedPosition; + } + + // Clever orientation interpolation + if (dirTarget.AlmostZero()) + { + // Don't know what we're looking at - can only slerp + state.RawOrientation = UnityQuaternionExtensions.SlerpWithReferenceUp( + stateA.RawOrientation, stateB.RawOrientation, t, state.ReferenceUp); + } + else + { + // Rotate while preserving our lookAt target + dirTarget = dirTarget.normalized; + if ((dirTarget - state.ReferenceUp).AlmostZero() + || (dirTarget + state.ReferenceUp).AlmostZero()) + { + // Looking up or down at the pole + state.RawOrientation = UnityQuaternionExtensions.SlerpWithReferenceUp( + stateA.RawOrientation, stateB.RawOrientation, t, state.ReferenceUp); + } + else + { + // Put the target in the center + state.RawOrientation = Quaternion.LookRotation(dirTarget, state.ReferenceUp); + + // Blend the desired offsets from center + Vector2 deltaA = -stateA.RawOrientation.GetCameraRotationToTarget( + stateA.ReferenceLookAt - stateA.CorrectedPosition, stateA.ReferenceUp); + Vector2 deltaB = -stateB.RawOrientation.GetCameraRotationToTarget( + stateB.ReferenceLookAt - stateB.CorrectedPosition, stateB.ReferenceUp); + state.RawOrientation = state.RawOrientation.ApplyCameraRotation( + Vector2.Lerp(deltaA, deltaB, adjustedT), state.ReferenceUp); + } + } + + // Accumulate the custom blendables and apply the weights + for (int i = 0; i < stateA.NumCustomBlendables; ++i) + { + CustomBlendable b = stateA.GetCustomBlendable(i); + b.m_Weight *= (1-t); + if (b.m_Weight > UnityVectorExtensions.Epsilon) + state.AddCustomBlendable(b); + } + for (int i = 0; i < stateB.NumCustomBlendables; ++i) + { + CustomBlendable b = stateB.GetCustomBlendable(i); + b.m_Weight *= t; + if (b.m_Weight > UnityVectorExtensions.Epsilon) + state.AddCustomBlendable(b); + } + return state; + } + + float InterpolateFOV(float fovA, float fovB, float dA, float dB, float t) + { + // We interpolate shot height + float hA = dA * 2f * Mathf.Tan(fovA * Mathf.Deg2Rad / 2f); + float hB = dB * 2f * Mathf.Tan(fovB * Mathf.Deg2Rad / 2f); + float h = Mathf.Lerp(hA, hB, t); + float fov = 179f; + float d = Mathf.Lerp(dA, dB, t); + if (d > UnityVectorExtensions.Epsilon) + fov = 2f * Mathf.Atan(h / (2 * d)) * Mathf.Rad2Deg; + return Mathf.Clamp(fov, Mathf.Min(fovA, fovB), Mathf.Max(fovA, fovB)); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs.meta new file mode 100644 index 0000000..4000a13 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CameraState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c2a918f460a69394eb9726b31e1d404c +timeCreated: 1488314898 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs new file mode 100644 index 0000000..2e8da48 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs @@ -0,0 +1,207 @@ +using System; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// Describes a blend between 2 Cinemachine Virtual Cameras, and holds the + /// current state of the blend. + /// + public class CinemachineBlend + { + /// First camera in the blend + public ICinemachineCamera CamA { get; set; } + + /// Second camera in the blend + public ICinemachineCamera CamB { get; set; } + + /// The curve that describes the way the blend transitions over time + /// from the first camera to the second. X-axis is time in seconds over which + /// the blend takes place and Y axis is blend weight (0..1) + public AnimationCurve BlendCurve { get; set; } + + /// The current time relative to the start of the blend + public float TimeInBlend { get; set; } + + /// The current weight of the blend. This is an evaluation of the + /// BlendCurve at the current time relative to the start of the blend. + /// 0 means camA, 1 means camB. + public float BlendWeight + { + get { return BlendCurve != null ? BlendCurve.Evaluate(TimeInBlend) : 0; } + } + + /// Validity test for the blend. True if both cameras are defined. + public bool IsValid + { + get { return (CamA != null || CamB != null); } + } + + /// Duration in seconds of the blend. + /// This is given read from the BlendCurve. + public float Duration { get; set; } + + /// True if the time relative to the start of the blend is greater + /// than or equal to the blend duration + public bool IsComplete { get { return TimeInBlend >= Duration; } } + + /// Text description of the blend, for debugging + public string Description + { + get + { + string fromName = (CamA != null) ? "[" + CamA.Name + "]": "(none)"; + string toName = (CamB != null) ? "[" + CamB.Name + "]" : "(none)"; + int percent = (int)(BlendWeight * 100f); + return string.Format("{0} {1}% from {2}", toName, percent, fromName); + } + } + + /// Does the blend use a specific Cinemachine Virtual Camera? + /// The camera to test + /// True if the camera is involved in the blend + public bool Uses(ICinemachineCamera cam) + { + if (cam == CamA || cam == CamB) + return true; + BlendSourceVirtualCamera b = CamA as BlendSourceVirtualCamera; + if (b != null && b.Blend.Uses(cam)) + return true; + b = CamB as BlendSourceVirtualCamera; + if (b != null && b.Blend.Uses(cam)) + return true; + return false; + } + + /// Construct a blend + /// First camera + /// Second camera + /// Blend curve + /// Current time in blend, relative to the start of the blend + public CinemachineBlend( + ICinemachineCamera a, ICinemachineCamera b, AnimationCurve curve, float duration, float t) + { + if (a == null || b == null) + throw new ArgumentException("Blend cameras cannot be null"); + CamA = a; + CamB = b; + BlendCurve = curve; + TimeInBlend = t; + Duration = duration; + } + + /// Make sure the source cameras get updated. + /// Default world up. Individual vcams may modify this + /// Time increment used for calculating time-based behaviours (e.g. damping) + public void UpdateCameraState(Vector3 worldUp, float deltaTime) + { + // Make sure both cameras have been updated (they are not necessarily + // enabled, and only enabled cameras get updated automatically + // every frame) + CinemachineCore.Instance.UpdateVirtualCamera(CamA, worldUp, deltaTime); + CinemachineCore.Instance.UpdateVirtualCamera(CamB, worldUp, deltaTime); + } + + /// Compute the blended CameraState for the current time in the blend. + public CameraState State { get { return CameraState.Lerp(CamA.State, CamB.State, BlendWeight); } } + } + + /// Definition of a Camera blend. This struct holds the information + /// necessary to generate a suitable AnimationCurve for a Cinemachine Blend. + [Serializable] + [DocumentationSorting(10.2f, DocumentationSortingAttribute.Level.UserRef)] + public struct CinemachineBlendDefinition + { + /// Supported predefined shapes for the blend curve. + [DocumentationSorting(10.21f, DocumentationSortingAttribute.Level.UserRef)] + public enum Style + { + /// Zero-length blend + Cut, + /// S-shaped curve, giving a gentle and smooth transition + EaseInOut, + /// Linear out of the outgoing shot, and easy into the incoming + EaseIn, + /// Easy out of the outgoing shot, and linear into the incoming + EaseOut, + /// Easy out of the outgoing, and hard into the incoming + HardIn, + /// Hard out of the outgoing, and easy into the incoming + HardOut, + /// Linear blend. Mechanical-looking. + Linear + }; + + /// The shape of the blend curve. + [Tooltip("Shape of the blend curve")] + public Style m_Style; + + /// The duration (in seconds) of the blend + [Tooltip("Duration of the blend, in seconds")] + public float m_Time; + + /// Constructor + /// The shape of the blend curve. + /// The duration (in seconds) of the blend + public CinemachineBlendDefinition(Style style, float time) + { + m_Style = style; + m_Time = time; + } + + /// + /// An AnimationCurve specifying the interpolation duration and value + /// for this camera blend. The time of the last key frame is assumed to the be the + /// duration of the blend. Y-axis values must be in range [0,1] (internally clamped + /// within Blender) and time must be in range of [0, +infinity) + /// + public AnimationCurve BlendCurve + { + get + { + float time = Mathf.Max(0, m_Time); + switch (m_Style) + { + default: + case Style.Cut: return new AnimationCurve(); + case Style.EaseInOut: return AnimationCurve.EaseInOut(0f, 0f, time, 1f); + case Style.EaseIn: + { + AnimationCurve curve = AnimationCurve.Linear(0f, 0f, time, 1f); + Keyframe[] keys = curve.keys; + keys[1].inTangent = 0; + curve.keys = keys; + return curve; + } + case Style.EaseOut: + { + AnimationCurve curve = AnimationCurve.Linear(0f, 0f, time, 1f); + Keyframe[] keys = curve.keys; + keys[0].outTangent = 0; + curve.keys = keys; + return curve; + } + case Style.HardIn: + { + AnimationCurve curve = AnimationCurve.Linear(0f, 0f, time, 1f); + Keyframe[] keys = curve.keys; + keys[0].outTangent = 0; + keys[1].inTangent = 1.5708f; // pi/2 = up + curve.keys = keys; + return curve; + } + case Style.HardOut: + { + AnimationCurve curve = AnimationCurve.Linear(0f, 0f, time, 1f); + Keyframe[] keys = curve.keys; + keys[0].outTangent = 1.5708f; // pi/2 = up + keys[1].inTangent = 0; + curve.keys = keys; + return curve; + } + case Style.Linear: return AnimationCurve.Linear(0f, 0f, time, 1f); + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs.meta new file mode 100644 index 0000000..71ba1aa --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlend.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3fed8968b96eb924891cf86f5c51f661 +timeCreated: 1484407000 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs new file mode 100644 index 0000000..8abb672 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs @@ -0,0 +1,95 @@ +using UnityEngine; +using System; + +namespace Cinemachine +{ + /// + /// Asset that defines the rules for blending between Virtual Cameras. + /// + [DocumentationSorting(10, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public sealed class CinemachineBlenderSettings : ScriptableObject + { + /// + /// Container specifying how two specific Cinemachine Virtual Cameras + /// blend together. + /// + [DocumentationSorting(10.1f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct CustomBlend + { + [Tooltip("When blending from this camera")] + public string m_From; + + [Tooltip("When blending to this camera")] + public string m_To; + + [Tooltip("Blend curve definition")] + public CinemachineBlendDefinition m_Blend; + } + /// The array containing explicitly defined blends between two Virtual Cameras + [Tooltip("The array containing explicitly defined blends between two Virtual Cameras")] + public CustomBlend[] m_CustomBlends = null; + + /// Internal API for the inspector editopr: a label to represent any camera + public const string kBlendFromAnyCameraLabel = "**ANY CAMERA**"; + + /// + /// Attempts to find a blend curve which matches the to and from cameras as specified. + /// If no match is found, the function returns either the + /// default blend for this Blender or NULL depending on the state + /// of returnDefaultOnNoMatch. + /// + /// The game object name of the from camera + /// The game object name of the to camera + /// Curve to return if no curve found. Can be NULL. + /// + public AnimationCurve GetBlendCurveForVirtualCameras( + string fromCameraName, string toCameraName, AnimationCurve defaultCurve) + { + AnimationCurve anyToMe = null; + AnimationCurve meToAny = null; + if (m_CustomBlends != null) + { + for (int i = 0; i < m_CustomBlends.Length; ++i) + { + // Attempt to find direct name first + CustomBlend blendParams = m_CustomBlends[i]; + if ((blendParams.m_From == fromCameraName) + && (blendParams.m_To == toCameraName)) + { + return blendParams.m_Blend.BlendCurve; + } + // If we come across default applicable wildcards, remember them + if (blendParams.m_From == kBlendFromAnyCameraLabel) + { + if (!string.IsNullOrEmpty(toCameraName) + && blendParams.m_To == toCameraName) + { + anyToMe = blendParams.m_Blend.BlendCurve; + } + else if (blendParams.m_To == kBlendFromAnyCameraLabel) + defaultCurve = blendParams.m_Blend.BlendCurve; + } + else if (blendParams.m_To == kBlendFromAnyCameraLabel + && !string.IsNullOrEmpty(fromCameraName) + && blendParams.m_From == fromCameraName) + { + meToAny = blendParams.m_Blend.BlendCurve; + } + } + } + + // If nothing is found try to find wild card blends from any + // camera to our new one + if (anyToMe != null) + return anyToMe; + + // Still have nothing? Try from our camera to any camera + if (meToAny != null) + return meToAny; + + return defaultCurve; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs.meta new file mode 100644 index 0000000..7a50b50 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineBlenderSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 36baaa8bdcb9d8b49b9199833965d2c3 +timeCreated: 1486497606 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs new file mode 100644 index 0000000..cfcbaf8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs @@ -0,0 +1,77 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// An abstract representation of a mutator acting on a Cinemachine Virtual Camera + /// + [DocumentationSorting(24, DocumentationSortingAttribute.Level.API)] + public abstract class CinemachineComponentBase : MonoBehaviour + { + /// Useful constant for very small floats + protected const float Epsilon = Utility.UnityVectorExtensions.Epsilon; + + /// Get the associated CinemachineVirtualCameraBase + public CinemachineVirtualCameraBase VirtualCamera + { + get + { + if (m_vcamOwner == null) + m_vcamOwner = gameObject.transform.parent.gameObject.GetComponent(); + return m_vcamOwner; + } + } + CinemachineVirtualCameraBase m_vcamOwner; + + /// Returns the owner vcam's Follow target. + public Transform FollowTarget + { + get + { + CinemachineVirtualCameraBase vcam = VirtualCamera; + return vcam == null ? null : vcam.Follow; + } + } + + /// Returns the owner vcam's LookAt target. + public Transform LookAtTarget + { + get + { + CinemachineVirtualCameraBase vcam = VirtualCamera; + return vcam == null ? null : vcam.LookAt; + } + } + + /// Returns the owner vcam's CameraState. + public CameraState VcamState + { + get + { + CinemachineVirtualCameraBase vcam = VirtualCamera; + return vcam == null ? CameraState.Default : vcam.State; + } + } + + /// Returns true if this object is enabled and set up to produce results. + public abstract bool IsValid { get; } + + /// Override this to do such things as offset the RefereceLookAt. + /// Base class implementation does nothing. + /// Input state that must be mutated + public virtual void PrePipelineMutateCameraState(ref CameraState state) {} + + /// What part of the pipeline this fits into + public abstract CinemachineCore.Stage Stage { get; } + + /// Mutates the camera state. This state will later be applied to the camera. + /// Input state that must be mutated + /// Delta time for time-based effects (ignore if less than 0) + public abstract void MutateCameraState(ref CameraState curState, float deltaTime); + + /// API for the editor, to process a position drag from the user. + /// Base class implementation does nothing. + /// The amount dragged this frame + public virtual void OnPositionDragged(Vector3 delta) {} + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs.meta new file mode 100644 index 0000000..9d67537 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineComponentBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b2f73bdc979030e419f33c10913639cc +timeCreated: 1510078351 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs new file mode 100644 index 0000000..8bf6877 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs @@ -0,0 +1,429 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace Cinemachine +{ + /// A singleton that manages complete lists of CinemachineBrain and, + /// Cinemachine Virtual Cameras, and the priority queue. Provides + /// services to keeping track of whether Cinemachine Virtual Cameras have + /// been updated each frame. + public sealed class CinemachineCore + { + /// Data version string. Used to upgrade from legacy projects + public static readonly int kStreamingVersion = 20170927; + + /// Human-readable Cinemachine Version + public static readonly string kVersionString = "2.1"; + + /// + /// Stages in the Cinemachine Component pipeline, used for + /// UI organization>. This enum defines the pipeline order. + /// + public enum Stage + { + /// Second stage: position the camera in space + Body, + + /// Third stage: orient the camera to point at the target + Aim, + + /// Final stage: apply noise (this is done separately, in the + /// Correction channel of the CameraState) + Noise + }; + + private static CinemachineCore sInstance = null; + + /// Get the singleton instance + public static CinemachineCore Instance + { + get + { + if (sInstance == null) + sInstance = new CinemachineCore(); + return sInstance; + } + } + + /// + /// If true, show hidden Cinemachine objects, to make manual script mapping possible. + /// + public static bool sShowHiddenObjects = false; + + /// Delegate for overriding Unity's default input system. Returns the value + /// of the named axis. + public delegate float AxisInputDelegate(string axisName); + + /// Delegate for overriding Unity's default input system. + /// If you set this, then your delegate will be called instead of + /// System.Input.GetAxis(axisName) whenever in-game user input is needed. + public static AxisInputDelegate GetInputAxis = UnityEngine.Input.GetAxis; + + /// List of all active CinemachineBrains. + private List mActiveBrains = new List(); + + /// Access the array of active CinemachineBrains in the scene + public int BrainCount { get { return mActiveBrains.Count; } } + + /// Access the array of active CinemachineBrains in the scene + /// without gebnerating garbage + /// Index of the brain to access, range 0-BrainCount + /// The brain at the specified index + public CinemachineBrain GetActiveBrain(int index) + { + return mActiveBrains[index]; + } + + /// Called when a CinemachineBrain is enabled. + internal void AddActiveBrain(CinemachineBrain brain) + { + // First remove it, just in case it's being added twice + RemoveActiveBrain(brain); + mActiveBrains.Insert(0, brain); + } + + /// Called when a CinemachineBrain is disabled. + internal void RemoveActiveBrain(CinemachineBrain brain) + { + mActiveBrains.Remove(brain); + } + + /// List of all active ICinemachineCameras. + private List mActiveCameras = new List(); + + /// + /// List of all active Cinemachine Virtual Cameras for all brains. + /// This list is kept sorted by priority. + /// + public int VirtualCameraCount { get { return mActiveCameras.Count; } } + + /// Access the array of active ICinemachineCamera in the scene + /// without gebnerating garbage + /// Index of the camera to access, range 0-VirtualCameraCount + /// The virtual camera at the specified index + public ICinemachineCamera GetVirtualCamera(int index) + { + return mActiveCameras[index]; + } + + /// Called when a Cinemachine Virtual Camera is enabled. + internal void AddActiveCamera(ICinemachineCamera vcam) + { + // Bring it to the top of the list + RemoveActiveCamera(vcam); + + // Keep list sorted by priority + int insertIndex; + for (insertIndex = 0; insertIndex < mActiveCameras.Count; ++insertIndex) + if (vcam.Priority >= mActiveCameras[insertIndex].Priority) + break; + + mActiveCameras.Insert(insertIndex, vcam); + } + + /// Called when a Cinemachine Virtual Camera is disabled. + internal void RemoveActiveCamera(ICinemachineCamera vcam) + { + mActiveCameras.Remove(vcam); + } + + // Registry of all vcams that are parented (i.e. slaves of) to other vcams + private List> mChildCameras = new List>(); + + /// Called when a child vcam is enabled. + internal void AddChildCamera(ICinemachineCamera vcam) + { + RemoveChildCamera(vcam); + + int parentLevel = 0; + for (ICinemachineCamera p = vcam; p != null; p = p.ParentCamera) + ++parentLevel; + while (mChildCameras.Count < parentLevel) + mChildCameras.Add(new List()); + mChildCameras[parentLevel-1].Add(vcam); + } + + /// Called when a child vcam is disabled. + internal void RemoveChildCamera(ICinemachineCamera vcam) + { + for (int i = 0; i < mChildCameras.Count; ++i) + mChildCameras[i].Remove(vcam); + } + + /// Update all the active vcams in the scene, in the correct dependency order. + internal void UpdateAllActiveVirtualCameras(Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineCore.UpdateAllActiveVirtualCameras"); + int numCameras; + + // Update the leaf-most cameras first + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineCore.UpdateAllActiveVirtualCameras.leaf-most"); + for (int i = mChildCameras.Count-1; i >= 0; --i) + { + numCameras = mChildCameras[i].Count; + for (int j = 0; j < numCameras; ++j) + UpdateVirtualCamera(mChildCameras[i][j], worldUp, deltaTime); + } + //UnityEngine.Profiling.Profiler.EndSample(); + + // Then all the top-level cameras + numCameras = VirtualCameraCount; + for (int i = 0; i < numCameras; ++i) + UpdateVirtualCamera(GetVirtualCamera(i), worldUp, deltaTime); + //UnityEngine.Profiling.Profiler.EndSample(); + } + + /// + /// Update a single Cinemachine Virtual Camera if and only if it + /// hasn't already been updated this frame. Always update vcams via this method. + /// Calling this more than once per frame for the same camera will have no effect. + /// + internal bool UpdateVirtualCamera(ICinemachineCamera vcam, Vector3 worldUp, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachineCore.UpdateVirtualCamera"); + int now = Time.frameCount; + UpdateFilter filter = CurrentUpdateFilter; + bool isSmartUpdate = filter != UpdateFilter.ForcedFixed + && filter != UpdateFilter.ForcedLate; + bool isSmartLateUpdate = filter == UpdateFilter.Late; + if (!isSmartUpdate) + { + if (filter == UpdateFilter.ForcedFixed) + filter = UpdateFilter.Fixed; + if (filter == UpdateFilter.ForcedLate) + filter = UpdateFilter.Late; + } + + if (mUpdateStatus == null) + mUpdateStatus = new Dictionary(); + if (vcam.VirtualCameraGameObject == null) + { + if (mUpdateStatus.ContainsKey(vcam)) + mUpdateStatus.Remove(vcam); + //UnityEngine.Profiling.Profiler.EndSample(); + return false; // camera was deleted + } + UpdateStatus status; + if (!mUpdateStatus.TryGetValue(vcam, out status)) + { + status = new UpdateStatus(now); + mUpdateStatus.Add(vcam, status); + } + + int subframes = isSmartLateUpdate ? 1 : CinemachineBrain.GetSubframeCount(); + if (status.lastUpdateFrame != now) + status.lastUpdateSubframe = 0; + + // If we're in smart update mode and the target moved, then we must examine + // how the target has been moving recently in order to figure out whether to + // update now + bool updateNow = !isSmartUpdate; + if (isSmartUpdate) + { + Matrix4x4 targetPos; + if (!GetTargetPosition(vcam, out targetPos)) + updateNow = isSmartLateUpdate; // no target + else + updateNow = status.ChoosePreferredUpdate(now, targetPos, filter) + == filter; + } + + if (updateNow) + { + status.preferredUpdate = filter; + while (status.lastUpdateSubframe < subframes) + { +//Debug.Log(vcam.Name + ": frame " + Time.frameCount + "." + status.lastUpdateSubframe + ", " + CurrentUpdateFilter + ", deltaTime = " + deltaTime); + vcam.UpdateCameraState(worldUp, deltaTime); + ++status.lastUpdateSubframe; + } + status.lastUpdateFrame = now; + } + + mUpdateStatus[vcam] = status; + //UnityEngine.Profiling.Profiler.EndSample(); + return true; + } + + struct UpdateStatus + { + const int kWindowSize = 30; + + public int lastUpdateFrame; + public int lastUpdateSubframe; + + public int windowStart; + public int numWindowLateUpdateMoves; + public int numWindowFixedUpdateMoves; + public int numWindows; + public UpdateFilter preferredUpdate; + + public Matrix4x4 targetPos; + + public UpdateStatus(int currentFrame) + { + lastUpdateFrame = -1; + lastUpdateSubframe = 0; + windowStart = currentFrame; + numWindowLateUpdateMoves = 0; + numWindowFixedUpdateMoves = 0; + numWindows = 0; + preferredUpdate = UpdateFilter.Late; + targetPos = Matrix4x4.zero; + } + + // Important: updateFilter may ONLY be Late or Fixed + public UpdateFilter ChoosePreferredUpdate( + int currentFrame, Matrix4x4 pos, UpdateFilter updateFilter) + { + if (targetPos != pos) + { + if (updateFilter == UpdateFilter.Late) + ++numWindowLateUpdateMoves; + else if (lastUpdateSubframe == 0) + ++numWindowFixedUpdateMoves; + targetPos = pos; + } + //Debug.Log("Fixed=" + numWindowFixedUpdateMoves + ", Late=" + numWindowLateUpdateMoves); + UpdateFilter choice = preferredUpdate; + bool inconsistent = numWindowLateUpdateMoves > 0 && numWindowFixedUpdateMoves > 0; + if (inconsistent || numWindowLateUpdateMoves >= numWindowFixedUpdateMoves) + choice = UpdateFilter.Late; + else + choice = UpdateFilter.Fixed; + if (numWindows == 0) + preferredUpdate = choice; + + if (windowStart + kWindowSize <= currentFrame) + { + preferredUpdate = choice; + ++numWindows; + windowStart = currentFrame; + numWindowLateUpdateMoves = numWindowFixedUpdateMoves = 0; + } + return preferredUpdate; + } + } + Dictionary mUpdateStatus; + + /// Internal use only + public enum UpdateFilter { Fixed, ForcedFixed, Late, ForcedLate }; + internal UpdateFilter CurrentUpdateFilter { get; set; } + private static bool GetTargetPosition(ICinemachineCamera vcam, out Matrix4x4 targetPos) + { + ICinemachineCamera vcamTarget = vcam.LiveChildOrSelf; + if (vcamTarget == null || vcamTarget.VirtualCameraGameObject == null) + { + targetPos = Matrix4x4.identity; + return false; + } + targetPos = vcamTarget.VirtualCameraGameObject.transform.localToWorldMatrix; + if (vcamTarget.LookAt != null) + { + targetPos = vcamTarget.LookAt.localToWorldMatrix; + return true; + } + if (vcamTarget.Follow != null) + { + targetPos = vcamTarget.Follow.localToWorldMatrix; + return true; + } + // If no target, use the vcam itself + targetPos = vcam.VirtualCameraGameObject.transform.localToWorldMatrix; + return true; + } + + /// Internal use only + public UpdateFilter GetVcamUpdateStatus(ICinemachineCamera vcam) + { + UpdateStatus status; + if (mUpdateStatus == null || !mUpdateStatus.TryGetValue(vcam, out status)) + return UpdateFilter.Late; + return status.preferredUpdate; + } + + /// + /// Is this virtual camera currently actively controlling any Camera? + /// + public bool IsLive(ICinemachineCamera vcam) + { + if (vcam != null) + { + for (int i = 0; i < BrainCount; ++i) + { + CinemachineBrain b = GetActiveBrain(i); + if (b != null && b.IsLive(vcam)) + return true; + } + } + return false; + } + + /// + /// Signal that the virtual has been activated. + /// If the camera is live, then all CinemachineBrains that are showing it will + /// send an activation event. + /// + public void GenerateCameraActivationEvent(ICinemachineCamera vcam) + { + if (vcam != null) + { + for (int i = 0; i < BrainCount; ++i) + { + CinemachineBrain b = GetActiveBrain(i); + if (b != null && b.IsLive(vcam)) + b.m_CameraActivatedEvent.Invoke(vcam); + } + } + } + + /// + /// Signal that the virtual camera's content is discontinuous WRT the previous frame. + /// If the camera is live, then all CinemachineBrains that are showing it will send a cut event. + /// + public void GenerateCameraCutEvent(ICinemachineCamera vcam) + { + if (vcam != null) + { + for (int i = 0; i < BrainCount; ++i) + { + CinemachineBrain b = GetActiveBrain(i); + if (b != null && b.IsLive(vcam)) + b.m_CameraCutEvent.Invoke(b); + } + } + } + + /// + /// Try to find a CinemachineBrain to associate with a + /// Cinemachine Virtual Camera. The first CinemachineBrain + /// in which this Cinemachine Virtual Camera is live will be used. + /// If none, then the first active CinemachineBrain will be used. + /// Brains with OutputCamera == null will not be returned. + /// Final result may be null. + /// + /// Virtual camera whose potential brain we need. + /// First CinemachineBrain found that might be + /// appropriate for this vcam, or null + public CinemachineBrain FindPotentialTargetBrain(ICinemachineCamera vcam) + { + int numBrains = BrainCount; + if (vcam != null && numBrains > 1) + { + for (int i = 0; i < numBrains; ++i) + { + CinemachineBrain b = GetActiveBrain(i); + if (b != null && b.OutputCamera != null && b.IsLive(vcam)) + return b; + } + } + for (int i = 0; i < numBrains; ++i) + { + CinemachineBrain b = GetActiveBrain(i); + if (b != null && b.OutputCamera != null) + return b; + } + return null; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs.meta new file mode 100644 index 0000000..84800d9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineCore.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c7d73314dfe49f8458398c6dc8edcda8 +timeCreated: 1484001119 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs new file mode 100644 index 0000000..77c4912 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs @@ -0,0 +1,47 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace Cinemachine.Utility +{ + /// Manages onscreen positions for Cinemachine debugging output + public class CinemachineGameWindowDebug + { + static HashSet mClients; + + /// Release a screen rectangle previously obtained through GetScreenPos() + /// The client caller. Used as a handle. + public static void ReleaseScreenPos(Object client) + { + if (mClients != null && mClients.Contains(client)) + mClients.Remove(client); + } + + /// Reserve an on-screen rectangle for debugging output. + /// The client caller. This is used as a handle. + /// Sample text, for determining rectangle size + /// What style will be used to draw, used here for + /// determining rect size + /// An area on the game screen large enough to print the text + /// in the style indicated + public static Rect GetScreenPos(Object client, string text, GUIStyle style) + { + if (mClients == null) + mClients = new HashSet(); + if (!mClients.Contains(client)) + mClients.Add(client); + + Vector2 pos = new Vector2(0, 0); + Vector2 size = style.CalcSize(new GUIContent(text)); + if (mClients != null) + { + foreach (var c in mClients) + { + if (c == client) + break; + pos.y += size.y; + } + } + return new Rect(pos, size); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs.meta new file mode 100644 index 0000000..763e6f2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineDebugLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 10e6f8c815d3c4d45b1d98b951d53912 +timeCreated: 1481654954 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs new file mode 100644 index 0000000..a993882 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs @@ -0,0 +1,89 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// Base class for a Cinemachine Virtual Camera extension module. + /// Hooks into the Cinemachine Pipeline. + /// + [DocumentationSorting(23, DocumentationSortingAttribute.Level.API)] + public abstract class CinemachineExtension : MonoBehaviour + { + /// Useful constant for very small floats + protected const float Epsilon = Utility.UnityVectorExtensions.Epsilon; + + /// Get the associated CinemachineVirtualCameraBase + public CinemachineVirtualCameraBase VirtualCamera + { + get + { + if (m_vcamOwner == null) + m_vcamOwner = GetComponent(); + return m_vcamOwner; + } + } + CinemachineVirtualCameraBase m_vcamOwner; + + /// Connect to virtual camera pipeline. + /// Override implementations must call this base implementation + protected virtual void Awake() + { + ConnectToVcam(); + } + + /// Disconnect from virtual camera pipeline. + /// Override implementations must call this base implementation + protected virtual void OnDestroy() + { + if (VirtualCamera != null) + VirtualCamera.RemovePostPipelineStageHook(PostPipelineStageCallback); + } + + void ConnectToVcam() + { + if (VirtualCamera == null) + Debug.LogError("CinemachineExtension requires a Cinemachine Virtual Camera component"); + else + VirtualCamera.AddPostPipelineStageHook(PostPipelineStageCallback); + mExtraState = null; + } + + /// + /// This callback will be called after the virtual camera has implemented + /// each stage in the pipeline. This method may modify the referenced state. + /// If deltaTime less than 0, reset all state info and perform no damping. + /// + protected abstract void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime); + + /// Because extensions can be placed on manager cams and will in that + /// case be called for all the vcam children, vcam-specific state information + /// should be stored here. Just define a class to hold your state info + /// and use it exclusively when calling this. + protected T GetExtraState(ICinemachineCamera vcam) where T : class, new() + { + if (mExtraState == null) + mExtraState = new Dictionary(); + System.Object extra = null; + if (!mExtraState.TryGetValue(vcam, out extra)) + extra = mExtraState[vcam] = new T(); + return extra as T; + } + + /// Ineffeicient method to get all extra state infor for all vcams. + /// Intended for Editor use only, not runtime! + /// + protected List GetAllExtraStates() where T : class, new() + { + var list = new List(); + if (mExtraState != null) + foreach (var v in mExtraState) + list.Add(v.Value as T); + return list; + } + + private Dictionary mExtraState; + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs.meta new file mode 100644 index 0000000..afa0ba2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineExtension.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4fa53a91a43ae1a4bbf6b29961b45c38 +timeCreated: 1504804419 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs new file mode 100644 index 0000000..6254b25 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs @@ -0,0 +1,356 @@ +using UnityEngine; +using Cinemachine.Utility; +using System; + +namespace Cinemachine +{ + /// Abstract base class for a world-space path, + /// suitable for a camera dolly track. + public abstract class CinemachinePathBase : MonoBehaviour + { + /// Path samples per waypoint + [Tooltip("Path samples per waypoint. This is used for calculating path distances.")] + [Range(1, 100)] + public int m_Resolution = 20; + + /// This class holds the settings that control how the path + /// will appear in the editor scene view. The path is not visible in the game view + [DocumentationSorting(18.1f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] public class Appearance + { + [Tooltip("The color of the path itself when it is active in the editor")] + public Color pathColor = Color.green; + [Tooltip("The color of the path itself when it is inactive in the editor")] + public Color inactivePathColor = Color.gray; + [Tooltip("The width of the railroad-tracks that are drawn to represent the path")] + [Range(0f, 10f)] + public float width = 0.2f; + } + /// The settings that control how the path + /// will appear in the editor scene view. + [Tooltip("The settings that control how the path will appear in the editor scene view.")] + public Appearance m_Appearance = new Appearance(); + + /// The minimum value for the path position + public abstract float MinPos { get; } + + /// The maximum value for the path position + public abstract float MaxPos { get; } + + /// True if the path ends are joined to form a continuous loop + public abstract bool Looped { get; } + + /// Get a normalized path position, taking spins into account if looped + /// Position along the path + /// Normalized position, between MinPos and MaxPos + public virtual float NormalizePos(float pos) + { + if (MaxPos == 0) + return 0; + if (Looped) + { + pos = pos % MaxPos; + if (pos < 0) + pos += MaxPos; + return pos; + } + return Mathf.Clamp(pos, 0, MaxPos); + } + + /// Get a worldspace position of a point along the path + /// Postion along the path. Need not be normalized. + /// World-space position of the point along at path at pos + public abstract Vector3 EvaluatePosition(float pos); + + /// Get the tangent of the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space direction of the path tangent. + /// Length of the vector represents the tangent strength + public abstract Vector3 EvaluateTangent(float pos); + + /// Get the orientation the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// World-space orientation of the path + public abstract Quaternion EvaluateOrientation(float pos); + + /// Find the closest point on the path to a given worldspace target point. + /// Performance could be improved by checking the bounding polygon of each segment, + /// and only entering the best segment(s) + /// Worldspace target that we want to approach + /// In what segment of the path to start the search. + /// A Segment is a section of path between 2 waypoints. + /// How many segments on either side of the startSegment + /// to search. -1 means no limit, i.e. search the entire path + /// We search a segment by dividing it into this many + /// straight pieces. The higher the number, the more accurate the result, but performance + /// is proportionally slower for higher numbers + /// The position along the path that is closest to the target point. + /// The value is in Path Units, not Distance units. + public virtual float FindClosestPoint( + Vector3 p, int startSegment, int searchRadius, int stepsPerSegment) + { + float start = MinPos; + float end = MaxPos; + if (searchRadius >= 0) + { + int r = Mathf.FloorToInt(Mathf.Min(searchRadius, (end - start) / 2f)); + start = startSegment - r; + end = startSegment + r + 1; + if (!Looped) + { + start = Mathf.Max(start, MinPos); + end = Mathf.Max(end, MaxPos); + } + } + stepsPerSegment = Mathf.RoundToInt(Mathf.Clamp(stepsPerSegment, 1f, 100f)); + float stepSize = 1f / stepsPerSegment; + float bestPos = startSegment; + float bestDistance = float.MaxValue; + int iterations = (stepsPerSegment == 1) ? 1 : 3; + for (int i = 0; i < iterations; ++i) + { + Vector3 v0 = EvaluatePosition(start); + for (float f = start + stepSize; f <= end; f += stepSize) + { + Vector3 v = EvaluatePosition(f); + float t = p.ClosestPointOnSegment(v0, v); + float d = Vector3.SqrMagnitude(p - Vector3.Lerp(v0, v, t)); + if (d < bestDistance) + { + bestDistance = d; + bestPos = f - (1 - t) * stepSize; + } + v0 = v; + } + start = bestPos - stepSize; + end = bestPos + stepSize; + stepSize /= stepsPerSegment; + } + return bestPos; + } + + /// How to interpret the Path Position + public enum PositionUnits + { + /// Use PathPosition units, where 0 is first waypoint, 1 is second waypoint, etc + PathUnits, + /// Use Distance Along Path. Path will be sampled according to its Resolution + /// setting, and a distance lookup table will be cached internally + Distance + } + + /// Get the minimum value, for the given unity type + /// The uniot type + /// The minimum allowable value for this path + public float MinUnit(PositionUnits units) + { + return units == PositionUnits.Distance ? 0 : MinPos; + } + + /// Get the maximum value, for the given unity type + /// The uniot type + /// The maximum allowable value for this path + public float MaxUnit(PositionUnits units) + { + return units == PositionUnits.Distance ? PathLength : MaxPos; + } + + /// Normalize the unit, so that it lies between MinUmit and MaxUnit + /// The value to be normalized + /// The unit type + /// The normalized value of pos, between MinUnit and MaxUnit + public virtual float NormalizeUnit(float pos, PositionUnits units) + { + if (units == PositionUnits.Distance) + return NormalizePathDistance(pos); + return NormalizePos(pos); + } + + /// Get a worldspace position of a point along the path + /// Postion along the path. Need not be normalized. + /// The unit to use when interpreting the value of pos. + /// World-space position of the point along at path at pos + public Vector3 EvaluatePositionAtUnit(float pos, PositionUnits units) + { + if (units == PositionUnits.Distance) + pos = GetPathPositionFromDistance(pos); + return EvaluatePosition(pos); + } + + /// Get the tangent of the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// The unit to use when interpreting the value of pos. + /// World-space direction of the path tangent. + /// Length of the vector represents the tangent strength + public Vector3 EvaluateTangentAtUnit(float pos, PositionUnits units) + { + if (units == PositionUnits.Distance) + pos = GetPathPositionFromDistance(pos); + return EvaluateTangent(pos); + } + + /// Get the orientation the curve at a point along the path. + /// Postion along the path. Need not be normalized. + /// The unit to use when interpreting the value of pos. + /// World-space orientation of the path + public Quaternion EvaluateOrientationAtUnit(float pos, PositionUnits units) + { + if (units == PositionUnits.Distance) + pos = GetPathPositionFromDistance(pos); + return EvaluateOrientation(pos); + } + + /// When calculating the distance cache, sample the path this many + /// times between points + public abstract int DistanceCacheSampleStepsPerSegment { get; } + + /// Call this if the path changes in such a way as to affect distances + /// or other cached path elements + public virtual void InvalidateDistanceCache() + { + m_DistanceToPos = null; + m_PosToDistance = null; + m_CachedSampleSteps = 0; + m_PathLength = 0; + } + + /// See whether the distance cache is valid. If it's not valid, + /// then any call to GetPathLength() or GetPathPositionFromDistance() will + /// trigger a potentially costly regeneration of the path distance cache + /// The number of steps to take between path points + /// Whether the cache is valid for this sampling rate + public bool DistanceCacheIsValid() + { + return (MaxPos == MinPos) + || (m_DistanceToPos != null && m_PosToDistance != null + && m_CachedSampleSteps == DistanceCacheSampleStepsPerSegment + && m_CachedSampleSteps > 0); + } + + /// Get the length of the path in distance units. + /// If the distance cache is not valid, then calling this will + /// trigger a potentially costly regeneration of the path distance cache + /// The length of the path in distance units, when sampled at this rate + public float PathLength + { + get + { + if (DistanceCacheSampleStepsPerSegment < 1) + return 0; + if (!DistanceCacheIsValid()) + ResamplePath(DistanceCacheSampleStepsPerSegment); + return m_PathLength; + } + } + + /// Normalize a distance along the path based on the path length. + /// If the distance cache is not valid, then calling this will + /// trigger a potentially costly regeneration of the path distance cache + /// The distance to normalize + /// The normalized distance, ranging from 0 to path length + public float NormalizePathDistance(float distance) + { + float length = PathLength; + if (length < Vector3.kEpsilon) + return 0; + if (Looped) + { + distance = distance % length; + if (distance < 0) + distance += length; + } + return Mathf.Clamp(distance, 0, length); + } + + /// Get the path position (in path units) corresponding to this distance along the path. + /// If the distance cache is not valid, then calling this will + /// trigger a potentially costly regeneration of the path distance cache + /// The length of the path in distance units, when sampled at this rate + public float GetPathPositionFromDistance(float distance) + { + if (DistanceCacheSampleStepsPerSegment < 1 || PathLength < UnityVectorExtensions.Epsilon) + return MinPos; + distance = NormalizePathDistance(distance); + float d = distance / m_cachedDistanceStepSize; + int i = Mathf.FloorToInt(d); + if (i >= m_DistanceToPos.Length-1) + return MaxPos; + float t = d - (float)i; + return MinPos + Mathf.Lerp(m_DistanceToPos[i], m_DistanceToPos[i+1], t); + } + + /// Get the path position (in path units) corresponding to this distance along the path. + /// If the distance cache is not valid, then calling this will + /// trigger a potentially costly regeneration of the path distance cache + /// The length of the path in distance units, when sampled at this rate + public float GetPathDistanceFromPosition(float pos) + { + if (DistanceCacheSampleStepsPerSegment < 1 || PathLength < UnityVectorExtensions.Epsilon) + return 0; + pos = NormalizePos(pos); + float d = pos / m_cachedPosStepSize; + int i = Mathf.FloorToInt(d); + if (i >= m_PosToDistance.Length-1) + return m_PathLength; + float t = d - (float)i; + return Mathf.Lerp(m_PosToDistance[i], m_PosToDistance[i+1], t); + } + + private float[] m_DistanceToPos; + private float[] m_PosToDistance; + private int m_CachedSampleSteps; + private float m_PathLength; + private float m_cachedPosStepSize; + private float m_cachedDistanceStepSize; + + private void ResamplePath(int stepsPerSegment) + { + InvalidateDistanceCache(); + + float minPos = MinPos; + float maxPos = MaxPos; + float stepSize = 1f / Mathf.Max(1, stepsPerSegment); + + // Sample the positions + int numKeys = Mathf.RoundToInt((maxPos - minPos) / stepSize) + 1; + m_PosToDistance = new float[numKeys]; + m_CachedSampleSteps = stepsPerSegment; + m_cachedPosStepSize = stepSize; + + Vector3 p0 = EvaluatePosition(0); + m_PosToDistance[0] = 0; + float pos = minPos; + for (int i = 1; i < numKeys; ++i) + { + pos += stepSize; + Vector3 p = EvaluatePosition(pos); + float d = Vector3.Distance(p0, p); + m_PathLength += d; + p0 = p; + m_PosToDistance[i] = m_PathLength; + } + + // Resample the distances + m_DistanceToPos = new float[numKeys]; + m_DistanceToPos[0] = 0; + if (numKeys > 1) + { + stepSize = m_PathLength / (numKeys - 1); + m_cachedDistanceStepSize = stepSize; + float distance = 0; + int posIndex = 1; + for (int i = 1; i < numKeys; ++i) + { + distance += stepSize; + float d = m_PosToDistance[posIndex]; + while (d < distance && posIndex < numKeys-1) + d = m_PosToDistance[++posIndex]; + float d0 = m_PosToDistance[posIndex-1]; + float delta = d - d0; + float t = (distance - d0) / delta; + m_DistanceToPos[i] = m_cachedPosStepSize * (t + posIndex - 1); + } + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs.meta new file mode 100644 index 0000000..42afc1c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePathBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a73149a4b6c41d741bc5e4e3b7711c0d +timeCreated: 1494359378 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs new file mode 100644 index 0000000..3d64092 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs @@ -0,0 +1,70 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// Property applied to LensSettings. Used for custom drawing in the inspector. + /// + public sealed class LensSettingsPropertyAttribute : PropertyAttribute + { + } + + /// + /// Property applied to CinemachineBlendDefinition. Used for custom drawing in the inspector. + /// + public sealed class CinemachineBlendDefinitionPropertyAttribute : PropertyAttribute + { + } + + /// + /// Invoke play-mode-save for a class. This class's fields will be scanned + /// upon exiting play mode, and its property values will be applied to the scene object. + /// This is a stopgap measure that will become obsolete once Unity implements + /// play-mode-save in a more general way. + /// + public sealed class SaveDuringPlayAttribute : System.Attribute + { + } + + /// + /// Suppresses play-mode-save for a field. Use it if the calsee has [SaveDuringPlay] + /// attribute but there are fields in the class that shouldn't be saved. + /// + public sealed class NoSaveDuringPlayAttribute : PropertyAttribute + { + } + + /// Property field is a Tag. + public sealed class TagFieldAttribute : PropertyAttribute + { + } + + /// + /// Atrtribute to control the automatic generation of documentation. + /// + [DocumentationSorting(0f, DocumentationSortingAttribute.Level.Undoc)] + public sealed class DocumentationSortingAttribute : System.Attribute + { + /// Refinement level of the documentation + public enum Level + { + /// Type is excluded from documentation + Undoc, + /// Type is documented in the API reference + API, + /// Type is documented in the highly-refined User Manual + UserRef + }; + /// Where this type appears in the manual. Smaller number sort earlier. + public float SortOrder { get; private set; } + /// Refinement level of the documentation. The more refined, the more is excluded. + public Level Category { get; private set; } + + /// Contructor with specific values + public DocumentationSortingAttribute(float sortOrder, Level category) + { + SortOrder = sortOrder; + Category = category; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs.meta new file mode 100644 index 0000000..0198cbb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachinePropertyAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2c760cb7073c57e44959f36cbed8ed39 +timeCreated: 1486510400 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs new file mode 100644 index 0000000..fb42885 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs @@ -0,0 +1,360 @@ +using System; +using UnityEngine; + +namespace Cinemachine +{ + /// + /// Base class for a Monobehaviour that represents a Virtual Camera within the Unity scene. + /// + /// This is intended to be attached to an empty Transform GameObject. + /// Inherited classes can be either standalone virtual cameras such + /// as CinemachineVirtualCamera, or meta-cameras such as + /// CinemachineClearShot or CinemachineFreeLook. + /// + /// A CinemachineVirtualCameraBase exposes a Priority property. When the behaviour is + /// enabled in the game, the Virtual Camera is automatically placed in a queue + /// maintained by the static CinemachineCore singleton. + /// The queue is sorted by priority. When a Unity camera is equipped with a + /// CinemachineBrain behaviour, the brain will choose the camera + /// at the head of the queue. If you have multiple Unity cameras with CinemachineBrain + /// behaviours (say in a split-screen context), then you can filter the queue by + /// setting the culling flags on the virtual cameras. The culling mask of the + /// Unity Camera will then act as a filter for the brain. Apart from this, + /// there is nothing that prevents a virtual camera from controlling multiple + /// Unity cameras simultaneously. + /// + [SaveDuringPlay] + public abstract class CinemachineVirtualCameraBase : MonoBehaviour, ICinemachineCamera + { + /// This is deprecated. It is here to support the soon-to-be-removed + /// Cinemachine Debugger in the Editor. + [HideInInspector, NoSaveDuringPlay] + public Action CinemachineGUIDebuggerCallback = null; + + /// Inspector control - Use for hiding sections of the Inspector UI. + [HideInInspector, SerializeField, NoSaveDuringPlay] + public string[] m_ExcludedPropertiesInInspector = new string[] { "m_Script" }; + + /// Inspector control - Use for enabling sections of the Inspector UI. + [HideInInspector, SerializeField, NoSaveDuringPlay] + public CinemachineCore.Stage[] m_LockStageInInspector; + + /// Version that was last streamed, for upgrading legacy + public int ValidatingStreamVersion + { + get { return m_OnValidateCalled ? m_ValidatingStreamVersion : CinemachineCore.kStreamingVersion; } + private set { m_ValidatingStreamVersion = value; } + } + private int m_ValidatingStreamVersion = 0; + private bool m_OnValidateCalled = false; + + [HideInInspector, SerializeField, NoSaveDuringPlay] + private int m_StreamingVersion; + + /// The priority will determine which camera becomes active based on the + /// state of other cameras and this camera. Higher numbers have greater priority. + /// + [NoSaveDuringPlay] + [Tooltip("The priority will determine which camera becomes active based on the state of other cameras and this camera. Higher numbers have greater priority.")] + public int m_Priority = 10; + + /// + /// A delegate to hook into the state calculation pipeline. + /// This will be called after each pipeline stage, to allow others to hook into the pipeline. + /// See CinemachineCore.Stage. + /// + /// The delegate to call. + public virtual void AddPostPipelineStageHook(OnPostPipelineStageDelegate d) + { + OnPostPipelineStage -= d; + OnPostPipelineStage += d; + } + + /// Remove a Pipeline stage hook callback. + /// The delegate to remove. + public virtual void RemovePostPipelineStageHook(OnPostPipelineStageDelegate d) + { + OnPostPipelineStage -= d; + } + + /// + /// A delegate to hook into the state calculation pipeline. + /// This will be called after each pipeline stage, to allow other + /// services to hook into the pipeline. + /// See CinemachineCore.Stage. + /// + /// Parameters: + /// + /// * CinemachineVirtualCameraBase vcam: the virtual camera being updated + /// * CinemachineCore.Stage stage: what stage in the pipeline has just been updated + /// * ref CameraState newState: the current state of the vcam + /// * float deltaTime: the frame timestep. Less than 0 means "don't consider the previous frame" + /// + public delegate void OnPostPipelineStageDelegate( + CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, + ref CameraState newState, float deltaTime); + + /// + /// A delegate to hook into the state calculation pipeline. + /// Implementaion must be sure to call this after each pipeline stage, to allow + /// other services to hook into the pipeline. + /// See CinemachineCore.Stage. + /// + protected OnPostPipelineStageDelegate OnPostPipelineStage; + + /// + /// Invokes the PostPipelineStageDelegate for this camera, and up the hierarchy for all + /// parent cameras (if any). + /// + protected void InvokePostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, + ref CameraState newState, float deltaTime) + { + if (OnPostPipelineStage != null) + OnPostPipelineStage(vcam, stage, ref newState, deltaTime); + CinemachineVirtualCameraBase parent = ParentCamera as CinemachineVirtualCameraBase; + if (parent != null) + parent.InvokePostPipelineStageCallback(vcam, stage, ref newState, deltaTime); + } + + /// Get the name of the Virtual Camera. Base implementation + /// returns the owner GameObject's name. + public string Name { get { return name; } } + + /// Gets a brief debug description of this virtual camera, for use when displayiong debug info + public virtual string Description { get { return ""; }} + + /// Get the Priority of the virtual camera. This determines its placement + /// in the CinemachineCore's queue of eligible shots. + public int Priority { get { return m_Priority; } set { m_Priority = value; } } + + /// The GameObject owner of the Virtual Camera behaviour. + public GameObject VirtualCameraGameObject + { + get + { + if (this == null) + return null; // object deleted + return gameObject; + } + } + + /// The CameraState object holds all of the information + /// necessary to position the Unity camera. It is the output of this class. + public abstract CameraState State { get; } + + /// Just returns self. + public virtual ICinemachineCamera LiveChildOrSelf { get { return this; } } + + /// Support for meta-virtual-cameras. This is the situation where a + /// virtual camera is in fact the public face of a private army of virtual cameras, which + /// it manages on its own. This method gets the VirtualCamera owner, if any. + /// Private armies are implemented as Transform children of the parent vcam. + public ICinemachineCamera ParentCamera + { + get + { + if (!mSlaveStatusUpdated || !Application.isPlaying) + UpdateSlaveStatus(); + return m_parentVcam; + } + } + + /// Check whether the vcam a live child of this camera. + /// This base class implementation always returns false. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + public virtual bool IsLiveChild(ICinemachineCamera vcam) { return false; } + + /// Get the LookAt target for the Aim component in the CinemachinePipeline. + public abstract Transform LookAt { get; set; } + + /// Get the Follow target for the Body component in the CinemachinePipeline. + public abstract Transform Follow { get; set; } + + /// Set this to force the next update to ignore deltaTime and reset itself + public bool PreviousStateIsValid + { + get + { + if (LookAt != m_previousLookAtTarget) + { + m_previousLookAtTarget = LookAt; + m_previousStateIsValid = false; + } + if (Follow != m_previousFollowTarget) + { + m_previousFollowTarget = Follow; + m_previousStateIsValid = false; + } + return m_previousStateIsValid; + } + set + { + m_previousStateIsValid = value; + } + } + private bool m_previousStateIsValid; + private Transform m_previousLookAtTarget; + private Transform m_previousFollowTarget; + + + /// Called by CinemachineCore at designated update time + /// so the vcam can position itself and track its targets. + /// Do not call this method. Let the framework do it at the appropriate time + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + public abstract void UpdateCameraState(Vector3 worldUp, float deltaTime); + + /// Notification that this virtual camera is going live. + /// Base class implementationmust be called by any overridden method. + /// The camera being deactivated. May be null. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than or equal to 0) + public virtual void OnTransitionFromCamera( + ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime) + { + if (!gameObject.activeInHierarchy) + PreviousStateIsValid = false; + } + + /// Base class implementation does nothing. + protected virtual void Start() + { + } + + /// Base class implementation removes the virtual camera from the priority queue. + protected virtual void OnDestroy() + { + CinemachineCore.Instance.RemoveActiveCamera(this); + } + + /// Enforce bounds for fields, when changed in inspector. + /// Call base class implementation at the beginning of overridden method. + /// After base method is called, ValidatingStreamVersion will be valid. + protected virtual void OnValidate() + { + m_OnValidateCalled = true; + ValidatingStreamVersion = m_StreamingVersion; + m_StreamingVersion = CinemachineCore.kStreamingVersion; + } + + /// Base class implementation adds the virtual camera from the priority queue. + protected virtual void OnEnable() + { + // Sanity check - if another vcam component is enabled, shut down + var vcamComponents = GetComponents(); + for (int i = 0; i < vcamComponents.Length; ++i) + { + if (vcamComponents[i].enabled && vcamComponents[i] != this) + { + Debug.LogError(Name + + " has multiple CinemachineVirtualCameraBase-derived components. Disabling " + + GetType().Name + "."); + enabled = false; + } + } + UpdateSlaveStatus(); + UpdateVcamPoolStatus(); // Add to queue + PreviousStateIsValid = false; + } + + /// Base class implementation makes sure the priority queue remains up-to-date. + protected virtual void OnDisable() + { + UpdateVcamPoolStatus(); // Remove from queue + } + + /// Base class implementation makes sure the priority queue remains up-to-date. + protected virtual void Update() + { + if (m_Priority != m_QueuePriority) + UpdateVcamPoolStatus(); + } + + /// Base class implementation makes sure the priority queue remains up-to-date. + protected virtual void OnTransformParentChanged() + { + UpdateSlaveStatus(); + UpdateVcamPoolStatus(); + } + +#if UNITY_EDITOR + /// Support for the deprecated CinemachineDebugger. + protected virtual void OnGUI() + { + if (CinemachineGUIDebuggerCallback != null) + CinemachineGUIDebuggerCallback(); + } +#endif + private bool mSlaveStatusUpdated = false; + private CinemachineVirtualCameraBase m_parentVcam = null; + + private void UpdateSlaveStatus() + { + mSlaveStatusUpdated = true; + m_parentVcam = null; + Transform p = transform.parent; + if (p != null) + m_parentVcam = p.GetComponent(); + } + + /// Returns this vcam's LookAt target, or if that is null, will retrun + /// the parent vcam's LookAt target. + /// This vcam's LookAt value. + /// The same value, or the parent's if null and a parent exists. + protected Transform ResolveLookAt(Transform localLookAt) + { + Transform lookAt = localLookAt; + if (lookAt == null && ParentCamera != null) + lookAt = ParentCamera.LookAt; // Parent provides default + return lookAt; + } + + /// Returns this vcam's Follow target, or if that is null, will retrun + /// the parent vcam's Follow target. + /// This vcam's Follow value. + /// The same value, or the parent's if null and a parent exists. + protected Transform ResolveFollow(Transform localFollow) + { + Transform follow = localFollow; + if (follow == null && ParentCamera != null) + follow = ParentCamera.Follow; // Parent provides default + return follow; + } + + private int m_QueuePriority = int.MaxValue; + private void UpdateVcamPoolStatus() + { + m_QueuePriority = int.MaxValue; + CinemachineCore.Instance.RemoveActiveCamera(this); + CinemachineCore.Instance.RemoveChildCamera(this); + if (m_parentVcam == null) + { + if (isActiveAndEnabled) + { + CinemachineCore.Instance.AddActiveCamera(this); + m_QueuePriority = m_Priority; + } + } + else + { + if (isActiveAndEnabled) + CinemachineCore.Instance.AddChildCamera(this); + } + } + + /// When multiple virtual cameras have the highest priority, there is + /// sometimes the need to push one to the top, making it the current Live camera if + /// it shares the highest priority in the queue with its peers. + /// + /// This happens automatically when a + /// new vcam is enabled: the most recent one goes to the top of the priority subqueue. + /// Use this method to push a vcam to the top of its priority peers. + /// If it and its peers share the highest priority, then this vcam will become Live. + public void MoveToTopOfPrioritySubqueue() + { + UpdateVcamPoolStatus(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs.meta new file mode 100644 index 0000000..61fced5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/CinemachineVirtualCameraBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 15ebf04de67923d41a36c21e1fc63718 +timeCreated: 1488314898 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs new file mode 100644 index 0000000..8a1e5f7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs @@ -0,0 +1,140 @@ +using System; +using UnityEngine; + +namespace Cinemachine.Utility +{ + internal abstract class GaussianWindow1d + { + protected T[] mData; + protected float[] mKernel; + protected float mKernelSum; + protected int mCurrentPos; + + public float Sigma { get; private set; } // Filter strength: bigger numbers are stronger. 0.5 is minimal. + public int KernelSize { get { return mKernel.Length; } } + + void GenerateKernel(float sigma, int maxKernelRadius) + { + // Weight is close to 0 at a distance of sigma*3, so let's just cut it off a little early + int kernelRadius = Math.Min(maxKernelRadius, Mathf.FloorToInt(Mathf.Abs(sigma) * 2.5f)); + mKernel = new float[2 * kernelRadius + 1]; + mKernelSum = 0; + if (kernelRadius == 0) + mKernelSum = mKernel[0] = 1; + else for (int i = -kernelRadius; i <= kernelRadius; ++i) + { + mKernel[i + kernelRadius] + = (float)(Math.Exp(-(i * i) / (2 * sigma * sigma)) / Math.Sqrt(2.0 * Math.PI * sigma)); + mKernelSum += mKernel[i + kernelRadius]; + } + Sigma = sigma; + } + + protected abstract T Compute(int windowPos); + + public GaussianWindow1d(float sigma, int maxKernelRadius = 10) + { + GenerateKernel(sigma, maxKernelRadius); + mCurrentPos = 0; + } + + public void Reset() { mData = null; } + + public bool IsEmpty() { return mData == null; } + + public void AddValue(T v) + { + if (mData == null) + { + mData = new T[KernelSize]; + for (int i = 0; i < KernelSize; ++i) + mData[i] = v; + mCurrentPos = Mathf.Min(1, KernelSize-1); + } + mData[mCurrentPos] = v; + if (++mCurrentPos == KernelSize) + mCurrentPos = 0; + } + + public T Filter(T v) + { + if (KernelSize < 3) + return v; + AddValue(v); + return Value(); + } + + /// Returned value will be kernelRadius old + public T Value() { return Compute(mCurrentPos); } + } + + internal class GaussianWindow1D_Vector3 : GaussianWindow1d + { + public GaussianWindow1D_Vector3(float sigma, int maxKernelRadius = 10) + : base(sigma, maxKernelRadius) {} + + protected override Vector3 Compute(int windowPos) + { + Vector3 sum = Vector3.zero; + for (int i = 0; i < KernelSize; ++i) + { + sum += mData[windowPos] * mKernel[i]; + if (++windowPos == KernelSize) + windowPos = 0; + } + return sum / mKernelSum; + } + } + + internal class GaussianWindow1D_Quaternion : GaussianWindow1d + { + public GaussianWindow1D_Quaternion(float sigma, int maxKernelRadius = 10) + : base(sigma, maxKernelRadius) {} + protected override Quaternion Compute(int windowPos) + { + Quaternion sum = new Quaternion(0, 0, 0, 0); + Quaternion q = mData[mCurrentPos]; + Quaternion qInverse = Quaternion.Inverse(q); + for (int i = 0; i < KernelSize; ++i) + { + // Make sure the quaternion is in the same hemisphere, or averaging won't work + float scale = mKernel[i]; + Quaternion q2 = qInverse * mData[windowPos]; + if (Quaternion.Dot(Quaternion.identity, q2) < 0) + scale = -scale; + sum.x += q2.x * scale; + sum.y += q2.y * scale; + sum.z += q2.z * scale; + sum.w += q2.w * scale; + + if (++windowPos == KernelSize) + windowPos = 0; + } + return q * sum; + } + } + + internal class GaussianWindow1D_CameraRotation : GaussianWindow1d + { + public GaussianWindow1D_CameraRotation(float sigma, int maxKernelRadius = 10) + : base(sigma, maxKernelRadius) {} + + protected override Vector2 Compute(int windowPos) + { + Vector2 sum = Vector2.zero; + Vector2 v = mData[mCurrentPos]; + for (int i = 0; i < KernelSize; ++i) + { + Vector2 v2 = mData[windowPos] - v; + if (v2.y > 180f) + v2.y -= 360f; + if (v2.y < -180f) + v2.y += 360f; + sum += v2 * mKernel[i]; + if (++windowPos == KernelSize) + windowPos = 0; + } + return v + (sum / mKernelSum); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs.meta new file mode 100644 index 0000000..cd35138 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/GaussianFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 68839a4bf8790cd449d4043f5efb5aec +timeCreated: 1490719908 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs new file mode 100644 index 0000000..82e7af5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs @@ -0,0 +1,81 @@ +using UnityEngine; + +namespace Cinemachine +{ + /// + /// An abstract representation of a virtual camera which lives within the Unity scene + /// + public interface ICinemachineCamera + { + /// + /// Gets the name of this virtual camera. For use when deciding how to blend + /// to or from this camera + /// + string Name { get; } + + /// + /// Gets a brief debug description of this virtual camera, for use when displayiong debug info + /// + string Description { get; } + + /// + /// Gets the priority of this ICinemachineCamera. The virtual camera + /// will be inserted into the global priority stack based on this value. + /// + int Priority { get; set; } + + /// + /// The thing the camera wants to look at (aim). May be null. + /// + Transform LookAt { get; set; } + + /// + /// The thing the camera wants to follow (moving camera). May be null. + /// + Transform Follow { get; set; } + + /// + /// Camera state at the current time. + /// + CameraState State { get; } + + /// + /// Gets the virtual camera game attached to this class. + /// + GameObject VirtualCameraGameObject { get; } + + /// For cameras that implement child cameras, return the live child, + /// otherwise, just returns self. + ICinemachineCamera LiveChildOrSelf { get; } + + /// + /// For cameras that implement child cameras, returns the parent vcam, otherwise null. + /// + ICinemachineCamera ParentCamera { get; } + + /// Check whether the vcam is a live child of this camera. + /// The Virtual Camera to check + /// True if the vcam is currently actively influencing the state of this vcam + bool IsLiveChild(ICinemachineCamera vcam); + + /// + /// Updates this Cinemachine Camera. For an active camera this should be + /// called once and only once each frame. To guarantee this, you should never + /// call this method directly. Always use + /// CinemachineCore.UpdateVirtualCamera(ICinemachineCamera, float), which + /// has protection against multiple calls per frame. + /// + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + void UpdateCameraState(Vector3 worldUp, float deltaTime); + + /// + /// Notification that a new camera is being activated. This is sent to the + /// currently active camera. Both may be active simultaneously for a while, if blending. + /// + /// The camera being deactivated. May be null. + /// Default world Up, set by the CinemachineBrain + /// Delta time for time-based effects (ignore if less than 0) + void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime); + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs.meta new file mode 100644 index 0000000..860b3a7 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2643ac9881a89594a80c242b565b34ec +timeCreated: 1484407000 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs new file mode 100644 index 0000000..d9249fd --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs @@ -0,0 +1,3 @@ +// This file is intentionally blank. +// If you were implementing ICinemachineComponent interface, please refactor to +// inherit from CinemachineComponentBase instead. diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs.meta new file mode 100644 index 0000000..8e86dd9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ICinemachineComponent.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9a53087ba28aaf145a184ea363108831 +timeCreated: 1510078351 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs new file mode 100644 index 0000000..c0686a6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs @@ -0,0 +1,137 @@ +using UnityEngine; +using System; + +namespace Cinemachine +{ + /// + /// Describes the FOV and clip planes for a camera. This generally mirrors the Unity Camera's + /// lens settings, and will be used to drive the Unity camera when the vcam is active. + /// + [Serializable] + [DocumentationSorting(2, DocumentationSortingAttribute.Level.UserRef)] + public struct LensSettings + { + /// Default Lens Settings + public static LensSettings Default = new LensSettings(40f, 10, 0.1f, 5000f, 0, false, 1); + + /// + /// This is the camera view in vertical degrees. For cinematic people, a 50mm lens + /// on a super-35mm sensor would equal a 19.6 degree FOV + /// + [Range(1f, 179f)] + [Tooltip("This is the camera view in vertical degrees. For cinematic people, a 50mm lens on a super-35mm sensor would equal a 19.6 degree FOV")] + public float FieldOfView; + + /// + /// When using an orthographic camera, this defines the height, in world + /// co-ordinates, of the camera view. + /// + [Tooltip("When using an orthographic camera, this defines the half-height, in world coordinates, of the camera view.")] + public float OrthographicSize; + + /// + /// The near clip plane for this LensSettings + /// + [Tooltip("This defines the near region in the renderable range of the camera frustum. Raising this value will stop the game from drawing things near the camera, which can sometimes come in handy. Larger values will also increase your shadow resolution.")] + public float NearClipPlane; + + /// + /// The far clip plane for this LensSettings + /// + [Tooltip("This defines the far region of the renderable range of the camera frustum. Typically you want to set this value as low as possible without cutting off desired distant objects")] + public float FarClipPlane; + + /// + /// The dutch (tilt) to be applied to the camera. In degrees + /// + [Range(-180f, 180f)] + [Tooltip("Camera Z roll, or tilt, in degrees.")] + public float Dutch; + + /// + /// This is set every frame by the virtual camera, based on the value found in the + /// currently associated Unity camera + /// + internal bool Orthographic { get; set; } + + /// + /// This is set every frame by the virtual camera, based on the value + /// found in the currently associated Unity camera + /// + internal float Aspect { get; set; } + + /// + /// Creates a new LensSettings, copying the values from the + /// supplied Camera + /// + /// The Camera from which the FoV, near + /// and far clip planes will be copied. + public static LensSettings FromCamera(Camera fromCamera) + { + LensSettings lens = Default; + if (fromCamera != null) + { + lens.FieldOfView = fromCamera.fieldOfView; + lens.OrthographicSize = fromCamera.orthographicSize; + lens.NearClipPlane = fromCamera.nearClipPlane; + lens.FarClipPlane = fromCamera.farClipPlane; + lens.Orthographic = fromCamera.orthographic; + lens.Aspect = fromCamera.aspect; + } + return lens; + } + + /// + /// Explicit constructor for this LensSettings + /// + /// The Vertical field of view + /// If orthographic, this is the half-height of the screen + /// The near clip plane + /// The far clip plane + /// Camera roll, in degrees. This is applied at the end + /// Whether the lens is orthographic + /// The aspect ratio of the lens Width/height + /// after shot composition. + public LensSettings( + float fov, float orthographicSize, + float nearClip, float farClip, float dutch, + bool ortho, float aspect) : this() + { + FieldOfView = fov; + OrthographicSize = orthographicSize; + NearClipPlane = nearClip; + FarClipPlane = farClip; + Dutch = dutch; + Orthographic = ortho; + Aspect = aspect; + } + + /// + /// Linearly blends the fields of two LensSettings and returns the result + /// + /// The LensSettings to blend from + /// The LensSettings to blend to + /// The interpolation value. Internally clamped to the range [0,1] + /// Interpolated settings + public static LensSettings Lerp(LensSettings lensA, LensSettings lensB, float t) + { + t = Mathf.Clamp01(t); + LensSettings blendedLens = new LensSettings(); + blendedLens.FarClipPlane = Mathf.Lerp(lensA.FarClipPlane, lensB.FarClipPlane, t); + blendedLens.NearClipPlane = Mathf.Lerp(lensA.NearClipPlane, lensB.NearClipPlane, t); + blendedLens.FieldOfView = Mathf.Lerp(lensA.FieldOfView, lensB.FieldOfView, t); + blendedLens.OrthographicSize = Mathf.Lerp(lensA.OrthographicSize, lensB.OrthographicSize, t); + blendedLens.Dutch = Mathf.Lerp(lensA.Dutch, lensB.Dutch, t); + blendedLens.Aspect = Mathf.Lerp(lensA.Aspect, lensB.Aspect, t); + blendedLens.Orthographic = lensA.Orthographic && lensB.Orthographic; + return blendedLens; + } + + /// Make sure lens settings are sane. Call this from OnValidate(). + public void Validate() + { + NearClipPlane = Mathf.Max(NearClipPlane, 0.01f); + FarClipPlane = Mathf.Max(FarClipPlane, NearClipPlane + 0.01f); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs.meta new file mode 100644 index 0000000..9e018da --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/LensSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5778d22ca832d9f47b5e73a8c5fe78a2 +timeCreated: 1481654955 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs new file mode 100644 index 0000000..424d809 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs @@ -0,0 +1,82 @@ +using UnityEngine; +using System; + +namespace Cinemachine +{ + /// + /// This is an asset that defines a noise profile. A noise profile is the + /// shape of the noise as a function of time. You can build arbitrarily complex shapes by + /// combining different base perlin noise frequencies at different amplitudes. + /// + /// The frequencies and amplitudes should be chosen with care, to ensure an interesting + /// noise quality that is not obviously repetitive. + /// + /// As a mathematical side-note, any arbitrary periodic curve can be broken down into a + /// series of fixed-amplitude sine-waves added together. This is called fourier decomposition, + /// and is the basis of much signal processing. It doesn't really have much to do with this + /// asset, but it's super interesting! + /// + [DocumentationSorting(9, DocumentationSortingAttribute.Level.UserRef)] + public sealed class NoiseSettings : ScriptableObject + { + /// + /// Describes the behaviour for a channel of noise + /// + [DocumentationSorting(9.1f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct NoiseParams + { + /// The amplitude of the noise for this channel. Larger numbers vibrate higher + [Tooltip("The amplitude of the noise for this channel. Larger numbers vibrate higher.")] + public float Amplitude; + /// The frequency of noise for this channel. Higher magnitudes vibrate faster + [Tooltip("The frequency of noise for this channel. Higher magnitudes vibrate faster.")] + public float Frequency; + } + + /// + /// Contains the behaviour of noise for the noise module for all 3 cardinal axes of the camera + /// + [DocumentationSorting(9.2f, DocumentationSortingAttribute.Level.UserRef)] + [Serializable] + public struct TransformNoiseParams + { + /// Noise definition for X-axis + [Tooltip("Noise definition for X-axis")] + public NoiseParams X; + /// Noise definition for Y-axis + [Tooltip("Noise definition for Y-axis")] + public NoiseParams Y; + /// Noise definition for Z-axis + [Tooltip("Noise definition for Z-axis")] + public NoiseParams Z; + } + + [SerializeField] + [Tooltip("These are the noise channels for the virtual camera's position. Convincing noise setups typically mix low, medium and high frequencies together, so start with a size of 3")] + private TransformNoiseParams[] m_Position = new TransformNoiseParams[0]; + + /// + /// Gets the array of positional noise channels for this NoiseSettings + /// + public TransformNoiseParams[] PositionNoise { get { return m_Position; } } + + [SerializeField] + [Tooltip("These are the noise channels for the virtual camera's orientation. Convincing noise setups typically mix low, medium and high frequencies together, so start with a size of 3")] + private TransformNoiseParams[] m_Orientation = new TransformNoiseParams[0]; + + /// + /// Gets the array of orientation noise channels for this NoiseSettings + /// + public TransformNoiseParams[] OrientationNoise { get { return m_Orientation; } } + + /// Clones the contents of the other asset into this one + public void CopyFrom(NoiseSettings other) + { + m_Position = new TransformNoiseParams[other.m_Position.Length]; + other.m_Position.CopyTo(m_Position, 0); + m_Orientation = new TransformNoiseParams[other.m_Orientation.Length]; + other.m_Orientation.CopyTo(m_Orientation, 0); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs.meta new file mode 100644 index 0000000..ce5d9cb --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/NoiseSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b7f59e54f2bfd184b9dd451a678d089b +timeCreated: 1481654957 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs new file mode 100644 index 0000000..8b5c898 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Cinemachine.Utility +{ + internal class PositionPredictor + { + Vector3 m_Position; + + const float kSmoothingDefault = 10; + float mSmoothing = kSmoothingDefault; + public float Smoothing + { + get { return mSmoothing; } + set + { + if (value != mSmoothing) + { + mSmoothing = value; + int maxRadius = Mathf.Max(10, Mathf.FloorToInt(value * 1.5f)); + m_Velocity = new GaussianWindow1D_Vector3(mSmoothing, maxRadius); + m_Accel = new GaussianWindow1D_Vector3(mSmoothing, maxRadius); + } + } + } + + GaussianWindow1D_Vector3 m_Velocity = new GaussianWindow1D_Vector3(kSmoothingDefault); + GaussianWindow1D_Vector3 m_Accel = new GaussianWindow1D_Vector3(kSmoothingDefault); + + public bool IsEmpty { get { return m_Velocity.IsEmpty(); } } + + public void Reset() + { + m_Velocity.Reset(); + m_Accel.Reset(); + } + + public void AddPosition(Vector3 pos) + { + if (IsEmpty) + m_Velocity.AddValue(Vector3.zero); + else + { + Vector3 vel = m_Velocity.Value(); + Vector3 vel2 = (pos - m_Position) / Time.deltaTime; + m_Velocity.AddValue(vel2); + m_Accel.AddValue(vel2 - vel); + } + m_Position = pos; + } + + public Vector3 PredictPosition(float lookaheadTime) + { + int numSteps = Mathf.Min(Mathf.RoundToInt(lookaheadTime / Time.deltaTime), 6); + float dt = lookaheadTime / numSteps; + Vector3 pos = m_Position; + Vector3 vel = m_Velocity.IsEmpty() ? Vector3.zero : m_Velocity.Value(); + Vector3 accel = m_Accel.IsEmpty() ? Vector3.zero : m_Accel.Value(); + for (int i = 0; i < numSteps; ++i) + { + pos += vel * dt; + Vector3 vel2 = vel + (accel * dt); + accel = Quaternion.FromToRotation(vel, vel2) * accel; + vel = vel2; + } + return pos; + } + } + + /// Utility to perform realistic damping of float or Vector3 values. + /// The algorithm is based on exponentially decaying the delta until only + /// a negligible amount remains. + public static class Damper + { + const float Epsilon = UnityVectorExtensions.Epsilon; + + // Get the decay constant that would leave a given residual after a given time + static float DecayConstant(float time, float residual) + { + return Mathf.Log(1f / residual) / time; + } + + // Exponential decay: decay a given quantity opver a period of time + static float Decay(float initial, float decayConstant, float deltaTime) + { + return initial / Mathf.Exp(decayConstant * deltaTime); + } + + /// Standard residual + public const float kNegligibleResidual = 0.01f; + + /// Get a damped version of a quantity. This is the portion of the + /// quantity that will take effect over the given time. + /// The amount that will be damped + /// The rate of damping. This is the time it would + /// take to reduce the original amount to a negligible percentage + /// The time over which to damp + /// The damped amount. This will be the original amount scaled by + /// a value between 0 and 1. + public static float Damp(float initial, float dampTime, float deltaTime) + { + if (dampTime < Epsilon || Mathf.Abs(initial) < Epsilon) + return initial; + if (deltaTime < Epsilon) + return 0; + return initial - Decay( + initial, DecayConstant(dampTime, kNegligibleResidual), deltaTime); + } + + /// Get a damped version of a quantity. This is the portion of the + /// quantity that will take effect over the given time. + /// The amount that will be damped + /// The rate of damping. This is the time it would + /// take to reduce the original amount to a negligible percentage + /// The time over which to damp + /// The damped amount. This will be the original amount scaled by + /// a value between 0 and 1. + public static Vector3 Damp(Vector3 initial, Vector3 dampTime, float deltaTime) + { + for (int i = 0; i < 3; ++i) + initial[i] = Damp(initial[i], dampTime[i], deltaTime); + return initial; + } + + /// Get a damped version of a quantity. This is the portion of the + /// quantity that will take effect over the given time. + /// The amount that will be damped + /// The rate of damping. This is the time it would + /// take to reduce the original amount to a negligible percentage + /// The time over which to damp + /// The damped amount. This will be the original amount scaled by + /// a value between 0 and 1. + public static Vector3 Damp(Vector3 initial, float dampTime, float deltaTime) + { + for (int i = 0; i < 3; ++i) + initial[i] = Damp(initial[i], dampTime, deltaTime); + return initial; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs.meta new file mode 100644 index 0000000..ddbc47d --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/Predictor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6cef82e891a45884fb2b70604b0f8c29 +timeCreated: 1505225008 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs new file mode 100644 index 0000000..ca7a3e0 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; + +namespace Cinemachine.Utility +{ + /// An ad-hoc collection of helpers for reflection, used by Cinemachine + /// or its editor tools in various places + [DocumentationSorting(0, DocumentationSortingAttribute.Level.Undoc)] + public static class ReflectionHelpers + { + /// Copy the fields from one object to another + /// The source object to copy from + /// The destination object to copy to + /// The mask to filter the attributes. + /// Only those fields that get caught in the filter will be copied + public static void CopyFields( + Object src, Object dst, + BindingFlags bindingAttr = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) + { + if (src != null && dst != null) + { + Type type = src.GetType(); + FieldInfo[] fields = type.GetFields(bindingAttr); + for (int i = 0; i < fields.Length; ++i) + if (!fields[i].IsStatic) + fields[i].SetValue(dst, fields[i].GetValue(src)); + } + } + +#if UNITY_EDITOR + /// Search the assembly for all types that match a predicate + /// The assembly to search + /// The type to look for + /// A list of types found in the assembly that inherit from the predicate + public static IEnumerable GetTypesInAssembly( + Assembly assembly, Predicate predicate) + { + if (assembly == null) + return null; + + Type[] types = new Type[0]; + try + { + types = assembly.GetTypes(); + } + catch (Exception) + { + // Can't load the types in this assembly + } + types = (from t in types + where t != null && predicate(t) + select t).ToArray(); + return types; + } + + /// Get a type from a name + /// The name of the type to search for + /// The type matching the name, or null if not found + public static Type GetTypeInAllLoadedAssemblies(string typeName) + { + foreach (Type type in GetTypesInAllLoadedAssemblies(t => t.Name == typeName)) + return type; + return null; + } + + /// Search all assemblies for all types that match a predicate + /// The type to look for + /// A list of types found in the assembly that inherit from the predicate + public static IEnumerable GetTypesInAllLoadedAssemblies(Predicate predicate) + { + Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); + List foundTypes = new List(100); + foreach (Assembly assembly in assemblies) + { + foreach (Type foundType in GetTypesInAssembly(assembly, predicate)) + foundTypes.Add(foundType); + } + return foundTypes; + } + + /// call GetTypesInAssembly() for all assemblies that match a predicate + /// Which assemblies to search + /// What type to look for + public static IEnumerable GetTypesInLoadedAssemblies( + Predicate assemblyPredicate, Predicate predicate) + { + Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); + assemblies = assemblies.Where((Assembly assembly) + => { return assemblyPredicate(assembly); }).OrderBy((Assembly ass) + => { return ass.FullName; }).ToArray(); + + List foundTypes = new List(100); + foreach (Assembly assembly in assemblies) + { + foreach (Type foundType in GetTypesInAssembly(assembly, predicate)) + foundTypes.Add(foundType); + } + + return foundTypes; + } + + public static bool TypeIsDefined(string fullname) + { + return (from assembly in AppDomain.CurrentDomain.GetAssemblies() + from type in assembly.GetTypes() + where type.FullName == fullname + select type).Count() > 0; + } +#endif + + /// Cheater extension to access internal field of an object + /// The type of the field + /// The object to access + /// The string name of the field to access + /// The value of the field in the objects + public static T AccessInternalField(this Type type, object obj, string memberName) + { + if (string.IsNullOrEmpty(memberName) || (type == null)) + return default(T); + + BindingFlags bindingFlags = BindingFlags.NonPublic; + if (obj != null) + bindingFlags |= BindingFlags.Instance; + else + bindingFlags |= BindingFlags.Static; + + FieldInfo field = type.GetField(memberName, bindingFlags); + if ((field != null) && (field.FieldType == typeof(T))) + return (T)field.GetValue(obj); + else + return default(T); + } + + /// Get the object owner of a field. This method processes + /// the '.' separator to get from the object that owns the compound field + /// to the object that owns the leaf field + /// The name of the field, which may contain '.' separators + /// the owner of the compound field + public static object GetParentObject(string path, object obj) + { + var fields = path.Split('.'); + if (fields.Length == 1) + return obj; + + var info = obj.GetType().GetField( + fields[0], BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + obj = info.GetValue(obj); + + return GetParentObject(string.Join(".", fields, 1, fields.Length - 1), obj); + } + + /// Returns a string path from an expression - mostly used to retrieve serialized properties + /// without hardcoding the field path. Safer, and allows for proper refactoring. + public static string GetFieldPath(Expression> expr) + { + MemberExpression me; + switch (expr.Body.NodeType) + { + case ExpressionType.MemberAccess: + me = expr.Body as MemberExpression; + break; + default: + throw new InvalidOperationException(); + } + + var members = new List(); + while (me != null) + { + members.Add(me.Member.Name); + me = me.Expression as MemberExpression; + } + + var sb = new StringBuilder(); + for (int i = members.Count - 1; i >= 0; i--) + { + sb.Append(members[i]); + if (i > 0) sb.Append('.'); + } + return sb.ToString(); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs.meta new file mode 100644 index 0000000..3a1a965 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/ReflectionHelpers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8986fa27e90db314d8a3359520e7fd1a +timeCreated: 1487370732 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs new file mode 100644 index 0000000..8a7d29e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs @@ -0,0 +1,137 @@ +using UnityEngine; + +namespace Cinemachine.Utility +{ + internal static class SplineHelpers + { + public static Vector3 Bezier3( + float t, Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) + { + t = Mathf.Clamp01(t); + float d = 1f - t; + return d * d * d * p0 + 3f * d * d * t * p1 + + 3f * d * t * t * p2 + t * t * t * p3; + } + + public static Vector3 BezierTangent3( + float t, Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) + { + t = Mathf.Clamp01(t); + return (-3f * p0 + 9f * p1 - 9f * p2 + 3f * p3) * t * t + + (6f * p0 - 12f * p1 + 6f * p2) * t + - 3f * p0 + 3f * p1; + } + + public static float Bezier1(float t, float p0, float p1, float p2, float p3) + { + t = Mathf.Clamp01(t); + float d = 1f - t; + return d * d * d * p0 + 3f * d * d * t * p1 + + 3f * d * t * t * p2 + t * t * t * p3; + } + + public static float BezierTangent1( + float t, float p0, float p1, float p2, float p3) + { + t = Mathf.Clamp01(t); + return (-3f * p0 + 9f * p1 - 9f * p2 + 3f * p3) * t * t + + (6f * p0 - 12f * p1 + 6f * p2) * t + - 3f * p0 + 3f * p1; + } + + public static void ComputeSmoothControlPoints( + ref Vector4[] knot, ref Vector4[] ctrl1, ref Vector4[] ctrl2) + { + int numPoints = knot.Length; + if (numPoints <= 2) + { + if (numPoints == 2) + { + ctrl1[0] = Vector4.Lerp(knot[0], knot[1], 0.33333f); + ctrl2[0] = Vector4.Lerp(knot[0], knot[1], 0.66666f); + } + else if (numPoints == 1) + ctrl1[0] = ctrl2[0] = knot[0]; + return; + } + + var a = new float[numPoints]; + var b = new float[numPoints]; + var c = new float[numPoints]; + var r = new float[numPoints]; + for (int axis = 0; axis < 4; ++axis) + { + int n = numPoints - 1; + + // Linear into the first segment + a[0] = 0; + b[0] = 2; + c[0] = 1; + r[0] = knot[0][axis] + 2 * knot[1][axis]; + + // Internal segments + for (int i = 1; i < n - 1; ++i) + { + a[i] = 1; + b[i] = 4; + c[i] = 1; + r[i] = 4 * knot[i][axis] + 2 * knot[i+1][axis]; + } + + // Linear out of the last segment + a[n - 1] = 2; + b[n - 1] = 7; + c[n - 1] = 0; + r[n - 1] = 8 * knot[n - 1][axis] + knot[n][axis]; + + // Solve with Thomas algorithm + for (int i = 1; i < n; ++i) + { + float m = a[i] / b[i-1]; + b[i] = b[i] - m * c[i-1]; + r[i] = r[i] - m * r[i-1]; + } + + // Compute ctrl1 + ctrl1[n-1][axis] = r[n-1] / b[n-1]; + for (int i = n - 2; i >= 0; --i) + ctrl1[i][axis] = (r[i] - c[i] * ctrl1[i + 1][axis]) / b[i]; + + // Compute ctrl2 from ctrl1 + for (int i = 0; i < n; i++) + ctrl2[i][axis] = 2 * knot[i + 1][axis] - ctrl1[i + 1][axis]; + ctrl2[n - 1][axis] = 0.5f * (knot[n][axis] + ctrl1[n - 1][axis]); + } + } + + public static void ComputeSmoothControlPointsLooped( + ref Vector4[] knot, ref Vector4[] ctrl1, ref Vector4[] ctrl2) + { + int numPoints = knot.Length; + if (numPoints < 2) + { + if (numPoints == 1) + ctrl1[0] = ctrl2[0] = knot[0]; + return; + } + + int margin = Mathf.Min(4, numPoints-1); + Vector4[] knotLooped = new Vector4[numPoints + 2 * margin]; + Vector4[] ctrl1Looped = new Vector4[numPoints + 2 * margin]; + Vector4[] ctrl2Looped = new Vector4[numPoints + 2 * margin]; + for (int i = 0; i < margin; ++i) + { + knotLooped[i] = knot[numPoints-(margin-i)]; + knotLooped[numPoints+margin+i] = knot[i]; + } + for (int i = 0; i < numPoints; ++i) + knotLooped[i + margin] = knot[i]; + ComputeSmoothControlPoints(ref knotLooped, ref ctrl1Looped, ref ctrl2Looped); + for (int i = 0; i < numPoints; ++i) + { + ctrl1[i] = ctrl1Looped[i + margin]; + ctrl2[i] = ctrl2Looped[i + margin]; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs.meta new file mode 100644 index 0000000..59e559f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/SplineHelpers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fca2bf25139920d4f9bf86711457992e +timeCreated: 1505844077 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs new file mode 100644 index 0000000..4767832 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs @@ -0,0 +1,228 @@ +using UnityEngine; + +namespace Cinemachine.Utility +{ + /// Extensions to the Vector3 class, used by Cinemachine + public static class UnityVectorExtensions + { + /// A useful Epsilon + public const float Epsilon = 0.0001f; + + /// + /// Get the closest point on a line segment. + /// + /// A point in space + /// Start of line segment + /// End of line segment + /// The interpolation parameter representing the point on the segment, with 0==s0, and 1==s1 + public static float ClosestPointOnSegment(this Vector3 p, Vector3 s0, Vector3 s1) + { + Vector3 s = s1 - s0; + float len2 = Vector3.SqrMagnitude(s); + if (len2 < Epsilon) + return 0; // degenrate segment + return Mathf.Clamp01(Vector3.Dot(p - s0, s) / len2); + } + + /// + /// Get the closest point on a line segment. + /// + /// A point in space + /// Start of line segment + /// End of line segment + /// The interpolation parameter representing the point on the segment, with 0==s0, and 1==s1 + public static float ClosestPointOnSegment(this Vector2 p, Vector2 s0, Vector2 s1) + { + Vector2 s = s1 - s0; + float len2 = Vector2.SqrMagnitude(s); + if (len2 < Epsilon) + return 0; // degenrate segment + return Mathf.Clamp01(Vector2.Dot(p - s0, s) / len2); + } + + /// + /// Returns a non-normalized projection of the supplied vector onto a plane + /// as described by its normal + /// + /// + /// The normal that defines the plane. Cannot be zero-length. + /// The component of the vector that lies in the plane + public static Vector3 ProjectOntoPlane(this Vector3 vector, Vector3 planeNormal) + { + return (vector - Vector3.Dot(vector, planeNormal) * planeNormal); + } + + /// Is the vector within Epsilon of zero length? + /// + /// True if the square magnitude of the vector is within Epsilon of zero + public static bool AlmostZero(this Vector3 v) + { + return v.sqrMagnitude < (Epsilon * Epsilon); + } + + /// Get a signed angle between two vectors + /// Start direction + /// End direction + /// This is needed in order to determine the sign. + /// For example, if from an to lie on the XZ plane, then this would be the + /// Y unit vector, or indeed any vector which, when dotted with Y unit vector, + /// would give a positive result. + /// The signed angle between the vectors + public static float SignedAngle(Vector3 from, Vector3 to, Vector3 refNormal) + { + from.Normalize(); + to.Normalize(); + float dot = Vector3.Dot(Vector3.Cross(from, to), refNormal); + if (Mathf.Abs(dot) < -Epsilon) + return Vector3.Dot(from, to) < 0 ? 180 : 0; + float angle = Vector3.Angle(from, to); + if (dot < 0) + return -angle; + return angle; + } + + /// This is a slerp that mimics a camera operator's movement in that + /// it chooses a path that avoids the lower hemisphere, as defined by + /// the up param + /// First direction + /// Second direction + /// Interpolation amoun t + /// Defines the up direction + public static Vector3 SlerpWithReferenceUp( + Vector3 vA, Vector3 vB, float t, Vector3 up) + { + float dA = vA.magnitude; + float dB = vB.magnitude; + if (dA < Epsilon || dB < Epsilon) + return Vector3.Lerp(vA, vB, t); + + Vector3 dirA = vA / dA; + Vector3 dirB = vB / dB; + Quaternion qA = Quaternion.LookRotation(dirA, up); + Quaternion qB = Quaternion.LookRotation(dirB, up); + Quaternion q = UnityQuaternionExtensions.SlerpWithReferenceUp(qA, qB, t, up); + Vector3 dir = q * Vector3.forward; + return dir * Mathf.Lerp(dA, dB, t); + } + } + + /// Extentions to the Quaternion class, usen in various places by Cinemachine + public static class UnityQuaternionExtensions + { + /// This is a slerp that mimics a camera operator's movement in that + /// it chooses a path that avoids the lower hemisphere, as defined by + /// the up param + /// First direction + /// Second direction + /// Interpolation amoun t + /// Defines the up direction + public static Quaternion SlerpWithReferenceUp( + Quaternion qA, Quaternion qB, float t, Vector3 up) + { + Vector3 dirA = (qA * Vector3.forward).ProjectOntoPlane(up); + Vector3 dirB = (qB * Vector3.forward).ProjectOntoPlane(up); + if (dirA.AlmostZero() || dirB.AlmostZero()) + return Quaternion.Slerp(qA, qB, t); + + // Work on the plane, in eulers + Quaternion qBase = Quaternion.LookRotation(dirA, up); + Quaternion qA1 = Quaternion.Inverse(qBase) * qA; + Quaternion qB1 = Quaternion.Inverse(qBase) * qB; + Vector3 eA = qA1.eulerAngles; + Vector3 eB = qB1.eulerAngles; + return qBase * Quaternion.Euler( + Mathf.LerpAngle(eA.x, eB.x, t), + Mathf.LerpAngle(eA.y, eB.y, t), + Mathf.LerpAngle(eA.z, eB.z, t)); + } + + /// Normalize a quaternion + /// + /// The normalized quaternion. Unit length is 1. + public static Quaternion Normalized(this Quaternion q) + { + Vector4 v = new Vector4(q.x, q.y, q.z, q.w).normalized; + return new Quaternion(v.x, v.y, v.z, v.w); + } + + /// + /// Get the rotations, first about world up, then about (travelling) local right, + /// necessary to align the quaternion's forward with the target direction. + /// This represents the tripod head movement needed to look at the target. + /// This formulation makes it easy to interpolate without introducing spurious roll. + /// + /// + /// The worldspace target direction in which we want to look + /// Which way is up + /// Vector2.y is rotation about worldUp, and Vector2.x is second rotation, + /// about local right. + public static Vector2 GetCameraRotationToTarget( + this Quaternion orient, Vector3 lookAtDir, Vector3 worldUp) + { + if (lookAtDir.AlmostZero()) + return Vector2.zero; // degenerate + + // Work in local space + Quaternion toLocal = Quaternion.Inverse(orient); + Vector3 up = toLocal * worldUp; + lookAtDir = toLocal * lookAtDir; + + // Align yaw based on world up + float angleH = 0; + { + Vector3 targetDirH = lookAtDir.ProjectOntoPlane(up); + if (!targetDirH.AlmostZero()) + { + Vector3 currentDirH = Vector3.forward.ProjectOntoPlane(up); + if (currentDirH.AlmostZero()) + { + // We're looking at the north or south pole + if (Vector3.Dot(currentDirH, up) > 0) + currentDirH = Vector3.down.ProjectOntoPlane(up); + else + currentDirH = Vector3.up.ProjectOntoPlane(up); + } + angleH = UnityVectorExtensions.SignedAngle(currentDirH, targetDirH, up); + } + } + Quaternion q = Quaternion.AngleAxis(angleH, up); + + // Get local vertical angle + float angleV = UnityVectorExtensions.SignedAngle( + q * Vector3.forward, lookAtDir, q * Vector3.right); + + return new Vector2(angleV, angleH); + } + + /// + /// Apply rotations, first about world up, then about (travelling) local right. + /// rot.y is rotation about worldUp, and rot.x is second rotation, about local right. + /// + /// + /// Vector2.y is rotation about worldUp, and Vector2.x is second rotation, + /// about local right. + /// Which way is up + public static Quaternion ApplyCameraRotation( + this Quaternion orient, Vector2 rot, Vector3 worldUp) + { + Quaternion q = Quaternion.AngleAxis(rot.x, Vector3.right); + return (Quaternion.AngleAxis(rot.y, worldUp) * orient) * q; + } + } + + /// Ad-hoc xxtentions to the Rect structure, used by Cinemachine + public static class UnityRectExtensions + { + /// Inflate a rect + /// + /// x and y are added/subtracted fto/from the edges of + /// the rect, inflating it in all directions + /// The inflated rect + public static Rect Inflated(this Rect r, Vector2 delta) + { + return new Rect( + r.xMin - delta.x, r.yMin - delta.y, + r.width + delta.x * 2, r.height + delta.y * 2); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs.meta b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs.meta new file mode 100644 index 0000000..fae0b0e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Base/Runtime/Core/UnityVectorExtensions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6a0472cd31396f741969b8c1af8dd5a0 +timeCreated: 1481654955 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta b/Assets/_Vendor/Cinemachine/CINEMACHINE_install.pdf.meta similarity index 51% rename from Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta rename to Assets/_Vendor/Cinemachine/CINEMACHINE_install.pdf.meta index 106ed73..851dccf 100644 --- a/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta +++ b/Assets/_Vendor/Cinemachine/CINEMACHINE_install.pdf.meta @@ -1,8 +1,8 @@ -fileFormatVersion: 2 -guid: 40ffc3f187306164aa6634a9d032f2e3 -timeCreated: 1435040073 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: f9e81eceaa4926345af2955aff7cf00b +timeCreated: 1482432997 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/CinemachineAPI.chm b/Assets/_Vendor/Cinemachine/CinemachineAPI.chm new file mode 100644 index 0000000..a3c76b3 Binary files /dev/null and b/Assets/_Vendor/Cinemachine/CinemachineAPI.chm differ diff --git a/Assets/_Vendor/Cinemachine/CinemachineAPI.chm.meta b/Assets/_Vendor/Cinemachine/CinemachineAPI.chm.meta new file mode 100644 index 0000000..76e5115 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/CinemachineAPI.chm.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42cf855b42713884aa8851e8bb50acc3 +timeCreated: 1491835890 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Gizmos.meta b/Assets/_Vendor/Cinemachine/Gizmos.meta new file mode 100644 index 0000000..de400d0 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Gizmos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9ca844c06be1ab40a3f7fc9e3c42c55 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine.meta b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine.meta new file mode 100644 index 0000000..e7f65ce --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ca2168befea188b41a64ed01e777e286 +folderAsset: yes +timeCreated: 1455580628 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png new file mode 100644 index 0000000..47f1903 Binary files /dev/null and b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png differ diff --git a/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png.meta b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png.meta new file mode 100644 index 0000000..59553fe --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Gizmos/Cinemachine/cm_logo_lg.png.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: ca058052cfb44474dbd1f8ec45658065 +timeCreated: 1456162759 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 1 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/LICENSE b/Assets/_Vendor/Cinemachine/LICENSE new file mode 100644 index 0000000..858ba24 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/LICENSE @@ -0,0 +1,30 @@ +Unity Companion Cinemachine Code License 1.0 (“License”) +Copyright © 2017 Unity Technologies ApS (“Unity”) + +Unity hereby grants to you a worldwide, non-exclusive, no-charge, and royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the software that is made available with this License (“Software”), subject to the following terms and conditions: + +1. Unity Companion Use Only. Exercise of the license granted herein is limited to exercise for the creation, use, and/or distribution of applications, software, or other content pursuant to a valid Unity development engine software license (“Engine License”). That means while use of the Software is not limited to use in the software licensed under the Engine License, the Software may not be used for any purpose other than the creation, use, and/or distribution of Engine License-dependent applications, software, or other content. No other exercise of the license granted herein is permitted. + +2. No Modification of Engine License. Neither this License nor any exercise of the license granted herein modifies the Engine License in any way. + +3. Ownership & Grant Back to You. + +3.1 You own your content. In this License, “derivative works” means derivatives of the Software itself--works derived only from the Software by you under this License (for example, modifying the code of the Software itself to improve its efficacy); “derivative works” of the Software do not include, for example, games, apps, or content that you create using the Software. You keep all right, title, and interest to your own content. + +3.2 Unity owns its content. While you keep all right, title, and interest to your own content per the above, as between Unity and you, Unity will own all right, title, and interest to all intellectual property rights (including patent, trademark, and copyright) in the Software and derivative works of the Software, and you hereby assign and agree to assign all such rights in those derivative works to Unity. + +3.3 You have a license to those derivative works. Subject to this License, Unity grants to you the same worldwide, non-exclusive, no-charge, and royalty-free copyright license to derivative works of the Software you create as is granted to you for the Software under this License. + +4. Trademarks. You are not granted any right or license under this License to use any trademarks, service marks, trade names, products names, or branding of Unity or its affiliates (“Trademarks”). Descriptive uses of Trademarks are permitted; see, for example, Unity’s Branding Usage Guidelines at https://unity3d.com/public-relations/brand. + +5. Notices & Third-Party Rights. This License, including the copyright notice above, must be provided in all substantial portions of the Software and derivative works thereof (or, if that is impracticable, in any other location where such notices are customarily placed). Further, if the Software is accompanied by a Unity “third-party notices” or similar file, you acknowledge and agree that software identified in that file is governed by those separate license terms. + +6. DISCLAIMER, LIMITATION OF LIABILITY. THE SOFTWARE AND ANY DERIVATIVE WORKS THEREOF IS PROVIDED ON AN "AS IS" BASIS, AND IS PROVIDED WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR NONINFRINGEMENT. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES (WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL, INCLUDING PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS, AND BUSINESS INTERRUPTION), OR OTHER LIABILITY WHATSOEVER, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR OUT OF, OR IN CONNECTION WITH, THE SOFTWARE OR ANY DERIVATIVE WORKS THEREOF OR THE USE OF OR OTHER DEALINGS IN SAME, EVEN WHERE ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +7. USE IS ACCEPTANCE and License Versions. Your receipt and use of the Software constitutes your acceptance of this License and its terms and conditions. Software released by Unity under this License may be modified or updated and the License with it; upon any such modification or update, you will comply with the terms of the updated License for any use of any of the Software under the updated License. + +8. Use in Compliance with Law and Termination. Your exercise of the license granted herein will at all times be in compliance with applicable law and will not infringe any proprietary rights (including intellectual property rights); this License will terminate immediately on any breach by you of this License. + +9. Severability. If any provision of this License is held to be unenforceable or invalid, that provision will be enforced to the maximum extent possible and the other provisions will remain in full force and effect. + +10. Governing Law and Venue. This License is governed by and construed in accordance with the laws of Denmark, except for its conflict of laws rules; the United Nations Convention on Contracts for the International Sale of Goods will not apply. If you reside (or your principal place of business is) within the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in San Francisco County, California concerning any dispute arising out of this License (“Dispute”). If you reside (or your principal place of business is) outside the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the courts located in Copenhagen, Denmark concerning any Dispute. diff --git a/Assets/_Vendor/Cinemachine/LICENSE.meta b/Assets/_Vendor/Cinemachine/LICENSE.meta new file mode 100644 index 0000000..1b14703 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/LICENSE.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d832c901796201458d7c595a98a0242 +timeCreated: 1490729325 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX.meta b/Assets/_Vendor/Cinemachine/PostFX.meta new file mode 100644 index 0000000..2404e68 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a82dea150a2b394388860e48a701ed4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs new file mode 100644 index 0000000..9d0ac89 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs @@ -0,0 +1,161 @@ +using UnityEngine; + +// NOTE: If you are getting errors of the sort that say something like: +// "The type or namespace name `PostProcessing' does not exist in the namespace" +// it is because the PostProcessing v1 module has been removed from your project. +// +// To make the errors go away, you can either: +// 1 - Download PostProcessing V1 and install it into your project +// or +// 2 - Go into PlayerSettings/OtherSettings and remove the Scripting Define for UNITY_POST_PROCESSING_STACK_V1 +// + +namespace Cinemachine.PostFX +{ +#if UNITY_POST_PROCESSING_STACK_V1 && !UNITY_POST_PROCESSING_STACK_V2 + /// + /// This behaviour is a liaison between Cinemachine with the Post-Processing v1 module. You must + /// have the Post-Processing V1 stack asset store package installed in order to use this behaviour. + /// + /// It's used in 2 ways: + /// + /// * As a component on the Unity Camera: it serves as the liaison + /// between the camera's CinemachineBrain and the camera's Post-Processing behaviour. + /// It listens for camera Cut events and resets the Post-Processing stack when they occur. + /// If you are using Post-Processing, then you should add this behaviour to your + /// camera alongside the CinemachineBrain, always. + /// + /// * As a component on the Virtual Camera: In this capacity, it holds + /// a Post-Processing Profile asset that will be applied to the Unity camera whenever + /// the Virtual camera is live. It also has the (temporary) optional functionality of animating + /// the Focus Distance and DepthOfField properties of the Camera State, and + /// applying them to the current Post-Processing profile. + /// + [DocumentationSorting(100, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [DisallowMultipleComponent] + [AddComponentMenu("Cinemachine/CinemachinePostFX")] + [SaveDuringPlay] + public class CinemachinePostFX : MonoBehaviour + { + // Just for the Enabled checkbox + void Update() {} + + [Tooltip("When this behaviour is on a Unity Camera, this setting is the default Post-Processing profile for the camera, and will be applied whenever it is not overridden by a virtual camera. When the behaviour is on a virtual camera, then this is the Post-Processing profile that will become active whenever this virtual camera is live")] + public UnityEngine.PostProcessing.PostProcessingProfile m_Profile; + + [Tooltip("If checked, then the Focus Distance will be set to the distance between the camera and the LookAt target.")] + public bool m_FocusTracksTarget; + + [Tooltip("Offset from target distance, to be used with Focus Tracks Target.")] + public float m_FocusOffset; + + // These are used if this behaviour is on a Unity Camera + CinemachineBrain mBrain; + UnityEngine.PostProcessing.PostProcessingBehaviour mPostProcessingBehaviour; + + void ConnectToBrain() + { + // If I am a component on the Unity camera, connect to its brain + // and to its post-processing behaviour + mBrain = GetComponent(); + if (mBrain != null) + { + mBrain.m_CameraCutEvent.RemoveListener(OnCameraCut); + mBrain.m_CameraCutEvent.AddListener(OnCameraCut); + } + // Must have one of these if connected to a brain + mPostProcessingBehaviour = GetComponent(); + if (mPostProcessingBehaviour == null && mBrain != null) + mPostProcessingBehaviour = gameObject.AddComponent(); + } + + void OnDestroy() + { + if (mBrain != null) + mBrain.m_CameraCutEvent.RemoveListener(OnCameraCut); + } + + // CinemachineBrain callback used when this behaviour is on the Unity Camera + internal void PostFXHandler(CinemachineBrain brain) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachinePostFX.PostFXHandler"); + ICinemachineCamera vcam = brain.ActiveVirtualCamera; + if (enabled && mBrain != null && mPostProcessingBehaviour != null) + { + // Look for the vcam's PostFX behaviour + CinemachinePostFX postFX = GetEffectivePostFX(vcam); + if (postFX == null) + postFX = this; // vcam does not define a profile - apply the default + if (postFX.m_Profile != null) + { + // Adjust the focus distance + CameraState state = brain.CurrentCameraState; + UnityEngine.PostProcessing.DepthOfFieldModel.Settings dof + = postFX.m_Profile.depthOfField.settings; + if (postFX.m_FocusTracksTarget && state.HasLookAt) + dof.focusDistance = (state.FinalPosition - state.ReferenceLookAt).magnitude + + postFX.m_FocusOffset; + postFX.m_Profile.depthOfField.settings = dof; + } + // Apply the profile + if (mPostProcessingBehaviour.profile != postFX.m_Profile) + { + mPostProcessingBehaviour.profile = postFX.m_Profile; + mPostProcessingBehaviour.ResetTemporalEffects(); + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + CinemachinePostFX GetEffectivePostFX(ICinemachineCamera vcam) + { + while (vcam != null && vcam.LiveChildOrSelf != vcam) + vcam = vcam.LiveChildOrSelf; + CinemachinePostFX postFX = null; + while (vcam != null && postFX == null) + { + CinemachineVirtualCameraBase vcamBase = vcam as CinemachineVirtualCameraBase; + if (vcamBase != null) + postFX = vcamBase.GetComponent(); + if (postFX != null && !postFX.enabled) + postFX = null; + vcam = vcam.ParentCamera; + } + return postFX; + } + + void OnCameraCut(CinemachineBrain brain) + { + if (mPostProcessingBehaviour != null) + { + //Debug.Log("CinemachinePostFX.OnCameraCut()"); + mPostProcessingBehaviour.ResetTemporalEffects(); + } + } + + static void StaticPostFXHandler(CinemachineBrain brain) + { + CinemachinePostFX postFX = brain.PostProcessingComponent as CinemachinePostFX; + if (postFX == null) + { + brain.PostProcessingComponent = brain.GetComponent(); + postFX = brain.PostProcessingComponent as CinemachinePostFX; + if (postFX != null) + postFX.ConnectToBrain(); + } + if (postFX != null) + postFX.PostFXHandler(brain); + } + + /// Internal method called by editor module + [RuntimeInitializeOnLoadMethod] + public static void InitializeModule() + { + // When the brain pushes the state to the camera, hook in to the PostFX + CinemachineBrain.sPostProcessingHandler.RemoveListener(StaticPostFXHandler); + CinemachineBrain.sPostProcessingHandler.AddListener(StaticPostFXHandler); + } + } +#endif +} diff --git a/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs.meta b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs.meta new file mode 100644 index 0000000..92e322c --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostFX.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 360979aafebd332448626a2236bafdb4 +timeCreated: 1493845370 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs new file mode 100644 index 0000000..4fc6241 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs @@ -0,0 +1,231 @@ +#if UNITY_POST_PROCESSING_STACK_V2 + +// NOTE: If you are getting errors of the sort that say something like: +// "The type or namespace name `PostProcessing' does not exist in the namespace" +// it is because the PostProcessing v2 module has been removed from your project. +// +// To make the errors go away, you can either: +// 1 - Download PostProcessing V2 and install it into your project +// or +// 2 - Go into PlayerSettings/OtherSettings and remove the Scripting Define for UNITY_POST_PROCESSING_STACK_V2 +// + +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +namespace Cinemachine.PostFX +{ + /// + /// This behaviour is a liaison between Cinemachine with the Post-Processing v2 module. You must + /// have the Post-Processing V2 stack asset store package installed in order to use this behaviour. + /// + /// As a component on the Virtual Camera, it holds + /// a Post-Processing Profile asset that will be applied to the Unity camera whenever + /// the Virtual camera is live. It also has the optional functionality of animating + /// the Focus Distance and DepthOfField properties of the Camera State, and + /// applying them to the current Post-Processing profile, provided that profile has a + /// DepthOfField effect that is enabled. + /// + [DocumentationSorting(101, DocumentationSortingAttribute.Level.UserRef)] + [ExecuteInEditMode] + [AddComponentMenu("")] // Hide in menu + [SaveDuringPlay] + public class CinemachinePostProcessing : CinemachineExtension + { + [Tooltip("If checked, then the Focus Distance will be set to the distance between the camera and the LookAt target. Requires DepthOfField effect in the Profile")] + public bool m_FocusTracksTarget; + + [Tooltip("Offset from target distance, to be used with Focus Tracks Target. Offsets the sharpest point away from the LookAt target.")] + public float m_FocusOffset; + + [Tooltip("This Post-Processing profile will be applied whenever this virtual camera is live")] + public PostProcessProfile m_Profile; + + bool mCachedProfileIsInvalid = true; + PostProcessProfile mProfileCopy; + public PostProcessProfile Profile { get { return mProfileCopy != null ? mProfileCopy : m_Profile; } } + + /// True if the profile is enabled and nontrivial + public bool IsValid { get { return m_Profile != null && m_Profile.settings.Count > 0; } } + + /// Called by the editor when the shared asset has been edited + public void InvalidateCachedProfile() { mCachedProfileIsInvalid = true; } + + void CreateProfileCopy() + { + DestroyProfileCopy(); + PostProcessProfile profile = ScriptableObject.CreateInstance(); + if (m_Profile != null) + { + foreach (var item in m_Profile.settings) + { + var itemCopy = Instantiate(item); + profile.settings.Add(itemCopy); + } + } + mProfileCopy = profile; + mCachedProfileIsInvalid = false; + } + + void DestroyProfileCopy() + { + if (mProfileCopy != null) + DestroyImmediate(mProfileCopy); + mProfileCopy = null; + } + + protected override void OnDestroy() + { + base.OnDestroy(); + DestroyProfileCopy(); + } + + protected override void PostPipelineStageCallback( + CinemachineVirtualCameraBase vcam, + CinemachineCore.Stage stage, ref CameraState state, float deltaTime) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachinePostProcessing.PostPipelineStageCallback"); + // Set the focus after the camera has been fully positioned. + // GML todo: what about collider? + if (stage == CinemachineCore.Stage.Aim) + { + if (!IsValid) + DestroyProfileCopy(); + else + { + // Handle Follow Focus + if (!m_FocusTracksTarget || !state.HasLookAt) + DestroyProfileCopy(); + else + { + if (mProfileCopy == null || mCachedProfileIsInvalid) + CreateProfileCopy(); + DepthOfField dof; + if (mProfileCopy.TryGetSettings(out dof)) + dof.focusDistance.value + = (state.FinalPosition - state.ReferenceLookAt).magnitude + m_FocusOffset; + } + + // Apply the post-processing + state.AddCustomBlendable(new CameraState.CustomBlendable(this, 1)); + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + static void OnCameraCut(CinemachineBrain brain) + { + // Debug.Log("Camera cut event"); + PostProcessLayer postFX = brain.PostProcessingComponent as PostProcessLayer; + if (postFX == null) + brain.PostProcessingComponent = null; // object deleted + else + postFX.ResetHistory(); + } + + static void ApplyPostFX(CinemachineBrain brain) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachinePostProcessing.ApplyPostFX"); + PostProcessLayer ppLayer = brain.GetComponent(); + if (ppLayer == null || !ppLayer.enabled || ppLayer.volumeLayer == 0) + return; + + CameraState state = brain.CurrentCameraState; + int numBlendables = state.NumCustomBlendables; + List volumes = GetDynamicBrainVolumes(brain, ppLayer, numBlendables); + for (int i = 0; i < volumes.Count; ++i) + { + volumes[i].weight = 0; + volumes[i].sharedProfile = null; + volumes[i].profile = null; + } + for (int i = 0; i < numBlendables; ++i) + { + var b = state.GetCustomBlendable(i); + CinemachinePostProcessing src = b.m_Custom as CinemachinePostProcessing; + if (!(src == null)) // in case it was deleted + { + PostProcessVolume v = volumes[i]; + v.sharedProfile = src.Profile; + v.isGlobal = true; + v.priority = float.MaxValue-1; + v.weight = b.m_Weight; + } + } + //UnityEngine.Profiling.Profiler.EndSample(); + } + + static string sVolumeOwnerName = "__CMVolumes"; + static List sVolumes = new List(); + static List GetDynamicBrainVolumes( + CinemachineBrain brain, PostProcessLayer ppLayer, int minVolumes) + { + //UnityEngine.Profiling.Profiler.BeginSample("CinemachinePostProcessing.GetDynamicBrainVolumes"); + // Locate the camera's child object that holds our dynamic volumes + GameObject volumeOwner = null; + Transform t = brain.transform; + int numChildren = t.childCount; + + sVolumes.Clear(); + for (int i = 0; volumeOwner == null && i < numChildren; ++i) + { + GameObject child = t.GetChild(i).gameObject; + if (child.hideFlags == HideFlags.HideAndDontSave) + { + child.GetComponents(sVolumes); + if (sVolumes.Count > 0) + volumeOwner = child; + } + } + + if (minVolumes > 0) + { + if (volumeOwner == null) + { + volumeOwner = new GameObject(sVolumeOwnerName); + volumeOwner.hideFlags = HideFlags.HideAndDontSave; + volumeOwner.transform.parent = t; + } + // Update the volume's layer so it will be seen + int mask = ppLayer.volumeLayer.value; + for (int i = 0; i < 32; ++i) + { + if ((mask & (1 << i)) != 0) + { + volumeOwner.layer = i; + break; + } + } + while (sVolumes.Count < minVolumes) + sVolumes.Add(volumeOwner.gameObject.AddComponent()); + } + //UnityEngine.Profiling.Profiler.EndSample(); + return sVolumes; + } + + /// Internal method called by editor module + [RuntimeInitializeOnLoadMethod] + public static void InitializeModule() + { + // When the brain pushes the state to the camera, hook in to the PostFX + CinemachineBrain.sPostProcessingHandler.RemoveListener(StaticPostFXHandler); + CinemachineBrain.sPostProcessingHandler.AddListener(StaticPostFXHandler); + } + + static void StaticPostFXHandler(CinemachineBrain brain) + { + PostProcessLayer postFX = brain.PostProcessingComponent as PostProcessLayer; + if (postFX == null) + { + brain.PostProcessingComponent = brain.GetComponent(); + postFX = brain.PostProcessingComponent as PostProcessLayer; + if (postFX != null) + brain.m_CameraCutEvent.AddListener(CinemachinePostProcessing.OnCameraCut); + } + if (postFX != null) + CinemachinePostProcessing.ApplyPostFX(brain); + } + } +} +#endif diff --git a/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs.meta b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs.meta new file mode 100644 index 0000000..081dc26 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/CinemachinePostProcessing.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 729aad4491e915a41bda2b8325cf757a +timeCreated: 1504838447 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 5f2a108eb023faf43a809979fd3d38f2, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor.meta b/Assets/_Vendor/Cinemachine/PostFX/Editor.meta new file mode 100644 index 0000000..b1f7ae3 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8656080a6ad58f046abadcd6f2c0fb4f +folderAsset: yes +timeCreated: 1493832945 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs b/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs new file mode 100644 index 0000000..7306d53 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs @@ -0,0 +1,180 @@ +#if UNITY_POST_PROCESSING_STACK_V2 + +// NOTE: If you are getting errors of the sort that say something like: +// "The type or namespace name `PostProcessing' does not exist in the namespace" +// it is because the PostProcessing v2 module has been removed from your project. +// +// To make the errors go away, you can either: +// 1 - Download PostProcessing V2 and install it into your project +// or +// 2 - Go into PlayerSettings and remove the define for UNITY_POST_PROCESSING_STACK_V2 +// + +using UnityEngine; +using UnityEditor; +using UnityEngine.Rendering.PostProcessing; +using UnityEditor.Rendering.PostProcessing; + +namespace Cinemachine.PostFX.Editor +{ + [CustomEditor(typeof(CinemachinePostProcessing))] + public sealed class CinemachinePostProcessingEditor + : Cinemachine.Editor.BaseEditor + { + SerializedProperty m_Profile; + SerializedProperty m_FocusTracksTarget; + SerializedProperty m_FocusOffset; + + EffectListEditor m_EffectList; + GUIContent m_ProfileLabel; + + void OnEnable() + { + Texture textue = Resources.Load("PostProcessLayer") as Texture; + m_ProfileLabel = new GUIContent("Profile", textue, "A reference to a profile asset"); + + m_FocusTracksTarget = FindProperty(x => x.m_FocusTracksTarget); + m_FocusOffset = FindProperty(x => x.m_FocusOffset); + m_Profile = FindProperty(x => x.m_Profile); + + m_EffectList = new EffectListEditor(this); + RefreshEffectListEditor(Target.m_Profile); + } + + void OnDisable() + { + m_EffectList.Clear(); + } + + void RefreshEffectListEditor(PostProcessProfile asset) + { + m_EffectList.Clear(); + if (asset != null) + m_EffectList.Init(asset, new SerializedObject(asset)); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + var rect = GUILayoutUtility.GetRect(1, EditorGUIUtility.singleLineHeight); rect.y += 2; + float checkboxWidth = rect.height + 5; + rect = EditorGUI.PrefixLabel(rect, new GUIContent(m_FocusTracksTarget.displayName)); + EditorGUI.PropertyField(new Rect(rect.x, rect.y, checkboxWidth, rect.height), m_FocusTracksTarget, GUIContent.none); + rect.x += checkboxWidth; rect.width -= checkboxWidth; + if (m_FocusTracksTarget.boolValue) + { + GUIContent offsetText = new GUIContent("Offset "); + var textDimensions = GUI.skin.label.CalcSize(offsetText); + float oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = textDimensions.x; + EditorGUI.PropertyField(rect, m_FocusOffset, offsetText); + EditorGUIUtility.labelWidth = oldWidth; + + bool valid = false; + DepthOfField dof; + if (Target.m_Profile != null && Target.m_Profile.TryGetSettings(out dof)) + valid = dof.enabled && dof.active && dof.focusDistance.overrideState + && Target.VirtualCamera.LookAt != null; + if (!valid) + EditorGUILayout.HelpBox( + "Focus Tracking requires a LookAt target on the Virtual Camera, and an active DepthOfField/FocusDistance effect in the profile", + MessageType.Warning); + } + + DrawProfileInspectorGUI(); + Target.InvalidateCachedProfile(); + + serializedObject.ApplyModifiedProperties(); + } + + void DrawProfileInspectorGUI() + { + EditorGUILayout.Space(); + + bool assetHasChanged = false; + bool showCopy = m_Profile.objectReferenceValue != null; + + // The layout system sort of break alignement when mixing inspector fields with custom + // layouted fields, do the layout manually instead + int buttonWidth = showCopy ? 45 : 60; + float indentOffset = EditorGUI.indentLevel * 15f; + var lineRect = GUILayoutUtility.GetRect(1, EditorGUIUtility.singleLineHeight); + var labelRect = new Rect(lineRect.x, lineRect.y, EditorGUIUtility.labelWidth - indentOffset, lineRect.height); + var fieldRect = new Rect(labelRect.xMax, lineRect.y, lineRect.width - labelRect.width - buttonWidth * (showCopy ? 2 : 1), lineRect.height); + var buttonNewRect = new Rect(fieldRect.xMax, lineRect.y, buttonWidth, lineRect.height); + var buttonCopyRect = new Rect(buttonNewRect.xMax, lineRect.y, buttonWidth, lineRect.height); + + EditorGUI.PrefixLabel(labelRect, m_ProfileLabel); + + using (var scope = new EditorGUI.ChangeCheckScope()) + { + m_Profile.objectReferenceValue + = (PostProcessProfile)EditorGUI.ObjectField( + fieldRect, m_Profile.objectReferenceValue, typeof(PostProcessProfile), false); + assetHasChanged = scope.changed; + } + + if (GUI.Button( + buttonNewRect, + EditorUtilities.GetContent("New|Create a new profile."), + showCopy ? EditorStyles.miniButtonLeft : EditorStyles.miniButton)) + { + // By default, try to put assets in a folder next to the currently active + // scene file. If the user isn't a scene, put them in root instead. + var targetName = Target.name; + var scene = Target.gameObject.scene; + var asset = ProfileFactory.CreatePostProcessProfile(scene, targetName); + m_Profile.objectReferenceValue = asset; + assetHasChanged = true; + } + + if (showCopy && GUI.Button( + buttonCopyRect, + EditorUtilities.GetContent("Clone|Create a new profile and copy the content of the currently assigned profile."), + EditorStyles.miniButtonRight)) + { + // Duplicate the currently assigned profile and save it as a new profile + var origin = (PostProcessProfile)m_Profile.objectReferenceValue; + var path = AssetDatabase.GetAssetPath(origin); + path = AssetDatabase.GenerateUniqueAssetPath(path); + + var asset = Instantiate(origin); + asset.settings.Clear(); + AssetDatabase.CreateAsset(asset, path); + + foreach (var item in origin.settings) + { + var itemCopy = Instantiate(item); + itemCopy.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy; + itemCopy.name = item.name; + asset.settings.Add(itemCopy); + AssetDatabase.AddObjectToAsset(itemCopy, asset); + } + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + + m_Profile.objectReferenceValue = asset; + assetHasChanged = true; + } + + if (m_Profile.objectReferenceValue == null) + { + if (assetHasChanged) + m_EffectList.Clear(); // Asset wasn't null before, do some cleanup + + EditorGUILayout.HelpBox( + "Assign an existing Post-process Profile by choosing an asset, or create a new one by clicking the \"New\" button.\nNew assets are automatically put in a folder next to your scene file. If your scene hasn't been saved yet they will be created at the root of the Assets folder.", + MessageType.Info); + } + else + { + if (assetHasChanged) + RefreshEffectListEditor((PostProcessProfile)m_Profile.objectReferenceValue); + m_EffectList.OnGUI(); + } + } + } +} +#endif diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs.meta b/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs.meta new file mode 100644 index 0000000..1b8fbd2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/CinemachinePostProcessingEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dec69862942cc9744ade63216979cafd +timeCreated: 1504726346 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs b/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs new file mode 100644 index 0000000..1156197 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs @@ -0,0 +1,35 @@ + +namespace Cinemachine.PostFX +{ + /// Integrates Cinemachine with PostProcessing V1 stack. + /// Since PostPorcessing V1 does not create a define in Player settings the + /// way V2 does, we do it ourselves if we detect the presence of PostProcessing V1 + class PostFXAutoImport + { + [UnityEditor.InitializeOnLoad] + class EditorInitialize + { + static EditorInitialize() + { +#if UNITY_POST_PROCESSING_STACK_V2 + // We have PPv2 + CinemachinePostProcessing.InitializeModule(); +#else + // Check for PostProcessing V1. Define symbol if we have it. + if (Cinemachine.Utility.ReflectionHelpers.TypeIsDefined("UnityEngine.PostProcessing.PostProcessingBehaviour")) + { + if (Cinemachine.Editor.ScriptableObjectUtility.AddDefineForAllBuildTargets("UNITY_POST_PROCESSING_STACK_V1")) + { + string path = Cinemachine.Editor.ScriptableObjectUtility.CinemachineInstallAssetPath + "/PostFX/CinemachinePostFX.cs"; + UnityEditor.AssetDatabase.ImportAsset(path, UnityEditor.ImportAssetOptions.ForceUpdate); + } + } + #if UNITY_POST_PROCESSING_STACK_V1 + // We have PPv1 + CinemachinePostFX.InitializeModule(); + #endif +#endif + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs.meta b/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs.meta new file mode 100644 index 0000000..7b0d751 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/PostFXAutoImport.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f6542fc5402b30a4482cd20a3621602b +timeCreated: 1493832945 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources.meta b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources.meta new file mode 100644 index 0000000..20303b9 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f15624949ca514549b2f04481b49bdd0 +folderAsset: yes +timeCreated: 1504790995 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png new file mode 100644 index 0000000..c0a61de Binary files /dev/null and b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png differ diff --git a/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png.meta b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png.meta new file mode 100644 index 0000000..b9624e0 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/PostFX/Editor/Resources/PostProcessLayer.png.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: 1fa3cd9f91afee64e96c128a82544bcd +timeCreated: 1504790999 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets.meta b/Assets/_Vendor/Cinemachine/Presets.meta new file mode 100644 index 0000000..08ca6d6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f96161bfc85a364aac3baa0b7279f94 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise.meta b/Assets/_Vendor/Cinemachine/Presets/Noise.meta new file mode 100644 index 0000000..5dfe199 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8f107aadf823af24889bc290a1cca90d +folderAsset: yes +timeCreated: 1455314775 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset new file mode 100644 index 0000000..1c75436 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_normal_extreme + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 15 + Frequency: 0.2 + Y: + Amplitude: 7 + Frequency: 0.25 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 5 + Frequency: 0.9 + Y: + Amplitude: 3 + Frequency: 1 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 2 + Frequency: 2 + Y: + Amplitude: 1 + Frequency: 0 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset.meta new file mode 100644 index 0000000..68f25e6 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_extreme.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20a705aea2d80e0478fb89b6f43d8530 +timeCreated: 1465497741 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset new file mode 100644 index 0000000..e2aa301 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_normal_mild + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 7 + Frequency: 0.15 + Y: + Amplitude: 5 + Frequency: 0.1 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 4 + Frequency: 0.8 + Y: + Amplitude: 2 + Frequency: 0.75 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 1 + Frequency: 1.2 + Y: + Amplitude: 0.8 + Frequency: 1.5 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset.meta new file mode 100644 index 0000000..db7e8fc --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_mild.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46965f9cbaf525742a6da4c2172a99cd +timeCreated: 1461691296 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset new file mode 100644 index 0000000..a1b2322 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_normal_strong + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 10 + Frequency: .400000006 + Y: + Amplitude: 10 + Frequency: .0599999987 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 5 + Frequency: 1.44000006 + Y: + Amplitude: 3 + Frequency: .730000019 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 3 + Frequency: 2.49000001 + Y: + Amplitude: 1 + Frequency: 2 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset.meta new file mode 100644 index 0000000..48fbe8e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_normal_strong.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b241f91b9ccf8ff489abf204b30d3112 +timeCreated: 1461691296 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset new file mode 100644 index 0000000..62e6df3 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_tele_mild + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 4 + Frequency: .200000003 + Y: + Amplitude: 2 + Frequency: .150000006 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 2 + Frequency: .400000006 + Y: + Amplitude: 2 + Frequency: .5 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 1 + Frequency: .699999988 + Y: + Amplitude: 1 + Frequency: .600000024 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset.meta new file mode 100644 index 0000000..344b495 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_mild.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3dacaec0287d7444b4bd276816e1666 +timeCreated: 1461691921 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset new file mode 100644 index 0000000..ce27c4b --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_tele_strong + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 6.19000006 + Frequency: .389999986 + Y: + Amplitude: 4 + Frequency: .150000006 + Z: + Amplitude: 1 + Frequency: .100000001 + - X: + Amplitude: 1.84000003 + Frequency: 1.75 + Y: + Amplitude: .5 + Frequency: .899999976 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 2.29999995 + Frequency: 2 + Y: + Amplitude: .5 + Frequency: 1.39999998 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset.meta new file mode 100644 index 0000000..8c927b5 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_tele_strong.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 554b0ed52734c154eab51f6cedd3a7d7 +timeCreated: 1461691296 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset new file mode 100644 index 0000000..16f1a0f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_wideangle_mild + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 12 + Frequency: .150000006 + Y: + Amplitude: 5 + Frequency: .100000001 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 5 + Frequency: .600000024 + Y: + Amplitude: 4 + Frequency: .449999988 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 1 + Frequency: 1.5 + Y: + Amplitude: 1 + Frequency: 1.20000005 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset.meta new file mode 100644 index 0000000..2ed32d0 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_mild.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8608ec81ee27a15488d33f9dad239e91 +timeCreated: 1461691111 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset new file mode 100644 index 0000000..5fb0804 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Handheld_wideangle_strong + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 17.4599991 + Frequency: .5 + Y: + Amplitude: 5 + Frequency: .25 + Z: + Amplitude: 0 + Frequency: .100000001 + - X: + Amplitude: 12.4700003 + Frequency: .939999998 + Y: + Amplitude: 4 + Frequency: .5 + Z: + Amplitude: 1 + Frequency: .400000006 + - X: + Amplitude: 4 + Frequency: 1.20000005 + Y: + Amplitude: 2 + Frequency: 1.29999995 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset.meta new file mode 100644 index 0000000..125164e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Handheld_wideangle_strong.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20e46be82478fa24b90f748044c06b4b +timeCreated: 1461691111 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset b/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset new file mode 100644 index 0000000..b99844f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset @@ -0,0 +1,33 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7f59e54f2bfd184b9dd451a678d089b, type: 3} + m_Name: Vibration + m_EditorClassIdentifier: + m_Position: [] + m_Orientation: + - X: + Amplitude: 20 + Frequency: 3 + Y: + Amplitude: 5 + Frequency: 0.8 + Z: + Amplitude: 0 + Frequency: 0 + - X: + Amplitude: 15 + Frequency: 4 + Y: + Amplitude: 5 + Frequency: 1 + Z: + Amplitude: 0 + Frequency: 0 diff --git a/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset.meta b/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset.meta new file mode 100644 index 0000000..43fd142 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Presets/Noise/Vibration.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68b0627ea3d796448b29ab0938f2c240 +timeCreated: 1465506449 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/ReleaseNotes.txt b/Assets/_Vendor/Cinemachine/ReleaseNotes.txt new file mode 100644 index 0000000..fc93d55 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/ReleaseNotes.txt @@ -0,0 +1,71 @@ +Version 2.1.10 + +- New Aim component: Same As Follow Target simply uses the same orientation as the Follow target +- Perlin Noise component: added UI to clone or locate existing Noise profiles, and to create new ones inspector +- Noise Presets were moved outside of the Examples folder +- Example Assets are now included as embedded package, not imported by default +- Bugfix: FreeLook with PositionDelta was not properly updating the heading +- Bugfix: Transitioning between FreeLooks simetimes caused a short camera freeze +- Bugfix: Added some null checks to FreeLook, to prevent error messages at build time + + +Version 2.1.09 + +New Features + +- PostProcessing V2 is now supported. +- New Collider implementation. Curb feelers are gone, replaced by a clever camera-repositioning algorithm that will try to preserve camera height or distance from target (strategy is user-selectable). +- New CinemachineConfiner: confine a virtual camera to a simple bounding volume or PolygonCollider2D. +- New Framing Transposer. This is a special transposer that will respect composition and framing rules by moving the camera without rotating it. Takes only a Follow Target (no LookAt - this is important). Designed for Orthographic cameras, but will also work for Perspective cameras. If Follow target is a CinemachineTargetGroup, then will also provide Group Framing options. +- New CinemachinePOV Aim component. Camera aim is entirely controlled by user, using 2 input axes. +- New CinemachineMixingCamera. Drive a continuous blend of up to 8 virtual cameras from timeline or game logic. Create complex rigs with custom blends and expose them as ordinary vcams. +- New CinemachineBlendListCamera. A mini vcam sequencer that provides a quick and easy way to do AB camera moves on the fly. +- New CinemachineDollyCart behaviour, for moving anything along a path. No need to create dummy vcams just for that. +- New CinemachineSmoothPath component. You can use it instead of the old CinemachinePath. The difference is that the SmoothPath guarantees second-order continuity, which means that there will never be any sudden camera rotation changes baked into the path tangents. Easier to use, too: no tangents to mess around with (they get automatically set for smoothness). +- Path now supports Distance Units in addition to Path units, making it easy to create steady motion. +- TrackedDolly: added ability to use Distance or Path units for path position. +- Transposer and TrackedDolly: added target angular damping on 3 axes. +- OrbitalTransposer and FreeLook: added angular damping and binding mode, same as Transposer. +- OrbitalTransopser and freelook: added checkbox to invert input axis. +- Transposer, OrbitalTransposer, and FreeLook: added new Simple Follow binding mode, which will follow the target using rotation as much as possible, changing position as little as possible. Like a lazy cameraman. +- Added IgnoreTimeScale option to Brain. Useful for snappy cameras even in slo-mo. +- Added Lookahead Time to composer. Composer will look at the point where it estimates the target will be at some time in the near future. This gives much more natural framing of a moving target. + + +Improvements + +- SmartUpdate is smarter: added support for Interpolation when target is animated by physics system. +- Added off-button for SaveDuringPlay. +- No SaveDuringPlay for vcam priority, LookAt and Follow targets, GroupTarget members. +- Added IsBlending API method to StateDrivenCamera and ClearShot. +- TargetGroup now has a user-selectable update method. +- TargetGroup now respects the weight when computing bounding box, so it's possible to gradually add or remove members by manipulating the weight. +- Clearshot: if randomize, then re-randomize whenever it becomes active. +- ClearShot: default blend is cut. +- ClearShot create menu: add a Collider by default. +- FollowZoom: min/max FOV defaults changed to 3/60. +- Composer damping range is now 0-20 instead of 0-100. +- Orbital and FreeLook: Heading Bias can now be animated on the timeline. +- Orbital and FreeLook: damping no longer interferes with camera response to user input. Axis movement bypasses all damping. +- TrackedDolly: added path position offset to Auto-Dolly. Stays on the path (unlike path offset, which is based on the path tangent and so can go off the path) +- Noise component inspector now has a dropdown for Profile presets, instead of directly allowing editing of the Profile asset. +- Added concept of Cinemachine Extension. Collider, confiner, PostProcessing, etc are now Extensions. They are available via a dropdown at the bottom of the inspection for virtual cameras. They will no longer appear in the standard Components menu. +- Time.timeScale = 0 is now supported. Pausing the game will also pause the virtual cameras. +- HardConstraint has been split into two settings: Do Nothing and Hard LookAt/Follow. Do Nothing will leave the camera's transform alone, ignoring any target that may have been set. +- CinemachineBrain no longer requires a Camera component. Can be used with any GameObject, making it possible to use Cinemachine to control the transforms of arbitrary objects. +- Improved logic for AxisState accel/decel. More realistic behaviour. + + +Bugfixes + +- SaveDuringPlay obsolete API fix for 2017.2. +- Fixed build errors when building for UWP. +- Clearshot and SDC: don't reset state if deactivated. +- FreeLook destroy - no more orphan rigs. +- Fixed strange build error that only showed up in MonoDevelop. +- FreeLook was not respecting X-axis accel and decel. Heading speed had to be crazy high. Now same as Orbital (warning: may have to re-tune settings on existing FreeLooks). +- Recenter to target heading was not moving smoothly in some circumstances. +- Collider raycasts no longer hit triggers. +- Noise: handle variable deltaTime gracefully. +- State-Driven-Camera: don't generate errors when animated target is inactive. +- Several jitter and judder issues resolved. diff --git a/Assets/Demigiant/DOTween/DOTween46.xml.meta b/Assets/_Vendor/Cinemachine/ReleaseNotes.txt.meta similarity index 54% rename from Assets/Demigiant/DOTween/DOTween46.xml.meta rename to Assets/_Vendor/Cinemachine/ReleaseNotes.txt.meta index e6f5e7c..55e8541 100644 --- a/Assets/Demigiant/DOTween/DOTween46.xml.meta +++ b/Assets/_Vendor/Cinemachine/ReleaseNotes.txt.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0c0748b94b209b743b6f78b7b260a5d7 -timeCreated: 1435040074 -licenseType: Pro +guid: 048dcb775445a4a478914781ec3ca9c6 +timeCreated: 1503606237 +licenseType: Store TextScriptImporter: userData: assetBundleName: diff --git a/Assets/_Vendor/Cinemachine/Timeline.meta b/Assets/_Vendor/Cinemachine/Timeline.meta new file mode 100644 index 0000000..08484cf --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0282251d79d6e964089ace2dc6e6e496 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs b/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs new file mode 100644 index 0000000..4a7e1a8 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs @@ -0,0 +1,84 @@ +using UnityEngine; +using UnityEngine.Playables; + +namespace Cinemachine.Timeline +{ + public sealed class CinemachineMixer : PlayableBehaviour + { + // The brain that this track controls + private CinemachineBrain mBrain; + private int mBrainOverrideId = -1; + private bool mPlaying; + + public override void OnGraphStop(Playable playable) + { + if (mBrain != null) + mBrain.ReleaseCameraOverride(mBrainOverrideId); // clean up + mBrainOverrideId = -1; + } + + public override void ProcessFrame(Playable playable, FrameData info, object playerData) + { + base.ProcessFrame(playable, info, playerData); + + // Get the brain that this track controls. + // Older versions of timeline sent the gameObject by mistake. + GameObject go = playerData as GameObject; + if (go == null) + mBrain = (CinemachineBrain)playerData; + else + mBrain = go.GetComponent(); + if (mBrain == null) + return; + + // Find which clips are active. We can process a maximum of 2. + // In the case that the weights don't add up to 1, the outgoing weight + // will be calculated as the inverse of the incoming weight. + int activeInputs = 0; + ICinemachineCamera camA = null; + ICinemachineCamera camB = null; + float camWeight = 1f; + for (int i = 0; i < playable.GetInputCount(); ++i) + { + CinemachineShotPlayable shot + = ((ScriptPlayable)playable.GetInput(i)).GetBehaviour(); + float weight = playable.GetInputWeight(i); + if (shot != null && shot.VirtualCamera != null + && playable.GetPlayState() == PlayState.Playing + && weight > 0.0001f) + { + if (activeInputs == 1) + camB = camA; + camWeight = weight; + camA = shot.VirtualCamera; + ++activeInputs; + if (activeInputs == 2) + break; + } + } + + float deltaTime = info.deltaTime; + if (!mPlaying) + { + if (mBrainOverrideId < 0) + mLastOverrideFrame = -1; + float time = Time.realtimeSinceStartup; + deltaTime = Time.unscaledDeltaTime; + if (!Application.isPlaying && (mLastOverrideFrame < 0 || time - mLastOverrideFrame > Time.maximumDeltaTime)) + deltaTime = -1; + mLastOverrideFrame = time; + } + + // Override the Cinemachine brain with our results + mBrainOverrideId = mBrain.SetCameraOverride( + mBrainOverrideId, camB, camA, camWeight, deltaTime); + + } + float mLastOverrideFrame; + + public override void PrepareFrame(Playable playable, FrameData info) + { + mPlaying = info.evaluationType == FrameData.EvaluationType.Playback; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs.meta b/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs.meta new file mode 100644 index 0000000..ee7318f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineMixer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 961772e8b1d75dd4a915fb8a236d5a8a +timeCreated: 1489083733 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs b/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs new file mode 100644 index 0000000..eb383d2 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs @@ -0,0 +1,38 @@ +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace Cinemachine.Timeline +{ + internal sealed class CinemachineShotPlayable : PlayableBehaviour + { + public CinemachineVirtualCameraBase VirtualCamera; + } + + public sealed class CinemachineShot : PlayableAsset, IPropertyPreview + { + public ExposedReference VirtualCamera; + + public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) + { + var playable = ScriptPlayable.Create(graph); + playable.GetBehaviour().VirtualCamera = VirtualCamera.Resolve(graph.GetResolver()); + return playable; + } + + // IPropertyPreview implementation + public void GatherProperties(PlayableDirector director, IPropertyCollector driver) + { + driver.AddFromName("m_LocalPosition.x"); + driver.AddFromName("m_LocalPosition.y"); + driver.AddFromName("m_LocalPosition.z"); + driver.AddFromName("m_LocalRotation.x"); + driver.AddFromName("m_LocalRotation.y"); + driver.AddFromName("m_LocalRotation.z"); + + driver.AddFromName("field of view"); + driver.AddFromName("near clip plane"); + driver.AddFromName("far clip plane"); + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs.meta b/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs.meta new file mode 100644 index 0000000..0478d22 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineShot.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 90fb794a295e73545af71bcdb7375791 +timeCreated: 1489083733 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs b/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs new file mode 100644 index 0000000..44502cf --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs @@ -0,0 +1,32 @@ +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace Cinemachine.Timeline +{ + [Serializable] + [TrackClipType(typeof(CinemachineShot))] + [TrackMediaType(TimelineAsset.MediaType.Script)] + [TrackBindingType(typeof(CinemachineBrain))] + [TrackColor(0.53f, 0.0f, 0.08f)] + public class CinemachineTrack : TrackAsset + { + public override Playable CreateTrackMixer( + PlayableGraph graph, GameObject go, int inputCount) + { + // Hack to set the display name of the clip to match the vcam + foreach (var c in GetClips()) + { + CinemachineShot shot = (CinemachineShot)c.asset; + CinemachineVirtualCameraBase vcam = shot.VirtualCamera.Resolve(graph.GetResolver()); + if (vcam != null) + c.displayName = vcam.Name; + } + + var mixer = ScriptPlayable.Create(graph); + mixer.SetInputCount(inputCount); + return mixer; + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs.meta b/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs.meta new file mode 100644 index 0000000..dd69b8f --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/CinemachineTrack.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 05acc715f855ced458d76ee6f8ac6c61 +timeCreated: 1489083732 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/Editor.meta b/Assets/_Vendor/Cinemachine/Timeline/Editor.meta new file mode 100644 index 0000000..96aa723 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 47030f88f181f334ab93c4b8ccfe1b78 +folderAsset: yes +timeCreated: 1489096338 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs b/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs new file mode 100644 index 0000000..f58204e --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs @@ -0,0 +1,111 @@ +using UnityEditor; +using UnityEngine; +using Cinemachine.Editor; + +namespace Cinemachine.Timeline +{ + [CustomEditor(typeof(CinemachineShot))] + internal sealed class CinemachineShotEditor : UnityEditor.Editor + { + private static readonly string[] m_excludeFields = new string[] { "m_Script" }; + private SerializedProperty mVirtualCameraProperty = null; + private static readonly GUIContent kVirtualCameraLabel + = new GUIContent("Virtual Camera", "The virtual camera to use for this shot"); + + private void OnEnable() + { + if (serializedObject != null) + mVirtualCameraProperty = serializedObject.FindProperty("VirtualCamera"); + } + + private void OnDisable() + { + DestroyComponentEditors(); + } + + private void OnDestroy() + { + DestroyComponentEditors(); + } + + public override void OnInspectorGUI() + { + CinemachineVirtualCameraBase obj + = mVirtualCameraProperty.exposedReferenceValue as CinemachineVirtualCameraBase; + if (obj == null) + { + serializedObject.Update(); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(mVirtualCameraProperty, kVirtualCameraLabel, GUILayout.ExpandWidth(true)); + obj = mVirtualCameraProperty.exposedReferenceValue as CinemachineVirtualCameraBase; + if ((obj == null) && GUILayout.Button(new GUIContent("Create"), GUILayout.ExpandWidth(false))) + { + CinemachineVirtualCameraBase vcam = CinemachineMenu.CreateDefaultVirtualCamera(); + mVirtualCameraProperty.exposedReferenceValue = vcam; + } + EditorGUILayout.EndHorizontal(); + serializedObject.ApplyModifiedProperties(); + } + else + { + serializedObject.Update(); + DrawPropertiesExcluding(serializedObject, m_excludeFields); + + // Create an editor for each of the cinemachine virtual cam and its components + UpdateComponentEditors(obj); + if (m_editors != null) + { + foreach (UnityEditor.Editor e in m_editors) + { + EditorGUILayout.Separator(); + if (e.target.GetType() != typeof(Transform)) + { + GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(1) } ); + EditorGUILayout.LabelField(e.target.GetType().Name, EditorStyles.boldLabel); + } + e.OnInspectorGUI(); + } + } + serializedObject.ApplyModifiedProperties(); + } + } + + CinemachineVirtualCameraBase m_cachedReferenceObject; + UnityEditor.Editor[] m_editors = null; + void UpdateComponentEditors(CinemachineVirtualCameraBase obj) + { + MonoBehaviour[] components = null; + if (obj != null) + components = obj.gameObject.GetComponents(); + int numComponents = (components == null) ? 0 : components.Length; + int numEditors = (m_editors == null) ? 0 : m_editors.Length; + if (m_cachedReferenceObject != obj || (numComponents + 1) != numEditors) + { + DestroyComponentEditors(); + m_cachedReferenceObject = obj; + if (obj != null) + { + m_editors = new UnityEditor.Editor[components.Length + 1]; + CreateCachedEditor(obj.gameObject.GetComponent(), null, ref m_editors[0]); + for (int i = 0; i < components.Length; ++i) + CreateCachedEditor(components[i], null, ref m_editors[i + 1]); + } + } + } + + void DestroyComponentEditors() + { + m_cachedReferenceObject = null; + if (m_editors != null) + { + for (int i = 0; i < m_editors.Length; ++i) + { + if (m_editors[i] != null) + UnityEngine.Object.DestroyImmediate(m_editors[i]); + m_editors[i] = null; + } + m_editors = null; + } + } + } +} diff --git a/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs.meta b/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs.meta new file mode 100644 index 0000000..e752452 --- /dev/null +++ b/Assets/_Vendor/Cinemachine/Timeline/Editor/CinemachineShotEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f24a4388d07ef494e8516cb859803e09 +timeCreated: 1484435492 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage b/Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage new file mode 100644 index 0000000..1ed6b83 Binary files /dev/null and b/Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage differ diff --git a/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta b/Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage.meta similarity index 53% rename from Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta rename to Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage.meta index ea2dc1e..39a4d1b 100644 --- a/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta +++ b/Assets/_Vendor/Cinemachine/Timeline/LegacyTimelineAPI.unitypackage.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b24ab3e82de189d4e97f2e6aa1170dba -timeCreated: 1435040073 -licenseType: Pro +guid: 1e24085edff8e4e499582d8dcf099510 +timeCreated: 1493908344 +licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/Assets/Demigiant.meta b/Assets/_Vendor/Demigiant.meta similarity index 58% rename from Assets/Demigiant.meta rename to Assets/_Vendor/Demigiant.meta index dd7c4b5..d823cb1 100644 --- a/Assets/Demigiant.meta +++ b/Assets/_Vendor/Demigiant.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: e8445646f82a4294ab79b5f66b93d339 +guid: ee6ea3294414b504da230ab1462c3f1f folderAsset: yes -timeCreated: 1435039945 -licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Demigiant/DOTween.meta b/Assets/_Vendor/Demigiant/DOTween.meta similarity index 58% rename from Assets/Demigiant/DOTween.meta rename to Assets/_Vendor/Demigiant/DOTween.meta index 377d20e..4837f03 100644 --- a/Assets/Demigiant/DOTween.meta +++ b/Assets/_Vendor/Demigiant/DOTween.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: fe7c987bf7671c8419248883cb4803f5 +guid: 3f1f111e66ff8564a89d3ff2e4a6a237 folderAsset: yes -timeCreated: 1435039945 -licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/DOTween.XML b/Assets/_Vendor/Demigiant/DOTween/DOTween.XML similarity index 81% rename from Assets/Demigiant/DOTween/DOTween.XML rename to Assets/_Vendor/Demigiant/DOTween/DOTween.XML index dfd017b..d49cc92 100644 --- a/Assets/Demigiant/DOTween/DOTween.XML +++ b/Assets/_Vendor/Demigiant/DOTween/DOTween.XML @@ -1,2207 +1,2551 @@ - - - - DOTween - - - - - Update type - - - - Updates every frame during Update calls - - - Updates every frame during LateUpdate calls - - - Updates using FixedUpdate calls - - - - Path mode (used to determine correct LookAt orientation) - - - - Ignores the path mode (and thus LookAt behaviour) - - - Regular 3D path - - - 2D top-down path - - - 2D side-scroller path - - - - Used internally - - - - - This class serves only as a utility class to store tween settings to apply on multiple tweens. - It is in no way needed otherwise, since you can directly apply tween settings to a tween via chaining - - - - A variable you can eventually Clear and reuse when needed, - to avoid instantiating TweenParams objects - - - Creates a new TweenParams object, which you can use to store tween settings - to pass to multiple tweens via myTween.SetAs(myTweenParms) - - - Clears and resets this TweenParams instance using default values, - so it can be reused without instantiating another one - - - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started - If TRUE the tween will be automatically killed when complete - - - Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. - The ID to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the target for the tween, which can then be used as a filter with DOTween's static methods. - IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. - When using shorcuts the shortcut target is already assigned as the tween's target, - so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. - The target to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - Loop behaviour type (default: LoopType.Restart) - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - Eventual overshoot or amplitude to use with Back or Elastic easeType (default is 1.70158) - Eventual period to use with Elastic easeType (default is 0) - - - Sets the ease of the tween using an AnimationCurve. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween using a custom ease function. - If applied to Sequences eases the whole sequence animation - - - Sets the recycling behaviour for the tween. - If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. - - - Sets the update type to the one defined in DOTween.defaultUpdateType (UpdateType.Normal unless changed) - and lets you choose if it should be independent from Unity's Time.timeScale - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the type of update (default or independent) for the tween - The type of update (default: UpdateType.Normal) - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the onStart callback for the tween. - Called the first time the tween is set in a playing state, after any eventual delay - - - Sets the onPlay callback for the tween. - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Sets the onRewind callback for the tween. - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Sets the onUpdate callback for the tween. - Called each time the tween updates - - - Sets the onStepComplete callback for the tween. - Called the moment the tween completes one loop cycle, even when going backwards - - - Sets the onComplete callback for the tween. - Called the moment the tween reaches its final forward position, loops included - - - Sets the onKill callback for the tween. - Called the moment the tween is killed - - - Sets the onWaypointChange callback for the tween. - Called when a path tween reaches a new waypoint - - - Sets a delayed startup for the tween. - Has no effect on Sequences or if the tween has already started - - - If isRelative is TRUE sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - - Used to separate DOTween class from the MonoBehaviour instance (in order to use static constructors on DOTween). - Contains all instance-based methods - - - - - Used to allow method chaining with DOTween.Init - - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - Used internally inside Unity Editor, as a trick to update DOTween's inspector at every frame - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - - Public so it can be used by lose scripts related to DOTween (like DOTweenAnimation) - - - - - Controls other tweens as a group - - - - - Indicates either a Tweener or a Sequence - - - - Called the first time the tween is set in a playing state, after any eventual delay - - - TimeScale for the tween - - - If TRUE the tween wil go backwards - - - Id (usable for filtering with DOTween static methods). Can be an int, a string, an object, or anything else - - - Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shorcuts - - - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Called when the tween state changes from playing to paused. - If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. - - - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Called each time the tween updates - - - Called the moment the tween completes one loop cycle - - - Called the moment the tween reaches completion (loops included) - - - Called the moment the tween is killed - - - Called when a path tween's current waypoint changes - - - Gets and sets the time position (loops included, delays excluded) of the tween - - - - Rotation mode used with DORotate methods - - - - - Fastest way that never rotates beyond 360° - - - - - Fastest way that rotates beyond 360° - - - - - Adds the given rotation to the transform using world axis and an advanced precision mode - (like when using transform.Rotate(Space.World)). - In this mode the end value is is always considered relative - - - - - Adds the given rotation to the transform's local axis - (like when rotating an object with the "local" switch enabled in Unity's editor or using transform.Rotate(Space.Self)). - In this mode the end value is is always considered relative - - - - - This plugin generates some GC allocations at startup - - - - - Don't assign this! It's assigned automatically when creating 0 duration tweens - - - - - Don't assign this! It's assigned automatically when setting the ease to an AnimationCurve or to a custom ease function - - - - - Types of log behaviours - - - - Log only warnings and errors - - - Log warnings, errors and additional infos - - - Log only errors - - - - Methods that extend Tween objects and allow to set their parameters - - - - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started - - - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started - If TRUE the tween will be automatically killed when complete - - - Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. - The ID to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the target for the tween, which can then be used as a filter with DOTween's static methods. - IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. - When using shorcuts the shortcut target is already assigned as the tween's target, - so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. - The target to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - Loop behaviour type (default: LoopType.Restart) - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - Eventual overshoot to use with Back ease (default is 1.70158) - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - Eventual amplitude to use with Elastic easeType (default is 1.70158) - Eventual period to use with Elastic easeType (default is 0) - - - Sets the ease of the tween using an AnimationCurve. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween using a custom ease function (which must return a value between 0 and 1). - If applied to Sequences eases the whole sequence animation - - - Allows the tween to be recycled after being killed. - - - Sets the recycling behaviour for the tween. - If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. - - - Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the type of update for the tween - The type of update (defalt: UpdateType.Normal) - - - Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale - The type of update - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the onStart callback for the tween. - Called the first time the tween is set in a playing state, after any eventual delay - - - Sets the onPlay callback for the tween. - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Sets the onPlay callback for the tween. - Called when the tween state changes from playing to paused. - If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. - - - Sets the onRewind callback for the tween. - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Sets the onUpdate callback for the tween. - Called each time the tween updates - - - Sets the onStepComplete callback for the tween. - Called the moment the tween completes one loop cycle, even when going backwards - - - Sets the onComplete callback for the tween. - Called the moment the tween reaches its final forward position, loops included - - - Sets the onKill callback for the tween. - Called the moment the tween is killed - - - Sets the onWaypointChange callback for the tween. - Called when a path tween's current waypoint changes - - - Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one. - Doesn't copy specific SetOptions settings: those will need to be applied manually each time. - Has no effect if the tween has already started. - NOTE: the tween's target will not be changed - Tween from which to copy the parameters - - - Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParams. - Has no effect if the tween has already started. - TweenParams from which to copy the parameters - - - Adds the given tween to the end of the Sequence. - Has no effect if the Sequence has already started - The tween to append - - - Adds the given tween to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The tween to prepend - - - Inserts the given tween at the same time position of the last tween added to the Sequence. - Has no effect if the Sequence has already started - - - Inserts the given tween at the given time position in the Sequence, - automatically adding an interval if needed. - Has no effect if the Sequence has already started - The time position where the tween will be placed - The tween to insert - - - Adds the given interval to the end of the Sequence. - Has no effect if the Sequence has already started - The interval duration - - - Adds the given interval to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The interval duration - - - Adds the given callback to the end of the Sequence. - Has no effect if the Sequence has already started - The callback to append - - - Adds the given callback to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The callback to prepend - - - Inserts the given callback at the given time position in the Sequence, - automatically adding an interval if needed. - Has no effect if the Sequence has already started - The time position where the callback will be placed - The callback to insert - - - Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue - then immediately sends the target to the previously set endValue. - - - Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue - then immediately sends the target to the previously set endValue. - If TRUE the FROM value will be calculated as relative to the current one - - - Sets a delayed startup for the tween. - Has no effect on Sequences or if the tween has already started - - - Sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isRelative is TRUE sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - Options for float tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector2 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector2 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Quaternion tweens - If TRUE (default) the rotation will take the shortest route, and will not rotate more than 360°. - If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative - - - Options for Color tweens - If TRUE only the alpha value of the color will be tweened - - - Options for Vector4 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - If TRUE, rich text will be interpreted correctly while animated, - otherwise all tags will be considered as normal text - The type of scramble to use, if any - A string containing the characters to use for scrambling. - Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. - Leave it to NULL to use default ones - - - Options for Vector3Array tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3Array tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Path tweens (created via the DOPath shortcut) - The eventual movement axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - The eventual rotation axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - - - Options for Path tweens (created via the DOPath shortcut) - If TRUE the path will be automatically closed - The eventual movement axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - The eventual rotation axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards the given position. - Must be chained directly to the tween creation method or to a SetOptions - The position to look at - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards another transform. - Must be chained directly to the tween creation method or to a SetOptions - The transform to look at - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target to the path, with the given lookAhead. - Must be chained directly to the tween creation method or to a SetOptions - The percentage of lookAhead to use (0 to 1) - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - - Methods that extend Tween objects and allow to control or get data from them - - - - Completes the tween - - - Flips the direction of this tween (backwards if it was going forward or viceversa) - - - Forces the tween to initialize its settings immediately - - - Send the tween to the given position in time - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - Kills the tween - If TRUE completes the tween before killing it - - - Pauses the tween - - - Plays the tween - - - Sets the tween in a backwards direction and plays it - - - Sets the tween in a forward direction and plays it - - - Restarts the tween from the beginning - If TRUE includes the eventual tween delay, otherwise skips it - - - Rewinds the tween - If TRUE includes the eventual tween delay, otherwise skips it - - - Plays the tween if it was paused, pauses it if it was playing - - - Send a path tween to the given waypoint. - Has no effect if this is not a path tween. - BEWARE, this is a special utility method: - it works only with Linear eases. Also, the lookAt direction might be wrong after calling this and might need to be set manually - (because it relies on a smooth path movement and doesn't work well with jumps that encompass dramatic direction changes) - Waypoint index to reach - (if higher than the max waypoint index the tween will simply go to the last one) - If TRUE will play the tween after reaching the given waypoint, otherwise it will pause it - - - - Creates a yield instruction that waits until the tween is killed or complete. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForCompletion(); - - - - - Creates a yield instruction that waits until the tween is killed or rewinded. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForRewind(); - - - - - Creates a yield instruction that waits until the tween is killed. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForKill(); - - - - - Creates a yield instruction that waits until the tween is killed or has gone through the given amount of loops. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForElapsedLoops(2); - - Elapsed loops to wait for - - - - Creates a yield instruction that waits until the tween is killed or has reached the given position (loops included, delays excluded). - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForPosition(2.5f); - - Position (loops included, delays excluded) to wait for - - - - Creates a yield instruction that waits until the tween is killed or started - (meaning when the tween is set in a playing state the first time, after any eventual delay). - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForStart(); - - - - Returns the total number of loops completed by this tween - - - Returns the eventual delay set for this tween - - - Returns the duration of this tween (delays excluded). - NOTE: when using settings like SpeedBased, the duration will be recalculated when the tween starts - If TRUE returns the full duration loops included, - otherwise the duration of a single loop cycle - - - Returns the elapsed time for this tween (delays exluded) - If TRUE returns the elapsed time since startup loops included, - otherwise the elapsed time within the current loop cycle - - - Returns the elapsed percentage (0 to 1) of this tween (delays exluded) - If TRUE returns the elapsed percentage since startup loops included, - otherwise the elapsed percentage within the current loop cycle - - - Returns the elapsed percentage (0 to 1) of this tween (delays exluded), - based on a single loop, and calculating eventual backwards Yoyo loops as 1 to 0 instead of 0 to 1 - - - Returns FALSE if this tween has been killed. - BEWARE: if this tween is recyclable it might have been spawned again for another use and thus return TRUE anyway. - When working with recyclable tweens you should take care to know when a tween has been killed and manually set your references to NULL. - If you want to be sure your references are set to NULL when a tween is killed you can use the OnKill callback like this: - .OnKill(()=> myTweenReference = null) - - - Returns TRUE if this tween was reversed and is set to go backwards - - - Returns TRUE if the tween is complete - (silently fails and returns FALSE if the tween has been killed) - - - Returns TRUE if this tween has been initialized - - - Returns TRUE if this tween is playing - - - - Returns a point on a path based on the given path percentage - (returns Vector3.zero if this is not a path tween, if the tween is invalid, or if the path is not yet initialized) - A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). - You can force a path to be initialized by calling myTween.ForceInit(). - - Percentage of the path (0 to 1) on which to get the point - - - - Returns the length of a path (returns -1 if this is not a path tween, if the tween is invalid, or if the path is not yet initialized). - A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). - You can force a path to be initialized by calling myTween.ForceInit(). - - - - - Used for tween callbacks - - - - - Used for tween callbacks - - - - - Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1. - - - - - Used in place of System.Func, which is not available in mscorlib. - - - - - Used in place of System.Action. - - - - - Types of autoPlay behaviours - - - - No tween is automatically played - - - Only Sequences are automatically played - - - Only Tweeners are automatically played - - - All tweens are automatically played - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances - - - - Tweens an AudioSource's volume to the given value. - Also stores the AudioSource as the tween's target so it can be used for filtered operations - The end value to reach (0 to 1)The duration of the tween - - - Tweens an AudioSource's pitch to the given value. - Also stores the AudioSource as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's aspect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's backgroundColor to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's farClipPlane to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's fieldOfView to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's nearClipPlane to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's orthographicSize to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's pixelRect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's rect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Shakes a Camera's localPosition along its relative X Y axes with the given values. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Camera's localPosition along its relative X Y axes with the given values. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Camera's localRotation. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Camera's localRotation. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Tweens a Light's color to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Light's intensity to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Light's shadowStrength to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a LineRenderer's color to the given value. - Also stores the LineRenderer as the tween's target so it can be used for filtered operations. - Note that this method requires to also insert the start colors for the tween, - since LineRenderers have no way to get them. - The start value to tween from - The end value to reachThe duration of the tween - - - Tweens a Material's color to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's named color property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Material's alpha color to the given value - (will have no effect unless your material supports transparency). - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's alpha color to the given value - (will have no effect unless your material supports transparency). - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Material's named float property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's texture offset to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The duration of the tween - - - Tweens a Material's named texture offset property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's texture scale to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The duration of the tween - - - Tweens a Material's named texture scale property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's named Vector property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Rigidbody's position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's X position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's Y position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's Z position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's rotation to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Rigidbody's rotation so that it will look towards the given position. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The position to look atThe duration of the tween - Eventual axis constraint for the rotation - The vector that defines in which direction up is (default: Vector3.up) - - - Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the Rigidbody as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a TrailRenderer's startWidth/endWidth to the given value. - Also stores the TrailRenderer as the tween's target so it can be used for filtered operations - The end startWidth to reachThe end endWidth to reach - The duration of the tween - - - Tweens a TrailRenderer's time to the given value. - Also stores the TrailRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's X position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Y position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Z position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's X localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Y localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Z localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's rotation to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Transform's localRotation to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Transform's localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's localScale uniformly to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's X localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's Y localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's Z localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's rotation so that it will look towards the given position. - Also stores the transform as the tween's target so it can be used for filtered operations - The position to look atThe duration of the tween - Eventual axis constraint for the rotation - The vector that defines in which direction up is (default: Vector3.up) - - - Punches a Transform's localPosition towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - The direction and strength of the punch (added to the Transform's current position) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the punch direction and the opposite direction, - while 0 oscillates only between the punch and the start position - If TRUE the tween will smoothly snap all values to integers - - - Punches a Transform's localScale towards the given size and then back to the starting one - as if it was connected to the starting scale via an elastic. - The punch strength (added to the Transform's current scale) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting size when bouncing backwards. - 1 creates a full oscillation between the punch scale and the opposite scale, - while 0 oscillates only between the punch scale and the start scale - - - Punches a Transform's localRotation towards the given size and then back to the starting one - as if it was connected to the starting rotation via an elastic. - The punch strength (added to the Transform's current rotation) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. - 1 creates a full oscillation between the punch rotation and the opposite rotation, - while 0 oscillates only between the punch and the start rotation - - - Shakes a Transform's localPosition with the given values. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - - - Shakes a Transform's localPosition with the given values. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - - - Shakes a Transform's localRotation. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Transform's localRotation. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Transform's localScale. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Shakes a Transform's localScale. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - - - Tweens a Transform's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's position through the given path waypoints, using the chosen path algorithm. - Also stores the transform as the tween's target so it can be used for filtered operations - The waypoints to go through - The duration of the tween - The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) - - - Tweens a Transform's localPosition through the given path waypoints, using the chosen path algorithm. - Also stores the transform as the tween's target so it can be used for filtered operations - The waypoint to go through - The duration of the tween - The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) - - - Tweens a Light's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Light as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Material's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Material as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Material's named color property to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Material as the tween's target so it can be used for filtered operations - The value to tween to - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Transform's position BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableMove tweens to work together on the same target, - instead than fight each other as multiple DOMove would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableMove tweens to work together on the same target, - instead than fight each other as multiple DOMove would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - EXPERIMENTAL METHOD - Tweens a Transform's rotation BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableRotate tweens to work together on the same target, - instead than fight each other as multiple DORotate would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - Rotation mode - - - EXPERIMENTAL METHOD - Tweens a Transform's lcoalRotation BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableRotate tweens to work together on the same target, - instead than fight each other as multiple DORotate would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - Rotation mode - - - Tweens a Transform's localScale BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableScale tweens to work together on the same target, - instead than fight each other as multiple DOScale would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - - - - Completes all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - - - - Kills all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens killed. - - If TRUE completes the tween before killing it - - - - Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens flipped. - - - - - Sends to the given position all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - - Pauses all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens paused. - - - - - Plays all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays backwards all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays forward all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Restarts all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens restarted. - - - - - Rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - - - - Type of path to use with DOPath tweens - - - - Linear, composed of straight segments between each waypoint - - - Curved path (which uses Catmull-Rom curves) - - - - Main DOTween class. Contains static methods to create and control tweens in a generic way - - - - DOTween's version - - - If TRUE (default) makes tweens slightly slower but safer, automatically taking care of a series of things - (like targets becoming null while a tween is playing). - Default: TRUE - - - If TRUE you will get a DOTween report when exiting play mode (only in the Editor). - Useful to know how many max Tweeners and Sequences you reached and optimize your final project accordingly. - Beware, this will slightly slow down your tweens while inside Unity Editor. - Default: FALSE - - - Global DOTween timeScale. - Default: 1 - - - If TRUE draws path gizmos in Unity Editor (if the gizmos button is active). - Deactivate this if you want to avoid gizmos overhead while in Unity Editor - - - Default updateType for new tweens. - Default: UpdateType.Normal - - - Sets whether Unity's timeScale should be taken into account by default or not. - Default: false - - - Default autoPlay behaviour for new tweens. - Default: AutoPlay.All - - - Default autoKillOnComplete behaviour for new tweens. - Default: TRUE - - - Default loopType applied to all new tweens. - Default: LoopType.Restart - - - If TRUE all newly created tweens are set as recyclable, otherwise not. - Default: FALSE - - - Default ease applied to all new Tweeners (not to Sequences which always have Ease.Linear as default). - Default: Ease.InOutQuad - - - Default overshoot/amplitude used for eases - Default: 1.70158f - - - Default period used for eases - Default: 0 - - - - Must be called once, before the first ever DOTween call/reference, - otherwise it will be called automatically and will use default options. - Calling it a second time won't have any effect. - You can chain SetCapacity to this method, to directly set the max starting size of Tweeners and Sequences: - DOTween.Init(false, false, LogBehaviour.Default).SetCapacity(100, 20); - - If TRUE all new tweens will be set for recycling, meaning that when killed, - instead of being destroyed, they will be put in a pool and reused instead of creating new tweens. This option allows you to avoid - GC allocations by reusing tweens, but you will have to take care of tween references, since they might result active - even if they were killed (since they might have been respawned and are now being used for other tweens). - If you want to automatically set your tween references to NULL when a tween is killed - you can use the OnKill callback like this: - .OnKill(()=> myTweenReference = null) - You can change this setting at any time by changing the static property, - or you can set the recycling behaviour for each tween separately, using: - SetRecyclable(bool recyclable) - Default: FALSE - If TRUE makes tweens slightly slower but safer, automatically taking care of a series of things - (like targets becoming null while a tween is playing). - You can change this setting at any time by changing the static property. - Default: FALSE - Type of logging to use. - You can change this setting at any time by changing the static property. - Default: ErrorsOnly - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - - Kills all tweens, clears all cached tween pools and plugins and resets the max Tweeners/Sequences capacities to the default values. - - If TRUE also destroys DOTween's gameObject and resets its initializiation, default settings and everything else - (so that next time you use it it will need to be re-initialized) - - - - Clears all cached tween pools. - - - - - Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL) - and returns the total number of invalid tweens found and removed. - Automatically called when loading a new scene if is TRUE. - BEWARE: this is a slightly expensive operation so use it with care - - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using a custom plugin - The plugin to use. Each custom plugin implements a static Get() method - you'll need to call to assign the correct plugin in the correct way, like this: - CustomPlugin.Get() - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens only one axis of a Vector3 to the given value using default plugins. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - The axis to tween - - - Tweens only the alpha of a Color to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a virtual property from the given start to the given end value - and implements a setter that allows to use that value with an external method or a lambda - Example: - To(MyMethod, 0, 12, 0.5f); - Where MyMethod is a function that accepts a float parameter (which will be the result of the virtual tween) - The action to perform with the tweened value - The value to start from - The end value to reach - The duration of the virtual tween - - - - Punches a Vector3 towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - This tween type generates some GC allocations at startup - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The direction and strength of the punch - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the direction and the opposite decaying direction, - while 0 oscillates only between the starting position and the decaying direction - - - Shakes a Vector3 with the given values. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction and behave like a random punch. - If TRUE only shakes on the X Y axis (looks better with things like cameras). - - - Shakes a Vector3 with the given values. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction and behave like a random punch. - - - Tweens a property or field to the given values using default plugins. - Ease is applied between each segment and not as a whole. - This tween type generates some GC allocations at startup - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end values to reach for each segment. This array must have the same length as durations - The duration of each segment. This array must have the same length as endValues - - - - Returns a new to be used for tween groups - - - - Completes all tweens and returns the number of actual tweens completed - (meaning tweens that don't have infinite loops and were not already complete) - - - Completes all tweens with the given ID or target and returns the number of actual tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - - Flips all tweens (changing their direction to forward if it was backwards and viceversa), - then returns the number of actual tweens flipped - - - Flips the tweens with the given ID or target (changing their direction to forward if it was backwards and viceversa), - then returns the number of actual tweens flipped - - - Sends all tweens to the given position (calculating also eventual loop cycles) and returns the actual tweens involved - - - Sends all tweens with the given ID or target to the given position (calculating also eventual loop cycles) - and returns the actual tweens involved - - - Kills all tweens and returns the number of actual tweens killed - If TRUE completes the tweens before killing them - - - Kills all tweens with the given ID or target and returns the number of actual tweens killed - If TRUE completes the tweens before killing them - - - Pauses all tweens and returns the number of actual tweens paused - - - Pauses all tweens with the given ID or target and returns the number of actual tweens paused - (meaning the tweens that were actually playing and have been paused) - - - Plays all tweens and returns the number of actual tweens played - (meaning tweens that were not already playing or complete) - - - Plays all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - - - Plays all tweens with the given target and the given ID, and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - - - Plays backwards all tweens and returns the number of actual tweens played - (meaning tweens that were not already started, playing backwards or rewinded) - - - Plays backwards all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already started, playing backwards or rewinded) - - - Plays forward all tweens and returns the number of actual tweens played - (meaning tweens that were not already playing forward or complete) - - - Plays forward all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already playing forward or complete) - - - Restarts all tweens, then returns the number of actual tweens restarted - - - Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted - - - Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - - - Rewinds and pauses all tweens, then returns the number of actual tweens rewinded - (meaning tweens that were not already rewinded) - - - Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded - (meaning the tweens that were not already rewinded) - - - Toggles the play state of all tweens and returns the number of actual tweens toggled - (meaning tweens that could be played or paused, depending on the toggle state) - - - Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled - (meaning the tweens that could be played or paused, depending on the toggle state) - - - - Returns TRUE if a tween with the given ID or target is active (regardless if it's playing or not). - You can also use this to know if a shortcut tween is active for a given target. - Example: - transform.DOMoveX(45, 1); // transform is automatically added as the tween target - DOTween.IsTweening(transform); // Returns true - - - - - Returns the total number of active and playing tweens. - A tween is considered as playing even if its delay is actually playing - - - - - Returns a list of all active tweens in a playing state. - Returns NULL if there are no active playing tweens. - Beware: each time you call this method a new list is generated, so use it for debug only - - - - - Returns a list of all active tweens in a paused state. - Returns NULL if there are no active paused tweens. - Beware: each time you call this method a new list is generated, so use it for debug only - - - - - Returns a list of all active tweens with the given id. - Returns NULL if there are no active tweens with the given id. - Beware: each time you call this method a new list is generated - If TRUE returns only the tweens with the given ID that are currently playing - - - - - Returns a list of all active tweens with the given target. - Returns NULL if there are no active tweens with the given target. - Beware: each time you call this method a new list is generated - If TRUE returns only the tweens with the given target that are currently playing - - - - DOTween's log behaviour. - Default: LogBehaviour.ErrorsOnly - - - - Path plugin works exclusively with Transforms - - - - - Allows to wrap ease method in special ways, adding extra features - - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - Ease type - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - AnimationCurve to use for the ease - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - Custom ease function to use - - - - Types of loop - - - - Each loop cycle restarts from the beginning - - - The tween moves forward and backwards at alternate cycles - - - Continuously increments the tween at the end of each loop cycle (A to B, B to B+(A-B), and so on), thus always moving "onward". - In case of String tweens works only if the tween is set as relative - - - - Animates a single value - - - - Changes the start value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - If bigger than 0 applies it as the new tween duration - - - Changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If bigger than 0 applies it as the new tween duration - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - Changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - Changes the start and end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - The new end value - If bigger than 0 applies it as the new tween duration - - - - Creates virtual tweens that can be used to change other elements via their OnUpdate calls - - - - - Tweens a virtual float. - You can add regular settings to the generated tween, - but do not use SetUpdate or you will overwrite the onVirtualUpdate parameter - - The value to start from - The value to tween to - The duration of the tween - A callback which must accept a parameter of type float, called at each update - - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - Eventual overshoot to use with Back ease - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - Eventual amplitude to use with Elastic easeType - Eventual period to use with Elastic easeType - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The AnimationCurve to use for ease - - - Fires the given callback after the given time. - Callback delay - Callback to fire when the delay has expired - If TRUE (default) ignores Unity's timeScale - - - - Used to interpret AnimationCurves as eases. - Public so it can be used by external ease factories - - - - - This class contains a C# port of the easing equations created by Robert Penner (http://robertpenner.com/easing). - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Struct that stores two colors (used for LineRenderer tweens) - - - - - What axis to constrain in case of Vector tweens - - - - - Type of scramble to apply to string tweens - - - - - No scrambling of characters - - - - - A-Z + a-z + 0-9 characters - - - - - A-Z characters - - - - - a-z characters - - - - - 0-9 characters - - - - - Custom characters - - - - - Path control point - - - - - Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected - - - - - Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected - - - - - Returns a Vector3 with z = 0 - - - - - Returns the 2D angle between two vectors - - - - - Gets the point on the path at the given percentage (0 to 1) - - The percentage (0 to 1) at which to get the point - If TRUE constant speed is taken into account, otherwise not - - - - Public only so custom shortcuts can access some of these methods - - - - - Additional notices passed to plugins when updating. - Public so it can be used by custom plugins. Internally, only PathPlugin uses it - - - - - None - - - - - Lets the plugin know that we restarted or rewinded - - - - + + + + DOTween + + + + + Types of autoPlay behaviours + + + + No tween is automatically played + + + Only Sequences are automatically played + + + Only Tweeners are automatically played + + + All tweens are automatically played + + + + What axis to constrain in case of Vector tweens + + + + Called the first time the tween is set in a playing state, after any eventual delay + + + + Used in place of System.Func, which is not available in mscorlib. + + + + + Used in place of System.Action. + + + + + Public so it can be used by lose scripts related to DOTween (like DOTweenAnimation) + + + + + Used to separate DOTween class from the MonoBehaviour instance (in order to use static constructors on DOTween). + Contains all instance-based methods + + + + Used internally inside Unity Editor, as a trick to update DOTween's inspector at every frame + + + + Directly sets the current max capacity of Tweeners and Sequences + (meaning how many Tweeners and Sequences can be running at the same time), + so that DOTween doesn't need to automatically increase them in case the max is reached + (which might lead to hiccups when that happens). + Sequences capacity must be less or equal to Tweeners capacity + (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). + Beware: use this method only when there are no tweens running. + + Max Tweeners capacity. + Default: 200 + Max Sequences capacity. + Default: 50 + + + + This class contains a C# port of the easing equations created by Robert Penner (http://robertpenner.com/easing). + + + + + Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. + + + Current time (in frames or seconds). + + + Expected easing duration (in frames or seconds). + + Unused: here to keep same delegate for all ease types. + Unused: here to keep same delegate for all ease types. + + The eased value. + + + + + Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. + + + Current time (in frames or seconds). + + + Expected easing duration (in frames or seconds). + + Unused: here to keep same delegate for all ease types. + Unused: here to keep same delegate for all ease types. + + The eased value. + + + + + Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. + + + Current time (in frames or seconds). + + + Expected easing duration (in frames or seconds). + + Unused: here to keep same delegate for all ease types. + Unused: here to keep same delegate for all ease types. + + The eased value. + + + + + Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected + + + + + Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected + + + + + Used to interpret AnimationCurves as eases. + Public so it can be used by external ease factories + + + + + Additional notices passed to plugins when updating. + Public so it can be used by custom plugins. Internally, only PathPlugin uses it + + + + + None + + + + + Lets the plugin know that we restarted or rewinded + + + + + OnRewind callback behaviour (can only be set via DOTween's Utility Panel) + + + + + When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will be fired only if the tween isn't already rewinded + + + + + When calling Rewind, OnRewind callbacks will always be fired, even if the tween is already rewinded. + When calling PlayBackwards/SmoothRewind instead, OnRewind callbacks will be fired only if the tween isn't already rewinded + + + + + When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will always be fired, even if the tween is already rewinded + + + + + Public only so custom shortcuts can access some of these methods + + + + + INTERNAL: used by DO shortcuts and Modules to set special startup mode + + + + + INTERNAL: used by DO shortcuts and Modules to set the tween as blendable + + + + + INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed + + + + + Used to dispatch commands that need to be captured externally, usually by Modules + + + + + Returns a Vector3 with z = 0 + + + + + Returns the 2D angle between two vectors + + + + + Uses approximate equality on each axis instead of Unity's Vector3 equality, + because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it. + + + + + Looks for the type withing all possible project assembly names + + + + + Struct that stores two colors (used for LineRenderer tweens) + + + + + Used for tween callbacks + + + + + Used for tween callbacks + + + + + Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1. + + + + + Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly. + Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence). + To use it, call DOTween.To with the plugin parameter overload, passing it PureQuaternionPlugin.Plug() as first parameter + (do not use any of the other public PureQuaternionPlugin methods): + DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration); + + + + + Plug this plugin inside a DOTween.To call. + Example: + DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration); + + + + INTERNAL: do not use + + + INTERNAL: do not use + + + INTERNAL: do not use + + + INTERNAL: do not use + + + INTERNAL: do not use + + + INTERNAL: do not use + + + INTERNAL: do not use + + + + Main DOTween class. Contains static methods to create and control tweens in a generic way + + + + DOTween's version + + + If TRUE (default) makes tweens slightly slower but safer, automatically taking care of a series of things + (like targets becoming null while a tween is playing). + Default: TRUE + + + If TRUE you will get a DOTween report when exiting play mode (only in the Editor). + Useful to know how many max Tweeners and Sequences you reached and optimize your final project accordingly. + Beware, this will slightly slow down your tweens while inside Unity Editor. + Default: FALSE + + + Global DOTween timeScale. + Default: 1 + + + If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens + (unless they're set as timeScaleIndependent, in which case a value between the last timestep + and will be used instead). + Setting this to TRUE will lead to smoother animations. + Default: FALSE + + + If is TRUE, this indicates the max timeStep that an independent update call can last. + Setting this to TRUE will lead to smoother animations. + Default: FALSE + + + DOTween's log behaviour. + Default: LogBehaviour.ErrorsOnly + + + If TRUE draws path gizmos in Unity Editor (if the gizmos button is active). + Deactivate this if you want to avoid gizmos overhead while in Unity Editor + + + Default updateType for new tweens. + Default: UpdateType.Normal + + + Sets whether Unity's timeScale should be taken into account by default or not. + Default: false + + + Default autoPlay behaviour for new tweens. + Default: AutoPlay.All + + + Default autoKillOnComplete behaviour for new tweens. + Default: TRUE + + + Default loopType applied to all new tweens. + Default: LoopType.Restart + + + If TRUE all newly created tweens are set as recyclable, otherwise not. + Default: FALSE + + + Default ease applied to all new Tweeners (not to Sequences which always have Ease.Linear as default). + Default: Ease.InOutQuad + + + Default overshoot/amplitude used for eases + Default: 1.70158f + + + Default period used for eases + Default: 0 + + + + Must be called once, before the first ever DOTween call/reference, + otherwise it will be called automatically and will use default options. + Calling it a second time won't have any effect. + You can chain SetCapacity to this method, to directly set the max starting size of Tweeners and Sequences: + DOTween.Init(false, false, LogBehaviour.Default).SetCapacity(100, 20); + + If TRUE all new tweens will be set for recycling, meaning that when killed, + instead of being destroyed, they will be put in a pool and reused instead of creating new tweens. This option allows you to avoid + GC allocations by reusing tweens, but you will have to take care of tween references, since they might result active + even if they were killed (since they might have been respawned and are now being used for other tweens). + If you want to automatically set your tween references to NULL when a tween is killed + you can use the OnKill callback like this: + .OnKill(()=> myTweenReference = null) + You can change this setting at any time by changing the static property, + or you can set the recycling behaviour for each tween separately, using: + SetRecyclable(bool recyclable) + Default: FALSE + If TRUE makes tweens slightly slower but safer, automatically taking care of a series of things + (like targets becoming null while a tween is playing). + You can change this setting at any time by changing the static property. + Default: FALSE + Type of logging to use. + You can change this setting at any time by changing the static property. + Default: ErrorsOnly + + + + Directly sets the current max capacity of Tweeners and Sequences + (meaning how many Tweeners and Sequences can be running at the same time), + so that DOTween doesn't need to automatically increase them in case the max is reached + (which might lead to hiccups when that happens). + Sequences capacity must be less or equal to Tweeners capacity + (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). + Beware: use this method only when there are no tweens running. + + Max Tweeners capacity. + Default: 200 + Max Sequences capacity. + Default: 50 + + + + Kills all tweens, clears all cached tween pools and plugins and resets the max Tweeners/Sequences capacities to the default values. + + If TRUE also destroys DOTween's gameObject and resets its initializiation, default settings and everything else + (so that next time you use it it will need to be re-initialized) + + + + Clears all cached tween pools. + + + + + Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL) + and returns the total number of invalid tweens found and removed. + IMPORTANT: this will cause an error on UWP platform, so don't use it there + BEWARE: this is a slightly expensive operation so use it with care + + + + + Updates all tweens that are set to . + + Manual deltaTime + Unscaled delta time (used with tweens set as timeScaleIndependent) + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a property or field to the given value using a custom plugin + The plugin to use. Each custom plugin implements a static Get() method + you'll need to call to assign the correct plugin in the correct way, like this: + CustomPlugin.Get() + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens only one axis of a Vector3 to the given value using default plugins. + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + The axis to tween + + + Tweens only the alpha of a Color to the given value using default plugins + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end value to reachThe tween's duration + + + Tweens a virtual property from the given start to the given end value + and implements a setter that allows to use that value with an external method or a lambda + Example: + To(MyMethod, 0, 12, 0.5f); + Where MyMethod is a function that accepts a float parameter (which will be the result of the virtual tween) + The action to perform with the tweened value + The value to start from + The end value to reach + The duration of the virtual tween + + + + Punches a Vector3 towards the given direction and then back to the starting one + as if it was connected to the starting position via an elastic. + This tween type generates some GC allocations at startup + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The direction and strength of the punch + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. + 1 creates a full oscillation between the direction and the opposite decaying direction, + while 0 oscillates only between the starting position and the decaying direction + + + Shakes a Vector3 with the given values. + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction and behave like a random punch. + If TRUE only shakes on the X Y axis (looks better with things like cameras). + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Vector3 with the given values. + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction and behave like a random punch. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Tweens a property or field to the given values using default plugins. + Ease is applied between each segment and not as a whole. + This tween type generates some GC allocations at startup + A getter for the field or property to tween. + Example usage with lambda:()=> myProperty + A setter for the field or property to tween + Example usage with lambda:x=> myProperty = x + The end values to reach for each segment. This array must have the same length as durations + The duration of each segment. This array must have the same length as endValues + + + + Returns a new to be used for tween groups + + + + Completes all tweens and returns the number of actual tweens completed + (meaning tweens that don't have infinite loops and were not already complete) + For Sequences only: if TRUE also internal Sequence callbacks will be fired, + otherwise they will be ignored + + + Completes all tweens with the given ID or target and returns the number of actual tweens completed + (meaning the tweens that don't have infinite loops and were not already complete) + For Sequences only: if TRUE internal Sequence callbacks will be fired, + otherwise they will be ignored + + + Flips all tweens (changing their direction to forward if it was backwards and viceversa), + then returns the number of actual tweens flipped + + + Flips the tweens with the given ID or target (changing their direction to forward if it was backwards and viceversa), + then returns the number of actual tweens flipped + + + Sends all tweens to the given position (calculating also eventual loop cycles) and returns the actual tweens involved + + + Sends all tweens with the given ID or target to the given position (calculating also eventual loop cycles) + and returns the actual tweens involved + + + Kills all tweens and returns the number of actual tweens killed + If TRUE completes the tweens before killing them + + + Kills all tweens and returns the number of actual tweens killed + If TRUE completes the tweens before killing them + Eventual IDs or targets to exclude from the killing + + + Kills all tweens with the given ID or target and returns the number of actual tweens killed + If TRUE completes the tweens before killing them + + + Pauses all tweens and returns the number of actual tweens paused + + + Pauses all tweens with the given ID or target and returns the number of actual tweens paused + (meaning the tweens that were actually playing and have been paused) + + + Plays all tweens and returns the number of actual tweens played + (meaning tweens that were not already playing or complete) + + + Plays all tweens with the given ID or target and returns the number of actual tweens played + (meaning the tweens that were not already playing or complete) + + + Plays all tweens with the given target and the given ID, and returns the number of actual tweens played + (meaning the tweens that were not already playing or complete) + + + Plays backwards all tweens and returns the number of actual tweens played + (meaning tweens that were not already started, playing backwards or rewinded) + + + Plays backwards all tweens with the given ID or target and returns the number of actual tweens played + (meaning the tweens that were not already started, playing backwards or rewinded) + + + Plays backwards all tweens with the given target and ID and returns the number of actual tweens played + (meaning the tweens that were not already started, playing backwards or rewinded) + + + Plays forward all tweens and returns the number of actual tweens played + (meaning tweens that were not already playing forward or complete) + + + Plays forward all tweens with the given ID or target and returns the number of actual tweens played + (meaning the tweens that were not already playing forward or complete) + + + Plays forward all tweens with the given target and ID and returns the number of actual tweens played + (meaning the tweens that were not already started, playing backwards or rewinded) + + + Restarts all tweens, then returns the number of actual tweens restarted + + + Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it + + + Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played + (meaning the tweens that were not already playing or complete) + If TRUE includes the eventual tweens delays, otherwise skips them + If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it + + + Rewinds and pauses all tweens, then returns the number of actual tweens rewinded + (meaning tweens that were not already rewinded) + + + Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded + (meaning the tweens that were not already rewinded) + + + Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded + (meaning tweens that were not already rewinded). + A "smooth rewind" animates the tween to its start position, + skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. + Note that a tween that was smoothly rewinded will have its play direction flipped + + + Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded + (meaning the tweens that were not already rewinded). + A "smooth rewind" animates the tween to its start position, + skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. + Note that a tween that was smoothly rewinded will have its play direction flipped + + + Toggles the play state of all tweens and returns the number of actual tweens toggled + (meaning tweens that could be played or paused, depending on the toggle state) + + + Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled + (meaning the tweens that could be played or paused, depending on the toggle state) + + + + Returns TRUE if a tween with the given ID or target is active. + You can also use this to know if a shortcut tween is active for a given target. + Example: + transform.DOMoveX(45, 1); // transform is automatically added as the tween target + DOTween.IsTweening(transform); // Returns true + + The target or ID to look for + If FALSE (default) returns TRUE as long as a tween for the given target/ID is active, + otherwise also requires it to be playing + + + + Returns the total number of active and playing tweens. + A tween is considered as playing even if its delay is actually playing + + + + + Returns a list of all active tweens in a playing state. + Returns NULL if there are no active playing tweens. + Beware: each time you call this method a new list is generated, so use it for debug only + + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) + + + + Returns a list of all active tweens in a paused state. + Returns NULL if there are no active paused tweens. + Beware: each time you call this method a new list is generated, so use it for debug only + + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) + + + + Returns a list of all active tweens with the given id. + Returns NULL if there are no active tweens with the given id. + Beware: each time you call this method a new list is generated + + If TRUE returns only the tweens with the given ID that are currently playing + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) + + + + Returns a list of all active tweens with the given target. + Returns NULL if there are no active tweens with the given target. + Beware: each time you call this method a new list is generated + If TRUE returns only the tweens with the given target that are currently playing + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) + + + + + Creates virtual tweens that can be used to change other elements via their OnUpdate calls + + + + + Tweens a virtual float. + You can add regular settings to the generated tween, + but do not use SetUpdate or you will overwrite the onVirtualUpdate parameter + + The value to start from + The value to tween to + The duration of the tween + A callback which must accept a parameter of type float, called at each update + + + + Returns a value based on the given ease and lifetime percentage (0 to 1) + The value to start from when lifetimePercentage is 0 + The value to reach when lifetimePercentage is 1 + The time percentage (0 to 1) at which the value should be taken + The type of ease + + + Returns a value based on the given ease and lifetime percentage (0 to 1) + The value to start from when lifetimePercentage is 0 + The value to reach when lifetimePercentage is 1 + The time percentage (0 to 1) at which the value should be taken + The type of ease + Eventual overshoot to use with Back ease + + + Returns a value based on the given ease and lifetime percentage (0 to 1) + The value to start from when lifetimePercentage is 0 + The value to reach when lifetimePercentage is 1 + The time percentage (0 to 1) at which the value should be taken + The type of ease + Eventual amplitude to use with Elastic easeType + Eventual period to use with Elastic easeType + + + Returns a value based on the given ease and lifetime percentage (0 to 1) + The value to start from when lifetimePercentage is 0 + The value to reach when lifetimePercentage is 1 + The time percentage (0 to 1) at which the value should be taken + The AnimationCurve to use for ease + + + Fires the given callback after the given time. + Callback delay + Callback to fire when the delay has expired + If TRUE (default) ignores Unity's timeScale + + + + Don't assign this! It's assigned automatically when creating 0 duration tweens + + + + + Don't assign this! It's assigned automatically when setting the ease to an AnimationCurve or to a custom ease function + + + + + Allows to wrap ease method in special ways, adding extra features + + + + + Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS + + FPS at which the tween should be played + Ease type + + + + Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS + + FPS at which the tween should be played + AnimationCurve to use for the ease + + + + Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS + + FPS at which the tween should be played + Custom ease function to use + + + + Used to allow method chaining with DOTween.Init + + + + + Directly sets the current max capacity of Tweeners and Sequences + (meaning how many Tweeners and Sequences can be running at the same time), + so that DOTween doesn't need to automatically increase them in case the max is reached + (which might lead to hiccups when that happens). + Sequences capacity must be less or equal to Tweeners capacity + (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). + Beware: use this method only when there are no tweens running. + + Max Tweeners capacity. + Default: 200 + Max Sequences capacity. + Default: 50 + + + + Path mode (used to determine correct LookAt orientation) + + + + Ignores the path mode (and thus LookAt behaviour) + + + Regular 3D path + + + 2D top-down path + + + 2D side-scroller path + + + + Type of path to use with DOPath tweens + + + + Linear, composed of straight segments between each waypoint + + + Curved path (which uses Catmull-Rom curves) + + + + Path control point + + + + + Gets the point on the path at the given percentage (0 to 1) + + The percentage (0 to 1) at which to get the point + If TRUE constant speed is taken into account, otherwise not + + + + Base interface for all tween plugins options + + + + Resets the plugin + + + + This plugin generates some GC allocations at startup + + + + + Path plugin works exclusively with Transforms + + + + + Rotation mode used with DORotate methods + + + + + Fastest way that never rotates beyond 360° + + + + + Fastest way that rotates beyond 360° + + + + + Adds the given rotation to the transform using world axis and an advanced precision mode + (like when using transform.Rotate(Space.World)). + In this mode the end value is is always considered relative + + + + + Adds the given rotation to the transform's local axis + (like when rotating an object with the "local" switch enabled in Unity's editor or using transform.Rotate(Space.Self)). + In this mode the end value is is always considered relative + + + + + Type of scramble to apply to string tweens + + + + + No scrambling of characters + + + + + A-Z + a-z + 0-9 characters + + + + + A-Z characters + + + + + a-z characters + + + + + 0-9 characters + + + + + Custom characters + + + + + Methods that extend Tween objects and allow to control or get data from them + + + + Completes the tween + + + Completes the tween + For Sequences only: if TRUE also internal Sequence callbacks will be fired, + otherwise they will be ignored + + + Flips the direction of this tween (backwards if it was going forward or viceversa) + + + Forces the tween to initialize its settings immediately + + + Send the tween to the given position in time + Time position to reach + (if higher than the whole tween duration the tween will simply reach its end) + If TRUE will play the tween after reaching the given position, otherwise it will pause it + + + Kills the tween + If TRUE completes the tween before killing it + + + Pauses the tween + + + Plays the tween + + + Sets the tween in a backwards direction and plays it + + + Sets the tween in a forward direction and plays it + + + Restarts the tween from the beginning + If TRUE includes the eventual tween delay, otherwise skips it + If >= 0 changes the startup delay to this value, otherwise doesn't touch it + + + Rewinds and pauses the tween + If TRUE includes the eventual tween delay, otherwise skips it + + + Smoothly rewinds the tween (delays excluded). + A "smooth rewind" animates the tween to its start position, + skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. + If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween. + Note that a tween that was smoothly rewinded will have its play direction flipped + + + Plays the tween if it was paused, pauses it if it was playing + + + Send a path tween to the given waypoint. + Has no effect if this is not a path tween. + BEWARE, this is a special utility method: + it works only with Linear eases. Also, the lookAt direction might be wrong after calling this and might need to be set manually + (because it relies on a smooth path movement and doesn't work well with jumps that encompass dramatic direction changes) + Waypoint index to reach + (if higher than the max waypoint index the tween will simply go to the last one) + If TRUE will play the tween after reaching the given waypoint, otherwise it will pause it + + + + Creates a yield instruction that waits until the tween is killed or complete. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForCompletion(); + + + + + Creates a yield instruction that waits until the tween is killed or rewinded. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForRewind(); + + + + + Creates a yield instruction that waits until the tween is killed. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForKill(); + + + + + Creates a yield instruction that waits until the tween is killed or has gone through the given amount of loops. + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForElapsedLoops(2); + + Elapsed loops to wait for + + + + Creates a yield instruction that waits until the tween is killed or has reached the given position (loops included, delays excluded). + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForPosition(2.5f); + + Position (loops included, delays excluded) to wait for + + + + Creates a yield instruction that waits until the tween is killed or started + (meaning when the tween is set in a playing state the first time, after any eventual delay). + It can be used inside a coroutine as a yield. + Example usage:yield return myTween.WaitForStart(); + + + + Returns the total number of loops completed by this tween + + + Returns the eventual delay set for this tween + + + Returns the duration of this tween (delays excluded). + NOTE: when using settings like SpeedBased, the duration will be recalculated when the tween starts + If TRUE returns the full duration loops included, + otherwise the duration of a single loop cycle + + + Returns the elapsed time for this tween (delays exluded) + If TRUE returns the elapsed time since startup loops included, + otherwise the elapsed time within the current loop cycle + + + Returns the elapsed percentage (0 to 1) of this tween (delays exluded) + If TRUE returns the elapsed percentage since startup loops included, + otherwise the elapsed percentage within the current loop cycle + + + Returns the elapsed percentage (0 to 1) of this tween (delays exluded), + based on a single loop, and calculating eventual backwards Yoyo loops as 1 to 0 instead of 0 to 1 + + + Returns FALSE if this tween has been killed. + BEWARE: if this tween is recyclable it might have been spawned again for another use and thus return TRUE anyway. + When working with recyclable tweens you should take care to know when a tween has been killed and manually set your references to NULL. + If you want to be sure your references are set to NULL when a tween is killed you can use the OnKill callback like this: + .OnKill(()=> myTweenReference = null) + + + Returns TRUE if this tween was reversed and is set to go backwards + + + Returns TRUE if the tween is complete + (silently fails and returns FALSE if the tween has been killed) + + + Returns TRUE if this tween has been initialized + + + Returns TRUE if this tween is playing + + + Returns the total number of loops set for this tween + (returns -1 if the loops are infinite) + + + + Returns a point on a path based on the given path percentage. + Returns Vector3.zero if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. + A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). + You can force a path to be initialized by calling myTween.ForceInit(). + + Percentage of the path (0 to 1) on which to get the point + + + + Returns an array of points that can be used to draw the path. + Note that this method generates allocations, because it creates a new array. + Returns NULL if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. + A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). + You can force a path to be initialized by calling myTween.ForceInit(). + + How many points to create for each path segment (waypoint to waypoint). + Only used in case of non-Linear paths + + + + Returns the length of a path. + Returns -1 if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. + A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). + You can force a path to be initialized by calling myTween.ForceInit(). + + + + + Types of loop + + + + Each loop cycle restarts from the beginning + + + The tween moves forward and backwards at alternate cycles + + + Continuously increments the tween at the end of each loop cycle (A to B, B to B+(A-B), and so on), thus always moving "onward". + In case of String tweens works only if the tween is set as relative + + + + Controls other tweens as a group + + + + + Methods that extend known Unity objects and allow to directly create and control tweens from their instances + + + + Tweens a Camera's aspect to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's backgroundColor to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's farClipPlane to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's fieldOfView to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's nearClipPlane to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's orthographicSize to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's pixelRect to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Camera's rect to the given value. + Also stores the camera as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Shakes a Camera's localPosition along its relative X Y axes with the given values. + Also stores the camera as the tween's target so it can be used for filtered operations + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Camera's localPosition along its relative X Y axes with the given values. + Also stores the camera as the tween's target so it can be used for filtered operations + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Camera's localRotation. + Also stores the camera as the tween's target so it can be used for filtered operations + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Camera's localRotation. + Also stores the camera as the tween's target so it can be used for filtered operations + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Tweens a Light's color to the given value. + Also stores the light as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Light's intensity to the given value. + Also stores the light as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Light's shadowStrength to the given value. + Also stores the light as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a LineRenderer's color to the given value. + Also stores the LineRenderer as the tween's target so it can be used for filtered operations. + Note that this method requires to also insert the start colors for the tween, + since LineRenderers have no way to get them. + The start value to tween from + The end value to reachThe duration of the tween + + + Tweens a Material's color to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Material's named color property to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + + + Tweens a Material's named float property to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween + The duration of the tween + + + Tweens a Material's texture offset to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The duration of the tween + + + Tweens a Material's named texture offset property to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween + The duration of the tween + + + Tweens a Material's texture scale to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The duration of the tween + + + Tweens a Material's named texture scale property to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween + The duration of the tween + + + Tweens a Material's named Vector property to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween + The duration of the tween + + + Tweens a TrailRenderer's startWidth/endWidth to the given value. + Also stores the TrailRenderer as the tween's target so it can be used for filtered operations + The end startWidth to reachThe end endWidth to reach + The duration of the tween + + + Tweens a TrailRenderer's time to the given value. + Also stores the TrailRenderer as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's position to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's X position to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's Y position to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's Z position to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's localPosition to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's X localPosition to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's Y localPosition to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's Z localPosition to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's rotation to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + Rotation mode + + + Tweens a Transform's rotation to the given value using pure quaternion values. + Also stores the transform as the tween's target so it can be used for filtered operations. + PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method. + This method was implemented for very special cases, and doesn't support LoopType.Incremental loops + (neither for itself nor if placed inside a LoopType.Incremental Sequence) + + The end value to reachThe duration of the tween + + + Tweens a Transform's localRotation to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + Rotation mode + + + Tweens a Transform's rotation to the given value using pure quaternion values. + Also stores the transform as the tween's target so it can be used for filtered operations. + PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method. + This method was implemented for very special cases, and doesn't support LoopType.Incremental loops + (neither for itself nor if placed inside a LoopType.Incremental Sequence) + + The end value to reachThe duration of the tween + + + Tweens a Transform's localScale to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's localScale uniformly to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's X localScale to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's Y localScale to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's Z localScale to the given value. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Transform's rotation so that it will look towards the given position. + Also stores the transform as the tween's target so it can be used for filtered operations + The position to look atThe duration of the tween + Eventual axis constraint for the rotation + The vector that defines in which direction up is (default: Vector3.up) + + + Punches a Transform's localPosition towards the given direction and then back to the starting one + as if it was connected to the starting position via an elastic. + The direction and strength of the punch (added to the Transform's current position) + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. + 1 creates a full oscillation between the punch direction and the opposite direction, + while 0 oscillates only between the punch and the start position + If TRUE the tween will smoothly snap all values to integers + + + Punches a Transform's localScale towards the given size and then back to the starting one + as if it was connected to the starting scale via an elastic. + The punch strength (added to the Transform's current scale) + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting size when bouncing backwards. + 1 creates a full oscillation between the punch scale and the opposite scale, + while 0 oscillates only between the punch scale and the start scale + + + Punches a Transform's localRotation towards the given size and then back to the starting one + as if it was connected to the starting rotation via an elastic. + The punch strength (added to the Transform's current rotation) + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. + 1 creates a full oscillation between the punch rotation and the opposite rotation, + while 0 oscillates only between the punch and the start rotation + + + Shakes a Transform's localPosition with the given values. + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the tween will smoothly snap all values to integers + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Transform's localPosition with the given values. + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the tween will smoothly snap all values to integers + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Transform's localRotation. + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Transform's localRotation. + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Transform's localScale. + The duration of the tween + The shake strength + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Shakes a Transform's localScale. + The duration of the tween + The shake strength on each axis + Indicates how much will the shake vibrate + Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + Setting it to 0 will shake along a single direction. + If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + + + Tweens a Transform's position to the given value, while also applying a jump effect along the Y axis. + Returns a Sequence instead of a Tweener. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reach + Power of the jump (the max height of the jump is represented by this plus the final Y offset) + Total number of jumps + The duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's localPosition to the given value, while also applying a jump effect along the Y axis. + Returns a Sequence instead of a Tweener. + Also stores the transform as the tween's target so it can be used for filtered operations + The end value to reach + Power of the jump (the max height of the jump is represented by this plus the final Y offset) + Total number of jumps + The duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's position through the given path waypoints, using the chosen path algorithm. + Also stores the transform as the tween's target so it can be used for filtered operations + The waypoints to go through + The duration of the tween + The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + The path mode: 3D, side-scroller 2D, top-down 2D + The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. + Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + The color of the path (shown when gizmos are active in the Play panel and the tween is running) + + + Tweens a Transform's localPosition through the given path waypoints, using the chosen path algorithm. + Also stores the transform as the tween's target so it can be used for filtered operations + The waypoint to go through + The duration of the tween + The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + The path mode: 3D, side-scroller 2D, top-down 2D + The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. + Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + The color of the path (shown when gizmos are active in the Play panel and the tween is running) + + + IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. + Tweens a Transform's position via the given path. + Also stores the transform as the tween's target so it can be used for filtered operations + The path to use + The duration of the tween + The path mode: 3D, side-scroller 2D, top-down 2D + + + IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. + Tweens a Transform's localPosition via the given path. + Also stores the transform as the tween's target so it can be used for filtered operations + The path to use + The duration of the tween + The path mode: 3D, side-scroller 2D, top-down 2D + + + Tweens a Tween's timeScale to the given value. + Also stores the Tween as the tween's target so it can be used for filtered operations + The end value to reachThe duration of the tween + + + Tweens a Light's color to the given value, + in a way that allows other DOBlendableColor tweens to work together on the same target, + instead than fight each other as multiple DOColor would do. + Also stores the Light as the tween's target so it can be used for filtered operations + The value to tween toThe duration of the tween + + + Tweens a Material's color to the given value, + in a way that allows other DOBlendableColor tweens to work together on the same target, + instead than fight each other as multiple DOColor would do. + Also stores the Material as the tween's target so it can be used for filtered operations + The value to tween toThe duration of the tween + + + Tweens a Material's named color property to the given value, + in a way that allows other DOBlendableColor tweens to work together on the same target, + instead than fight each other as multiple DOColor would do. + Also stores the Material as the tween's target so it can be used for filtered operations + The value to tween to + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + + + Tweens a Transform's position BY the given value (as if you chained a SetRelative), + in a way that allows other DOBlendableMove tweens to work together on the same target, + instead than fight each other as multiple DOMove would do. + Also stores the transform as the tween's target so it can be used for filtered operations + The value to tween byThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + Tweens a Transform's localPosition BY the given value (as if you chained a SetRelative), + in a way that allows other DOBlendableMove tweens to work together on the same target, + instead than fight each other as multiple DOMove would do. + Also stores the transform as the tween's target so it can be used for filtered operations + The value to tween byThe duration of the tween + If TRUE the tween will smoothly snap all values to integers + + + EXPERIMENTAL METHOD - Tweens a Transform's rotation BY the given value (as if you chained a SetRelative), + in a way that allows other DOBlendableRotate tweens to work together on the same target, + instead than fight each other as multiple DORotate would do. + Also stores the transform as the tween's target so it can be used for filtered operations + The value to tween byThe duration of the tween + Rotation mode + + + EXPERIMENTAL METHOD - Tweens a Transform's lcoalRotation BY the given value (as if you chained a SetRelative), + in a way that allows other DOBlendableRotate tweens to work together on the same target, + instead than fight each other as multiple DORotate would do. + Also stores the transform as the tween's target so it can be used for filtered operations + The value to tween byThe duration of the tween + Rotation mode + + + Punches a Transform's localRotation BY the given value and then back to the starting one + as if it was connected to the starting rotation via an elastic. Does it in a way that allows other + DOBlendableRotate tweens to work together on the same target + The punch strength (added to the Transform's current rotation) + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. + 1 creates a full oscillation between the punch rotation and the opposite rotation, + while 0 oscillates only between the punch and the start rotation + + + Tweens a Transform's localScale BY the given value (as if you chained a SetRelative), + in a way that allows other DOBlendableScale tweens to work together on the same target, + instead than fight each other as multiple DOScale would do. + Also stores the transform as the tween's target so it can be used for filtered operations + The value to tween byThe duration of the tween + + + + Completes all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens completed + (meaning the tweens that don't have infinite loops and were not already complete) + + For Sequences only: if TRUE also internal Sequence callbacks will be fired, + otherwise they will be ignored + + + + Completes all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens completed + (meaning the tweens that don't have infinite loops and were not already complete) + + For Sequences only: if TRUE also internal Sequence callbacks will be fired, + otherwise they will be ignored + + + + Kills all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens killed. + + If TRUE completes the tween before killing it + + + + Kills all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens killed. + + If TRUE completes the tween before killing it + + + + Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens flipped. + + + + + Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens flipped. + + + + + Sends to the given position all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens involved. + + Time position to reach + (if higher than the whole tween duration the tween will simply reach its end) + If TRUE will play the tween after reaching the given position, otherwise it will pause it + + + + Sends to the given position all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens involved. + + Time position to reach + (if higher than the whole tween duration the tween will simply reach its end) + If TRUE will play the tween after reaching the given position, otherwise it will pause it + + + + Pauses all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens paused. + + + + + Pauses all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens paused. + + + + + Plays all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Plays all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Plays backwards all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Plays backwards all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Plays forward all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Plays forward all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens played. + + + + + Restarts all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens restarted. + + + + + Restarts all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens restarted. + + + + + Rewinds all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens rewinded. + + + + + Rewinds all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens rewinded. + + + + + Smoothly rewinds all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens rewinded. + + + + + Smoothly rewinds all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens rewinded. + + + + + Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens involved. + + + + + Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference + (meaning tweens that were started from this target, or that had this target added as an Id) + and returns the total number of tweens involved. + + + + + This class serves only as a utility class to store tween settings to apply on multiple tweens. + It is in no way needed otherwise, since you can directly apply tween settings to a tween via chaining + + + + A variable you can eventually Clear and reuse when needed, + to avoid instantiating TweenParams objects + + + Creates a new TweenParams object, which you can use to store tween settings + to pass to multiple tweens via myTween.SetAs(myTweenParms) + + + Clears and resets this TweenParams instance using default values, + so it can be reused without instantiating another one + + + Sets the autoKill behaviour of the tween. + Has no effect if the tween has already started + If TRUE the tween will be automatically killed when complete + + + Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. + The ID to assign to this tween. Can be an int, a string, an object or anything else. + + + Sets the target for the tween, which can then be used as a filter with DOTween's static methods. + IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. + When using shorcuts the shortcut target is already assigned as the tween's target, + so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. + The target to assign to this tween. Can be an int, a string, an object or anything else. + + + Sets the looping options for the tween. + Has no effect if the tween has already started + Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) + Loop behaviour type (default: LoopType.Restart) + + + Sets the ease of the tween. + If applied to Sequences eases the whole sequence animation + Eventual overshoot or amplitude to use with Back or Elastic easeType (default is 1.70158) + Eventual period to use with Elastic easeType (default is 0) + + + Sets the ease of the tween using an AnimationCurve. + If applied to Sequences eases the whole sequence animation + + + Sets the ease of the tween using a custom ease function. + If applied to Sequences eases the whole sequence animation + + + Sets the recycling behaviour for the tween. + If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. + + + Sets the update type to the one defined in DOTween.defaultUpdateType (UpdateType.Normal unless changed) + and lets you choose if it should be independent from Unity's Time.timeScale + If TRUE the tween will ignore Unity's Time.timeScale + + + Sets the type of update (default or independent) for the tween + The type of update (default: UpdateType.Normal) + If TRUE the tween will ignore Unity's Time.timeScale + + + Sets the onStart callback for the tween. + Called the first time the tween is set in a playing state, after any eventual delay + + + Sets the onPlay callback for the tween. + Called when the tween is set in a playing state, after any eventual delay. + Also called each time the tween resumes playing from a paused state + + + Sets the onRewind callback for the tween. + Called when the tween is rewinded, + either by calling Rewind or by reaching the start position while playing backwards. + Rewinding a tween that is already rewinded will not fire this callback + + + Sets the onUpdate callback for the tween. + Called each time the tween updates + + + Sets the onStepComplete callback for the tween. + Called the moment the tween completes one loop cycle, even when going backwards + + + Sets the onComplete callback for the tween. + Called the moment the tween reaches its final forward position, loops included + + + Sets the onKill callback for the tween. + Called the moment the tween is killed + + + Sets the onWaypointChange callback for the tween. + Called when a path tween reaches a new waypoint + + + Sets a delayed startup for the tween. + Has no effect on Sequences or if the tween has already started + + + If isRelative is TRUE sets the tween as relative + (the endValue will be calculated as startValue + endValue instead than being used directly). + Has no effect on Sequences or if the tween has already started + + + If isSpeedBased is TRUE sets the tween as speed based + (the duration will represent the number of units the tween moves x second). + Has no effect on Sequences, nested tweens, or if the tween has already started + + + + Methods that extend Tween objects and allow to set their parameters + + + + Sets the autoKill behaviour of the tween. + Has no effect if the tween has already started + + + Sets the autoKill behaviour of the tween. + Has no effect if the tween has already started + If TRUE the tween will be automatically killed when complete + + + Sets an ID for the tween (), which can then be used as a filter with DOTween's static methods. + The ID to assign to this tween. Can be an int, a string, an object or anything else. + + + Sets a string ID for the tween (), which can then be used as a filter with DOTween's static methods. + Filtering via string is 2X faster than using an object as an ID (using the alternate obejct overload) + The string ID to assign to this tween. + + + Sets an int ID for the tween (), which can then be used as a filter with DOTween's static methods. + Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads) + The int ID to assign to this tween. + + + Sets the target for the tween, which can then be used as a filter with DOTween's static methods. + IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. + When using shorcuts the shortcut target is already assigned as the tween's target, + so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. + The target to assign to this tween. Can be an int, a string, an object or anything else. + + + Sets the looping options for the tween. + Has no effect if the tween has already started + Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) + + + Sets the looping options for the tween. + Has no effect if the tween has already started + Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) + Loop behaviour type (default: LoopType.Restart) + + + Sets the ease of the tween. + If applied to Sequences eases the whole sequence animation + + + Sets the ease of the tween. + If applied to Sequences eases the whole sequence animation + + Eventual overshoot to use with Back or Flash ease (default is 1.70158 - 1 for Flash). + In case of Flash ease it must be an intenger and sets the total number of flashes that will happen. + Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value. + + + + Sets the ease of the tween. + If applied to Sequences eases the whole sequence animation + Eventual amplitude to use with Elastic easeType or overshoot to use with Flash easeType (default is 1.70158 - 1 for Flash). + In case of Flash ease it must be an integer and sets the total number of flashes that will happen. + Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value. + + Eventual period to use with Elastic or Flash easeType (default is 0). + In case of Flash ease it indicates the power in time of the ease, and must be between -1 and 1. + 0 is balanced, 1 weakens the ease with time, -1 starts the ease weakened and gives it power towards the end. + + + + Sets the ease of the tween using an AnimationCurve. + If applied to Sequences eases the whole sequence animation + + + Sets the ease of the tween using a custom ease function (which must return a value between 0 and 1). + If applied to Sequences eases the whole sequence animation + + + Allows the tween to be recycled after being killed. + + + Sets the recycling behaviour for the tween. + If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. + + + Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale + If TRUE the tween will ignore Unity's Time.timeScale + + + Sets the type of update for the tween + The type of update (defalt: UpdateType.Normal) + + + Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale + The type of update + If TRUE the tween will ignore Unity's Time.timeScale + + + Sets the onStart callback for the tween, clearing any previous onStart callback that was set. + Called the first time the tween is set in a playing state, after any eventual delay + + + Sets the onPlay callback for the tween, clearing any previous onPlay callback that was set. + Called when the tween is set in a playing state, after any eventual delay. + Also called each time the tween resumes playing from a paused state + + + Sets the onPause callback for the tween, clearing any previous onPause callback that was set. + Called when the tween state changes from playing to paused. + If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. + + + Sets the onRewind callback for the tween, clearing any previous onRewind callback that was set. + Called when the tween is rewinded, + either by calling Rewind or by reaching the start position while playing backwards. + Rewinding a tween that is already rewinded will not fire this callback + + + Sets the onUpdate callback for the tween, clearing any previous onUpdate callback that was set. + Called each time the tween updates + + + Sets the onStepComplete callback for the tween, clearing any previous onStepComplete callback that was set. + Called the moment the tween completes one loop cycle, even when going backwards + + + Sets the onComplete callback for the tween, clearing any previous onComplete callback that was set. + Called the moment the tween reaches its final forward position, loops included + + + Sets the onKill callback for the tween, clearing any previous onKill callback that was set. + Called the moment the tween is killed + + + Sets the onWaypointChange callback for the tween, clearing any previous onWaypointChange callback that was set. + Called when a path tween's current waypoint changes + + + Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one. + Doesn't copy specific SetOptions settings: those will need to be applied manually each time. + Has no effect if the tween has already started. + NOTE: the tween's target will not be changed + Tween from which to copy the parameters + + + Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParams. + Has no effect if the tween has already started. + TweenParams from which to copy the parameters + + + Adds the given tween to the end of the Sequence. + Has no effect if the Sequence has already started + The tween to append + + + Adds the given tween to the beginning of the Sequence, pushing forward the other nested content. + Has no effect if the Sequence has already started + The tween to prepend + + + Inserts the given tween at the same time position of the last tween, callback or intervale added to the Sequence. + Note that, in case of a Join after an interval, the insertion time will be the time where the interval starts, not where it finishes. + Has no effect if the Sequence has already started + + + Inserts the given tween at the given time position in the Sequence, + automatically adding an interval if needed. + Has no effect if the Sequence has already started + The time position where the tween will be placed + The tween to insert + + + Adds the given interval to the end of the Sequence. + Has no effect if the Sequence has already started + The interval duration + + + Adds the given interval to the beginning of the Sequence, pushing forward the other nested content. + Has no effect if the Sequence has already started + The interval duration + + + Adds the given callback to the end of the Sequence. + Has no effect if the Sequence has already started + The callback to append + + + Adds the given callback to the beginning of the Sequence, pushing forward the other nested content. + Has no effect if the Sequence has already started + The callback to prepend + + + Inserts the given callback at the given time position in the Sequence, + automatically adding an interval if needed. + Has no effect if the Sequence has already started + The time position where the callback will be placed + The callback to insert + + + Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue + then immediately sends the target to the previously set endValue. + + + Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue + then immediately sends the target to the previously set endValue. + If TRUE the FROM value will be calculated as relative to the current one + + + Sets a delayed startup for the tween. + Has no effect on Sequences or if the tween has already started + + + Sets the tween as relative + (the endValue will be calculated as startValue + endValue instead than being used directly). + Has no effect on Sequences or if the tween has already started + + + If isRelative is TRUE sets the tween as relative + (the endValue will be calculated as startValue + endValue instead than being used directly). + Has no effect on Sequences or if the tween has already started + + + If isSpeedBased is TRUE sets the tween as speed based + (the duration will represent the number of units the tween moves x second). + Has no effect on Sequences, nested tweens, or if the tween has already started + + + If isSpeedBased is TRUE sets the tween as speed based + (the duration will represent the number of units the tween moves x second). + Has no effect on Sequences, nested tweens, or if the tween has already started + + + Options for float tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector2 tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector2 tweens + Selecting an axis will tween the vector only on that axis, leaving the others untouched + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector3 tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector3 tweens + Selecting an axis will tween the vector only on that axis, leaving the others untouched + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector4 tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector4 tweens + Selecting an axis will tween the vector only on that axis, leaving the others untouched + If TRUE the tween will smoothly snap all values to integers + + + Options for Quaternion tweens + If TRUE (default) the rotation will take the shortest route, and will not rotate more than 360°. + If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative + + + Options for Color tweens + If TRUE only the alpha value of the color will be tweened + + + Options for Vector4 tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector4 tweens + If TRUE, rich text will be interpreted correctly while animated, + otherwise all tags will be considered as normal text + The type of scramble to use, if any + A string containing the characters to use for scrambling. + Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. + Leave it to NULL to use default ones + + + Options for Vector3Array tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Vector3Array tweens + If TRUE the tween will smoothly snap all values to integers + + + Options for Path tweens (created via the DOPath shortcut) + The eventual movement axis to lock. You can input multiple axis if you separate them like this: + AxisConstrain.X | AxisConstraint.Y + The eventual rotation axis to lock. You can input multiple axis if you separate them like this: + AxisConstrain.X | AxisConstraint.Y + + + Options for Path tweens (created via the DOPath shortcut) + If TRUE the path will be automatically closed + The eventual movement axis to lock. You can input multiple axis if you separate them like this: + AxisConstrain.X | AxisConstraint.Y + The eventual rotation axis to lock. You can input multiple axis if you separate them like this: + AxisConstrain.X | AxisConstraint.Y + + + Additional LookAt options for Path tweens (created via the DOPath shortcut). + Orients the target towards the given position. + Must be chained directly to the tween creation method or to a SetOptions + The position to look at + The eventual direction to consider as "forward". + If left to NULL defaults to the regular forward side of the transform + The vector that defines in which direction up is (default: Vector3.up) + + + Additional LookAt options for Path tweens (created via the DOPath shortcut). + Orients the target towards another transform. + Must be chained directly to the tween creation method or to a SetOptions + The transform to look at + The eventual direction to consider as "forward". + If left to NULL defaults to the regular forward side of the transform + The vector that defines in which direction up is (default: Vector3.up) + + + Additional LookAt options for Path tweens (created via the DOPath shortcut). + Orients the target to the path, with the given lookAhead. + Must be chained directly to the tween creation method or to a SetOptions + The percentage of lookAhead to use (0 to 1) + The eventual direction to consider as "forward". + If left to NULL defaults to the regular forward side of the transform + The vector that defines in which direction up is (default: Vector3.up) + + + + Types of log behaviours + + + + Log only warnings and errors + + + Log warnings, errors and additional infos + + + Log only errors + + + + Indicates either a Tweener or a Sequence + + + + TimeScale for the tween + + + If TRUE the tween wil go backwards + + + Object ID (usable for filtering with DOTween static methods). Can be anything except a string or an int + (use or for those) + + + String ID (usable for filtering with DOTween static methods). 2X faster than using an object id + + + Int ID (usable for filtering with DOTween static methods). 4X faster than using an object id, 2X faster than using a string id. + Default is -999 so avoid using an ID like that or it will capture all unset intIds + + + Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shorcuts + + + Called when the tween is set in a playing state, after any eventual delay. + Also called each time the tween resumes playing from a paused state + + + Called when the tween state changes from playing to paused. + If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. + + + Called when the tween is rewinded, + either by calling Rewind or by reaching the start position while playing backwards. + Rewinding a tween that is already rewinded will not fire this callback + + + Called each time the tween updates + + + Called the moment the tween completes one loop cycle + + + Called the moment the tween reaches completion (loops included) + + + Called the moment the tween is killed + + + Called when a path tween's current waypoint changes + + + Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative + + + FALSE when tween is (or should be) despawned - set only by TweenManager + + + Gets and sets the time position (loops included, delays excluded) of the tween + + + TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed + + + Time position within a single loop cycle + + + + Animates a single value + + + + Changes the start value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new start value + If bigger than 0 applies it as the new tween duration + + + Changes the end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new end value + If bigger than 0 applies it as the new tween duration + If TRUE the start value will become the current target's value, otherwise it will stay the same + + + Changes the end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new end value + If TRUE the start value will become the current target's value, otherwise it will stay the same + + + Changes the start and end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new start value + The new end value + If bigger than 0 applies it as the new tween duration + + + + Used internally + + + + + Update type + + + + Updates every frame during Update calls + + + Updates every frame during LateUpdate calls + + + Updates using FixedUpdate calls + + + Updates using manual update calls + + + diff --git a/Assets/Demigiant/DOTween/DOTween.XML.meta b/Assets/_Vendor/Demigiant/DOTween/DOTween.XML.meta similarity index 61% rename from Assets/Demigiant/DOTween/DOTween.XML.meta rename to Assets/_Vendor/Demigiant/DOTween/DOTween.XML.meta index 28ed6f4..c87a520 100644 --- a/Assets/Demigiant/DOTween/DOTween.XML.meta +++ b/Assets/_Vendor/Demigiant/DOTween/DOTween.XML.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 5ec570c4aad08e54aa562697147a6947 +guid: 34192c5e0d14aee43a0e86cc4823268a TextScriptImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/DOTween.dll b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll new file mode 100644 index 0000000..1b93c17 Binary files /dev/null and b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll differ diff --git a/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb new file mode 100644 index 0000000..0d8a8ce Binary files /dev/null and b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/Assets/Demigiant/DOTween/DOTween.dll.mdb.meta b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb.meta similarity index 60% rename from Assets/Demigiant/DOTween/DOTween.dll.mdb.meta rename to Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb.meta index 75e6b42..779c1ad 100644 --- a/Assets/Demigiant/DOTween/DOTween.dll.mdb.meta +++ b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.mdb.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 5c2dfc56de474cf43acb60e5b0ba64c9 +guid: 4f007001a22b3d24dae350342c4d19c8 DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.meta b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.meta new file mode 100644 index 0000000..7a04fd5 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/DOTween.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: a811bde74b26b53498b4f6d872b09b6d +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnityVS/Editor.meta b/Assets/_Vendor/Demigiant/DOTween/Editor.meta similarity index 58% rename from Assets/UnityVS/Editor.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor.meta index 77d86fa..6c1a7fd 100644 --- a/Assets/UnityVS/Editor.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 6e71a3e2fb5854e43823a9da25b68e21 +guid: 03ffde4676add194b96c104e9402b084 folderAsset: yes -timeCreated: 1434954187 -licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML similarity index 52% rename from Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML rename to Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML index db17f44..3f9114a 100644 --- a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML @@ -1,65 +1,77 @@ - - - - DOTweenEditor - - - - - Not used as menu item anymore, but as a utiity function - - - - - Setups DOTween - - If TRUE, no warning window appears in case there is no need for setup - - - - Checks that the given editor texture use the correct import settings, - and applies them if they're incorrect. - - - - - Returns TRUE if addons setup is required. - - - - - Returns TRUE if the file/directory at the given path exists. - - Path, relative to Unity's project folder - - - - - Converts the given project-relative path to a full path, - with backward (\) slashes). - - - - - Converts the given full path to a path usable with AssetDatabase methods - (relative to Unity's project folder, and with the correct Unity forward (/) slashes). - - - - - Connects to a asset. - If the asset already exists at the given path, loads it and returns it. - Otherwise, either returns NULL or automatically creates it before loading and returning it - (depending on the given parameters). - - Asset type - File path (relative to Unity's project folder) - If TRUE and the requested asset doesn't exist, forces its creation - - - - Full path for the given loaded assembly, assembly file included - - - - + + + + DOTweenEditor + + + + + Checks that the given editor texture use the correct import settings, + and applies them if they're incorrect. + + + + + Returns TRUE if setup is required + + + + + Returns TRUE if the file/directory at the given path exists. + + Path, relative to Unity's project folder + + + + + Converts the given project-relative path to a full path, + with backward (\) slashes). + + + + + Converts the given full path to a path usable with AssetDatabase methods + (relative to Unity's project folder, and with the correct Unity forward (/) slashes). + + + + + Connects to a asset. + If the asset already exists at the given path, loads it and returns it. + Otherwise, either returns NULL or automatically creates it before loading and returning it + (depending on the given parameters). + + Asset type + File path (relative to Unity's project folder) + If TRUE and the requested asset doesn't exist, forces its creation + + + + Full path for the given loaded assembly, assembly file included + + + + + Adds the given global define if it's not already present + + + + + Removes the given global define if it's present + + + + + Returns TRUE if the given global define is present in all the + or only in the given , depending on passed parameters. + + + to use. Leave NULL to check in all of them. + + + + Not used as menu item anymore, but as a utiity function + + + + diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta similarity index 61% rename from Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta index 543042b..258ca87 100644 --- a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 5405503ee5afddc42bf1b95cabc6ad89 +guid: 2e2c6224d345d9249acfa6e8ef40bb2d TextScriptImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll new file mode 100644 index 0000000..edd8d9b Binary files /dev/null and b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb new file mode 100644 index 0000000..152c979 Binary files /dev/null and b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta similarity index 60% rename from Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta index b63bbfd..2ee6141 100644 --- a/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 3402d640d15ce8e4bb99cb4cbb26ea7d +guid: 8f46310a8b0a8f04a92993c37c713243 DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta new file mode 100644 index 0000000..79fefee --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: 45d5034162d6cf04dbe46da84fc7d074 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs.meta similarity index 58% rename from Assets/Demigiant/DOTween/Editor/Imgs.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs.meta index 94944a9..8357e38 100644 --- a/Assets/Demigiant/DOTween/Editor/Imgs.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 3f1069cf41cc33c4e88fb49c6778c668 +guid: aef32bb4d60cc644e8858b0f25cb679f folderAsset: yes -timeCreated: 1435039946 -licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png similarity index 100% rename from Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png diff --git a/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta new file mode 100644 index 0000000..2d0236d --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 8da095e39e9b4df488dfd436f81116d6 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 1 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 128 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer.png similarity index 100% rename from Assets/Demigiant/DOTween/Editor/Imgs/Footer.png rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer.png diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer.png.meta similarity index 50% rename from Assets/Demigiant/DOTween/Editor/Imgs/Footer.png.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer.png.meta index 1801922..c02fabd 100644 --- a/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer.png.meta @@ -1,52 +1,75 @@ fileFormatVersion: 2 -guid: 0ce7b533e9764c141a068fadd859f9a6 +guid: 7051dba417b3d53409f2918f1ea4938d TextureImporter: fileIDToRecycleName: {} - serializedVersion: 2 + externalObjects: {} + serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 0 + sRGBTexture: 0 linearTexture: 1 - correctGamma: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 - heightScale: .25 + heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -3 maxTextureSize: 256 textureSettings: + serializedVersion: 2 filterMode: 1 aniso: 1 mipBias: -1 - wrapMode: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 nPOTScale: 0 lightmap: 0 - rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationDetail: -1 textureType: 2 - buildTargetSettings: [] + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 spriteSheet: + serializedVersion: 2 sprites: [] + outline: [] + physicsShape: [] spritePackingTag: userData: assetBundleName: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer_dark.png similarity index 100% rename from Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer_dark.png diff --git a/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta new file mode 100644 index 0000000..098f8ee --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 519694efe2bb2914788b151fbd8c01f4 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 1024 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Header.jpg similarity index 100% rename from Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Header.jpg diff --git a/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta similarity index 50% rename from Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta rename to Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta index 2219358..1b0fbc1 100644 --- a/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta +++ b/Assets/_Vendor/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta @@ -1,52 +1,75 @@ fileFormatVersion: 2 -guid: 7741b4957200f0747a3c79d148de2402 +guid: 78a59ca99f8987941adb61f9e14a06a7 TextureImporter: fileIDToRecycleName: {} - serializedVersion: 2 + externalObjects: {} + serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 0 + sRGBTexture: 0 linearTexture: 1 - correctGamma: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 - heightScale: .25 + heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -3 maxTextureSize: 512 textureSettings: + serializedVersion: 2 filterMode: 1 aniso: 1 mipBias: -1 - wrapMode: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 nPOTScale: 0 lightmap: 0 - rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationDetail: -1 textureType: 2 - buildTargetSettings: [] + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 spriteSheet: + serializedVersion: 2 sprites: [] + outline: [] + physicsShape: [] spritePackingTag: userData: assetBundleName: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules.meta b/Assets/_Vendor/Demigiant/DOTween/Modules.meta new file mode 100644 index 0000000..42c733f --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56bdb2e16b7167546bb526e6e9d85c1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs new file mode 100644 index 0000000..2aa5432 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs @@ -0,0 +1,195 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if false // MODULE_MARKER +using System; +using UnityEngine; +#if UNITY_5 || UNITY_2017_1_OR_NEWER +using UnityEngine.Audio; // Required for AudioMixer +#endif + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleAudio + { + #region Shortcuts + + #region Audio + + /// Tweens an AudioSource's volume to the given value. + /// Also stores the AudioSource as the tween's target so it can be used for filtered operations + /// The end value to reach (0 to 1)The duration of the tween + public static Tweener DOFade(this AudioSource target, float endValue, float duration) + { + if (endValue < 0) endValue = 0; + else if (endValue > 1) endValue = 1; + return DOTween.To(() => target.volume, x => target.volume = x, endValue, duration).SetTarget(target); + } + + /// Tweens an AudioSource's pitch to the given value. + /// Also stores the AudioSource as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOPitch(this AudioSource target, float endValue, float duration) + { + return DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration).SetTarget(target); + } + + #endregion + +#if UNITY_5 || UNITY_2017_1_OR_NEWER + #region AudioMixer (Unity 5 or Newer) + + /// Tweens an AudioMixer's exposed float to the given value. + /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations. + /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer. + /// Name given to the exposed float to set + /// The end value to reachThe duration of the tween + public static Tweener DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration) + { + return DOTween.To(()=> { + float currVal; + target.GetFloat(floatName, out currVal); + return currVal; + }, x=> target.SetFloat(floatName, x), endValue, duration) + .SetTarget(target); + } + + #region Operation Shortcuts + + /// + /// Completes all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens completed + /// (meaning the tweens that don't have infinite loops and were not already complete) + /// + /// For Sequences only: if TRUE also internal Sequence callbacks will be fired, + /// otherwise they will be ignored + public static int DOComplete(this AudioMixer target, bool withCallbacks = false) + { + return DOTween.Complete(target, withCallbacks); + } + + /// + /// Kills all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens killed. + /// + /// If TRUE completes the tween before killing it + public static int DOKill(this AudioMixer target, bool complete = false) + { + return DOTween.Kill(target, complete); + } + + /// + /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens flipped. + /// + public static int DOFlip(this AudioMixer target) + { + return DOTween.Flip(target); + } + + /// + /// Sends to the given position all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens involved. + /// + /// Time position to reach + /// (if higher than the whole tween duration the tween will simply reach its end) + /// If TRUE will play the tween after reaching the given position, otherwise it will pause it + public static int DOGoto(this AudioMixer target, float to, bool andPlay = false) + { + return DOTween.Goto(target, to, andPlay); + } + + /// + /// Pauses all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens paused. + /// + public static int DOPause(this AudioMixer target) + { + return DOTween.Pause(target); + } + + /// + /// Plays all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlay(this AudioMixer target) + { + return DOTween.Play(target); + } + + /// + /// Plays backwards all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlayBackwards(this AudioMixer target) + { + return DOTween.PlayBackwards(target); + } + + /// + /// Plays forward all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlayForward(this AudioMixer target) + { + return DOTween.PlayForward(target); + } + + /// + /// Restarts all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens restarted. + /// + public static int DORestart(this AudioMixer target) + { + return DOTween.Restart(target); + } + + /// + /// Rewinds all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens rewinded. + /// + public static int DORewind(this AudioMixer target) + { + return DOTween.Rewind(target); + } + + /// + /// Smoothly rewinds all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens rewinded. + /// + public static int DOSmoothRewind(this AudioMixer target) + { + return DOTween.SmoothRewind(target); + } + + /// + /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens involved. + /// + public static int DOTogglePause(this AudioMixer target) + { + return DOTween.TogglePause(target); + } + + #endregion + + #endregion +#endif + + #endregion + } +} +#endif diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta new file mode 100644 index 0000000..5568217 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b766d08851589514b97afb23c6f30a70 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs new file mode 100644 index 0000000..252af97 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs @@ -0,0 +1,212 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if false // MODULE_MARKER +using System; +using DG.Tweening.Core; +using DG.Tweening.Core.Enums; +using DG.Tweening.Plugins; +using DG.Tweening.Plugins.Core.PathCore; +using DG.Tweening.Plugins.Options; +using UnityEngine; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModulePhysics + { + #region Shortcuts + + #region Rigidbody + + /// Tweens a Rigidbody's position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens a Rigidbody's X position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetTarget(target); + } + + /// Tweens a Rigidbody's Y position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration) + .SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + } + + /// Tweens a Rigidbody's Z position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration) + .SetOptions(AxisConstraint.Z, snapping).SetTarget(target); + } + + /// Tweens a Rigidbody's rotation to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// Rotation mode + public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast) + { + TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration); + t.SetTarget(target); + t.plugOptions.rotateMode = mode; + return t; + } + + /// Tweens a Rigidbody's rotation so that it will look towards the given position. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The position to look atThe duration of the tween + /// Eventual axis constraint for the rotation + /// The vector that defines in which direction up is (default: Vector3.up) + public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null) + { + TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt); + t.plugOptions.axisConstraint = axisConstraint; + t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up; + return t; + } + + #region Special + + /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); + s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration) + .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + yTween.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }); + return s; + } + + /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations. + /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. + /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). + /// If you plan to publish there you should use a regular transform.DOPath. + /// The waypoints to go through + /// The duration of the tween + /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + /// The path mode: 3D, side-scroller 2D, top-down 2D + /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. + /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) + public static TweenerCore DOPath( + this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, + PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null + ) + { + if (resolution < 1) resolution = 1; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration) + .SetTarget(target).SetUpdate(UpdateType.Fixed); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + return t; + } + /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations + /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. + /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). + /// If you plan to publish there you should use a regular transform.DOLocalPath. + /// The waypoint to go through + /// The duration of the tween + /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + /// The path mode: 3D, side-scroller 2D, top-down 2D + /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. + /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) + public static TweenerCore DOLocalPath( + this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, + PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null + ) + { + if (resolution < 1) resolution = 1; + Transform trans = target.transform; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration) + .SetTarget(target).SetUpdate(UpdateType.Fixed); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + t.plugOptions.useLocalPosition = true; + return t; + } + // Used by path editor when creating the actual tween, so it can pass a pre-compiled path + internal static TweenerCore DOPath( + this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D + ) + { + TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration) + .SetTarget(target); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + return t; + } + internal static TweenerCore DOLocalPath( + this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D + ) + { + Transform trans = target.transform; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration) + .SetTarget(target); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + t.plugOptions.useLocalPosition = true; + return t; + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta new file mode 100644 index 0000000..42a0566 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dae9aa560b4242648a3affa2bfabc365 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs new file mode 100644 index 0000000..94de997 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs @@ -0,0 +1,101 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if false && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using UnityEngine; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModulePhysics2D + { + #region Shortcuts + + #region Rigidbody2D Shortcuts + + /// Tweens a Rigidbody2D's position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens a Rigidbody2D's X position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetTarget(target); + } + + /// Tweens a Rigidbody2D's Y position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration) + .SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + } + + /// Tweens a Rigidbody2D's rotation to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration) + { + return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration) + .SetTarget(target); + } + + #region Special + + /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. + /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); + s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + yTween.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }); + return s; + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta new file mode 100644 index 0000000..323d0dd --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 230fe34542e175245ba74b4659dae700 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs new file mode 100644 index 0000000..2c16202 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs @@ -0,0 +1,88 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if false && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using UnityEngine; +using DG.Tweening.Core; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleSprite + { + #region Shortcuts + + #region SpriteRenderer + + /// Tweens a SpriteRenderer's color to the given value. + /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOColor(this SpriteRenderer target, Color endValue, float duration) + { + return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target); + } + + /// Tweens a Material's alpha color to the given value. + /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this SpriteRenderer target, float endValue, float duration) + { + return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) + .SetTarget(target); + } + + /// Tweens a SpriteRenderer's color using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + return s; + } + + #endregion + + #region Blendables + + #region SpriteRenderer + + /// Tweens a SpriteRenderer's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta new file mode 100644 index 0000000..e6ade0c --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 188918ab119d93148aa0de59ccf5286b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs new file mode 100644 index 0000000..698ca71 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs @@ -0,0 +1,570 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using UnityEngine; +using UnityEngine.UI; +using DG.Tweening.Core; +using DG.Tweening.Core.Enums; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleUI + { + #region Shortcuts + + #region CanvasGroup + + /// Tweens a CanvasGroup's alpha color to the given value. + /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this CanvasGroup target, float endValue, float duration) + { + return DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration) + .SetTarget(target); + } + + #endregion + + #region Graphic + + /// Tweens an Graphic's color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOColor(this Graphic target, Color endValue, float duration) + { + return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target); + } + + /// Tweens an Graphic's alpha color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this Graphic target, float endValue, float duration) + { + return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) + .SetTarget(target); + } + + #endregion + + #region Image + + /// Tweens an Image's color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOColor(this Image target, Color endValue, float duration) + { + return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target); + } + + /// Tweens an Image's alpha color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this Image target, float endValue, float duration) + { + return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) + .SetTarget(target); + } + + /// Tweens an Image's fillAmount to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reach (0 to 1)The duration of the tween + public static Tweener DOFillAmount(this Image target, float endValue, float duration) + { + if (endValue > 1) endValue = 1; + else if (endValue < 0) endValue = 0; + return DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration) + .SetTarget(target); + } + + /// Tweens an Image's colors using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + return s; + } + + #endregion + + #region LayoutElement + + /// Tweens an LayoutElement's flexibleWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => { + target.flexibleWidth = x.x; + target.flexibleHeight = x.y; + }, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens an LayoutElement's minWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => { + target.minWidth = x.x; + target.minHeight = x.y; + }, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens an LayoutElement's preferredWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => { + target.preferredWidth = x.x; + target.preferredHeight = x.y; + }, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + #endregion + + #region Outline + + /// Tweens a Outline's effectColor to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOColor(this Outline target, Color endValue, float duration) + { + return DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration).SetTarget(target); + } + + /// Tweens a Outline's effectColor alpha to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this Outline target, float endValue, float duration) + { + return DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration) + .SetTarget(target); + } + + /// Tweens a Outline's effectDistance to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOScale(this Outline target, Vector2 endValue, float duration) + { + return DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration) + .SetTarget(target); + } + + #endregion + + #region RectTransform + + /// Tweens a RectTransform's anchoredPosition to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a RectTransform's anchoredPosition X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetTarget(target); + } + /// Tweens a RectTransform's anchoredPosition Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration) + .SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + } + + /// Tweens a RectTransform's anchoredPosition3D to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a RectTransform's anchoredPosition3D X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetTarget(target); + } + /// Tweens a RectTransform's anchoredPosition3D Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration) + .SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + } + /// Tweens a RectTransform's anchoredPosition3D Z to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration) + .SetOptions(AxisConstraint.Z, snapping).SetTarget(target); + } + + /// Tweens a RectTransform's anchorMax to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens a RectTransform's anchorMin to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Tweens a RectTransform's pivot to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOPivot(this RectTransform target, Vector2 endValue, float duration) + { + return DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration) + .SetTarget(target); + } + /// Tweens a RectTransform's pivot X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOPivotX(this RectTransform target, float endValue, float duration) + { + return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration) + .SetOptions(AxisConstraint.X).SetTarget(target); + } + /// Tweens a RectTransform's pivot Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOPivotY(this RectTransform target, float endValue, float duration) + { + return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration) + .SetOptions(AxisConstraint.Y).SetTarget(target); + } + + /// Tweens a RectTransform's sizeDelta to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one + /// as if it was connected to the starting position via an elastic. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The direction and strength of the punch (added to the RectTransform's current position) + /// The duration of the tween + /// Indicates how much will the punch vibrate + /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. + /// 1 creates a full oscillation between the punch direction and the opposite direction, + /// while 0 oscillates only between the punch and the start position + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false) + { + return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity) + .SetTarget(target).SetOptions(snapping); + } + + /// Shakes a RectTransform's anchoredPosition with the given values. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The duration of the tween + /// The shake strength + /// Indicates how much will the shake vibrate + /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + /// Setting it to 0 will shake along a single direction. + /// If TRUE the tween will smoothly snap all values to integers + /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) + { + return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); + } + /// Shakes a RectTransform's anchoredPosition with the given values. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The duration of the tween + /// The shake strength on each axis + /// Indicates how much will the shake vibrate + /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + /// Setting it to 0 will shake along a single direction. + /// If TRUE the tween will smoothly snap all values to integers + /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) + { + return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); + } + + #region Special + + /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + + // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence + // (in case users add a delay or other elements to the Sequence) + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(()=> startPosY = target.anchoredPosition.y); + s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + s.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector2 pos = target.anchoredPosition; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.anchoredPosition = pos; + }); + return s; + } + + #endregion + + #endregion + + #region ScrollRect + + /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition), + x => { + target.horizontalNormalizedPosition = x.x; + target.verticalNormalizedPosition = x.y; + }, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a ScrollRect's verticalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + #endregion + + #region Slider + + /// Tweens a Slider's value to the given value. + /// Also stores the Slider as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOValue(this Slider target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.value, x => target.value = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + #endregion + + #region Text + + /// Tweens a Text's color to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOColor(this Text target, Color endValue, float duration) + { + return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target); + } + + /// Tweens a Text's alpha color to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static Tweener DOFade(this Text target, float endValue, float duration) + { + return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) + .SetTarget(target); + } + + /// Tweens a Text's text to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end string to tween toThe duration of the tween + /// If TRUE (default), rich text will be interpreted correctly while animated, + /// otherwise all tags will be considered as normal text + /// The type of scramble mode to use, if any + /// A string containing the characters to use for scrambling. + /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. + /// Leave it to NULL (default) to use default ones + public static Tweener DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null) + { + return DOTween.To(() => target.text, x => target.text = x, endValue, duration) + .SetOptions(richTextEnabled, scrambleMode, scrambleChars) + .SetTarget(target); + } + + #endregion + + #region Blendables + + #region Graphic + + /// Tweens a Graphic's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Graphic as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #region Image + + /// Tweens a Image's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Image as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Image target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #region Text + + /// Tweens a Text's color BY the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Text target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #endregion + + #endregion + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + public static class Utils + { + /// + /// Converts the anchoredPosition of the first RectTransform to the second RectTransform, + /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition + /// + public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to) + { + Vector2 localPoint; + Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin); + Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position); + screenP += fromPivotDerivedOffset; + RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint); + Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin); + return to.anchoredPosition + localPoint - pivotDerivedOffset; + } + } + } +} +#endif diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta new file mode 100644 index 0000000..b7f95cb --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a060394c03331a64392db53a10e7f2d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs new file mode 100644 index 0000000..767037f --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs @@ -0,0 +1,252 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +using System; +using UnityEngine; +using DG.Tweening.Core; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + /// + /// Shortcuts/functions that are not strictly related to specific Modules + /// but are available only on some Unity versions + /// + public static class DOTweenModuleUnityVersion + { +#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER + #region Unity 4.3 or Newer + + #region Material + + /// Tweens a Material's color using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + return s; + } + /// Tweens a Material's named color property using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to use + /// The name of the material property to tween (like _Tint or _SpecColor) + /// The duration of the tween + public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear)); + } + return s; + } + + #endregion + + #endregion +#endif + +#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER + #region CustomYieldInstructions (Unity 5.3 or Newer) + + /// + /// Returns a that waits until the tween is killed or complete. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForCompletion(true); + /// + public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForCompletion(t); + } + + /// + /// Returns a that waits until the tween is killed or rewinded. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForRewind(); + /// + public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForRewind(t); + } + + /// + /// Returns a that waits until the tween is killed. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForKill(); + /// + public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForKill(t); + } + + /// + /// Returns a that waits until the tween is killed or has gone through the given amount of loops. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForElapsedLoops(2); + /// + /// Elapsed loops to wait for + public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops); + } + + /// + /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded). + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForPosition(2.5f); + /// + /// Position (loops included, delays excluded) to wait for + public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForPosition(t, position); + } + + /// + /// Returns a that waits until the tween is killed or started + /// (meaning when the tween is set in a playing state the first time, after any eventual delay). + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForStart(); + /// + public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForStart(t); + } + + #endregion +#endif + } + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + +#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER + public static class DOTweenCYInstruction + { + public class WaitForCompletion : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && !t.IsComplete(); + }} + readonly Tween t; + public WaitForCompletion(Tween tween) + { + t = tween; + } + } + + public class WaitForRewind : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0); + }} + readonly Tween t; + public WaitForRewind(Tween tween) + { + t = tween; + } + } + + public class WaitForKill : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active; + }} + readonly Tween t; + public WaitForKill(Tween tween) + { + t = tween; + } + } + + public class WaitForElapsedLoops : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && t.CompletedLoops() < elapsedLoops; + }} + readonly Tween t; + readonly int elapsedLoops; + public WaitForElapsedLoops(Tween tween, int elapsedLoops) + { + t = tween; + this.elapsedLoops = elapsedLoops; + } + } + + public class WaitForPosition : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && t.position * (t.CompletedLoops() + 1) < position; + }} + readonly Tween t; + readonly float position; + public WaitForPosition(Tween tween, float position) + { + t = tween; + this.position = position; + } + } + + public class WaitForStart : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && !t.playedOnce; + }} + readonly Tween t; + public WaitForStart(Tween tween) + { + t = tween; + } + } + } +#endif +} diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta new file mode 100644 index 0000000..6256c54 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63c02322328255542995bd02b47b0457 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs new file mode 100644 index 0000000..a271a05 --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs @@ -0,0 +1,108 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +using System; +using UnityEngine; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Core.PathCore; +using DG.Tweening.Plugins.Options; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + /// + /// Utility functions that deal with available Modules. + /// Modules defines: + /// - DOTAUDIO + /// - DOTPHYSICS + /// - DOTPHYSICS2D + /// - DOTSPRITE + /// - DOTUI + /// Extra defines set and used for implementation of external assets: + /// - DOTWEEN_TMP ► TextMesh Pro + /// - DOTWEEN_TK2D ► 2D Toolkit + /// + public static class DOTweenModuleUtils + { + static bool _initialized; + + /// + /// Called via Reflection by DOTweenComponent on Awake + /// + public static void Init() + { + if (_initialized) return; + + _initialized = true; + DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath; + } + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + public static class Physics + { + // Called via DOTweenExternalCommand callback + public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans) + { +#if false // PHYSICS_MARKER + if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot; + else trans.rotation = newRot; +#else + trans.rotation = newRot; +#endif + } + + // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached + public static bool HasRigidbody2D(Component target) + { +#if false // PHYSICS2D_MARKER + return target.GetComponent() != null; +#else + return false; +#endif + } + + #region Called via Reflection + + + // Called via Reflection by DOTweenPathInspector + // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached + public static bool HasRigidbody(Component target) + { +#if false // PHYSICS_MARKER + return target.GetComponent() != null; +#else + return false; +#endif + } + + // Called via Reflection by DOTweenPath + public static TweenerCore CreateDOTweenPathTween( + MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode + ){ + TweenerCore t; +#if false // PHYSICS_MARKER + Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null; + if (tweenRigidbody && rBody != null) { + t = isLocal + ? rBody.DOLocalPath(path, duration, pathMode) + : rBody.DOPath(path, duration, pathMode); + } else { + t = isLocal + ? target.transform.DOLocalPath(path, duration, pathMode) + : target.transform.DOPath(path, duration, pathMode); + } +#else + t = isLocal + ? target.transform.DOLocalPath(path, duration, pathMode) + : target.transform.DOPath(path, duration, pathMode); +#endif + return t; + } + + #endregion + } + } +} diff --git a/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta new file mode 100644 index 0000000..9164e1e --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7bcaf917d9cf5b84090421a5a2abe42e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Vendor/Demigiant/DOTween/readme.txt b/Assets/_Vendor/Demigiant/DOTween/readme.txt new file mode 100644 index 0000000..82b7c6c --- /dev/null +++ b/Assets/_Vendor/Demigiant/DOTween/readme.txt @@ -0,0 +1,29 @@ +DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant + +// IMPORTANT!!! ///////////////////////////////////////////// +// Upgrading DOTween from versions older than 1.2.000 /////// +// (or DOTween Pro older than 1.0.000) ////////////////////// +------------------------------------------------------------- +If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully. +1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry +2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath +3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup +4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only) + +// GET STARTED ////////////////////////////////////////////// + +- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween. +- In your code, add "using DG.Tweening" to each class where you want to use DOTween. +- You're ready to tween. Check out the links below for full documentation and license info. + + +// LINKS /////////////////////////////////////////////////////// + +DOTween website (documentation, examples, etc): http://dotween.demigiant.com +DOTween license: http://dotween.demigiant.com/license.php +DOTween repository (Google Code): https://code.google.com/p/dotween/ +Demigiant website (documentation, examples, etc): http://www.demigiant.com + +// NOTES ////////////////////////////////////////////////////// + +- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences \ No newline at end of file diff --git a/Assets/Demigiant/DOTween/readme.txt.meta b/Assets/_Vendor/Demigiant/DOTween/readme.txt.meta similarity index 61% rename from Assets/Demigiant/DOTween/readme.txt.meta rename to Assets/_Vendor/Demigiant/DOTween/readme.txt.meta index b92c248..9c3a968 100644 --- a/Assets/Demigiant/DOTween/readme.txt.meta +++ b/Assets/_Vendor/Demigiant/DOTween/readme.txt.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 6a094c30a6fab4a479d30af956a423f0 +guid: fccfc62abf2eb0a4db614853430894fd TextScriptImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Editor.meta b/Assets/_Vendor/Editor.meta similarity index 100% rename from Assets/Editor.meta rename to Assets/_Vendor/Editor.meta diff --git a/Assets/Editor/ImageEffects.meta b/Assets/_Vendor/Editor/ImageEffects.meta similarity index 100% rename from Assets/Editor/ImageEffects.meta rename to Assets/_Vendor/Editor/ImageEffects.meta diff --git a/Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs b/Assets/_Vendor/Editor/ImageEffects/BloomAndFlaresEditor.cs similarity index 100% rename from Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs rename to Assets/_Vendor/Editor/ImageEffects/BloomAndFlaresEditor.cs diff --git a/Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta b/Assets/_Vendor/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta similarity index 100% rename from Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta rename to Assets/_Vendor/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta diff --git a/Assets/Editor/ImageEffects/BloomEditor.cs b/Assets/_Vendor/Editor/ImageEffects/BloomEditor.cs similarity index 100% rename from Assets/Editor/ImageEffects/BloomEditor.cs rename to Assets/_Vendor/Editor/ImageEffects/BloomEditor.cs diff --git a/Assets/Editor/ImageEffects/BloomEditor.cs.meta b/Assets/_Vendor/Editor/ImageEffects/BloomEditor.cs.meta similarity index 100% rename from Assets/Editor/ImageEffects/BloomEditor.cs.meta rename to Assets/_Vendor/Editor/ImageEffects/BloomEditor.cs.meta diff --git a/Assets/Standard Assets.meta b/Assets/_Vendor/Standard Assets.meta similarity index 100% rename from Assets/Standard Assets.meta rename to Assets/_Vendor/Standard Assets.meta diff --git a/Assets/Standard Assets/Effects.meta b/Assets/_Vendor/Standard Assets/Effects.meta similarity index 100% rename from Assets/Standard Assets/Effects.meta rename to Assets/_Vendor/Standard Assets/Effects.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs diff --git a/Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader similarity index 93% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader index 91c891e..abda938 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/Blend" { Properties { _MainTex ("Screen Blended", 2D) = "" {} @@ -26,7 +28,7 @@ Shader "Hidden/Blend" { v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy; @@ -40,7 +42,7 @@ Shader "Hidden/Blend" { v2f_mt vertMultiTap( appdata_img v ) { v2f_mt o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = v.texcoord.xy + _MainTex_TexelSize.xy * 0.5; o.uv[1] = v.texcoord.xy - _MainTex_TexelSize.xy * 0.5; o.uv[2] = v.texcoord.xy - _MainTex_TexelSize.xy * half2(1,-1) * 0.5; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader similarity index 96% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader index e88fba0..fbcdbd9 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/BlendForBloom" { Properties { _MainTex ("Screen Blended", 2D) = "" {} @@ -26,7 +28,7 @@ Shader "Hidden/BlendForBloom" { v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy; @@ -40,7 +42,7 @@ Shader "Hidden/BlendForBloom" { v2f_mt vertMultiTap( appdata_img v ) { v2f_mt o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[4] = v.texcoord.xy; o.uv[0] = v.texcoord.xy + _MainTex_TexelSize.xy * 0.5; o.uv[1] = v.texcoord.xy - _MainTex_TexelSize.xy * 0.5; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader similarity index 82% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader index 650f016..a100015 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/BlendOneOne" { Properties { _MainTex ("-", 2D) = "" {} @@ -17,7 +19,7 @@ Shader "Hidden/BlendOneOne" { v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; } diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader similarity index 95% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader index ec16958..6e799d1 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/BlurAndFlares" { Properties { _MainTex ("Base (RGB)", 2D) = "" {} @@ -41,14 +43,14 @@ Shader "Hidden/BlurAndFlares" { v2f vert (appdata_img v) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; } v2f_blur vertWithMultiCoords2 (appdata_img v) { v2f_blur o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv.xy = v.texcoord.xy; o.uv01 = v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1); o.uv23 = v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1) * 2.0; @@ -60,7 +62,7 @@ Shader "Hidden/BlurAndFlares" { v2f_opts vertStretch (appdata_img v) { v2f_opts o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); half b = _StretchWidth; o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy + b * 2.0 * _Offsets.xy; @@ -74,7 +76,7 @@ Shader "Hidden/BlurAndFlares" { v2f_opts vertWithMultiCoords (appdata_img v) { v2f_opts o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy + 0.5 * _MainTex_TexelSize.xy * _Offsets.xy; o.uv[2] = v.texcoord.xy - 0.5 * _MainTex_TexelSize.xy * _Offsets.xy; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader similarity index 87% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader index 3952ff8..323dfc1 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/BrightPassFilterForBloom" { Properties @@ -23,7 +25,7 @@ Shader "Hidden/BrightPassFilterForBloom" v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; } diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader similarity index 89% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader index b202a23..445f420 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/BrightPassFilter2" { Properties @@ -22,7 +24,7 @@ Shader "Hidden/BrightPassFilter2" v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; } diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader similarity index 89% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader index 135efe6..e4e62c1 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/LensFlareCreate" { Properties { _MainTex ("Base (RGB)", 2D) = "" {} @@ -21,7 +23,7 @@ Shader "Hidden/LensFlareCreate" { v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = ( ( v.texcoord.xy - 0.5 ) * -0.85 ) + 0.5; o.uv[1] = ( ( v.texcoord.xy - 0.5 ) * -1.45 ) + 0.5; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader similarity index 94% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader index 6fe10b1..132f318 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/FastBloom" { Properties { @@ -35,7 +37,7 @@ Shader "Hidden/FastBloom" { { v2f_simple o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = v.texcoord; #if UNITY_UV_STARTS_AT_TOP @@ -60,7 +62,7 @@ Shader "Hidden/FastBloom" { { v2f_tap o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv20 = v.texcoord + _MainTex_TexelSize.xy; o.uv21 = v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,-0.5h); o.uv22 = v.texcoord + _MainTex_TexelSize.xy * half2(0.5h,-0.5h); @@ -117,7 +119,7 @@ Shader "Hidden/FastBloom" { v2f_withBlurCoords8 vertBlurHorizontal (appdata_img v) { v2f_withBlurCoords8 o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); o.offs = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; @@ -128,7 +130,7 @@ Shader "Hidden/FastBloom" { v2f_withBlurCoords8 vertBlurVertical (appdata_img v) { v2f_withBlurCoords8 o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); o.offs = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; @@ -156,7 +158,7 @@ Shader "Hidden/FastBloom" { v2f_withBlurCoordsSGX vertBlurHorizontalSGX (appdata_img v) { v2f_withBlurCoordsSGX o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = v.texcoord.xy; half2 netFilterWidth = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; @@ -174,7 +176,7 @@ Shader "Hidden/FastBloom" { v2f_withBlurCoordsSGX vertBlurVerticalSGX (appdata_img v) { v2f_withBlurCoordsSGX o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); half2 netFilterWidth = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader similarity index 94% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader index bb89465..60f1d58 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/FastBlur" { Properties { @@ -28,7 +30,7 @@ Shader "Hidden/FastBlur" { { v2f_tap o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv20 = v.texcoord + _MainTex_TexelSize.xy; o.uv21 = v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,-0.5h); o.uv22 = v.texcoord + _MainTex_TexelSize.xy * half2(0.5h,-0.5h); @@ -70,7 +72,7 @@ Shader "Hidden/FastBlur" { v2f_withBlurCoords8 vertBlurHorizontal (appdata_img v) { v2f_withBlurCoords8 o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); o.offs = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; @@ -81,7 +83,7 @@ Shader "Hidden/FastBlur" { v2f_withBlurCoords8 vertBlurVertical (appdata_img v) { v2f_withBlurCoords8 o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); o.offs = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; @@ -109,7 +111,7 @@ Shader "Hidden/FastBlur" { v2f_withBlurCoordsSGX vertBlurHorizontalSGX (appdata_img v) { v2f_withBlurCoordsSGX o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = v.texcoord.xy; half2 netFilterWidth = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; @@ -127,7 +129,7 @@ Shader "Hidden/FastBlur" { v2f_withBlurCoordsSGX vertBlurVerticalSGX (appdata_img v) { v2f_withBlurCoordsSGX o; - o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = half4(v.texcoord.xy,1,1); half2 netFilterWidth = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader similarity index 94% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader index 3f4b93f..9c907f0 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/MultipassHollywoodFlares" { Properties { _MainTex ("Base (RGB)", 2D) = "" {} @@ -31,14 +33,14 @@ Shader "Hidden/MultipassHollywoodFlares" { v2f vert (appdata_img v) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; } v2f_opts vertStretch (appdata_img v) { v2f_opts o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); half b = stretchWidth; o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy + b * 2.0 * offsets.xy; @@ -52,7 +54,7 @@ Shader "Hidden/MultipassHollywoodFlares" { v2f_opts vertVerticalCoords (appdata_img v) { v2f_opts o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv[0] = v.texcoord.xy; o.uv[1] = v.texcoord.xy + 0.5 * _MainTex_TexelSize.xy * half2(0,1); o.uv[2] = v.texcoord.xy - 0.5 * _MainTex_TexelSize.xy * half2(0,1); diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader similarity index 92% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader index cc054f4..f190e40 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/SeparableBlurPlus" { Properties { _MainTex ("Base (RGB)", 2D) = "" {} @@ -22,7 +24,7 @@ Shader "Hidden/SeparableBlurPlus" { v2f vert (appdata_img v) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv.xy = v.texcoord.xy; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader similarity index 86% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader index 4289b2d..cf3624f 100644 --- a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader +++ b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "Hidden/VignetteShader" { Properties { _MainTex ("Base (RGB)", 2D) = "" {} @@ -19,7 +21,7 @@ Shader "Hidden/VignetteShader" { v2f vert( appdata_img v ) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord.xy; return o; diff --git a/Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/ContrastEnhanced3D16.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/HexShape.psd.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/MotionBlurJitter.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Neutral3D16.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/Noise.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Noise.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/Noise.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Noise.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/Noise.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Noise.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/Noise.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/Noise.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseAndGrain.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectGrain.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/NoiseEffectScratch.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/RandomVectors.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/SphereShape.psd.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/VignetteMask.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/color correction ramp.png.meta diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png diff --git a/Assets/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png.meta b/Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png.meta similarity index 100% rename from Assets/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png.meta rename to Assets/_Vendor/Standard Assets/Effects/ImageEffects/Textures/grayscale ramp.png.meta diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index f214a2b..f0a85e0 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,14 +6,20 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/MMM/Trails/Scenes/1. Whitesnake.unity + path: Assets/_Project/Scenes/1. Whitesnake.unity + guid: 6c491acdab574f4449d85602c9ad1769 - enabled: 1 - path: Assets/MMM/Trails/Scenes/2. Light Cycle.unity + path: Assets/_Project/Scenes/2. Light Cycle.unity + guid: 98b41907b99b4c1448b7b2cfe7135d58 - enabled: 1 - path: Assets/MMM/Trails/Scenes/3. Enter The Mirror.unity + path: Assets/_Project/Scenes/3. Enter The Mirror.unity + guid: e833145884cdee44fa280f9f083dbda1 - enabled: 1 - path: Assets/MMM/Trails/Scenes/4. The Camera Follows.unity + path: Assets/_Project/Scenes/4. The Camera Follows.unity + guid: a0add70e58f7c5c428c9e65a3f4c1422 - enabled: 1 - path: Assets/MMM/Trails/Scenes/5. A Simplification.unity + path: Assets/_Project/Scenes/5. The Cinemachine Follows.unity + guid: b3b3ec43d74830147a7e7aa938d4ada8 - enabled: 1 - path: Assets/MMM/Trails/Scenes/6. Texturality.unity + path: Assets/_Project/Scenes/6. Texturality.unity + guid: 70db5e0e18c2dbb45b8c80a275ffbecf diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 4103ab5..354f692 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,99 +3,193 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 14 + productGUID: f0d54d99afb8d6447b7a01ee061ce54e AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 defaultScreenOrientation: 4 targetDevice: 2 - targetResolution: 0 + useOnDemandResources: 0 accelerometerFrequency: 60 companyName: MMM Labs productName: Workshop defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, 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_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: 2 + iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 allowedAutorotateToLandscapeLeft: 1 useOSAutorotation: 1 use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 disableDepthAndStencilBuffers: 0 + androidBlitType: 0 defaultIsFullScreen: 1 defaultIsNativeResolution: 1 + macRetinaSupport: 1 runInBackground: 1 captureSingleScreen: 0 - Override IPod Music: 0 + muteOtherAudioSources: 0 Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 resizableWindow: 0 useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games gpuSkinning: 0 + graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 xboxEnableKinectAutoTracking: 0 xboxEnableFitness: 0 visibleInBackground: 0 + allowFullscreenSwitch: 1 + graphicsJobMode: 0 macFullscreenMode: 2 - d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + n3dsDisableStereoscopicView: 0 + n3dsEnableSharedListOpt: 1 + n3dsEnableVSync: 0 xboxOneResolution: 0 - ps3SplashScreen: {fileID: 0} + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOnePresentImmediateThreshold: 0 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 + wiiUTVResolution: 0 + wiiUGamePadMSAA: 1 + wiiUSupportsNunchuk: 0 + wiiUSupportsClassicController: 0 + wiiUSupportsBalanceBoard: 0 + wiiUSupportsMotionPlus: 0 + wiiUSupportsProController: 0 + wiiUAllowScreenCapture: 1 + wiiUControllerCount: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 16:10: 1 16:9: 1 Others: 1 - bundleIdentifier: com.Company.ProductName bundleVersion: 1.0 preloadedAssets: [] - metroEnableIndependentInputSource: 0 - metroEnableLowLatencyPresentationAPI: 0 + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 - virtualRealitySupported: 0 - productGUID: f0d54d99afb8d6447b7a01ee061ce54e + xboxOneEnable7thCore: 0 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + enableVideoLayer: 0 + useProtectedVideoMemory: 0 + minimumSupportedHeadTracking: 0 + maximumSupportedHeadTracking: 1 + hololens: + depthFormat: 1 + depthBufferSharingEnabled: 0 + oculus: + sharedDepthBuffer: 0 + dashSupport: 0 + protectGraphicsMemory: 0 + useHDRDisplay: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: + Android: com.Company.ProductName + Standalone: unity.MMM Labs.Workshop + Tizen: com.Company.ProductName + iOS: com.Company.ProductName + tvOS: com.Company.ProductName + buildNumber: + iOS: AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 9 + AndroidMinSdkVersion: 16 + AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: - apiCompatibilityLevel: 2 + stripEngineCode: 1 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 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: 7.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 @@ -105,10 +199,21 @@ PlayerSettings: iPhone47inSplashScreen: {fileID: 0} iPhone55inPortraitSplashScreen: {fileID: 0} iPhone55inLandscapeSplashScreen: {fileID: 0} + iPhone58inPortraitSplashScreen: {fileID: 0} + iPhone58inLandscapeSplashScreen: {fileID: 0} iPadPortraitSplashScreen: {fileID: 0} iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -118,6 +223,28 @@ PlayerSettings: iOSLaunchScreenFillPct: 1 iOSLaunchScreenSize: 100 iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSUseLaunchScreenStoryboard: 0 + iOSLaunchScreenCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 1 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + appleEnableAutomaticSigning: 0 + clonedFromGUID: 00000000000000000000000000000000 AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -125,7 +252,9 @@ PlayerSettings: AndroidKeyaliasName: AndroidTVCompatibility: 1 AndroidIsGame: 1 + AndroidEnableTango: 0 androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 m_AndroidBanners: - width: 320 height: 180 @@ -135,45 +264,178 @@ PlayerSettings: m_BuildTargetIcons: - m_BuildTarget: m_Icons: - - m_Icon: {fileID: 0} - m_Size: 128 + - serializedVersion: 2 + m_Icon: {fileID: 0} + m_Width: 128 + m_Height: 128 + m_Kind: 20647 m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: [] - webPlayerTemplate: APPLICATION:Default + m_BuildTargetVRSettings: [] + m_BuildTargetEnableVuforiaSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 m_TemplateCustomTags: {} + mobileMTRendering: + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Standalone + m_EncodingQuality: 1 + - m_BuildTarget: XboxOne + m_EncodingQuality: 1 + - m_BuildTarget: PS4 + m_EncodingQuality: 1 + wiiUTitleID: 0005000011000000 + wiiUGroupID: 00010000 + wiiUCommonSaveSize: 4096 + wiiUAccountSaveSize: 2048 + wiiUOlvAccessKey: 0 + wiiUTinCode: 0 + wiiUJoinGameId: 0 + wiiUJoinGameModeMask: 0000000000000000 + wiiUCommonBossSize: 0 + wiiUAccountBossSize: 0 + wiiUAddOnUniqueIDs: [] + wiiUMainThreadStackSize: 3072 + wiiULoaderThreadStackSize: 1024 + wiiUSystemHeapSize: 128 + wiiUTVStartupScreen: {fileID: 0} + wiiUGamePadStartupScreen: {fileID: 0} + wiiUDrcBufferDisabled: 0 + wiiUProfilerLibPath: + playModeTestRunnerEnabled: 0 actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 + cameraUsageDescription: locationUsageDescription: - XboxTitleId: - XboxImageXexPath: - XboxSpaPath: - XboxGenerateSpa: 0 - XboxDeployKinectResources: 0 - XboxSplashScreen: {fileID: 0} - xboxEnableSpeech: 0 - xboxAdditionalTitleMemorySize: 0 - xboxDeployKinectHeadOrientation: 0 - xboxDeployKinectHeadPosition: 0 - ps3TitleConfigPath: - ps3DLCConfigPath: - ps3ThumbnailPath: - ps3BackgroundPath: - ps3SoundPath: - ps3NPAgeRating: 12 - ps3TrophyCommId: - ps3NpCommunicationPassphrase: - ps3TrophyPackagePath: - ps3BootCheckMaxSaveGameSizeKB: 128 - ps3TrophyCommSig: - ps3SaveGameSlots: 1 - ps3TrialMode: 0 - ps3VideoMemoryForAudio: 0 - ps3EnableVerboseMemoryStats: 0 - ps3UseSPUForUmbra: 0 - ps3EnableMoveSupport: 1 - ps3DisableDolbyEncoding: 0 + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + 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} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {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} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {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 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + 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: @@ -185,28 +447,61 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: ps4SaveDataImagePath: + ps4SdkOverride: ps4BGMPath: ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 ps4EnterButtonAssignment: 1 ps4ApplicationParam1: 0 ps4ApplicationParam2: 0 ps4ApplicationParam3: 0 ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + 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} psp2NPTrophyPackPath: @@ -254,14 +549,39 @@ PlayerSettings: psp2UseLibLocation: 0 psp2InfoBarOnStartup: 0 psp2InfoBarColor: 0 + psp2ScriptOptimizationLevel: 0 psmSplashimage: {fileID: 0} + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 0 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLUseWasm: 0 + webGLCompressionFormat: 1 scriptingDefineSymbols: {} + platformArchitecture: + iOS: 2 + scriptingBackend: + Metro: 2 + Standalone: 0 + WP8: 2 + WebGL: 1 + iOS: 0 + incrementalIl2cppBuild: {} + additionalIl2CppArgs: + scriptingRuntimeVersion: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 metroPackageName: One - metroPackageLogo: - metroPackageLogo140: - metroPackageLogo180: - metroPackageLogo240: metroPackageVersion: metroCertificatePath: metroCertificatePassword: @@ -269,44 +589,7 @@ PlayerSettings: metroCertificateIssuer: metroCertificateNotAfter: 0000000000000000 metroApplicationDescription: One - metroStoreTileLogo80: - metroStoreTileLogo: - metroStoreTileLogo140: - metroStoreTileLogo180: - metroStoreTileWideLogo80: - metroStoreTileWideLogo: - metroStoreTileWideLogo140: - metroStoreTileWideLogo180: - metroStoreTileSmallLogo80: - metroStoreTileSmallLogo: - metroStoreTileSmallLogo140: - metroStoreTileSmallLogo180: - metroStoreSmallTile80: - metroStoreSmallTile: - metroStoreSmallTile140: - metroStoreSmallTile180: - metroStoreLargeTile80: - metroStoreLargeTile: - metroStoreLargeTile140: - metroStoreLargeTile180: - metroStoreSplashScreenImage: - metroStoreSplashScreenImage140: - metroStoreSplashScreenImage180: - metroPhoneAppIcon: - metroPhoneAppIcon140: - metroPhoneAppIcon240: - metroPhoneSmallTile: - metroPhoneSmallTile140: - metroPhoneSmallTile240: - metroPhoneMediumTile: - metroPhoneMediumTile140: - metroPhoneMediumTile240: - metroPhoneWideTile: - metroPhoneWideTile140: - metroPhoneWideTile240: - metroPhoneSplashScreenImage: - metroPhoneSplashScreenImage140: - metroPhoneSplashScreenImage240: + wsaImages: {} metroTileShortName: metroCommandLineArgsFile: metroTileShowName: 0 @@ -323,35 +606,25 @@ 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 - stvDeviceAddress: - stvProductDescription: - stvProductAuthor: - stvProductAuthorEmail: - stvProductLink: - stvProductCategory: 0 + tizenDeploymentTarget: + tizenDeploymentTargetType: -1 + tizenMinOSVersion: 1 + n3dsUseExtSaveData: 0 + n3dsCompressStaticMem: 1 + n3dsExtSaveDataNumber: 0x12345 + n3dsStackSize: 131072 + n3dsTargetPlatform: 2 + n3dsRegion: 7 + n3dsMediaSize: 0 + n3dsLogoStyle: 3 + n3dsTitle: GameName + n3dsProductCode: + n3dsApplicationId: 0xFF3FF XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -364,50 +637,28 @@ PlayerSettings: XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} XboxOneIsContentPackage: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 - intPropertyNames: - - Metro::ScriptingBackend - - Standalone::ScriptingBackend - - WP8::ScriptingBackend - - WebGL::ScriptingBackend - - WebGL::audioCompressionFormat - - WebGL::exceptionSupport - - WebGL::memorySize - - iOS::Architecture - - iOS::ScriptingBackend - Metro::ScriptingBackend: 2 - Standalone::ScriptingBackend: 0 - WP8::ScriptingBackend: 2 - WebGL::ScriptingBackend: 1 - WebGL::audioCompressionFormat: 4 - WebGL::exceptionSupport: 0 - WebGL::memorySize: 256 - iOS::Architecture: 2 - iOS::ScriptingBackend: 0 - boolPropertyNames: - - WebGL::analyzeBuildSize - - WebGL::dataCaching - - WebGL::useEmbeddedResources - - XboxOne::enus - WebGL::analyzeBuildSize: 0 - WebGL::dataCaching: 0 - WebGL::useEmbeddedResources: 0 - XboxOne::enus: 1 - stringPropertyNames: - - WebGL::emscriptenArgs - - WebGL::template - - additionalIl2CppArgs::additionalIl2CppArgs - WebGL::emscriptenArgs: - WebGL::template: APPLICATION:Default - additionalIl2CppArgs::additionalIl2CppArgs: - firstStreamedSceneWithResources: 0 + XboxOneXTitleMemory: 8 + xboxOneScriptCompiler: 0 + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: {} + facebookSdkVersion: 7.9.4 + apiCompatibilityLevel: 2 cloudProjectId: - projectId: projectName: organizationId: cloudEnabled: 0 + enableNativePlatformBackendsForNewInputSystem: 0 + disableOldInputManagerSupport: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 8c353d8..4a9cfb6 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.1.2f1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 2017.4.6f1 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..3da14d5 --- /dev/null +++ b/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + m_Enabled: 0 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate + m_Enabled: 0 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/UnityPackageManager/manifest.json b/UnityPackageManager/manifest.json new file mode 100644 index 0000000..526aca6 --- /dev/null +++ b/UnityPackageManager/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +}