This commit is contained in:
Sophie 2016-04-09 11:58:06 -04:00
commit 803bd94c77
7 changed files with 220 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@ -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:

View File

@ -106,6 +106,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c11fa6fea03561044843359e6d9d23a6, type: 3} m_Script: {fileID: 11500000, guid: c11fa6fea03561044843359e6d9d23a6, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
CriticalMin: 0.2
CriticalMax: 0.9
--- !u!114 &11401780 --- !u!114 &11401780
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -139,6 +141,8 @@ MonoBehaviour:
CartierMinRatio: 0.75 CartierMinRatio: 0.75
CartierMaxRatio: 1.25 CartierMaxRatio: 1.25
CartierStepSize: 0.25 CartierStepSize: 0.25
CartierWaitBeforeRaise: 0.6
balanceValue: 0
WedgePrefab: {fileID: 170328, guid: 0b78da08dfa398840862539a74cc2377, type: 2} WedgePrefab: {fileID: 170328, guid: 0b78da08dfa398840862539a74cc2377, type: 2}
--- !u!135 &13593906 --- !u!135 &13593906
SphereCollider: SphereCollider:

View File

@ -14,6 +14,7 @@ public class PlanetManager : MonoBehaviour
public float CartierMinRatio = 0.4f; public float CartierMinRatio = 0.4f;
public float CartierMaxRatio = 2.0f; public float CartierMaxRatio = 2.0f;
public float CartierStepSize = 0.25f; public float CartierStepSize = 0.25f;
public float CartierWaitBeforeRaise = 2f;
public float balanceValue; public float balanceValue;
private float disbalance = 0f; private float disbalance = 0f;
public GameObject WedgePrefab = null; public GameObject WedgePrefab = null;
@ -81,7 +82,7 @@ public class PlanetManager : MonoBehaviour
{ {
w.offset = 1.0f; w.offset = 1.0f;
} }
else if (w.offset > 1.0f) else if (w.offset > 1.0f && Time.time >= w.timeSinceLastPushedBack + CartierWaitBeforeRaise)
{ {
if (!CartierResetRatioSpeedRandomize) if (!CartierResetRatioSpeedRandomize)
{ {
@ -89,10 +90,10 @@ public class PlanetManager : MonoBehaviour
} }
else 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) if (!CartierResetRatioSpeedRandomize)
{ {
@ -114,9 +115,18 @@ public class PlanetManager : MonoBehaviour
var index = GetWedgeIndex(thetaPlayerX); var index = GetWedgeIndex(thetaPlayerX);
var w = wedges[index]; var w = wedges[index];
var difference = CartierStepSize;
var wOffsetBefore = w.offset;
w.offset = w.offset - CartierStepSize; 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.offset = CartierMinRatio;
}
w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1);
@ -125,27 +135,33 @@ public class PlanetManager : MonoBehaviour
var indexOppose = GetWedgeOpposé(index); var indexOppose = GetWedgeOpposé(index);
var v = wedges[indexOppose]; var v = wedges[indexOppose];
v.offset = v.offset + CartierStepSize; // if (Time.time >= v.timeSincePushedToMinimum + CartierWaitBeforeRaise) // résultats étranges ;)
if (v.offset >= CartierMaxRatio) // if (wOffsetBefore >= 0.9f)
{ // {
v.offset = CartierMaxRatio; if (v.offset < CartierMaxRatio) v.timeSinceLastPushedBack = Time.time;
v.offset = v.offset + difference; //CartierStepSize; //diférentiel au lieu du step size
//checker si on éjecte des players if (v.offset >= CartierMaxRatio)
var players = FindObjectsOfType<Astronaut>();
foreach (var p in players)
{ {
if (v.tMax >= p.GetTheta() && p.GetTheta() >= v.tMin && p.IsGrounded()) v.offset = CartierMaxRatio;
//checker si on éjecte des players
var players = FindObjectsOfType<Astronaut>();
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. // call fill gauge after every hit.
var earthQuakeGauge = FindObjectOfType<Earthquake>(); var earthQuakeGauge = FindObjectOfType<Earthquake>();
@ -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 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 tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier;
public float tMax = 0; public float tMax = 0;
public float timeSincePushedToMinimum = 0.0f;
public float timeSinceLastPushedBack = 0.0f;
public GameObject sprite; //sprite et collider 2D public GameObject sprite; //sprite et collider 2D
public GameObject gameObject; //wedge prefab avec collider public GameObject gameObject; //wedge prefab avec collider
} }

View File

@ -241,6 +241,64 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 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 --- !u!114 &1027139440 stripped
MonoBehaviour: MonoBehaviour:
m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1,
@ -499,9 +557,17 @@ Prefab:
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 140218, guid: 8347d06db0c264442891d12282c4a4dd, type: 2}
propertyPath: m_Name
value: Stars behind
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 8347d06db0c264442891d12282c4a4dd, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 8347d06db0c264442891d12282c4a4dd, type: 2}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!4 &1867085522 stripped
Transform:
m_PrefabParentObject: {fileID: 483280, guid: 8347d06db0c264442891d12282c4a4dd, type: 2}
m_PrefabInternal: {fileID: 1867085521}
--- !u!1 &1945693977 --- !u!1 &1945693977
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0