diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b671d86..ebdb0176 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,9 @@ jobs: build: name: Build Android Project runs-on: ubuntu-latest - steps: + steps: + - uses: jlumbroso/free-disk-space@v1.3.1 + # Checkout - name: Checkout repository uses: actions/checkout@v4 @@ -41,9 +43,14 @@ jobs: with: targetPlatform: Android unityVersion: 2021.3.11f1 + androidKeystoreName: springman # This file won't exist, but this property needs to exist. + androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} + androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} + androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} # Output - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Build path: build diff --git a/Assets/LeanTween/Examples/Archived.meta b/Assets/LeanTween/Examples/Archived.meta deleted file mode 100644 index 2f2f934c..00000000 --- a/Assets/LeanTween/Examples/Archived.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8d71b219a4562400b9fabb60eb51396d -folderAsset: yes -timeCreated: 1460027769 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader b/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader deleted file mode 100644 index 0115e68a..00000000 --- a/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader +++ /dev/null @@ -1,30 +0,0 @@ -Shader "Custom/2dUnlitWithFade" { - Properties - { - _Color ("Color Tint", Color) = (1,1,1,1) - _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" - } - - Category - { - Lighting Off - ZWrite Off - //ZWrite On // uncomment if you have problems like the sprite disappear in some rotations. - Cull back - Blend SrcAlpha OneMinusSrcAlpha - //AlphaTest Greater 0.001 // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels. - Tags {Queue=Transparent} - - SubShader - { - Pass - { - SetTexture [_MainTex] - { - ConstantColor [_Color] - Combine Texture * constant - } - } - } - } -} diff --git a/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader.meta b/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader.meta deleted file mode 100644 index 0be95923..00000000 --- a/Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 8bce9282b1bfd475284fd2e72b37403c diff --git a/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg b/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg deleted file mode 100644 index c725862a..00000000 Binary files a/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg and /dev/null differ diff --git a/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg.meta b/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg.meta deleted file mode 100644 index af6d297f..00000000 --- a/Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 6a9d1d221a3c94d83b614d921df0402e -TextureImporter: - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - 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 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: 1 - mipBias: -1 - wrapMode: 0 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - textureType: 5 - buildTargetSettings: [] diff --git a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs b/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs deleted file mode 100644 index 64d4a0e9..00000000 --- a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs +++ /dev/null @@ -1,84 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class OldGUIExamplesCS : MonoBehaviour { - public Texture2D grumpy; - public Texture2D beauty; - - private float w; - private float h; - - private LTRect buttonRect1; - private LTRect buttonRect2; - private LTRect buttonRect3; - private LTRect buttonRect4; - private LTRect grumpyRect; - private LTRect beautyTileRect; - - - // Use this for initialization - void Start () { - w = Screen.width; - h = Screen.height; - buttonRect1 = new LTRect(0.10f*w, 0.8f*h, 0.2f*w, 0.14f*h ); - buttonRect2 = new LTRect(1.2f*w, 0.8f*h, 0.2f*w, 0.14f*h ); - buttonRect3 = new LTRect(0.35f*w, 0.0f*h, 0.3f*w, 0.2f*h, 0f ); - buttonRect4 = new LTRect(0.0f*w, 0.4f*h, 0.3f*w, 0.2f*h, 1.0f, 15.0f ); - - grumpyRect = new LTRect(0.5f*w - grumpy.width*0.5f, 0.5f*h - grumpy.height*0.5f, grumpy.width, grumpy.height ); - beautyTileRect = new LTRect(0.0f,0.0f,1.0f,1.0f ); - - LeanTween.move( buttonRect2, new Vector2(0.55f*w, buttonRect2.rect.y), 0.7f ).setEase(LeanTweenType.easeOutQuad); - } - - public void catMoved(){ - Debug.Log("cat moved..."); - } - - // Update is called once per frame - void OnGUI () { - GUI.DrawTexture( grumpyRect.rect, grumpy); - - Rect staticRect = new Rect(0.0f*w, 0.0f*h, 0.2f*w, 0.14f*h); - if(GUI.Button( staticRect, "Move Cat")){ - if(LeanTween.isTweening(grumpyRect)==false){ // Check to see if the cat is already tweening, so it doesn't freak out - Vector2 orig = new Vector2( grumpyRect.rect.x, grumpyRect.rect.y ); - LeanTween.move( grumpyRect, new Vector2( 1.0f*Screen.width - grumpy.width, 0.0f*Screen.height ), 1.0f).setEase(LeanTweenType.easeOutBounce).setOnComplete(catMoved); - LeanTween.move( grumpyRect, orig, 1.0f ).setDelay(1.0f).setEase( LeanTweenType.easeOutBounce); - } - } - - if(GUI.Button(buttonRect1.rect, "Scale Centered")){ - LeanTween.scale( buttonRect1, new Vector2(buttonRect1.rect.width, buttonRect1.rect.height) * 1.2f, 0.25f ).setEase( LeanTweenType.easeOutQuad ); - LeanTween.move( buttonRect1, new Vector2(buttonRect1.rect.x-buttonRect1.rect.width*0.1f, buttonRect1.rect.y-buttonRect1.rect.height*0.1f), 0.25f ).setEase(LeanTweenType.easeOutQuad); - } - - if(GUI.Button(buttonRect2.rect, "Scale")){ - LeanTween.scale( buttonRect2, new Vector2(buttonRect2.rect.width, buttonRect2.rect.height) * 1.2f, 0.25f ).setEase(LeanTweenType.easeOutBounce); - } - - staticRect = new Rect(0.76f*w, 0.53f*h, 0.2f*w, 0.14f*h); - if(GUI.Button( staticRect, "Flip Tile")){ - LeanTween.move( beautyTileRect, new Vector2( 0f, beautyTileRect.rect.y + 1.0f ), 1.0f ).setEase(LeanTweenType.easeOutBounce); - } - - GUI.DrawTextureWithTexCoords( new Rect(0.8f*w, 0.5f*h - beauty.height*0.5f, beauty.width*0.5f, beauty.height*0.5f), beauty, beautyTileRect.rect); - - - if(GUI.Button(buttonRect3.rect, "Alpha")){ - LeanTween.alpha( buttonRect3, 0.0f, 1.0f).setEase(LeanTweenType.easeOutQuad); - LeanTween.alpha( buttonRect3, 1.0f, 1.0f).setDelay(1.0f).setEase( LeanTweenType.easeInQuad); - - LeanTween.alpha( grumpyRect, 0.0f, 1.0f).setEase(LeanTweenType.easeOutQuad); - LeanTween.alpha( grumpyRect, 1.0f, 1.0f).setDelay(1.0f).setEase(LeanTweenType.easeInQuad); - } - GUI.color = new Color(1.0f,1.0f,1.0f,1.0f); // Reset to normal alpha, otherwise other gui elements will be effected - - if(GUI.Button(buttonRect4.rect, "Rotate")){ - LeanTween.rotate( buttonRect4, 150.0f, 1.0f ).setEase(LeanTweenType.easeOutElastic); - LeanTween.rotate( buttonRect4, 0.0f, 1.0f ).setDelay(1.0f).setEase(LeanTweenType.easeOutElastic); - } - GUI.matrix = Matrix4x4.identity; - } -} diff --git a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs.meta b/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs.meta deleted file mode 100644 index 11322cb8..00000000 --- a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 876bfcaf53a664f29a628faa9fa332fc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity b/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity deleted file mode 100644 index 4b20be78..00000000 --- a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity +++ /dev/null @@ -1,230 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 3 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &4 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 1 - m_BakeResolution: 50 - m_AtlasSize: 1024 - m_AO: 1 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 0 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 1 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 512 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 0 - m_PVRDenoiserTypeDirect: 0 - m_PVRDenoiserTypeIndirect: 0 - m_PVRDenoiserTypeAO: 0 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 0 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 ---- !u!196 &5 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666666 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &1713412972 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1713412973} - - component: {fileID: 1713412974} - - component: {fileID: 1713412977} - - component: {fileID: 1713412975} - - component: {fileID: 1713412978} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1713412973 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1713412972} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - 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!20 &1713412974 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1713412972} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 100 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!81 &1713412975 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1713412972} - m_Enabled: 1 ---- !u!124 &1713412977 -Behaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1713412972} - m_Enabled: 1 ---- !u!114 &1713412978 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1713412972} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 876bfcaf53a664f29a628faa9fa332fc, type: 3} - m_Name: - m_EditorClassIdentifier: - grumpy: {fileID: 2800000, guid: 6a9d1d221a3c94d83b614d921df0402e, type: 3} - beauty: {fileID: 2800000, guid: 78e9e608c3c9d47a3b312c2908d10f46, type: 3} diff --git a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity.meta b/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity.meta deleted file mode 100644 index 76cb917d..00000000 --- a/Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.unity.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: ec27881ee9cf54018ac9bd5706c2fdab diff --git a/Assets/LeanTween/Examples/Archived/SoBeautiful.gif b/Assets/LeanTween/Examples/Archived/SoBeautiful.gif deleted file mode 100644 index 64170b1e..00000000 Binary files a/Assets/LeanTween/Examples/Archived/SoBeautiful.gif and /dev/null differ diff --git a/Assets/LeanTween/Examples/Archived/SoBeautiful.gif.meta b/Assets/LeanTween/Examples/Archived/SoBeautiful.gif.meta deleted file mode 100644 index 0d69f175..00000000 --- a/Assets/LeanTween/Examples/Archived/SoBeautiful.gif.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 78e9e608c3c9d47a3b312c2908d10f46 -TextureImporter: - 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 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - textureType: -1 - buildTargetSettings: [] diff --git a/Assets/LeanTween/Examples/Archived/TestingPunch.cs b/Assets/LeanTween/Examples/Archived/TestingPunch.cs deleted file mode 100644 index 683d44aa..00000000 --- a/Assets/LeanTween/Examples/Archived/TestingPunch.cs +++ /dev/null @@ -1,182 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class TestingPunch : MonoBehaviour { - - public AnimationCurve exportCurve; - public float overShootValue = 1f; - - private LTDescr descr; - - void Start () { - //LeanTween.rotateAround(gameObject, gameObject.transform.rotation.eulerAngles, 360f, 5f).setDelay(1f).setEase(LeanTweenType.easeOutBounce); - Debug.Log( "exported curve:" + curveToString(exportCurve) ); - } - - void Update () - { - LeanTween.dtManual = Time.deltaTime; - if (Input.GetKeyDown(KeyCode.Q)) - { - //LeanTween.scale(this.gameObject, Vector3.one*3f, 1.0f).setEase(LeanTweenType.easeSpring).setUseManualTime(true); - //print("scale punch time independent!"); - - LeanTween.moveLocalX(gameObject, 5, 1).setOnComplete( () => { - Debug.Log("on complete move local X"); - }).setOnCompleteOnStart(true); - - GameObject light = GameObject.Find("DirectionalLight"); - Light lt = light.GetComponent(); - - LeanTween.value(lt.gameObject, lt.intensity, 0.0f, 1.5f) - .setEase(LeanTweenType.linear) - .setLoopPingPong() - .setRepeat(-1) - .setOnUpdate((float val)=>{ - - lt.intensity = val; - }); - } - if (Input.GetKeyDown(KeyCode.S)) - { - print("scale punch!"); - - tweenStatically( this.gameObject ); - - LeanTween.scale(this.gameObject, new Vector3(1.15f, 1.15f, 1.15f), 0.6f); - - LeanTween.rotateAround(this.gameObject, Vector3.forward, -360f, 0.3f).setOnComplete(() => - { - LeanTween.rotateAround(this.gameObject, Vector3.forward, -360f, 0.4f).setOnComplete(() => - { - LeanTween.scale(this.gameObject, new Vector3(1f, 1f, 1f), 0.1f); - - LeanTween.value(this.gameObject, (v) => - { - - }, 0, 1, 0.3f).setDelay(1); - - }); - - }); - - - } - - if (Input.GetKeyDown(KeyCode.T)) - { - Vector3[] pts = new Vector3[] {new Vector3(-1f,0f,0f), new Vector3(0f,0f,0f), new Vector3(4f,0f,0f), new Vector3(20f,0f,0f)}; - descr = LeanTween.move(gameObject, pts, 15f).setOrientToPath(true).setDirection(1f).setOnComplete( ()=>{ - Debug.Log("move path finished"); - }); - } - - if (Input.GetKeyDown(KeyCode.Y)) // Reverse the move path - { - descr.setDirection(-descr.direction); - } - - if (Input.GetKeyDown(KeyCode.R)) - { - // LeanTween.rotate(this.gameObject, Vector3.one, 1.0f).setEase(LeanTweenType.punch); - LeanTween.rotateAroundLocal(this.gameObject, this.transform.forward, -80f, 5.0f).setPoint(new Vector3(1.25f, 0f, 0f)); - print("rotate punch!"); - } - - if (Input.GetKeyDown(KeyCode.M)) - { - // LeanTween.move(this.gameObject, new Vector3(0f,0f,1f), 1.0f).setEase(LeanTweenType.punch); - print("move punch!"); - Time.timeScale = 0.25f; - float start = Time.realtimeSinceStartup; - LeanTween.moveX( this.gameObject, 1f, 1f).setOnComplete( destroyOnComp ).setOnCompleteParam( this.gameObject ).setOnComplete( ()=>{ - float end = Time.realtimeSinceStartup; - float diff = end - start; - Debug.Log("start:"+start+" end:"+end+" diff:"+diff+" x:"+this.gameObject.transform.position.x); - }).setEase(LeanTweenType.easeInBack).setOvershoot( overShootValue ).setPeriod(0.3f); - } - - if (Input.GetKeyDown(KeyCode.C)) - { - LeanTween.color( this.gameObject, new Color(1f, 0f, 0f, 0.5f), 1f); - - Color to = new Color(Random.Range(0f,1f),0f,Random.Range(0f,1f),0.0f); - GameObject l = GameObject.Find("LCharacter"); - LeanTween.color( l, to, 4.0f ).setLoopPingPong(1).setEase(LeanTweenType.easeOutBounce); - } - - if (Input.GetKeyDown(KeyCode.E)) - { - LeanTween.delayedCall(gameObject,0.3f, delayedMethod).setRepeat(4).setOnCompleteOnRepeat(true).setOnCompleteParam( "hi" ); - } - - if (Input.GetKeyDown(KeyCode.V)) - { - LeanTween.value( gameObject, updateColor, new Color(1.0f,0.0f,0.0f,1.0f), Color.blue, 4.0f );//.setRepeat(2).setLoopPingPong().setEase(LeanTweenType.easeOutBounce); - } - - if (Input.GetKeyDown(KeyCode.P)) - { - LeanTween.delayedCall(0.05f, enterMiniGameStart).setOnCompleteParam( new object[]{""+5} ); - } - - if(Input.GetKeyDown(KeyCode.U)){ - #if !UNITY_FLASH - LeanTween.value(gameObject, (Vector2 val)=>{ - // Debug.Log("tweening vec2 val:"+val); - transform.position = new Vector3(val.x, transform.position.y, transform.position.z); - }, new Vector2(0f,0f), new Vector2(5f,100f), 1f ).setEase(LeanTweenType.easeOutBounce); - - GameObject l = GameObject.Find("LCharacter"); - Debug.Log("x:"+l.transform.position.x+" y:"+l.transform.position.y); - LeanTween.value(l, new Vector2( l.transform.position.x, l.transform.position.y), new Vector2( l.transform.position.x, l.transform.position.y+5), 1f ).setOnUpdate( - (Vector2 val)=>{ - Debug.Log("tweening vec2 val:"+val); - l.transform.position = new Vector3(val.x, val.y, transform.position.z); - } - - ); - #endif - } - } - - static void tweenStatically( GameObject gameObject ){ - Debug.Log("Starting to tween..."); - LeanTween.value(gameObject, (val)=>{ - Debug.Log("tweening val:"+val); - }, 0f, 1f, 1f); - } - - void enterMiniGameStart( object val ){ - object[] arr = (object [])val; - int lvl = int.Parse((string)arr[0]); - Debug.Log("level:"+lvl); - } - - void updateColor( Color c ){ - GameObject l = GameObject.Find("LCharacter"); - // Debug.Log("new col:"+c); - l.GetComponent().material.color = c; - } - - void delayedMethod( object myVal ){ - string castBack = myVal as string; - Debug.Log("delayed call:"+Time.time +" myVal:"+castBack); - } - - void destroyOnComp( object p ){ - GameObject g = (GameObject)p; - Destroy( g ); - } - - string curveToString( AnimationCurve curve) { - string str = ""; - for(int i = 0; i < curve.length; i++){ - str += "new Keyframe("+curve[i].time+"f, "+curve[i].value+"f)"; - if(i{ - for(int i=0; i < 10; i++){ - // Instantiate Container - GameObject rotator = new GameObject("rotator"+i); - rotator.transform.position = new Vector3(10.2f,2.85f,0f); - - // Instantiate Avatar - GameObject dude = (GameObject)GameObject.Instantiate(prefabAvatar, Vector3.zero, prefabAvatar.transform.rotation ); - dude.transform.parent = rotator.transform; - dude.transform.localPosition = new Vector3(0f,1.5f,2.5f*i); - - // Scale, pop-in - dude.transform.localScale = new Vector3(0f,0f,0f); - LeanTween.scale(dude, new Vector3(0.65f,0.65f,0.65f), 1f).setDelay(i*0.2f).setEase(LeanTweenType.easeOutBack); - - // Color like the rainbow - float period = LeanTween.tau/10*i; - float red = Mathf.Sin(period + LeanTween.tau*0f/3f) * 0.5f + 0.5f; - float green = Mathf.Sin(period + LeanTween.tau*1f/3f) * 0.5f + 0.5f; - float blue = Mathf.Sin(period + LeanTween.tau*2f/3f) * 0.5f + 0.5f; - Color rainbowColor = new Color(red, green, blue); - LeanTween.color(dude, rainbowColor, 0.3f).setDelay(1.2f + i*0.4f); - - // Push into the wheel - LeanTween.moveZ(dude, 0f, 0.3f).setDelay(1.2f + i*0.4f).setEase(LeanTweenType.easeSpring).setOnComplete( - ()=>{ - LeanTween.rotateAround(rotator, Vector3.forward, -1080f, 12f); - } - ); - - // Jump Up and back down - LeanTween.moveLocalY(dude,4f,1.2f).setDelay(5f + i*0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeInOutQuad); - - // Alpha Out, and destroy - LeanTween.alpha(dude, 0f, 0.6f).setDelay(9.2f + i*0.4f).setDestroyOnComplete(true).setOnComplete( - ()=>{ - Destroy( rotator ); // destroying parent as well - } - ); - } - - }).setOnCompleteOnStart(true).setRepeat(-1); // Have the OnComplete play in the beginning and have the whole group repeat endlessly - } -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralBasic.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralBasic.cs.meta deleted file mode 100644 index 312c974f..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralBasic.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a2605544ab2e14c93a780ca20c108cfe -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs b/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs deleted file mode 100644 index c4ad2740..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs +++ /dev/null @@ -1,102 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class GeneralBasics2d : MonoBehaviour { - - public Texture2D dudeTexture; - public GameObject prefabParticles; - - #if !(UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2) - - void Start () { - // Setup - GameObject avatarRotate = createSpriteDude( "avatarRotate", new Vector3(-2.51208f,10.7119f,-14.37754f)); - GameObject avatarScale = createSpriteDude( "avatarScale", new Vector3(2.51208f,10.2119f,-14.37754f)); - GameObject avatarMove = createSpriteDude( "avatarMove", new Vector3(-3.1208f,7.100643f,-14.37754f)); - - // Rotate Example - LeanTween.rotateAround( avatarRotate, Vector3.forward, -360f, 5f); - - // Scale Example - LeanTween.scale( avatarScale, new Vector3(1.7f, 1.7f, 1.7f), 5f).setEase(LeanTweenType.easeOutBounce); - LeanTween.moveX( avatarScale, avatarScale.transform.position.x + 1f, 5f).setEase(LeanTweenType.easeOutBounce); // Simultaneously target many different tweens on the same object - - // Move Example - LeanTween.move( avatarMove, avatarMove.transform.position + new Vector3(1.7f, 0f, 0f), 2f).setEase(LeanTweenType.easeInQuad); - - // Delay - LeanTween.move( avatarMove, avatarMove.transform.position + new Vector3(2f, -1f, 0f), 2f).setDelay(3f); - - // Chain properties (delay, easing with a set repeating of type ping pong) - LeanTween.scale( avatarScale, new Vector3(0.2f, 0.2f, 0.2f), 1f).setDelay(7f).setEase(LeanTweenType.easeInOutCirc).setLoopPingPong(3); - - // Call methods after a certain time period - LeanTween.delayedCall(gameObject, 0.2f, advancedExamples); - } - - GameObject createSpriteDude( string name, Vector3 pos, bool hasParticles = true ){ - GameObject go = new GameObject(name); - SpriteRenderer ren = go.AddComponent(); - go.GetComponent().color = new Color(0f,181f/255f,1f); - ren.sprite = Sprite.Create( dudeTexture, new Rect(0.0f,0.0f,256.0f,256.0f), new Vector2(0.5f,0f), 256f); - go.transform.position = pos; - - if(hasParticles){ - GameObject particles = (GameObject)GameObject.Instantiate(prefabParticles, Vector3.zero, prefabParticles.transform.rotation ); - particles.transform.parent = go.transform; - particles.transform.localPosition = prefabParticles.transform.position; - } - return go; - } - - // Advanced Examples - // It might be best to master the basics first, but this is included to tease the many possibilies LeanTween provides. - - void advancedExamples(){ - LeanTween.delayedCall(gameObject, 14f, ()=>{ - for(int i=0; i < 10; i++){ - // Instantiate Container - GameObject rotator = new GameObject("rotator"+i); - rotator.transform.position = new Vector3(2.71208f,7.100643f,-12.37754f); - - // Instantiate Avatar - GameObject dude = createSpriteDude( "dude"+i, new Vector3(-2.51208f,7.100643f,-14.37754f), false);//(GameObject)GameObject.Instantiate(prefabAvatar, Vector3.zero, prefabAvatar.transform.rotation ); - dude.transform.parent = rotator.transform; - dude.transform.localPosition = new Vector3(0f,0.5f,0.5f*i); - - // Scale, pop-in - dude.transform.localScale = new Vector3(0f,0f,0f); - LeanTween.scale(dude, new Vector3(0.65f,0.65f,0.65f), 1f).setDelay(i*0.2f).setEase(LeanTweenType.easeOutBack); - - // Color like the rainbow - float period = LeanTween.tau/10*i; - float red = Mathf.Sin(period + LeanTween.tau*0f/3f) * 0.5f + 0.5f; - float green = Mathf.Sin(period + LeanTween.tau*1f/3f) * 0.5f + 0.5f; - float blue = Mathf.Sin(period + LeanTween.tau*2f/3f) * 0.5f + 0.5f; - Color rainbowColor = new Color(red, green, blue); - LeanTween.color(dude, rainbowColor, 0.3f).setDelay(1.2f + i*0.4f); - - // Push into the wheel - LeanTween.moveLocalZ(dude, -2f, 0.3f).setDelay(1.2f + i*0.4f).setEase(LeanTweenType.easeSpring).setOnComplete( - ()=>{ - LeanTween.rotateAround(rotator, Vector3.forward, -1080f, 12f); - } - ); - - // Jump Up and back down - LeanTween.moveLocalY(dude,1.17f,1.2f).setDelay(5f + i*0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeInOutQuad); - - // Alpha Out, and destroy - LeanTween.alpha(dude, 0f, 0.6f).setDelay(9.2f + i*0.4f).setDestroyOnComplete(true).setOnComplete( - ()=>{ - Destroy( rotator ); // destroying parent as well - } - ); - } - - }).setOnCompleteOnStart(true).setRepeat(-1); // Have the OnComplete play in the beginning and have the whole group repeat endlessly - } - - #endif -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs.meta deleted file mode 100644 index d8194633..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralBasics2d.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9b39dd70d168b4cbea9a7b8561d9accc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs b/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs deleted file mode 100644 index 36c19d23..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs +++ /dev/null @@ -1,82 +0,0 @@ -#if !UNITY_FLASH -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class GeneralCameraShake : MonoBehaviour { - - private GameObject avatarBig; - private float jumpIter = 9.5f; - private AudioClip boomAudioClip; - - // Use this for initialization - void Start () { - avatarBig = GameObject.Find("AvatarBig"); - - AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(8.130963E-06f, 0.06526042f, 0f, -1f), new Keyframe(0.0007692695f, 2.449077f, 9.078861f, 9.078861f), new Keyframe(0.01541314f, 0.9343268f, -40f, -40f), new Keyframe(0.05169491f, 0.03835937f, -0.08621139f, -0.08621139f)); - AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0f, 0.003005181f, 0f, 0f), new Keyframe(0.01507768f, 0.002227979f, 0f, 0f)); - boomAudioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.1f,0f,0f)} )); - - - bigGuyJump(); - } - - void bigGuyJump(){ - float height = Mathf.PerlinNoise(jumpIter, 0f)*10f; - height = height*height * 0.3f; - // Debug.Log("height:"+height+" jumpIter:"+jumpIter); - - LeanTween.moveY(avatarBig, height, 1f).setEase(LeanTweenType.easeInOutQuad).setOnComplete( ()=>{ - LeanTween.moveY(avatarBig, 0f, 0.27f).setEase(LeanTweenType.easeInQuad).setOnComplete( ()=>{ - LeanTween.cancel(gameObject); - - /************** - * Camera Shake - **************/ - - float shakeAmt = height*0.2f; // the degrees to shake the camera - float shakePeriodTime = 0.42f; // The period of each shake - float dropOffTime = 1.6f; // How long it takes the shaking to settle down to nothing - LTDescr shakeTween = LeanTween.rotateAroundLocal( gameObject, Vector3.right, shakeAmt, shakePeriodTime) - .setEase( LeanTweenType.easeShake ) // this is a special ease that is good for shaking - .setLoopClamp() - .setRepeat(-1); - - // Slow the camera shake down to zero - LeanTween.value(gameObject, shakeAmt, 0f, dropOffTime).setOnUpdate( - (float val)=>{ - shakeTween.setTo(Vector3.right*val); - } - ).setEase(LeanTweenType.easeOutQuad); - - - /******************** - * Shake scene objects - ********************/ - - // Make the boxes jump from the big stomping - GameObject[] boxes = GameObject.FindGameObjectsWithTag("Respawn"); // I just arbitrarily tagged the boxes with this since it was available in the scene - foreach (GameObject box in boxes) { - box.GetComponent().AddForce(Vector3.up * 100 * height); - } - - // Make the lamps spin from the big stomping - GameObject[] lamps = GameObject.FindGameObjectsWithTag("GameController"); // I just arbitrarily tagged the lamps with this since it was available in the scene - foreach (GameObject lamp in lamps) { - float z = lamp.transform.eulerAngles.z; - z = z > 0.0f && z < 180f ? 1 : -1; // push the lamps in whatever direction they are currently swinging - lamp.GetComponent().AddForce(new Vector3(z, 0f, 0f ) * 15 * height); - } - - // Play BOOM! - LeanAudio.play(boomAudioClip, transform.position, height*0.2f); // Like this sound? : http://leanaudioplay.dentedpixel.com/?d=a:fvb:8,0,0.003005181,0,0,0.01507768,0.002227979,0,0,8~8,8.130963E-06,0.06526042,0,-1,0.0007692695,2.449077,9.078861,9.078861,0.01541314,0.9343268,-40,-40,0.05169491,0.03835937,-0.08621139,-0.08621139,8~0.1,0,0,~44100 - - // Have the jump happen again 2 seconds from now - LeanTween.delayedCall(2f, bigGuyJump); - }); - }); - jumpIter += 5.2f; - } - -} -#endif \ No newline at end of file diff --git a/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs.meta deleted file mode 100644 index 6bc5aa7a..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralCameraShake.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8a650682fa3d54a57a2521dbf9f6eac2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs b/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs deleted file mode 100644 index f493123a..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs +++ /dev/null @@ -1,72 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Reflection; -using DentedPixel; - -public class GeneralEasingTypes : MonoBehaviour { - - public float lineDrawScale = 10f; - public AnimationCurve animationCurve; - - private string[] easeTypes = new string[]{ - "EaseLinear","EaseAnimationCurve","EaseSpring", - "EaseInQuad","EaseOutQuad","EaseInOutQuad", - "EaseInCubic","EaseOutCubic","EaseInOutCubic", - "EaseInQuart","EaseOutQuart","EaseInOutQuart", - "EaseInQuint","EaseOutQuint","EaseInOutQuint", - "EaseInSine","EaseOutSine","EaseInOutSine", - "EaseInExpo","EaseOutExpo","EaseInOutExpo", - "EaseInCirc","EaseOutCirc","EaseInOutCirc", - "EaseInBounce","EaseOutBounce","EaseInOutBounce", - "EaseInBack","EaseOutBack","EaseInOutBack", - "EaseInElastic","EaseOutElastic","EaseInOutElastic", - "EasePunch","EaseShake", - }; - - void Start () { - - demoEaseTypes(); - } - - private void demoEaseTypes(){ - for(int i = 0; i < easeTypes.Length; i++){ - string easeName = easeTypes[i]; - Transform obj1 = GameObject.Find(easeName).transform.Find("Line"); - float obj1val = 0f; - LTDescr lt = LeanTween.value( obj1.gameObject, 0f, 1f, 5f).setOnUpdate( (float val)=>{ - Vector3 vec = obj1.localPosition; - vec.x = obj1val*lineDrawScale; - vec.y = val*lineDrawScale; - - obj1.localPosition = vec; - - obj1val += Time.deltaTime/5f; - if(obj1val>1f) - obj1val = 0f; - }); - if(easeName.IndexOf("AnimationCurve")>=0){ - lt.setEase(animationCurve); - }else{ - MethodInfo theMethod = lt.GetType().GetMethod("set"+easeName); - theMethod.Invoke(lt, null); - } - - if (easeName.IndexOf("EasePunch") >= 0) { - lt.setScale(1f); - } else if (easeName.IndexOf("EaseOutBounce") >= 0) { - lt.setOvershoot(2f); - } - } - - LeanTween.delayedCall(gameObject, 10f, resetLines); - LeanTween.delayedCall(gameObject, 10.1f, demoEaseTypes); - } - - private void resetLines(){ - for(int i = 0; i < easeTypes.Length; i++){ - Transform obj1 = GameObject.Find(easeTypes[i]).transform.Find("Line"); - obj1.localPosition = new Vector3(0f,0f,0f); - } - } - -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs.meta deleted file mode 100644 index 9414a293..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralEasingTypes.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 94e9a883a33cd40b9be1a63f002c4db2 -timeCreated: 1471950328 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs b/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs deleted file mode 100644 index 758495f3..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs +++ /dev/null @@ -1,83 +0,0 @@ -#if !UNITY_FLASH -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class GeneralEventsListeners : MonoBehaviour { - - Vector3 towardsRotation; - float turnForLength = 0.5f; - float turnForIter = 0f; - Color fromColor; - - // It's best to make this a public enum that you use throughout your project, so every class can have access to it - public enum MyEvents{ - CHANGE_COLOR, - JUMP, - LENGTH - } - - void Awake(){ - LeanTween.LISTENERS_MAX = 100; // This is the maximum of event listeners you will have added as listeners - LeanTween.EVENTS_MAX = (int)MyEvents.LENGTH; // The maximum amount of events you will be dispatching - - fromColor = GetComponent().material.color; - } - - void Start () { - // Adding Listeners, it's best to use an enum so your listeners are more descriptive but you could use an int like 0,1,2,... - LeanTween.addListener(gameObject, (int)MyEvents.CHANGE_COLOR, changeColor); - LeanTween.addListener(gameObject, (int)MyEvents.JUMP, jumpUp); - } - - // ****** Event Listening Methods - - void jumpUp( LTEvent e ){ - GetComponent().AddRelativeForce(Vector3.forward * 300f); - } - - void changeColor( LTEvent e ){ - Transform tran = (Transform)e.data; - float distance = Vector3.Distance( tran.position, transform.position); - Color to = new Color(Random.Range(0f,1f),0f,Random.Range(0f,1f)); - LeanTween.value( gameObject, fromColor, to, 0.8f ).setLoopPingPong(1).setDelay(distance*0.05f).setOnUpdate( - (Color col)=>{ - GetComponent().material.color = col; - } - ); - } - - // ****** Physics / AI Stuff - - void OnCollisionEnter(Collision collision) { - if(collision.gameObject.layer!=2) - towardsRotation = new Vector3(0f, Random.Range(-180, 180), 0f); - } - - void OnCollisionStay(Collision collision) { - if(collision.gameObject.layer!=2){ - turnForIter = 0f; - turnForLength = Random.Range(0.5f, 1.5f); - } - } - - void FixedUpdate(){ - if(turnForIter < turnForLength){ - GetComponent().MoveRotation( GetComponent().rotation * Quaternion.Euler(towardsRotation * Time.deltaTime ) ); - turnForIter += Time.deltaTime; - } - - GetComponent().AddRelativeForce(Vector3.forward * 4.5f); - } - - // ****** Key and clicking detection - - void OnMouseDown(){ - if(Input.GetKey( KeyCode.J )){ // Are you also pressing the "j" key while clicking - LeanTween.dispatchEvent((int)MyEvents.JUMP); - }else{ - LeanTween.dispatchEvent((int)MyEvents.CHANGE_COLOR, transform); // with every dispatched event, you can include an object (retrieve this object with the *.data var in LTEvent) - } - } -} -#endif diff --git a/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs.meta deleted file mode 100644 index 6842c4af..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralEventsListeners.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cd679d4fbbd8d475ba7187561370c3aa -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs b/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs deleted file mode 100644 index 2d05bd9a..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GeneralSequencer : MonoBehaviour { - - public GameObject avatar1; - - public GameObject star; - - public GameObject dustCloudPrefab; - - public float speedScale = 1f; - - public void Start(){ - - // Jump up - var seq = LeanTween.sequence(); - - - seq.append( LeanTween.moveY( avatar1, avatar1.transform.localPosition.y + 6f, 1f).setEaseOutQuad() ); - - // Power up star, use insert when you want to branch off from the regular sequence (this does not push back the delay of other subsequent tweens) - seq.insert( LeanTween.alpha(star, 0f, 1f) ); - seq.insert( LeanTween.scale( star, Vector3.one * 3f, 1f) ); - - // Rotate 360 - seq.append( LeanTween.rotateAround( avatar1, Vector3.forward, 360f, 0.6f ).setEaseInBack() ); - - // Return to ground - seq.append( LeanTween.moveY( avatar1, avatar1.transform.localPosition.y, 1f).setEaseInQuad() ); - - // Kick off spiraling clouds - Example of appending a callback method - seq.append(() => { - for(int i = 0; i < 50f; i++){ - GameObject cloud = Instantiate(dustCloudPrefab) as GameObject; - cloud.transform.parent = avatar1.transform; - cloud.transform.localPosition = new Vector3(Random.Range(-2f,2f),0f,0f); - cloud.transform.eulerAngles = new Vector3(0f,0f,Random.Range(0,360f)); - - var range = new Vector3(cloud.transform.localPosition.x, Random.Range(2f,4f), Random.Range(-10f,10f)); - - // Tweens not in a sequence, because we want them all to animate at the same time - LeanTween.moveLocal(cloud, range, 3f*speedScale).setEaseOutCirc(); - LeanTween.rotateAround(cloud, Vector3.forward, 360f*2, 3f*speedScale).setEaseOutCirc(); - LeanTween.alpha(cloud, 0f, 3f*speedScale).setEaseOutCirc().setDestroyOnComplete(true); - } - }); - - // You can speed up or slow down the sequence of events - seq.setScale(speedScale); - - // seq.reverse(); // not working yet - - // Testing canceling sequence after a bit of time - //LeanTween.delayedCall(3f, () => - //{ - // LeanTween.cancel(seq.id); - //}); - } -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs.meta deleted file mode 100644 index d786cdbd..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralSequencer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5b54bce4a9ed14e28a4a423c794a2d70 -timeCreated: 1488722358 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs b/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs deleted file mode 100644 index 12133b53..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs +++ /dev/null @@ -1,56 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class GeneralSimpleUI : MonoBehaviour { - #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_5 - - public RectTransform button; - - void Start () { - Debug.Log("For better examples see the 4.6_Examples folder!"); - if(button==null){ - Debug.LogError("Button not assigned! Create a new button via Hierarchy->Create->UI->Button. Then assign it to the button variable"); - return; - } - - // Tweening various values in a block callback style - LeanTween.value(button.gameObject, button.anchoredPosition, new Vector2(200f,100f), 1f ).setOnUpdate( - (Vector2 val)=>{ - button.anchoredPosition = val; - } - ); - - LeanTween.value(gameObject, 1f, 0.5f, 1f ).setOnUpdate( - (float volume)=>{ - Debug.Log("volume:"+volume); - } - ); - - LeanTween.value(gameObject, gameObject.transform.position, gameObject.transform.position + new Vector3(0,1f,0), 1f ).setOnUpdate( - (Vector3 val)=>{ - gameObject.transform.position = val; - } - ); - - LeanTween.value(gameObject, Color.red, Color.green, 1f ).setOnUpdate( - (Color val)=>{ - UnityEngine.UI.Image image = (UnityEngine.UI.Image)button.gameObject.GetComponent( typeof(UnityEngine.UI.Image) ); - image.color = val; - } - ); - - // Tweening Using Unity's new Canvas GUI System - LeanTween.move(button, new Vector3(200f,-100f,0f), 1f).setDelay(1f); - LeanTween.rotateAround(button, Vector3.forward, 90f, 1f).setDelay(2f); - LeanTween.scale(button, button.localScale*2f, 1f).setDelay(3f); - LeanTween.rotateAround(button, Vector3.forward, -90f, 1f).setDelay(4f).setEase(LeanTweenType.easeInOutElastic); - } - - #else - void Start(){ - Debug.LogError("Unity 4.6+ is required to use the new UI"); - } - - #endif -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs.meta deleted file mode 100644 index 1f6e36ac..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralSimpleUI.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 19c352f230e8b46f08abbbd7cc11edb8 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs b/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs deleted file mode 100644 index f2f490bf..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs +++ /dev/null @@ -1,89 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class GeneralUISpace : MonoBehaviour { - - public RectTransform mainWindow; - public RectTransform mainParagraphText; - public RectTransform mainTitleText; - public RectTransform mainButton1; - public RectTransform mainButton2; - - public RectTransform pauseRing1; - public RectTransform pauseRing2; - public RectTransform pauseWindow; - - public RectTransform chatWindow; - public RectTransform chatRect; - public Sprite[] chatSprites; - public RectTransform chatBar1; - public RectTransform chatBar2; - public UnityEngine.UI.Text chatText; - - public RectTransform rawImageRect; - - void Start () { - // Time.timeScale = 1f/4f; - - // *********** Main Window ********** - // Scale the whole window in - mainWindow.localScale = Vector3.zero; - LeanTween.scale( mainWindow, new Vector3(1f,1f,1f), 0.6f).setEase(LeanTweenType.easeOutBack); - LeanTween.alphaCanvas( mainWindow.GetComponent(), 0f, 1f).setDelay(2f).setLoopPingPong().setRepeat(2); - - // Fade the main paragraph in while moving upwards - mainParagraphText.anchoredPosition3D += new Vector3(0f,-10f,0f); - LeanTween.textAlpha( mainParagraphText, 0f, 0.6f).setFrom(0f).setDelay(0f); - LeanTween.textAlpha( mainParagraphText, 1f, 0.6f).setEase(LeanTweenType.easeOutQuad).setDelay(0.6f); - LeanTween.move( mainParagraphText, mainParagraphText.anchoredPosition3D + new Vector3(0f,10f,0f), 0.6f).setEase(LeanTweenType.easeOutQuad).setDelay(0.6f); - - // Flash text to purple and back - LeanTween.textColor( mainTitleText, new Color(133f/255f,145f/255f,223f/255f), 0.6f).setEase(LeanTweenType.easeOutQuad).setDelay(0.6f).setLoopPingPong().setRepeat(-1); - - // Fade button in - LeanTween.textAlpha(mainButton2, 1f, 2f ).setFrom(0f).setDelay(0f).setEase(LeanTweenType.easeOutQuad); - LeanTween.alpha(mainButton2, 1f, 2f ).setFrom(0f).setDelay(0f).setEase(LeanTweenType.easeOutQuad); - - // Pop size of button - LeanTween.size(mainButton1, mainButton1.sizeDelta * 1.1f, 0.5f).setDelay(3f).setEaseInOutCirc().setRepeat(6).setLoopPingPong(); - - - // *********** Pause Button ********** - // Drop pause button in - pauseWindow.anchoredPosition3D += new Vector3(0f,200f,0f); - LeanTween.moveY( pauseWindow, pauseWindow.anchoredPosition3D.y + -200f, 0.6f).setEase(LeanTweenType.easeOutSine).setDelay(0.6f); - - // Punch Pause Symbol - RectTransform pauseText = pauseWindow.Find("PauseText").GetComponent(); - LeanTween.moveZ( pauseText, pauseText.anchoredPosition3D.z - 80f, 1.5f).setEase(LeanTweenType.punch).setDelay(2.0f); - - // Rotate rings around in opposite directions - LeanTween.rotateAroundLocal(pauseRing1, Vector3.forward, 360f, 12f).setRepeat(-1); - LeanTween.rotateAroundLocal(pauseRing2, Vector3.forward, -360f, 22f).setRepeat(-1); - - - // *********** Chat Window ********** - // Flip the chat window in - chatWindow.RotateAround(chatWindow.position, Vector3.up, -180f); - LeanTween.rotateAround(chatWindow, Vector3.up, 180f, 2f).setEase(LeanTweenType.easeOutElastic).setDelay(1.2f); - - // Play a series of sprites on the window on repeat endlessly - LeanTween.play(chatRect, chatSprites).setLoopPingPong(); - - // Animate the bar up and down while changing the color to red-ish - LeanTween.color( chatBar2, new Color(248f/255f,67f/255f,108f/255f, 0.5f), 1.2f).setEase(LeanTweenType.easeInQuad).setLoopPingPong().setDelay(1.2f); - LeanTween.scale( chatBar2, new Vector2(1f,0.7f), 1.2f).setEase(LeanTweenType.easeInQuad).setLoopPingPong(); - - // Write in paragraph text - string origText = chatText.text; - chatText.text = ""; - LeanTween.value(gameObject, 0, (float)origText.Length, 6f).setEase(LeanTweenType.easeOutQuad).setOnUpdate( (float val)=>{ - chatText.text = origText.Substring( 0, Mathf.RoundToInt( val ) ); - }).setLoopClamp().setDelay(2.0f); - - // Raw Image - LeanTween.alpha(rawImageRect,0f,1f).setLoopPingPong(); - } - -} diff --git a/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs.meta b/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs.meta deleted file mode 100644 index 5452abb3..00000000 --- a/Assets/LeanTween/Examples/Scripts/GeneralUISpace.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cc2ddccee016148b189d987f564ee08e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs b/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs deleted file mode 100644 index 4692af8e..00000000 --- a/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using DentedPixel; - -public class LogoCinematic : MonoBehaviour { - - public GameObject lean; - - public GameObject tween; - - void Awake(){ - - } - - - void Start () { - //Time.timeScale = 0.2f; - - // Slide in - tween.transform.localPosition += -Vector3.right * 15f; - LeanTween.moveLocalX(tween, tween.transform.localPosition.x+15f, 0.4f).setEase(LeanTweenType.linear).setDelay(0f).setOnComplete( playBoom ); - - // Drop Down tween down - tween.transform.RotateAround(tween.transform.position, Vector3.forward, -30f); - LeanTween.rotateAround(tween, Vector3.forward, 30f, 0.4f).setEase(LeanTweenType.easeInQuad).setDelay(0.4f).setOnComplete( playBoom ); - - // Drop Lean In - lean.transform.position += Vector3.up * 5.1f; - LeanTween.moveY(lean, lean.transform.position.y-5.1f, 0.6f).setEase(LeanTweenType.easeInQuad).setDelay(0.6f).setOnComplete( playBoom ); - } - - void playBoom(){ - // Make your own Dynamic Audio at http://leanaudioplay.dentedpixel.com - - AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(0f, 1.163155f, 0f, -1f), new Keyframe(0.3098361f, 0f, 0f, 0f), new Keyframe(0.5f, 0.003524712f, 0f, 0f)); - AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0.000819672f, 0.007666667f, 0f, 0f), new Keyframe(0.01065573f, 0.002424242f, 0f, 0f), new Keyframe(0.02704918f, 0.007454545f, 0f, 0f), new Keyframe(0.03770492f, 0.002575758f, 0f, 0f), new Keyframe(0.052459f, 0.007090909f, 0f, 0f), new Keyframe(0.06885245f, 0.002939394f, 0f, 0f), new Keyframe(0.0819672f, 0.006727273f, 0f, 0f), new Keyframe(0.1040983f, 0.003181818f, 0f, 0f), new Keyframe(0.1188525f, 0.006212121f, 0f, 0f), new Keyframe(0.145082f, 0.004151515f, 0f, 0f), new Keyframe(0.1893443f, 0.005636364f, 0f, 0f)); - - AudioClip audioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.1f,0f,0f)} ).setFrequency(11025)); - - LeanAudio.play( audioClip ); //a:fvb:8,.000819672,.007666667,,,.01065573,.002424242,,,.02704918,.007454545,,,.03770492,.002575758,,,.052459,.007090909,,,.06885245,.002939394,,,.0819672,.006727273,,,.1040983,.003181818,,,.1188525,.006212121,,,.145082,.004151515,,,.1893443,.005636364,,,8~8,,1.163155,,-,.3098361,,,,.5,.003524712,,,8~.1,,,~11025~0~~ - } - -} diff --git a/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs.meta b/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs.meta deleted file mode 100644 index 5801ed3b..00000000 --- a/Assets/LeanTween/Examples/Scripts/LogoCinematic.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 674f3c10d8880408e875a9e6c3ee83bb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/PathBezier.cs b/Assets/LeanTween/Examples/Scripts/PathBezier.cs deleted file mode 100644 index 2b8317d8..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathBezier.cs +++ /dev/null @@ -1,48 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -namespace DentedPixel.LTExamples{ - -public class PathBezier : MonoBehaviour { - - public Transform[] trans; - - LTBezierPath cr; - private GameObject avatar1; - - void OnEnable(){ - // create the path - cr = new LTBezierPath( new Vector3[] {trans[0].position, trans[2].position, trans[1].position, trans[3].position, trans[3].position, trans[5].position, trans[4].position, trans[6].position} ); - } - - void Start () { - avatar1 = GameObject.Find("Avatar1"); - - // Tween automatically - LTDescr descr = LeanTween.move(avatar1, cr.pts, 6.5f).setOrientToPath(true).setRepeat(-1); - Debug.Log("length of path 1:"+cr.length); - Debug.Log("length of path 2:"+descr.optional.path.length); - } - - private float iter; - void Update () { - // Or Update Manually - //cr.place2d( sprite1.transform, iter ); - - iter += Time.deltaTime*0.07f; - if(iter>1.0f) - iter = 0.0f; - } - - void OnDrawGizmos(){ - // Debug.Log("drwaing"); - if(cr!=null) - OnEnable(); - Gizmos.color = Color.red; - if(cr!=null) - cr.gizmoDraw(); // To Visualize the path, use this method - } -} - -} \ No newline at end of file diff --git a/Assets/LeanTween/Examples/Scripts/PathBezier.cs.meta b/Assets/LeanTween/Examples/Scripts/PathBezier.cs.meta deleted file mode 100644 index 10740b63..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathBezier.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ac2038ba3961049ed889ae71039982cd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs b/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs deleted file mode 100644 index 21d3adeb..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class PathBezier2d : MonoBehaviour { - - public Transform[] cubes; - - public GameObject dude1; - public GameObject dude2; - - private LTBezierPath visualizePath; - - void Start () { - // move - Vector3[] path = new Vector3[]{cubes[0].position,cubes[1].position,cubes[2].position,cubes[3].position}; - // 90 degree test - // path = new Vector3[] {new Vector3(7.5f, 0f, 0f), new Vector3(0f, 0f, 2.5f), new Vector3(2.5f, 0f, 0f), new Vector3(0f, 0f, 7.5f)}; - visualizePath = new LTBezierPath(path); - LeanTween.move(dude1, path, 10f).setOrientToPath2d(true); - - // move local - LeanTween.moveLocal(dude2, path, 10f).setOrientToPath2d(true); - } - - void OnDrawGizmos(){ - // Debug.Log("drwaing"); - Gizmos.color = Color.red; - if(visualizePath!=null) - visualizePath.gizmoDraw(); // To Visualize the path, use this method - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs.meta b/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs.meta deleted file mode 100644 index b5a48ade..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathBezier2d.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 873cb511c724a48bd919ce8a18fa882c -timeCreated: 1493586162 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/PathSpline.cs b/Assets/LeanTween/Examples/Scripts/PathSpline.cs deleted file mode 100644 index a928a58a..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSpline.cs +++ /dev/null @@ -1,38 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class ExampleSpline : MonoBehaviour { - - public Transform[] trans; - - LTSpline spline; - private GameObject ltLogo; - private GameObject ltLogo2; - - void Start () { - spline = new LTSpline( new Vector3[] {trans[0].position, trans[1].position, trans[2].position, trans[3].position, trans[4].position} ); - ltLogo = GameObject.Find("LeanTweenLogo1"); - ltLogo2 = GameObject.Find("LeanTweenLogo2"); - - LeanTween.moveSpline( ltLogo2, spline.pts, 1f).setEase(LeanTweenType.easeInOutQuad).setLoopPingPong().setOrientToPath(true); - - LTDescr zoomInPath_LT = LeanTween.moveSpline(ltLogo2, new Vector3[]{Vector3.zero, Vector3.zero, new Vector3(1,1,1), new Vector3(2,1,1), new Vector3(2,1,1)}, 1.5f); - zoomInPath_LT.setUseEstimatedTime(true); - } - - private float iter; - void Update () { - // Iterating over path - ltLogo.transform.position = spline.point( iter /*(Time.time*1000)%1000 * 1.0 / 1000.0 */); - - iter += Time.deltaTime*0.1f; - if(iter>1.0f) - iter = 0.0f; - } - - void OnDrawGizmos(){ - if(spline!=null) - spline.gizmoDraw(); // debug aid to be able to see the path in the scene inspector - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSpline.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSpline.cs.meta deleted file mode 100644 index 91381603..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSpline.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ef4235237d8d8413c9d5807cf0a1f77b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs b/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs deleted file mode 100644 index 2a415d36..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class PathSpline2d : MonoBehaviour { - - public Transform[] cubes; - - public GameObject dude1; - public GameObject dude2; - - private LTSpline visualizePath; - - void Start () { - Vector3[] path = new Vector3[] { - cubes[0].position, - cubes[1].position, - cubes[2].position, - cubes[3].position, - cubes[4].position - }; - - visualizePath = new LTSpline( path ); - // move - LeanTween.moveSpline(dude1, path, 10f).setOrientToPath2d(true).setSpeed(2f); - - // move Local - LeanTween.moveSplineLocal(dude2, path, 10f).setOrientToPath2d(true).setSpeed(2f); - } - - void OnDrawGizmos(){ - Gizmos.color = Color.red; - if(visualizePath!=null) - visualizePath.gizmoDraw(); - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs.meta deleted file mode 100644 index 31392297..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSpline2d.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 15c036b11e3ff486ea685da06fa305f6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs b/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs deleted file mode 100644 index aec48643..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs +++ /dev/null @@ -1,125 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using DentedPixel; - -public class PathSplineEndless : MonoBehaviour { - public GameObject trackTrailRenderers; - public GameObject car; - public GameObject carInternal; - - public GameObject[] cubes; - private int cubesIter; - public GameObject[] trees; - private int treesIter; - - public float randomIterWidth = 0.1f; - - private LTSpline track; - private List trackPts = new List(); - private int zIter = 0; - private float carIter = 0f; - private float carAdd; - private int trackMaxItems = 15; - private int trackIter = 1; - private float pushTrackAhead = 0f; - private float randomIter = 0f; - - void Start () { - - // Setup initial track points - for(int i = 0; i < 4; i++){ - addRandomTrackPoint(); - } - refreshSpline(); - - // Animate in track ahead of the car - LeanTween.value(gameObject, 0, 0.3f, 2f).setOnUpdate( ( float val )=>{ - pushTrackAhead = val; - }); - } - - void Update () { - - float zLastDist = (trackPts[ trackPts.Count - 1].z - transform.position.z); - if(zLastDist < 200f){ // if the last node is too close we'll add in a new point and refresh the spline - addRandomTrackPoint(); - refreshSpline(); - } - - // Update avatar's position on correct track - track.place( car.transform, carIter ); - carIter += carAdd * Time.deltaTime; - - // we'll place the trail renders always a bit in front of the car - track.place( trackTrailRenderers.transform, carIter + pushTrackAhead ); - - - // Switch tracks on keyboard input - float turn = Input.GetAxis("Horizontal"); - if(Input.anyKeyDown){ - if(turn<0f && trackIter>0){ - trackIter--; - playSwish(); - }else if(turn>0f && trackIter < 2){ // We have three track "rails" so stopping it from going above 3 - trackIter++; - playSwish(); - } - // Move the internal local x of the car to simulate changing tracks - LeanTween.moveLocalX(carInternal, (trackIter-1)*6f, 0.3f).setEase(LeanTweenType.easeOutBack); - } - } - - // Simple object queuing system - GameObject objectQueue( GameObject[] arr, ref int lastIter ){ - lastIter = lastIter>=arr.Length-1 ? 0 : lastIter+1; - - // Reset scale and rotation for a new animation - arr[ lastIter ].transform.localScale = Vector3.one; - arr[ lastIter ].transform.rotation = Quaternion.identity; - return arr[ lastIter ]; - } - - void addRandomTrackPoint(){ - float randX = Mathf.PerlinNoise(0f, randomIter); - randomIter += randomIterWidth; - - Vector3 randomInFrontPosition = new Vector3( (randX-0.5f)*20f, 0f, zIter*40f); - - // placing the box is just to visualize how the paths get created - GameObject box = objectQueue( cubes, ref cubesIter ); - box.transform.position = randomInFrontPosition; - - // Line the roads with trees - GameObject tree = objectQueue( trees, ref treesIter ); - float treeX = zIter%2==0 ? -15f : 15f; - tree.transform.position = new Vector3( randomInFrontPosition.x + treeX, 0f, zIter*40f); - - // Animate in new tree (just for fun) - LeanTween.rotateAround( tree, Vector3.forward, 0f, 1f).setFrom( zIter%2==0 ? 180f : -180f).setEase(LeanTweenType.easeOutBack); - - trackPts.Add( randomInFrontPosition ); // Add a future spline node - if(trackPts.Count > trackMaxItems) - trackPts.RemoveAt(0); // Remove the trailing spline node - - zIter++; - } - - void refreshSpline(){ - track = new LTSpline( trackPts.ToArray() ); - carIter = track.ratioAtPoint( car.transform.position ); // we created a new spline so we need to update the cars iteration point on this new spline - // Debug.Log("distance:"+track.distance+" carIter:"+carIter); - carAdd = 40f / track.distance; // we want to make sure the speed is based on the distance of the spline for a more constant speed - } - - // Make your own LeanAudio sounds at http://leanaudioplay.dentedpixel.com - void playSwish(){ - AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(0f, 0.005464481f, 1.83897f, 0f), new Keyframe(0.1114856f, 2.281785f, 0f, 0f), new Keyframe(0.2482903f, 2.271654f, 0f, 0f), new Keyframe(0.3f, 0.01670286f, 0f, 0f)); - AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0f, 0.00136725f, 0f, 0f), new Keyframe(0.1482391f, 0.005405405f, 0f, 0f), new Keyframe(0.2650336f, 0.002480127f, 0f, 0f)); - - AudioClip audioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.2f,0.5f,0f)} ).setWaveNoise().setWaveNoiseScale(1000)); - - LeanAudio.play( audioClip ); //a:fvb:8,,.00136725,,,.1482391,.005405405,,,.2650336,.002480127,,,8~8,,.005464481,1.83897,,.1114856,2.281785,,,.2482903,2.271654,,,.3,.01670286,,,8~.2,.5,,~~0~~3,1000,1 - } - -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs.meta deleted file mode 100644 index 12d9047b..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplineEndless.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 784f0e347ee4d4c3b83ca56d6f33f01a -timeCreated: 1460315101 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs b/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs deleted file mode 100644 index a3e2884f..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs +++ /dev/null @@ -1,93 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using DentedPixel; -// This class is to test the upper limits of a complex spline - -public class PathSplinePerformance : MonoBehaviour { - - public GameObject trackTrailRenderers; - public GameObject car; - public GameObject carInternal; - - - public float circleLength = 10f; - public float randomRange = 1f; - public int trackNodes = 30; - public float carSpeed = 30f; - public float tracerSpeed = 2f; - - private LTSpline track; - private int trackIter = 1; - private float carAdd; - private float trackPosition; // ratio 0,1 of the avatars position on the track - - void Start () { - Application.targetFrameRate = 240; - - // Make the track from the provided transforms - List randList = new List(); - float degree = 0f; - int nodeLength = trackNodes + 1;// We need to add some extra because the first and last nodes just act as *guides* to the first and last curvature - for(int i = 0; i < nodeLength; i++){ - float x = Mathf.Cos( degree * Mathf.Deg2Rad ) * circleLength + Random.Range(0f, randomRange); - float z = Mathf.Sin( degree * Mathf.Deg2Rad ) * circleLength + Random.Range(0f, randomRange); - randList.Add( new Vector3(x,1f,z ) ); - - degree += 360f/(float)trackNodes; - } - randList[0] = randList[ randList.Count-1 ]; // set the zero-ith one as the last position so it will flow smoothly into the first curve - randList.Add( randList[1] ); // Add the first and second one in, so the circle connects to itself - randList.Add( randList[2] ); - - track = new LTSpline( randList.ToArray() ); - - carAdd = carSpeed / track.distance; - - tracerSpeed = track.distance / (carSpeed*1.2f); - - // Optional technique to show the trails in game - LeanTween.moveSpline( trackTrailRenderers, track, tracerSpeed ).setOrientToPath(true).setRepeat(-1); - } - - void Update () { - // Switch tracks on keyboard input - float turn = Input.GetAxis("Horizontal"); - if(Input.anyKeyDown){ - if(turn<0f && trackIter>0){ - trackIter--; - playSwish(); - }else if(turn>0f && trackIter < 2){ // We have three track "rails" so stopping it from going above 3 - trackIter++; - playSwish(); - } - // Move the internal local x of the car to simulate changing tracks - LeanTween.moveLocalX(carInternal, (trackIter-1)*6f, 0.3f).setEase(LeanTweenType.easeOutBack); - - } - - // Update avatar's position on correct track - track.place( car.transform, trackPosition ); - - trackPosition += Time.deltaTime * carAdd; - - if(trackPosition>1f) - trackPosition = 0f; // We need to keep the ratio between 0-1 so after one we will loop back to the beginning of the track - } - - // Use this for visualizing what the track looks like in the editor (for a full suite of spline tools check out the LeanTween Editor) - void OnDrawGizmos(){ - if(track!=null) - track.drawGizmo( Color.red ); - } - - // Make your own LeanAudio sounds at http://leanaudioplay.dentedpixel.com - void playSwish(){ - AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(0f, 0.005464481f, 1.83897f, 0f), new Keyframe(0.1114856f, 2.281785f, 0f, 0f), new Keyframe(0.2482903f, 2.271654f, 0f, 0f), new Keyframe(0.3f, 0.01670286f, 0f, 0f)); - AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0f, 0.00136725f, 0f, 0f), new Keyframe(0.1482391f, 0.005405405f, 0f, 0f), new Keyframe(0.2650336f, 0.002480127f, 0f, 0f)); - - AudioClip audioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.2f,0.5f,0f)} ).setWaveNoise().setWaveNoiseScale(1000)); - - LeanAudio.play( audioClip ); //a:fvb:8,,.00136725,,,.1482391,.005405405,,,.2650336,.002480127,,,8~8,,.005464481,1.83897,,.1114856,2.281785,,,.2482903,2.271654,,,.3,.01670286,,,8~.2,.5,,~~0~~3,1000,1 - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs.meta deleted file mode 100644 index 056ba9da..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplinePerformance.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5de62495c8a5d49e6b3ca111f8c7e944 -timeCreated: 1460894008 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs b/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs deleted file mode 100644 index 4aa59f00..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs +++ /dev/null @@ -1,68 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -// This project demonstrates how you can use the spline behaviour for a multi-track game (like an endless runner style) - -public class PathSplineTrack : MonoBehaviour { - - public GameObject car; - public GameObject carInternal; - public GameObject trackTrailRenderers; - - public Transform[] trackOnePoints; - - private LTSpline track; - private int trackIter = 1; - private float trackPosition; // ratio 0,1 of the avatars position on the track - - void Start () { - // Make the track from the provided transforms - track = new LTSpline( new Vector3[] {trackOnePoints[0].position, trackOnePoints[1].position, trackOnePoints[2].position, trackOnePoints[3].position, trackOnePoints[4].position, trackOnePoints[5].position, trackOnePoints[6].position} ); - - // Optional technique to show the trails in game - LeanTween.moveSpline( trackTrailRenderers, track, 2f ).setOrientToPath(true).setRepeat(-1); - } - - void Update () { - // Switch tracks on keyboard input - float turn = Input.GetAxis("Horizontal"); - if(Input.anyKeyDown){ - if(turn<0f && trackIter>0){ - trackIter--; - playSwish(); - }else if(turn>0f && trackIter < 2){ // We have three track "rails" so stopping it from going above 3 - trackIter++; - playSwish(); - } - // Move the internal local x of the car to simulate changing tracks - LeanTween.moveLocalX(carInternal, (trackIter-1)*6f, 0.3f).setEase(LeanTweenType.easeOutBack); - - } - - // Update avatar's position on correct track - track.place( car.transform, trackPosition ); - - trackPosition += Time.deltaTime * 0.03f;// * Input.GetAxis("Vertical"); // Uncomment to have the forward and backwards controlled by the directional arrows - - if (trackPosition < 0f) // We need to keep the ratio between 0-1 so after one we will loop back to the beginning of the track - trackPosition = 1f; - else if(trackPosition>1f) - trackPosition = 0f; - } - - // Use this for visualizing what the track looks like in the editor (for a full suite of spline tools check out the LeanTween Editor) - void OnDrawGizmos(){ - LTSpline.drawGizmo( trackOnePoints, Color.red); - } - - // Make your own LeanAudio sounds at http://leanaudioplay.dentedpixel.com - void playSwish(){ - AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(0f, 0.005464481f, 1.83897f, 0f), new Keyframe(0.1114856f, 2.281785f, 0f, 0f), new Keyframe(0.2482903f, 2.271654f, 0f, 0f), new Keyframe(0.3f, 0.01670286f, 0f, 0f)); - AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0f, 0.00136725f, 0f, 0f), new Keyframe(0.1482391f, 0.005405405f, 0f, 0f), new Keyframe(0.2650336f, 0.002480127f, 0f, 0f)); - - AudioClip audioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.2f,0.5f,0f)} ).setWaveNoise().setWaveNoiseScale(1000)); - - LeanAudio.play( audioClip ); //a:fvb:8,,.00136725,,,.1482391,.005405405,,,.2650336,.002480127,,,8~8,,.005464481,1.83897,,.1114856,2.281785,,,.2482903,2.271654,,,.3,.01670286,,,8~.2,.5,,~~0~~3,1000,1 - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs.meta deleted file mode 100644 index 156b7870..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplineTrack.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 31af73f8be2864eda9a3fbb6d0d2a9c7 -timeCreated: 1460209336 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Scripts/PathSplines.cs b/Assets/LeanTween/Examples/Scripts/PathSplines.cs deleted file mode 100644 index 8df95b9a..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplines.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEngine; -using System.Collections; -using DentedPixel; - -public class PathSplines : MonoBehaviour { - - public Transform[] trans; - - LTSpline cr; - private GameObject avatar1; - - void OnEnable(){ - // create the path - cr = new LTSpline( new Vector3[] {trans[0].position, trans[1].position, trans[2].position, trans[3].position, trans[4].position} ); - // cr = new LTSpline( new Vector3[] {new Vector3(-1f,0f,0f), new Vector3(0f,0f,0f), new Vector3(4f,0f,0f), new Vector3(20f,0f,0f), new Vector3(30f,0f,0f)} ); - } - - void Start () { - avatar1 = GameObject.Find("Avatar1"); - - // Tween automatically - LeanTween.move(avatar1, cr, 6.5f).setOrientToPath(true).setRepeat(1).setOnComplete( ()=>{ - Vector3[] next = new Vector3[] {trans[4].position, trans[3].position, trans[2].position, trans[1].position, trans[0].position}; - LeanTween.moveSpline( avatar1, next, 6.5f); // move it back to the start without an LTSpline - }).setEase(LeanTweenType.easeOutQuad); - } - - private float iter; - void Update () { - // Or Update Manually - // cr.place( avatar1.transform, iter ); - - iter += Time.deltaTime*0.07f; - if(iter>1.0f) - iter = 0.0f; - } - - void OnDrawGizmos(){ - // Debug.Log("drwaing"); - if(cr==null) - OnEnable(); - Gizmos.color = Color.red; - if(cr!=null) - cr.gizmoDraw(); // To Visualize the path, use this method - } -} diff --git a/Assets/LeanTween/Examples/Scripts/PathSplines.cs.meta b/Assets/LeanTween/Examples/Scripts/PathSplines.cs.meta deleted file mode 100644 index 2ac005b3..00000000 --- a/Assets/LeanTween/Examples/Scripts/PathSplines.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: de0396ae3eef541c190f0e6962090454 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs b/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs deleted file mode 100644 index b8db49e8..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs +++ /dev/null @@ -1,647 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using DentedPixel; - -namespace DentedPixel.LTExamples -{ - - public class TestingUnitTests : MonoBehaviour - { - - public GameObject cube1; - public GameObject cube2; - public GameObject cube3; - public GameObject cube4; - public GameObject cubeAlpha1; - public GameObject cubeAlpha2; - - - private bool eventGameObjectWasCalled = false, eventGeneralWasCalled = false; - private int lt1Id; - private LTDescr lt2; - private LTDescr lt3; - private LTDescr lt4; - private LTDescr[] groupTweens; - private GameObject[] groupGOs; - private int groupTweensCnt; - private int rotateRepeat; - private int rotateRepeatAngle; - private GameObject boxNoCollider; - private float timeElapsedNormalTimeScale; - private float timeElapsedIgnoreTimeScale; - private bool pauseTweenDidFinish = false; - - void Awake() - { - boxNoCollider = GameObject.CreatePrimitive(PrimitiveType.Cube); - Destroy(boxNoCollider.GetComponent(typeof(BoxCollider)) as Component); - } - - void Start() - { - // Time.timeScale = 0.25f; - - LeanTest.timeout = 46f; - LeanTest.expected = 62; - - LeanTween.init(1300); - - // add a listener - LeanTween.addListener(cube1, 0, eventGameObjectCalled); - - LeanTest.expect(LeanTween.isTweening() == false, "NOTHING TWEEENING AT BEGINNING"); - - LeanTest.expect(LeanTween.isTweening(cube1) == false, "OBJECT NOT TWEEENING AT BEGINNING"); - - LeanTween.scaleX(cube4, 2f, 0f).setOnComplete(() => { - LeanTest.expect(cube4.transform.localScale.x == 2f, "TWEENED WITH ZERO TIME"); - }); - - // dispatch event that is received - LeanTween.dispatchEvent(0); - LeanTest.expect(eventGameObjectWasCalled, "EVENT GAMEOBJECT RECEIVED"); - - // do not remove listener - LeanTest.expect(LeanTween.removeListener(cube2, 0, eventGameObjectCalled) == false, "EVENT GAMEOBJECT NOT REMOVED"); - // remove listener - LeanTest.expect(LeanTween.removeListener(cube1, 0, eventGameObjectCalled), "EVENT GAMEOBJECT REMOVED"); - - // add a listener - LeanTween.addListener(1, eventGeneralCalled); - - // dispatch event that is received - LeanTween.dispatchEvent(1); - LeanTest.expect(eventGeneralWasCalled, "EVENT ALL RECEIVED"); - - // remove listener - LeanTest.expect(LeanTween.removeListener(1, eventGeneralCalled), "EVENT ALL REMOVED"); - - lt1Id = LeanTween.move(cube1, new Vector3(3f, 2f, 0.5f), 1.1f).id; - LeanTween.move(cube2, new Vector3(-3f, -2f, -0.5f), 1.1f); - - LeanTween.reset(); - - // Queue up a bunch of tweens, cancel some of them but expect the remainder to finish - GameObject[] cubes = new GameObject[99]; - int[] tweenIds = new int[cubes.Length]; - for (int i = 0; i < cubes.Length; i++) - { - GameObject c = cubeNamed("cancel" + i); - tweenIds[i] = LeanTween.moveX(c, 100f, 1f).id; - cubes[i] = c; - } - int onCompleteCount = 0; - LeanTween.delayedCall(cubes[0], 0.2f, () => { - for (int i = 0; i < cubes.Length; i++) - { - if (i % 3 == 0) - { - LeanTween.cancel(cubes[i]); - } - else if (i % 3 == 1) - { - LeanTween.cancel(tweenIds[i]); - } - else if (i % 3 == 2) - { - LTDescr descr = LeanTween.descr(tweenIds[i]); - // Debug.Log("descr:"+descr); - descr.setOnComplete(() => { - onCompleteCount++; - // Debug.Log("onCompleteCount:"+onCompleteCount); - if (onCompleteCount >= 33) - { - LeanTest.expect(true, "CANCELS DO NOT EFFECT FINISHING"); - } - }); - } - } - }); - - Vector3[] splineArr = new Vector3[] { new Vector3(-1f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(4f, 0f, 0f), new Vector3(20f, 0f, 0f), new Vector3(30f, 0f, 0f) }; - LTSpline cr = new LTSpline(splineArr); - cr.place(cube4.transform, 0.5f); - LeanTest.expect((Vector3.Distance(cube4.transform.position, new Vector3(10f, 0f, 0f)) <= 0.7f), "SPLINE POSITIONING AT HALFWAY", "position is:" + cube4.transform.position + " but should be:(10f,0f,0f)"); - LeanTween.color(cube4, Color.green, 0.01f); - - // Debug.Log("Point 2:"+cr.ratioAtPoint(splineArr[2])); - - // OnStart Speed Test for ignoreTimeScale vs normal timeScale - - GameObject cubeDest = cubeNamed("cubeDest"); - Vector3 cubeDestEnd = new Vector3(100f, 20f, 0f); - LeanTween.move(cubeDest, cubeDestEnd, 0.7f); - - GameObject cubeToTrans = cubeNamed("cubeToTrans"); - LeanTween.move(cubeToTrans, cubeDest.transform, 1.2f).setEase(LeanTweenType.easeOutQuad).setOnComplete(() => { - LeanTest.expect(cubeToTrans.transform.position == cubeDestEnd, "MOVE TO TRANSFORM WORKS"); - }); - - GameObject cubeDestroy = cubeNamed("cubeDestroy"); - LeanTween.moveX(cubeDestroy, 200f, 0.05f).setDelay(0.02f).setDestroyOnComplete(true); - LeanTween.moveX(cubeDestroy, 200f, 0.1f).setDestroyOnComplete(true).setOnComplete(() => { - LeanTest.expect(true, "TWO DESTROY ON COMPLETE'S SUCCEED"); - }); - - GameObject cubeSpline = cubeNamed("cubeSpline"); - LeanTween.moveSpline(cubeSpline, new Vector3[] { new Vector3(0.5f, 0f, 0.5f), new Vector3(0.75f, 0f, 0.75f), new Vector3(1f, 0f, 1f), new Vector3(1f, 0f, 1f) }, 0.1f).setOnComplete(() => { - LeanTest.expect(Vector3.Distance(new Vector3(1f, 0f, 1f), cubeSpline.transform.position) < 0.01f, "SPLINE WITH TWO POINTS SUCCEEDS"); - }); - - // This test works when it is positioned last in the test queue (probably worth fixing when you have time) - GameObject jumpCube = cubeNamed("jumpTime"); - jumpCube.transform.position = new Vector3(100f, 0f, 0f); - jumpCube.transform.localScale *= 100f; - int jumpTimeId = LeanTween.moveX(jumpCube, 200f, 1f).id; - - LeanTween.delayedCall(gameObject, 0.2f, () => { - LTDescr d = LeanTween.descr(jumpTimeId); - float beforeX = jumpCube.transform.position.x; - d.setTime(0.5f); - LeanTween.delayedCall(0.0f, () => { }).setOnStart(() => { - float diffAmt = 1f;// This variable is dependent on a good frame-rate because it evalutes at the next Update - beforeX += Time.deltaTime * 100f * 2f; - LeanTest.expect(Mathf.Abs(jumpCube.transform.position.x - beforeX) < diffAmt, "CHANGING TIME DOESN'T JUMP AHEAD", "Difference:" + Mathf.Abs(jumpCube.transform.position.x - beforeX) + " beforeX:" + beforeX + " now:" + jumpCube.transform.position.x + " dt:" + Time.deltaTime); - }); - }); - - // Tween with time of zero is needs to be set to it's final value - GameObject zeroCube = cubeNamed("zeroCube"); - LeanTween.moveX(zeroCube, 10f, 0f).setOnComplete(() => { - LeanTest.expect(zeroCube.transform.position.x == 10f, "ZERO TIME FINSHES CORRECTLY", "final x:" + zeroCube.transform.position.x); - }); - - // Scale, and OnStart - GameObject cubeScale = cubeNamed("cubeScale"); - LeanTween.scale(cubeScale, new Vector3(5f, 5f, 5f), 0.01f).setOnStart(() => { - LeanTest.expect(true, "ON START WAS CALLED"); - }).setOnComplete(() => { - LeanTest.expect(cubeScale.transform.localScale.z == 5f, "SCALE", "expected scale z:" + 5f + " returned:" + cubeScale.transform.localScale.z); - }); - - // Rotate - GameObject cubeRotate = cubeNamed("cubeRotate"); - LeanTween.rotate(cubeRotate, new Vector3(0f, 180f, 0f), 0.02f).setOnComplete(() => { - LeanTest.expect(cubeRotate.transform.eulerAngles.y == 180f, "ROTATE", "expected rotate y:" + 180f + " returned:" + cubeRotate.transform.eulerAngles.y); - }); - - // RotateAround - GameObject cubeRotateA = cubeNamed("cubeRotateA"); - LeanTween.rotateAround(cubeRotateA, Vector3.forward, 90f, 0.3f).setOnComplete(() => { - LeanTest.expect(cubeRotateA.transform.eulerAngles.z == 90f, "ROTATE AROUND", "expected rotate z:" + 90f + " returned:" + cubeRotateA.transform.eulerAngles.z); - }); - - // RotateAround 360 - GameObject cubeRotateB = cubeNamed("cubeRotateB"); - cubeRotateB.transform.position = new Vector3(200f, 10f, 8f); - LeanTween.rotateAround(cubeRotateB, Vector3.forward, 360f, 0.3f).setPoint(new Vector3(5f, 3f, 2f)).setOnComplete(() => { - LeanTest.expect(cubeRotateB.transform.position.ToString() == (new Vector3(200f, 10f, 8f)).ToString(), "ROTATE AROUND 360", "expected rotate pos:" + (new Vector3(200f, 10f, 8f)) + " returned:" + cubeRotateB.transform.position); - }); - - // Alpha, onUpdate with passing value, onComplete value - LeanTween.alpha(cubeAlpha1, 0.5f, 0.1f).setOnUpdate((float val) => { - LeanTest.expect(val != 0f, "ON UPDATE VAL"); - }).setOnCompleteParam("Hi!").setOnComplete((object completeObj) => { - LeanTest.expect(((string)completeObj) == "Hi!", "ONCOMPLETE OBJECT"); - LeanTest.expect(cubeAlpha1.GetComponent().material.color.a == 0.5f, "ALPHA"); - }); - // Color - float onStartTime = -1f; - LeanTween.color(cubeAlpha2, Color.cyan, 0.3f).setOnComplete(() => { - LeanTest.expect(cubeAlpha2.GetComponent().material.color == Color.cyan, "COLOR"); - LeanTest.expect(onStartTime >= 0f && onStartTime < Time.time, "ON START", "onStartTime:" + onStartTime + " time:" + Time.time); - }).setOnStart(() => { - onStartTime = Time.time; - }); - // moveLocalY (make sure uses y values) - Vector3 beforePos = cubeAlpha1.transform.position; - LeanTween.moveY(cubeAlpha1, 3f, 0.2f).setOnComplete(() => { - LeanTest.expect(cubeAlpha1.transform.position.x == beforePos.x && cubeAlpha1.transform.position.z == beforePos.z, "MOVE Y"); - }); - - Vector3 beforePos2 = cubeAlpha2.transform.localPosition; - LeanTween.moveLocalZ(cubeAlpha2, 12f, 0.2f).setOnComplete(() => { - LeanTest.expect(cubeAlpha2.transform.localPosition.x == beforePos2.x && cubeAlpha2.transform.localPosition.y == beforePos2.y, "MOVE LOCAL Z", "ax:" + cubeAlpha2.transform.localPosition.x + " bx:" + beforePos.x + " ay:" + cubeAlpha2.transform.localPosition.y + " by:" + beforePos2.y); - }); - - AudioClip audioClip = LeanAudio.createAudio(new AnimationCurve(new Keyframe(0f, 1f, 0f, -1f), new Keyframe(1f, 0f, -1f, 0f)), new AnimationCurve(new Keyframe(0f, 0.001f, 0f, 0f), new Keyframe(1f, 0.001f, 0f, 0f)), LeanAudio.options()); - LeanTween.delayedSound(gameObject, audioClip, new Vector3(0f, 0f, 0f), 0.1f).setDelay(0.2f).setOnComplete(() => { - LeanTest.expect(Time.time > 0, "DELAYED SOUND"); - }); - - // Easing Methods - int totalEasingCheck = 0; - int totalEasingCheckSuccess = 0; - for (int j = 0; j < 2; j++) - { - bool isCheckingFrom = j == 1; - int totalTweenTypeLength = (int)LeanTweenType.easeShake; - for (int i = (int)LeanTweenType.notUsed; i < totalTweenTypeLength; i++) - { - LeanTweenType easeType = (LeanTweenType)i; - GameObject cube = cubeNamed("cube" + easeType); - LTDescr descr = LeanTween.moveLocalX(cube, 5, 0.1f).setOnComplete((object obj) => { - GameObject cubeIn = obj as GameObject; - totalEasingCheck++; - if (cubeIn.transform.position.x == 5f) - { - totalEasingCheckSuccess++; - } - if (totalEasingCheck == (2 * totalTweenTypeLength)) - { - LeanTest.expect(totalEasingCheck == totalEasingCheckSuccess, "EASING TYPES"); - } - }).setOnCompleteParam(cube); - - if (isCheckingFrom) - descr.setFrom(-5f); - } - } - - // value2 - bool value2UpdateCalled = false; - LeanTween.value(gameObject, new Vector2(0, 0), new Vector2(256, 96), 0.1f).setOnUpdate((Vector2 value) => { - value2UpdateCalled = true; - }); - LeanTween.delayedCall(0.2f, () => { - LeanTest.expect(value2UpdateCalled, "VALUE2 UPDATE"); - }); - - // check descr - // LTDescr descr2 = LeanTween.descr( descrId ); - // LeanTest.expect(descr2 == null,"DESCRIPTION STARTS AS NULL"); - - StartCoroutine(timeBasedTesting()); - } - - private GameObject cubeNamed(string name) - { - GameObject cube = Instantiate(boxNoCollider) as GameObject; - cube.name = name; - return cube; - } - - IEnumerator timeBasedTesting() - { - yield return new WaitForEndOfFrame(); - - GameObject cubeNormal = cubeNamed("normalTimeScale"); - // float timeElapsedNormal = Time.time; - LeanTween.moveX(cubeNormal, 12f, 1.5f).setIgnoreTimeScale(false).setOnComplete(() => { - timeElapsedNormalTimeScale = Time.time; - }); - - LTDescr[] descr = LeanTween.descriptions(cubeNormal); - LeanTest.expect(descr.Length >= 0 && descr[0].to.x == 12f, "WE CAN RETRIEVE A DESCRIPTION"); - - GameObject cubeIgnore = cubeNamed("ignoreTimeScale"); - LeanTween.moveX(cubeIgnore, 5f, 1.5f).setIgnoreTimeScale(true).setOnComplete(() => { - timeElapsedIgnoreTimeScale = Time.time; - }); - - yield return new WaitForSeconds(1.5f); - LeanTest.expect(Mathf.Abs(timeElapsedNormalTimeScale - timeElapsedIgnoreTimeScale) < 0.7f, "START IGNORE TIMING", "timeElapsedIgnoreTimeScale:" + timeElapsedIgnoreTimeScale + " timeElapsedNormalTimeScale:" + timeElapsedNormalTimeScale); - - // yield return new WaitForSeconds(100f); - Time.timeScale = 4f; - - int pauseCount = 0; - LeanTween.value(gameObject, 0f, 1f, 1f).setOnUpdate((float val) => { - pauseCount++; - }).pause(); - - // Bezier should end at exact end position not just 99% close to it - Vector3[] roundCirc = new Vector3[] { new Vector3(0f, 0f, 0f), new Vector3(-9.1f, 25.1f, 0f), new Vector3(-1.2f, 15.9f, 0f), new Vector3(-25f, 25f, 0f), new Vector3(-25f, 25f, 0f), new Vector3(-50.1f, 15.9f, 0f), new Vector3(-40.9f, 25.1f, 0f), new Vector3(-50f, 0f, 0f), new Vector3(-50f, 0f, 0f), new Vector3(-40.9f, -25.1f, 0f), new Vector3(-50.1f, -15.9f, 0f), new Vector3(-25f, -25f, 0f), new Vector3(-25f, -25f, 0f), new Vector3(0f, -15.9f, 0f), new Vector3(-9.1f, -25.1f, 0f), new Vector3(0f, 0f, 0f) }; - GameObject cubeRound = cubeNamed("bRound"); - Vector3 onStartPos = cubeRound.transform.position; - LeanTween.moveLocal(cubeRound, roundCirc, 0.5f).setOnComplete(() => { - LeanTest.expect(cubeRound.transform.position == onStartPos, "BEZIER CLOSED LOOP SHOULD END AT START", "onStartPos:" + onStartPos + " onEnd:" + cubeRound.transform.position); - }); - - // should be able to retrieve a point - LTBezierPath roundCircPath = new LTBezierPath(roundCirc); - float ratioPoint = roundCircPath.ratioAtPoint(new Vector3(-25f, 25f, 0f)); - LeanTest.expect(Mathf.Equals(ratioPoint, 0.25f), "BEZIER RATIO POINT"); - - // Spline should end at exact end position not just 99% close to it - Vector3[] roundSpline = new Vector3[] { new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(2f, 0f, 0f), new Vector3(0.9f, 2f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f) }; - GameObject cubeSpline = cubeNamed("bSpline"); - Vector3 onStartPosSpline = cubeSpline.transform.position; - LeanTween.moveSplineLocal(cubeSpline, roundSpline, 0.5f).setOnComplete(() => { - LeanTest.expect(Vector3.Distance(onStartPosSpline, cubeSpline.transform.position) <= 0.01f, "SPLINE CLOSED LOOP SHOULD END AT START", "onStartPos:" + onStartPosSpline + " onEnd:" + cubeSpline.transform.position + " dist:" + Vector3.Distance(onStartPosSpline, cubeSpline.transform.position)); - }); - - // Sequence test, do three tweens and make sure they end at the right points - GameObject cubeSeq = cubeNamed("cSeq"); - var seq = LeanTween.sequence().append(LeanTween.moveX(cubeSeq, 100f, 0.2f)); - seq.append(0.1f).append(LeanTween.scaleX(cubeSeq, 2f, 0.1f)); - seq.append(() => { - LeanTest.expect(cubeSeq.transform.position.x == 100f, "SEQ MOVE X FINISHED", "move x:" + cubeSeq.transform.position.x); - LeanTest.expect(cubeSeq.transform.localScale.x == 2f, "SEQ SCALE X FINISHED", "scale x:" + cubeSeq.transform.localScale.x); - }).setScale(0.2f); - - // Bounds check - GameObject cubeBounds = cubeNamed("cBounds"); - bool didPassBounds = true; - Vector3 failPoint = Vector3.zero; - LeanTween.move(cubeBounds, new Vector3(10, 10, 10), 0.1f).setOnUpdate((float val) => { - // Debug.LogWarning("cubeBounds x:"+cubeBounds.transform.position.x + " y:"+ cubeBounds.transform.position.y+" z:"+cubeBounds.transform.position.z); - if (cubeBounds.transform.position.x < 0f || cubeBounds.transform.position.x > 10f || cubeBounds.transform.position.y < 0f || cubeBounds.transform.position.y > 10f || cubeBounds.transform.position.z < 0f || cubeBounds.transform.position.z > 10f) - { - didPassBounds = false; - failPoint = cubeBounds.transform.position; - // Debug.LogError("OUT OF BOUNDS"); - } - }).setLoopPingPong().setRepeat(8).setOnComplete(() => { - LeanTest.expect(didPassBounds, "OUT OF BOUNDS", "pos x:" + failPoint.x + " y:" + failPoint.y + " z:" + failPoint.z); - }); - - // Local scale check - //GameObject cubeLocal = cubeNamed("cLocal"); - //LeanTween.scale(cubeLocal, new Vector3(0.5f, 0.5f, 0.5f), 0.2f).setOnComplete(() => - //{ - // LeanTest.expect((cubeLocal.transform.localScale.x == 0.5f && cubeLocal.transform.localScale.y == 0.5f && cubeLocal.transform.localScale.z == 0.5f), "SCALE WORKS", "scale x:" + cubeLocal.transform.localScale.x + " y:" + cubeLocal.transform.localScale.y + " z:" + cubeLocal.transform.localScale.z); - //}); - - // Groups of tweens testing - groupTweens = new LTDescr[1200]; - groupGOs = new GameObject[groupTweens.Length]; - groupTweensCnt = 0; - int descriptionMatchCount = 0; - for (int i = 0; i < groupTweens.Length; i++) - { - GameObject cube = cubeNamed("c" + i); - cube.transform.position = new Vector3(0, 0, i * 3); - - groupGOs[i] = cube; - } - - yield return new WaitForEndOfFrame(); - - bool hasGroupTweensCheckStarted = false; - int setOnStartNum = 0; - int setPosNum = 0; - bool setPosOnUpdate = true; - for (int i = 0; i < groupTweens.Length; i++) - { - Vector3 finalPos = transform.position + Vector3.one * 3f; - Dictionary finalDict = new Dictionary { { "final", finalPos }, { "go", groupGOs[i] } }; - groupTweens[i] = LeanTween.move(groupGOs[i], finalPos, 3f).setOnStart(() => { - setOnStartNum++; - }).setOnUpdate((Vector3 newPosition) => { - if (transform.position.z > newPosition.z) - { - setPosOnUpdate = false; - } - // Debug.LogWarning("New Position: " + newPosition.ToString()); - }). - setOnCompleteParam(finalDict). - setOnComplete((object param) => { - Dictionary finalDictRetr = param as Dictionary; - Vector3 neededPos = (Vector3)finalDictRetr["final"]; - GameObject tweenedGo = finalDictRetr["go"] as GameObject; - if (neededPos.ToString() == tweenedGo.transform.position.ToString()) - setPosNum++; - else - { - // Debug.Log("neededPos:"+neededPos+" tweenedGo.transform.position:"+tweenedGo.transform.position); - } - if (hasGroupTweensCheckStarted == false) - { - hasGroupTweensCheckStarted = true; - LeanTween.delayedCall(gameObject, 0.1f, () => { - LeanTest.expect(setOnStartNum == groupTweens.Length, "SETONSTART CALLS", "expected:" + groupTweens.Length + " was:" + setOnStartNum); - LeanTest.expect(groupTweensCnt == groupTweens.Length, "GROUP FINISH", "expected " + groupTweens.Length + " tweens but got " + groupTweensCnt); - LeanTest.expect(setPosNum == groupTweens.Length, "GROUP POSITION FINISH", "expected " + groupTweens.Length + " tweens but got " + setPosNum); - LeanTest.expect(setPosOnUpdate, "GROUP POSITION ON UPDATE"); - }); - } - groupTweensCnt++; - }); - - if (LeanTween.description(groupTweens[i].id).trans == groupTweens[i].trans) - descriptionMatchCount++; - } - - while (LeanTween.tweensRunning < groupTweens.Length) - yield return null; - - LeanTest.expect(descriptionMatchCount == groupTweens.Length, "GROUP IDS MATCH"); - int expectedSearch = groupTweens.Length + 7; - LeanTest.expect(LeanTween.maxSearch <= expectedSearch, "MAX SEARCH OPTIMIZED", "maxSearch:" + LeanTween.maxSearch + " should be:" + expectedSearch); - LeanTest.expect(LeanTween.isTweening() == true, "SOMETHING IS TWEENING"); - - // resume item before calling pause should continue item along it's way - float previousXlt4 = cube4.transform.position.x; - lt4 = LeanTween.moveX(cube4, 5.0f, 1.1f).setOnComplete(() => { - LeanTest.expect(cube4 != null && previousXlt4 != cube4.transform.position.x, "RESUME OUT OF ORDER", "cube4:" + cube4 + " previousXlt4:" + previousXlt4 + " cube4.transform.position.x:" + (cube4 != null ? cube4.transform.position.x : 0)); - }).setDestroyOnComplete(true); - lt4.resume(); - - rotateRepeat = rotateRepeatAngle = 0; - LeanTween.rotateAround(cube3, Vector3.forward, 360f, 0.1f).setRepeat(3).setOnComplete(rotateRepeatFinished).setOnCompleteOnRepeat(true).setDestroyOnComplete(true); - yield return new WaitForEndOfFrame(); - LeanTween.delayedCall(0.1f * 8f + 1f, rotateRepeatAllFinished); - - int countBeforeCancel = LeanTween.tweensRunning; - LeanTween.cancel(lt1Id); - LeanTest.expect(countBeforeCancel == LeanTween.tweensRunning, "CANCEL AFTER RESET SHOULD FAIL", "expected " + countBeforeCancel + " but got " + LeanTween.tweensRunning); - LeanTween.cancel(cube2); - - int tweenCount = 0; - for (int i = 0; i < groupTweens.Length; i++) - { - if (LeanTween.isTweening(groupGOs[i])) - tweenCount++; - if (i % 3 == 0) - LeanTween.pause(groupGOs[i]); - else if (i % 3 == 1) - groupTweens[i].pause(); - else - LeanTween.pause(groupTweens[i].id); - } - LeanTest.expect(tweenCount == groupTweens.Length, "GROUP ISTWEENING", "expected " + groupTweens.Length + " tweens but got " + tweenCount); - - yield return new WaitForEndOfFrame(); - - tweenCount = 0; - for (int i = 0; i < groupTweens.Length; i++) - { - if (i % 3 == 0) - LeanTween.resume(groupGOs[i]); - else if (i % 3 == 1) - groupTweens[i].resume(); - else - LeanTween.resume(groupTweens[i].id); - - if (i % 2 == 0 ? LeanTween.isTweening(groupTweens[i].id) : LeanTween.isTweening(groupGOs[i])) - tweenCount++; - } - LeanTest.expect(tweenCount == groupTweens.Length, "GROUP RESUME"); - - LeanTest.expect(LeanTween.isTweening(cube1) == false, "CANCEL TWEEN LTDESCR"); - LeanTest.expect(LeanTween.isTweening(cube2) == false, "CANCEL TWEEN LEANTWEEN"); - - LeanTest.expect(pauseCount == 0, "ON UPDATE NOT CALLED DURING PAUSE", "expect pause count of 0, but got " + pauseCount); - - - yield return new WaitForEndOfFrame(); - Time.timeScale = 0.25f; - float tweenTime = 0.2f; - float expectedTime = tweenTime * (1f / Time.timeScale); - float start = Time.realtimeSinceStartup; - bool onUpdateWasCalled = false; - LeanTween.moveX(cube1, -5f, tweenTime).setOnUpdate((float val) => { - onUpdateWasCalled = true; - }).setOnComplete(() => { - float end = Time.realtimeSinceStartup; - float diff = end - start; - - LeanTest.expect(Mathf.Abs(expectedTime - diff) < 0.06f, "SCALED TIMING DIFFERENCE", "expected to complete in roughly " + expectedTime + " but completed in " + diff); - LeanTest.expect(Mathf.Approximately(cube1.transform.position.x, -5f), "SCALED ENDING POSITION", "expected to end at -5f, but it ended at " + cube1.transform.position.x); - LeanTest.expect(onUpdateWasCalled, "ON UPDATE FIRED"); - }); - - bool didGetCorrectOnUpdate = false; - LeanTween.value(gameObject, new Vector3(1f, 1f, 1f), new Vector3(10f, 10f, 10f), 1f).setOnUpdate((Vector3 val) => { - didGetCorrectOnUpdate = val.x >= 1f && val.y >= 1f && val.z >= 1f; - }).setOnComplete(() => { - LeanTest.expect(didGetCorrectOnUpdate, "VECTOR3 CALLBACK CALLED"); - }); - - yield return new WaitForSeconds(expectedTime); - Time.timeScale = 1f; - - int ltCount = 0; - GameObject[] allGos = FindObjectsOfType(typeof(GameObject)) as GameObject[]; - foreach (GameObject go in allGos) - { - if (go.name == "~LeanTween") - ltCount++; - } - LeanTest.expect(ltCount == 1, "RESET CORRECTLY CLEANS UP"); - - StartCoroutine(lotsOfCancels()); - } - - IEnumerator lotsOfCancels() - { - yield return new WaitForEndOfFrame(); - - Time.timeScale = 4f; - int cubeCount = 10; - - int[] tweensA = new int[cubeCount]; - GameObject[] aGOs = new GameObject[cubeCount]; - for (int i = 0; i < aGOs.Length; i++) - { - GameObject cube = Instantiate(boxNoCollider) as GameObject; - cube.transform.position = new Vector3(0, 0, i * 2f); - cube.name = "a" + i; - aGOs[i] = cube; - tweensA[i] = LeanTween.move(cube, cube.transform.position + new Vector3(10f, 0, 0), 0.5f + 1f * (1.0f / (float)aGOs.Length)).id; - LeanTween.color(cube, Color.red, 0.01f); - } - - yield return new WaitForSeconds(1.0f); - - int[] tweensB = new int[cubeCount]; - GameObject[] bGOs = new GameObject[cubeCount]; - for (int i = 0; i < bGOs.Length; i++) - { - GameObject cube = Instantiate(boxNoCollider) as GameObject; - cube.transform.position = new Vector3(0, 0, i * 2f); - cube.name = "b" + i; - bGOs[i] = cube; - tweensB[i] = LeanTween.move(cube, cube.transform.position + new Vector3(10f, 0, 0), 2f).id; - } - - for (int i = 0; i < aGOs.Length; i++) - { - LeanTween.cancel(aGOs[i]); - GameObject cube = aGOs[i]; - tweensA[i] = LeanTween.move(cube, new Vector3(0, 0, i * 2f), 2f).id; - } - - yield return new WaitForSeconds(0.5f); - - for (int i = 0; i < aGOs.Length; i++) - { - LeanTween.cancel(aGOs[i]); - GameObject cube = aGOs[i]; - tweensA[i] = LeanTween.move(cube, new Vector3(0, 0, i * 2f) + new Vector3(10f, 0, 0), 2f).id; - } - - for (int i = 0; i < bGOs.Length; i++) - { - LeanTween.cancel(bGOs[i]); - GameObject cube = bGOs[i]; - tweensB[i] = LeanTween.move(cube, new Vector3(0, 0, i * 2f), 2f).id; - } - - yield return new WaitForSeconds(2.1f); - - bool inFinalPlace = true; - for (int i = 0; i < aGOs.Length; i++) - { - if (Vector3.Distance(aGOs[i].transform.position, new Vector3(0, 0, i * 2f) + new Vector3(10f, 0, 0)) > 0.1f) - inFinalPlace = false; - } - - for (int i = 0; i < bGOs.Length; i++) - { - if (Vector3.Distance(bGOs[i].transform.position, new Vector3(0, 0, i * 2f)) > 0.1f) - inFinalPlace = false; - } - - LeanTest.expect(inFinalPlace, "AFTER LOTS OF CANCELS"); - - GameObject cubePaused = cubeNamed("cPaused"); - cubePaused.LeanMoveX(10f, 1f).setOnComplete(() => { - pauseTweenDidFinish = true; - }); - StartCoroutine(pauseTimeNow()); - } - - IEnumerator pauseTimeNow() - { - yield return new WaitForSeconds(0.5f); - Time.timeScale = 0; - - LeanTween.delayedCall(0.5f, () => { - Time.timeScale = 1f; - }).setUseEstimatedTime(true); - - LeanTween.delayedCall(1.5f, () => { - LeanTest.expect(pauseTweenDidFinish, "PAUSE BY TIMESCALE FINISHES"); - }).setUseEstimatedTime(true); - } - - void rotateRepeatFinished() - { - if (Mathf.Abs(cube3.transform.eulerAngles.z) < 0.0001f) - rotateRepeatAngle++; - rotateRepeat++; - } - - void rotateRepeatAllFinished() - { - LeanTest.expect(rotateRepeatAngle == 3, "ROTATE AROUND MULTIPLE", "expected 3 times received " + rotateRepeatAngle + " times"); - LeanTest.expect(rotateRepeat == 3, "ROTATE REPEAT", "expected 3 times received " + rotateRepeat + " times"); - LeanTest.expect(cube3 == null, "DESTROY ON COMPLETE", "cube3:" + cube3); - } - - void eventGameObjectCalled(LTEvent e) - { - eventGameObjectWasCalled = true; - } - - void eventGeneralCalled(LTEvent e) - { - eventGeneralWasCalled = true; - } - - } - -} \ No newline at end of file diff --git a/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs.meta b/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs.meta deleted file mode 100644 index 72a6adf7..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingUnitTests.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fef58bd01146344429d022b95c6af872 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs b/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs deleted file mode 100644 index 85a1e092..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs +++ /dev/null @@ -1,233 +0,0 @@ -using UnityEngine; -using System.Collections; -using System; -using System.Threading; -using DentedPixel; - -public class TestingZLegacy : MonoBehaviour { - public AnimationCurve customAnimationCurve; - public Transform pt1; - public Transform pt2; - public Transform pt3; - public Transform pt4; - public Transform pt5; - - public delegate void NextFunc(); - private int exampleIter = 0; - private string[] exampleFunctions = new string[] { /**/"updateValue3Example", "loopTestClamp", "loopTestPingPong", "moveOnACurveExample", "customTweenExample", "moveExample", "rotateExample", "scaleExample", "updateValueExample", "delayedCallExample", "alphaExample", "moveLocalExample", "rotateAroundExample", "colorExample" }; - public bool useEstimatedTime = true; - private GameObject ltLogo; - private TimingType timingType = TimingType.SteadyNormalTime; - private int descrTimeScaleChangeId; - private Vector3 origin; - - public enum TimingType{ - SteadyNormalTime, - IgnoreTimeScale, - HalfTimeScale, - VariableTimeScale, - Length - } - - void Awake(){ - // LeanTween.init(3200); // This line is optional. Here you can specify the maximum number of tweens you will use (the default is 400). This must be called before any use of LeanTween is made for it to be effective. - } - - void Start () { - ltLogo = GameObject.Find("LeanTweenLogo"); - LeanTween.delayedCall(1f, cycleThroughExamples); - origin = ltLogo.transform.position; - -// alphaExample(); - } - - void pauseNow(){ - Time.timeScale = 0f; - Debug.Log("pausing"); - } - - void OnGUI(){ - string label = useEstimatedTime ? "useEstimatedTime" : "timeScale:"+Time.timeScale; - GUI.Label(new Rect(0.03f*Screen.width,0.03f*Screen.height,0.5f*Screen.width,0.3f*Screen.height), label); - } - - void endlessCallback(){ - Debug.Log("endless"); - } - - void cycleThroughExamples(){ - if(exampleIter==0){ - int iter = (int)timingType + 1; - if(iter>(int)TimingType.Length) - iter = 0; - timingType = (TimingType)iter; - useEstimatedTime = timingType==TimingType.IgnoreTimeScale; - Time.timeScale = useEstimatedTime ? 0 : 1f; // pause the Time Scale to show the effectiveness of the useEstimatedTime feature (this is very usefull with Pause Screens) - if(timingType==TimingType.HalfTimeScale) - Time.timeScale = 0.5f; - - if(timingType==TimingType.VariableTimeScale){ - descrTimeScaleChangeId = LeanTween.value( gameObject, 0.01f, 10.0f, 3f).setOnUpdate( (float val)=>{ - //Debug.Log("timeScale val:"+val); - Time.timeScale = val; - }).setEase(LeanTweenType.easeInQuad).setUseEstimatedTime(true).setRepeat(-1).id; - }else{ - Debug.Log("cancel variable time"); - LeanTween.cancel( descrTimeScaleChangeId ); - } - } - gameObject.BroadcastMessage( exampleFunctions[ exampleIter ] ); - - // Debug.Log("cycleThroughExamples time:"+Time.time + " useEstimatedTime:"+useEstimatedTime); - float delayTime = 1.1f; - LeanTween.delayedCall( gameObject, delayTime, cycleThroughExamples).setUseEstimatedTime(useEstimatedTime); - - exampleIter = exampleIter+1>=exampleFunctions.Length ? 0 : exampleIter + 1; - } - - public void updateValue3Example(){ - Debug.Log("updateValue3Example Time:"+Time.time); - LeanTween.value( gameObject, updateValue3ExampleCallback, new Vector3(0.0f, 270.0f, 0.0f), new Vector3(30.0f, 270.0f, 180f), 0.5f ).setEase(LeanTweenType.easeInBounce).setRepeat(2).setLoopPingPong().setOnUpdateVector3(updateValue3ExampleUpdate).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValue3ExampleUpdate( Vector3 val){ - //Debug.Log("val:"+val+" obj:"+obj); - } - - public void updateValue3ExampleCallback( Vector3 val ){ - ltLogo.transform.eulerAngles = val; - // Debug.Log("updateValue3ExampleCallback:"+val); - } - - public void loopTestClamp(){ - Debug.Log("loopTestClamp Time:"+Time.time); - GameObject cube1 = GameObject.Find("Cube1"); - cube1.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); - LeanTween.scaleZ( cube1, 4.0f, 1.0f).setEase(LeanTweenType.easeOutElastic).setRepeat(7).setLoopClamp().setUseEstimatedTime(useEstimatedTime);// - } - - public void loopTestPingPong(){ - Debug.Log("loopTestPingPong Time:"+Time.time); - GameObject cube2 = GameObject.Find("Cube2"); - cube2.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); - LeanTween.scaleY( cube2, 4.0f, 1.0f ).setEase(LeanTweenType.easeOutQuad).setLoopPingPong(4).setUseEstimatedTime(useEstimatedTime); - //LeanTween.scaleY( cube2, 4.0f, 1.0f, LeanTween.options().setEaseOutQuad().setRepeat(8).setLoopPingPong().setUseEstimatedTime(useEstimatedTime) ); - } - - public void colorExample(){ - GameObject lChar = GameObject.Find("LCharacter"); - LeanTween.color( lChar, new Color(1.0f,0.0f,0.0f,0.5f), 0.5f ).setEase(LeanTweenType.easeOutBounce).setRepeat(2).setLoopPingPong().setUseEstimatedTime(useEstimatedTime); - } - - public void moveOnACurveExample(){ - Debug.Log("moveOnACurveExample Time:"+Time.time); - - Vector3[] path = new Vector3[] { origin,pt1.position,pt2.position,pt3.position,pt3.position,pt4.position,pt5.position,origin}; - LeanTween.move( ltLogo, path, 1.0f ).setEase(LeanTweenType.easeOutQuad).setOrientToPath(true).setUseEstimatedTime(useEstimatedTime); - } - - public void customTweenExample(){ - Debug.Log("customTweenExample starting pos:"+ltLogo.transform.position+" origin:"+origin); - - LeanTween.moveX( ltLogo, -10.0f, 0.5f ).setEase(customAnimationCurve).setUseEstimatedTime(useEstimatedTime); - LeanTween.moveX( ltLogo, 0.0f, 0.5f ).setEase(customAnimationCurve).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void moveExample(){ - Debug.Log("moveExample"); - - LeanTween.move( ltLogo, new Vector3(-2f,-1f,0f), 0.5f).setUseEstimatedTime(useEstimatedTime); - LeanTween.move( ltLogo, origin, 0.5f).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateExample(){ - Debug.Log("rotateExample"); - - Hashtable returnParam = new Hashtable(); - returnParam.Add("yo", 5.0); - - LeanTween.rotate( ltLogo, new Vector3(0f,360f,0f), 1f).setEase(LeanTweenType.easeOutQuad).setOnComplete(rotateFinished).setOnCompleteParam(returnParam).setOnUpdate(rotateOnUpdate).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateOnUpdate( float val ){ - //Debug.Log("rotating val:"+val); - } - - public void rotateFinished( object hash ){ - Hashtable h = hash as Hashtable; - Debug.Log("rotateFinished hash:"+h["yo"]); - } - - public void scaleExample(){ - Debug.Log("scaleExample"); - - Vector3 currentScale = ltLogo.transform.localScale; - LeanTween.scale( ltLogo, new Vector3(currentScale.x+0.2f,currentScale.y+0.2f,currentScale.z+0.2f), 1f ).setEase(LeanTweenType.easeOutBounce).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValueExample(){ - Debug.Log("updateValueExample"); - Hashtable pass = new Hashtable(); - pass.Add("message", "hi"); - LeanTween.value( gameObject, (Action)updateValueExampleCallback, ltLogo.transform.eulerAngles.y, 270f, 1f ).setEase(LeanTweenType.easeOutElastic).setOnUpdateParam(pass).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValueExampleCallback( float val, object hash ){ - // Hashtable h = hash as Hashtable; - // Debug.Log("message:"+h["message"]+" val:"+val); - Vector3 tmp = ltLogo.transform.eulerAngles; - tmp.y = val; - ltLogo.transform.eulerAngles = tmp; - } - - public void delayedCallExample(){ - Debug.Log("delayedCallExample"); - - LeanTween.delayedCall(0.5f, delayedCallExampleCallback).setUseEstimatedTime(useEstimatedTime); - } - - public void delayedCallExampleCallback(){ - Debug.Log("Delayed function was called"); - Vector3 currentScale = ltLogo.transform.localScale; - - LeanTween.scale( ltLogo, new Vector3(currentScale.x-0.2f,currentScale.y-0.2f,currentScale.z-0.2f), 0.5f ).setEase(LeanTweenType.easeInOutCirc).setUseEstimatedTime(useEstimatedTime); - } - - public void alphaExample(){ - Debug.Log("alphaExample"); - - GameObject lChar = GameObject.Find ("LCharacter"); - LeanTween.alpha( lChar, 0.0f, 0.5f ).setUseEstimatedTime(useEstimatedTime); - LeanTween.alpha( lChar, 1.0f, 0.5f ).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void moveLocalExample(){ - Debug.Log("moveLocalExample"); - - GameObject lChar = GameObject.Find ("LCharacter"); - Vector3 origPos = lChar.transform.localPosition; - LeanTween.moveLocal( lChar, new Vector3(0.0f,2.0f,0.0f), 0.5f ).setUseEstimatedTime(useEstimatedTime); - LeanTween.moveLocal( lChar, origPos, 0.5f ).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateAroundExample(){ - Debug.Log("rotateAroundExample"); - - GameObject lChar = GameObject.Find ("LCharacter"); - LeanTween.rotateAround( lChar, Vector3.up, 360.0f, 1.0f ).setUseEstimatedTime(useEstimatedTime); - } - - public void loopPause(){ - GameObject cube1 = GameObject.Find("Cube1"); - LeanTween.pause(cube1); - } - - public void loopResume(){ - GameObject cube1 = GameObject.Find("Cube1"); - LeanTween.resume(cube1 ); - } - - public void punchTest(){ - LeanTween.moveX( ltLogo, 7.0f, 1.0f ).setEase(LeanTweenType.punch).setUseEstimatedTime(useEstimatedTime); - } -} diff --git a/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs.meta b/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs.meta deleted file mode 100644 index 3c7bab6f..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingZLegacy.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ed8575995d061498aa84acbaf0b377de -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs b/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs deleted file mode 100644 index 156e0485..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs +++ /dev/null @@ -1,269 +0,0 @@ -using UnityEngine; -using System.Collections; -using System; -using System.Threading; -using DentedPixel; - - -public class TestingZLegacyExt : MonoBehaviour { - - public AnimationCurve customAnimationCurve; - public Transform pt1; - public Transform pt2; - public Transform pt3; - public Transform pt4; - public Transform pt5; - - public delegate void NextFunc(); - private int exampleIter = 0; - private string[] exampleFunctions = new string[] { /**/"updateValue3Example", "loopTestClamp", "loopTestPingPong", "moveOnACurveExample", "customTweenExample", "moveExample", "rotateExample", "scaleExample", "updateValueExample", "delayedCallExample", "alphaExample", "moveLocalExample", "rotateAroundExample", "colorExample" }; - public bool useEstimatedTime = true; - private Transform ltLogo; - private TimingType timingType = TimingType.SteadyNormalTime; - private int descrTimeScaleChangeId; - private Vector3 origin; - - public enum TimingType - { - SteadyNormalTime, - IgnoreTimeScale, - HalfTimeScale, - VariableTimeScale, - Length - } - - void Awake() - { - // LeanTween.init(3200); // This line is optional. Here you can specify the maximum number of tweens you will use (the default is 400). This must be called before any use of LeanTween is made for it to be effective. - } - - void Start() - { - ltLogo = GameObject.Find("LeanTweenLogo").transform; - LeanTween.delayedCall(1f, cycleThroughExamples); - origin = ltLogo.position; - - // alphaExample(); - } - - void pauseNow() - { - Time.timeScale = 0f; - Debug.Log("pausing"); - } - - void OnGUI() - { - string label = useEstimatedTime ? "useEstimatedTime" : "timeScale:" + Time.timeScale; - GUI.Label(new Rect(0.03f * Screen.width, 0.03f * Screen.height, 0.5f * Screen.width, 0.3f * Screen.height), label); - } - - void endlessCallback() - { - Debug.Log("endless"); - } - - void cycleThroughExamples() - { - if (exampleIter == 0) - { - int iter = (int)timingType + 1; - if (iter > (int)TimingType.Length) - iter = 0; - timingType = (TimingType)iter; - useEstimatedTime = timingType == TimingType.IgnoreTimeScale; - Time.timeScale = useEstimatedTime ? 0 : 1f; // pause the Time Scale to show the effectiveness of the useEstimatedTime feature (this is very usefull with Pause Screens) - if (timingType == TimingType.HalfTimeScale) - Time.timeScale = 0.5f; - - if (timingType == TimingType.VariableTimeScale) - { - descrTimeScaleChangeId = gameObject.LeanValue(0.01f, 10.0f, 3f).setOnUpdate((float val) => { - //Debug.Log("timeScale val:"+val); - Time.timeScale = val; - }).setEase(LeanTweenType.easeInQuad).setUseEstimatedTime(true).setRepeat(-1).id; - } - else - { - Debug.Log("cancel variable time"); - LeanTween.cancel(descrTimeScaleChangeId); - } - } - gameObject.BroadcastMessage(exampleFunctions[exampleIter]); - - // Debug.Log("cycleThroughExamples time:"+Time.time + " useEstimatedTime:"+useEstimatedTime); - float delayTime = 1.1f; - gameObject.LeanDelayedCall( delayTime, cycleThroughExamples).setUseEstimatedTime(useEstimatedTime); - - exampleIter = exampleIter + 1 >= exampleFunctions.Length ? 0 : exampleIter + 1; - } - - public void updateValue3Example() - { - Debug.Log("updateValue3Example Time:" + Time.time); - gameObject.LeanValue( updateValue3ExampleCallback, new Vector3(0.0f, 270.0f, 0.0f), new Vector3(30.0f, 270.0f, 180f), 0.5f).setEase(LeanTweenType.easeInBounce).setRepeat(2).setLoopPingPong().setOnUpdateVector3(updateValue3ExampleUpdate).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValue3ExampleUpdate(Vector3 val) - { - //Debug.Log("val:"+val+" obj:"+obj); - } - - public void updateValue3ExampleCallback(Vector3 val) - { - ltLogo.transform.eulerAngles = val; - // Debug.Log("updateValue3ExampleCallback:"+val); - } - - public void loopTestClamp() - { - Debug.Log("loopTestClamp Time:" + Time.time); - Transform cube1 = GameObject.Find("Cube1").transform; - cube1.localScale = new Vector3(1.0f, 1.0f, 1.0f); - cube1.LeanScaleZ( 4.0f, 1.0f).setEase(LeanTweenType.easeOutElastic).setRepeat(7).setLoopClamp().setUseEstimatedTime(useEstimatedTime);// - } - - public void loopTestPingPong() - { - Debug.Log("loopTestPingPong Time:" + Time.time); - Transform cube2 = GameObject.Find("Cube2").transform; - cube2.localScale = new Vector3(1.0f, 1.0f, 1.0f); - cube2.LeanScaleY( 4.0f, 1.0f).setEase(LeanTweenType.easeOutQuad).setLoopPingPong(4).setUseEstimatedTime(useEstimatedTime); - //LeanTween.scaleY( cube2, 4.0f, 1.0f, LeanTween.options().setEaseOutQuad().setRepeat(8).setLoopPingPong().setUseEstimatedTime(useEstimatedTime) ); - } - - public void colorExample() - { - GameObject lChar = GameObject.Find("LCharacter"); - lChar.LeanColor( new Color(1.0f, 0.0f, 0.0f, 0.5f), 0.5f).setEase(LeanTweenType.easeOutBounce).setRepeat(2).setLoopPingPong().setUseEstimatedTime(useEstimatedTime); - } - - public void moveOnACurveExample() - { - Debug.Log("moveOnACurveExample Time:" + Time.time); - - Vector3[] path = new Vector3[] { origin, pt1.position, pt2.position, pt3.position, pt3.position, pt4.position, pt5.position, origin }; - ltLogo.LeanMove( path, 1.0f).setEase(LeanTweenType.easeOutQuad).setOrientToPath(true).setUseEstimatedTime(useEstimatedTime); - } - - public void customTweenExample() - { - Debug.Log("customTweenExample starting pos:" + ltLogo.position + " origin:" + origin); - - ltLogo.LeanMoveX(-10.0f, 0.5f).setEase(customAnimationCurve).setUseEstimatedTime(useEstimatedTime); - ltLogo.LeanMoveX( 0.0f, 0.5f).setEase(customAnimationCurve).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void moveExample() - { - Debug.Log("moveExample"); - - ltLogo.LeanMove(new Vector3(-2f, -1f, 0f), 0.5f).setUseEstimatedTime(useEstimatedTime); - ltLogo.LeanMove(origin, 0.5f).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateExample() - { - Debug.Log("rotateExample"); - - Hashtable returnParam = new Hashtable(); - returnParam.Add("yo", 5.0); - - ltLogo.LeanRotate(new Vector3(0f, 360f, 0f), 1f).setEase(LeanTweenType.easeOutQuad).setOnComplete(rotateFinished).setOnCompleteParam(returnParam).setOnUpdate(rotateOnUpdate).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateOnUpdate(float val) - { - //Debug.Log("rotating val:"+val); - } - - public void rotateFinished(object hash) - { - Hashtable h = hash as Hashtable; - Debug.Log("rotateFinished hash:" + h["yo"]); - } - - public void scaleExample() - { - Debug.Log("scaleExample"); - - Vector3 currentScale = ltLogo.localScale; - ltLogo.LeanScale(new Vector3(currentScale.x + 0.2f, currentScale.y + 0.2f, currentScale.z + 0.2f), 1f).setEase(LeanTweenType.easeOutBounce).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValueExample() - { - Debug.Log("updateValueExample"); - Hashtable pass = new Hashtable(); - pass.Add("message", "hi"); - gameObject.LeanValue( (Action)updateValueExampleCallback, ltLogo.eulerAngles.y, 270f, 1f).setEase(LeanTweenType.easeOutElastic).setOnUpdateParam(pass).setUseEstimatedTime(useEstimatedTime); - } - - public void updateValueExampleCallback(float val, object hash) - { - // Hashtable h = hash as Hashtable; - // Debug.Log("message:"+h["message"]+" val:"+val); - Vector3 tmp = ltLogo.eulerAngles; - tmp.y = val; - ltLogo.transform.eulerAngles = tmp; - } - - public void delayedCallExample() - { - Debug.Log("delayedCallExample"); - - LeanTween.delayedCall(0.5f, delayedCallExampleCallback).setUseEstimatedTime(useEstimatedTime); - } - - public void delayedCallExampleCallback() - { - Debug.Log("Delayed function was called"); - Vector3 currentScale = ltLogo.localScale; - - ltLogo.LeanScale( new Vector3(currentScale.x - 0.2f, currentScale.y - 0.2f, currentScale.z - 0.2f), 0.5f).setEase(LeanTweenType.easeInOutCirc).setUseEstimatedTime(useEstimatedTime); - } - - public void alphaExample() - { - Debug.Log("alphaExample"); - - GameObject lChar = GameObject.Find("LCharacter"); - lChar.LeanAlpha( 0.0f, 0.5f).setUseEstimatedTime(useEstimatedTime); - lChar.LeanAlpha( 1.0f, 0.5f).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void moveLocalExample() - { - Debug.Log("moveLocalExample"); - - GameObject lChar = GameObject.Find("LCharacter"); - Vector3 origPos = lChar.transform.localPosition; - lChar.LeanMoveLocal( new Vector3(0.0f, 2.0f, 0.0f), 0.5f).setUseEstimatedTime(useEstimatedTime); - lChar.LeanMoveLocal( origPos, 0.5f).setDelay(0.5f).setUseEstimatedTime(useEstimatedTime); - } - - public void rotateAroundExample() - { - Debug.Log("rotateAroundExample"); - - GameObject lChar = GameObject.Find("LCharacter"); - lChar.LeanRotateAround(Vector3.up, 360.0f, 1.0f).setUseEstimatedTime(useEstimatedTime); - } - - public void loopPause() - { - GameObject cube1 = GameObject.Find("Cube1"); - cube1.LeanPause(); - } - - public void loopResume() - { - GameObject cube1 = GameObject.Find("Cube1"); - cube1.LeanResume(); - } - - public void punchTest() - { - ltLogo.LeanMoveX(7.0f, 1.0f).setEase(LeanTweenType.punch).setUseEstimatedTime(useEstimatedTime); - } -} diff --git a/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs.meta b/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs.meta deleted file mode 100644 index a12d5da1..00000000 --- a/Assets/LeanTween/Examples/Scripts/TestingZLegacyExt.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: c5a76b5b44fc4416a82391d1ab9ec33d -timeCreated: 1533844515 -licenseType: Store -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Textures.meta b/Assets/LeanTween/Examples/Textures.meta deleted file mode 100644 index 131d746c..00000000 --- a/Assets/LeanTween/Examples/Textures.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 9e39f8f3dc0404757be9a05da7cc9802 diff --git a/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg b/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg deleted file mode 100644 index 66879448..00000000 Binary files a/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg and /dev/null differ diff --git a/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg.meta b/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg.meta deleted file mode 100644 index 5e4dd602..00000000 --- a/Assets/LeanTween/Examples/Textures/DefaultParticleReplacement.jpg.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: eabba395643bb4e388d633c8d9a4f1e8 -TextureImporter: - 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 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - textureType: -1 - buildTargetSettings: [] diff --git a/Assets/LeanTween/Examples/Textures/Dude2d.png b/Assets/LeanTween/Examples/Textures/Dude2d.png deleted file mode 100644 index d790b85e..00000000 Binary files a/Assets/LeanTween/Examples/Textures/Dude2d.png and /dev/null differ diff --git a/Assets/LeanTween/Examples/Textures/Dude2d.png.meta b/Assets/LeanTween/Examples/Textures/Dude2d.png.meta deleted file mode 100644 index cce6944e..00000000 --- a/Assets/LeanTween/Examples/Textures/Dude2d.png.meta +++ /dev/null @@ -1,92 +0,0 @@ -fileFormatVersion: 2 -guid: 5f7fa9a7940a64e79b5a42d9f661d42c -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - 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 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - 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: 8 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - applyGammaDecoding: 1 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 1024 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Textures/DustCloud.png b/Assets/LeanTween/Examples/Textures/DustCloud.png deleted file mode 100644 index bbb4886b..00000000 Binary files a/Assets/LeanTween/Examples/Textures/DustCloud.png and /dev/null differ diff --git a/Assets/LeanTween/Examples/Textures/DustCloud.png.meta b/Assets/LeanTween/Examples/Textures/DustCloud.png.meta deleted file mode 100644 index 7afb6037..00000000 --- a/Assets/LeanTween/Examples/Textures/DustCloud.png.meta +++ /dev/null @@ -1,128 +0,0 @@ -fileFormatVersion: 2 -guid: c4c548a339b4d41a590928c0c98934a7 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - 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 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - 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: 8 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - applyGammaDecoding: 1 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: iPhone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg b/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg deleted file mode 100644 index 566e2d29..00000000 Binary files a/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg and /dev/null differ diff --git a/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg.meta b/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg.meta deleted file mode 100644 index c90fc907..00000000 --- a/Assets/LeanTween/Examples/Textures/HorizontalGradient.jpg.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 547f51a8eea214bd7a5863356fd25619 -TextureImporter: - 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 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - textureType: -1 - buildTargetSettings: [] diff --git a/Assets/LeanTween/Examples/Textures/PowerUpStar.png b/Assets/LeanTween/Examples/Textures/PowerUpStar.png deleted file mode 100644 index 548e99f8..00000000 Binary files a/Assets/LeanTween/Examples/Textures/PowerUpStar.png and /dev/null differ diff --git a/Assets/LeanTween/Examples/Textures/PowerUpStar.png.meta b/Assets/LeanTween/Examples/Textures/PowerUpStar.png.meta deleted file mode 100644 index 6a8248e8..00000000 --- a/Assets/LeanTween/Examples/Textures/PowerUpStar.png.meta +++ /dev/null @@ -1,116 +0,0 @@ -fileFormatVersion: 2 -guid: 70141d51621e24facbca9196bbde84b4 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - 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 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - 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: 8 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - applyGammaDecoding: 1 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: iPhone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: