diff --git a/Assets/Art/T_Planet_Atmosphere_01.png b/Assets/Art/T_Planet_Atmosphere_01.png new file mode 100644 index 0000000..62d3787 Binary files /dev/null and b/Assets/Art/T_Planet_Atmosphere_01.png differ diff --git a/Assets/Art/T_Planet_Atmosphere_01.png.meta b/Assets/Art/T_Planet_Atmosphere_01.png.meta new file mode 100644 index 0000000..3f0df4e --- /dev/null +++ b/Assets/Art/T_Planet_Atmosphere_01.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 8d3ba69018238ee4f9629282ea7d9fcf +timeCreated: 1460214709 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/T_Space_Background_02.png b/Assets/Art/T_Space_Background_02.png new file mode 100644 index 0000000..35911c8 Binary files /dev/null and b/Assets/Art/T_Space_Background_02.png differ diff --git a/Assets/Art/T_Space_Background_02.png.meta b/Assets/Art/T_Space_Background_02.png.meta new file mode 100644 index 0000000..52ccf1d --- /dev/null +++ b/Assets/Art/T_Space_Background_02.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 7443ae7f877013a42941481b83fee96b +timeCreated: 1460214707 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Planet.prefab b/Assets/Prefabs/Planet.prefab index ca103ce..af19b05 100644 --- a/Assets/Prefabs/Planet.prefab +++ b/Assets/Prefabs/Planet.prefab @@ -106,6 +106,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c11fa6fea03561044843359e6d9d23a6, type: 3} m_Name: m_EditorClassIdentifier: + CriticalMin: 0.2 + CriticalMax: 0.9 --- !u!114 &11401780 MonoBehaviour: m_ObjectHideFlags: 1 @@ -139,6 +141,8 @@ MonoBehaviour: CartierMinRatio: 0.75 CartierMaxRatio: 1.25 CartierStepSize: 0.25 + CartierWaitBeforeRaise: 0.6 + balanceValue: 0 WedgePrefab: {fileID: 170328, guid: 0b78da08dfa398840862539a74cc2377, type: 2} --- !u!135 &13593906 SphereCollider: diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 30e9a62..1c29ed2 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -14,6 +14,7 @@ public class PlanetManager : MonoBehaviour public float CartierMinRatio = 0.4f; public float CartierMaxRatio = 2.0f; public float CartierStepSize = 0.25f; + public float CartierWaitBeforeRaise = 2f; public float balanceValue; private float disbalance = 0f; public GameObject WedgePrefab = null; @@ -81,7 +82,7 @@ public class PlanetManager : MonoBehaviour { w.offset = 1.0f; } - else if (w.offset > 1.0f) + else if (w.offset > 1.0f && Time.time >= w.timeSinceLastPushedBack + CartierWaitBeforeRaise) { if (!CartierResetRatioSpeedRandomize) { @@ -89,10 +90,10 @@ public class PlanetManager : MonoBehaviour } else { - w.offset -= 0.005f*CartierResetRatioSpeedFactor * UnityEngine.Random.Range(-0.5f, 2f); + w.offset -= 0.005f*CartierResetRatioSpeedFactor * UnityEngine.Random.Range(-0.5f, 1.8f); } } - else if (w.offset < 1.0f) + else if ((w.offset < 1.0f) && Time.time >= w.timeSincePushedToMinimum + CartierWaitBeforeRaise ) { if (!CartierResetRatioSpeedRandomize) { @@ -114,9 +115,18 @@ public class PlanetManager : MonoBehaviour var index = GetWedgeIndex(thetaPlayerX); var w = wedges[index]; + + var difference = CartierStepSize; + + var wOffsetBefore = w.offset; w.offset = w.offset - CartierStepSize; - if (w.offset < CartierMinRatio) + if (w.offset <= CartierMinRatio) + { + difference -= CartierMinRatio - w.offset; //enlever du push pour la plateforme qui va faire pousser dans le sens opposé + w.timeSincePushedToMinimum = Time.time; w.offset = CartierMinRatio; + } + w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); @@ -125,27 +135,33 @@ public class PlanetManager : MonoBehaviour var indexOppose = GetWedgeOpposé(index); var v = wedges[indexOppose]; - v.offset = v.offset + CartierStepSize; - if (v.offset >= CartierMaxRatio) - { - v.offset = CartierMaxRatio; + // if (Time.time >= v.timeSincePushedToMinimum + CartierWaitBeforeRaise) // résultats étranges ;) + // if (wOffsetBefore >= 0.9f) + // { + if (v.offset < CartierMaxRatio) v.timeSinceLastPushedBack = Time.time; - - //checker si on éjecte des players - var players = FindObjectsOfType(); - foreach (var p in players) + v.offset = v.offset + difference; //CartierStepSize; //diférentiel au lieu du step size + if (v.offset >= CartierMaxRatio) { - if (v.tMax >= p.GetTheta() && p.GetTheta() >= v.tMin && p.IsGrounded()) + v.offset = CartierMaxRatio; + + + //checker si on éjecte des players + var players = FindObjectsOfType(); + foreach (var p in players) { - p.Eject(); + if (v.tMax >= p.GetTheta() && p.GetTheta() >= v.tMin && p.IsGrounded()) + { + p.Eject(); + } } } - - - } + v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); + // } + - v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); + // call fill gauge after every hit. var earthQuakeGauge = FindObjectOfType(); @@ -288,7 +304,8 @@ public class PlanetManager : MonoBehaviour public float offset = 1.0f; //valeurs entre minRatio et maxRatio; < 1 étant renfoncé, 1 position normale, et > 1 vers l'extérieur public float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; public float tMax = 0; - + public float timeSincePushedToMinimum = 0.0f; + public float timeSinceLastPushedBack = 0.0f; public GameObject sprite; //sprite et collider 2D public GameObject gameObject; //wedge prefab avec collider } diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index c658fd5..b6fb9e7 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -241,6 +241,64 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 7 +--- !u!1 &227879751 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 227879752} + - 212: {fileID: 227879753} + m_Layer: 0 + m_Name: Atmosphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &227879752 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 227879751} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1867085522} + m_RootOrder: 1 +--- !u!212 &227879753 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 227879751} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, @@ -499,9 +557,17 @@ Prefab: propertyPath: m_RootOrder value: 5 objectReference: {fileID: 0} + - target: {fileID: 140218, guid: 8347d06db0c264442891d12282c4a4dd, type: 2} + propertyPath: m_Name + value: Stars behind + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 8347d06db0c264442891d12282c4a4dd, type: 2} m_IsPrefabParent: 0 +--- !u!4 &1867085522 stripped +Transform: + m_PrefabParentObject: {fileID: 483280, guid: 8347d06db0c264442891d12282c4a4dd, type: 2} + m_PrefabInternal: {fileID: 1867085521} --- !u!1 &1945693977 GameObject: m_ObjectHideFlags: 0