Commit ae0d2844 authored by Parsa Rahmaty's avatar Parsa Rahmaty

Added sea sound and Sun

parent 95011ed1
fileFormatVersion: 2
guid: 588e3273297b35942b458a2edf5b1451
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c92384bf8ce7c9f479d07a7efb790380
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sun
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.8200449, b: 0, a: 1}
- _EmissionColor: {r: 1.1353015, g: 0.92131793, b: 0, a: 1}
fileFormatVersion: 2
guid: 4a0a919c04dbfb047a982711dde993ec
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
...@@ -58,7 +58,7 @@ GameObject: ...@@ -58,7 +58,7 @@ GameObject:
- component: {fileID: 4362728094971556239} - component: {fileID: 4362728094971556239}
- component: {fileID: 4993034585398598532} - component: {fileID: 4993034585398598532}
- component: {fileID: 2480487072626728824} - component: {fileID: 2480487072626728824}
m_Layer: 0 m_Layer: 9
m_Name: Block m_Name: Block
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -58,7 +58,7 @@ GameObject: ...@@ -58,7 +58,7 @@ GameObject:
- component: {fileID: 4362728094971556239} - component: {fileID: 4362728094971556239}
- component: {fileID: 4993034585398598532} - component: {fileID: 4993034585398598532}
- component: {fileID: 7926518500587266054} - component: {fileID: 7926518500587266054}
m_Layer: 0 m_Layer: 9
m_Name: Block m_Name: Block
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -58,7 +58,7 @@ GameObject: ...@@ -58,7 +58,7 @@ GameObject:
- component: {fileID: 4362728094971556239} - component: {fileID: 4362728094971556239}
- component: {fileID: 4993034585398598532} - component: {fileID: 4993034585398598532}
- component: {fileID: 7206499325325071053} - component: {fileID: 7206499325325071053}
m_Layer: 0 m_Layer: 9
m_Name: Block m_Name: Block
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -15,7 +15,8 @@ GameObject: ...@@ -15,7 +15,8 @@ GameObject:
- component: {fileID: 5704020906800342289} - component: {fileID: 5704020906800342289}
- component: {fileID: 5366595633663589618} - component: {fileID: 5366595633663589618}
- component: {fileID: 6082561672976095912} - component: {fileID: 6082561672976095912}
m_Layer: 9 - component: {fileID: 8966297705323771058}
m_Layer: 8
m_Name: Stack Node m_Name: Stack Node
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -140,3 +141,23 @@ MonoBehaviour: ...@@ -140,3 +141,23 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e3cf5829d03eb97459c57901b7efff3d, type: 3} m_Script: {fileID: 11500000, guid: e3cf5829d03eb97459c57901b7efff3d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
animationCurve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!136 &8966297705323771058
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8953703217792660207}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5000001
m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
This diff is collapsed.
...@@ -23,6 +23,8 @@ public class ObstacleCircle : MonoBehaviour ...@@ -23,6 +23,8 @@ public class ObstacleCircle : MonoBehaviour
private float defaultRotationTime = 2.0f; private float defaultRotationTime = 2.0f;
private float defaultRotationSpeed = 1f; private float defaultRotationSpeed = 1f;
private bool keepRotating = true;
private void Awake() private void Awake()
{ {
initialRotationY = transform.localEulerAngles.y; initialRotationY = transform.localEulerAngles.y;
...@@ -100,15 +102,25 @@ public class ObstacleCircle : MonoBehaviour ...@@ -100,15 +102,25 @@ public class ObstacleCircle : MonoBehaviour
MakeNextLevel(); MakeNextLevel();
GameEvents.instance.onNextLevelEvent += NextLevel; GameEvents.instance.onNextLevelEvent += NextLevel;
GameEvents.instance.onGameRestartEvent += Restart; GameEvents.instance.onGameRestartEvent += Restart;
GameEvents.instance.onGameLostEvent += StopRotating;
GameEvents.instance.onGameRestartEvent += ContinueRotating;
GameEvents.instance.onGameRestartEvent += ResetTime;
} }
private void Update() private void FixedUpdate()
{ {
// Rotate the obstacles based on the animation curve in rotationTime of that level // Rotate the obstacles based on the animation curve in rotationTime of that level
if (keepRotating)
{
time += Time.deltaTime; time += Time.deltaTime;
if (time > rotationTimes[currentLevelIndex()]) if (time > rotationTimes[CurrentLevelIndex()])
time = 0f; time = 0f;
transform.localEulerAngles += new Vector3(0f, rotationSpeedCurve[currentLevelIndex()].Evaluate(time / rotationTimes[currentLevelIndex()]) * rotationSpeedMultiplier * Time.deltaTime, 0f); transform.localEulerAngles += new Vector3(0f, rotationSpeedCurve[CurrentLevelIndex()].Evaluate(time / rotationTimes[CurrentLevelIndex()]) * rotationSpeedMultiplier * Time.deltaTime, 0f);
}
else
{
transform.localEulerAngles += new Vector3(0f, rotationSpeedMultiplier / 2 * Time.deltaTime, 0f);
}
} }
private void MakeNextLevel() private void MakeNextLevel()
...@@ -175,8 +187,23 @@ public class ObstacleCircle : MonoBehaviour ...@@ -175,8 +187,23 @@ public class ObstacleCircle : MonoBehaviour
MakeNextLevel(); MakeNextLevel();
} }
private int currentLevelIndex() private int CurrentLevelIndex()
{ {
return (nextLevelIndex - 1 < 0) ? (levelEditor.Length - 1) : (nextLevelIndex - 1); return (nextLevelIndex - 1 < 0) ? (levelEditor.Length - 1) : (nextLevelIndex - 1);
} }
private void ResetTime()
{
time = 0f;
}
private void StopRotating()
{
keepRotating = false;
}
private void ContinueRotating()
{
keepRotating = true;
}
} }
...@@ -20,6 +20,8 @@ public class StackNode : MonoBehaviour ...@@ -20,6 +20,8 @@ public class StackNode : MonoBehaviour
void Start() void Start()
{ {
GameEvents.instance.onHitEvent += Descend; GameEvents.instance.onHitEvent += Descend;
GameEvents.instance.onGameLostEvent += FreezeYPosition;
GameEvents.instance.onGameRestartEvent += UnfreezeYPosition;
} }
void FixedUpdate() void FixedUpdate()
...@@ -30,6 +32,8 @@ public class StackNode : MonoBehaviour ...@@ -30,6 +32,8 @@ public class StackNode : MonoBehaviour
private void OnDestroy() private void OnDestroy()
{ {
GameEvents.instance.onHitEvent -= Descend; GameEvents.instance.onHitEvent -= Descend;
GameEvents.instance.onGameLostEvent -= FreezeYPosition;
GameEvents.instance.onGameRestartEvent -= UnfreezeYPosition;
} }
public float GetNodeHeight() public float GetNodeHeight()
...@@ -46,4 +50,14 @@ public class StackNode : MonoBehaviour ...@@ -46,4 +50,14 @@ public class StackNode : MonoBehaviour
{ {
movable.SetDestination(new Vector3(transform.position.x, movable.targetPosition.y - (nodeHeight + nodeHeightDistance), transform.position.z), descendTime); movable.SetDestination(new Vector3(transform.position.x, movable.targetPosition.y - (nodeHeight + nodeHeightDistance), transform.position.z), descendTime);
} }
private void FreezeYPosition()
{
GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
}
private void UnfreezeYPosition()
{
GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
}
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
--- !u!55 &1 --- !u!55 &1
PhysicsManager: PhysicsManager:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 11 serializedVersion: 13
m_Gravity: {x: 0, y: -9.81, z: 0} m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0} m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2 m_BounceThreshold: 2
...@@ -17,11 +17,12 @@ PhysicsManager: ...@@ -17,11 +17,12 @@ PhysicsManager:
m_ClothInterCollisionDistance: 0 m_ClothInterCollisionDistance: 0
m_ClothInterCollisionStiffness: 0 m_ClothInterCollisionStiffness: 0
m_ContactsGeneration: 1 m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: fffefffffffefffffffefffffffffffffffefffffffeffffffffffffffffffffc8feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1 m_AutoSimulation: 1
m_AutoSyncTransforms: 0 m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1 m_ReuseCollisionCallbacks: 1
m_ClothInterCollisionSettingsToggle: 0 m_ClothInterCollisionSettingsToggle: 0
m_ClothGravity: {x: 0, y: -9.81, z: 0}
m_ContactPairsMode: 0 m_ContactPairsMode: 0
m_BroadphaseType: 0 m_BroadphaseType: 0
m_WorldBounds: m_WorldBounds:
...@@ -31,4 +32,5 @@ PhysicsManager: ...@@ -31,4 +32,5 @@ PhysicsManager:
m_FrictionType: 0 m_FrictionType: 0
m_EnableEnhancedDeterminism: 0 m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1 m_EnableUnifiedHeightmaps: 1
m_DefaultMaxAngluarSpeed: 7 m_SolverType: 0
m_DefaultMaxAngularSpeed: 7
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
--- !u!78 &1 --- !u!78 &1
TagManager: TagManager:
serializedVersion: 2 serializedVersion: 2
tags: [] tags:
- Cannonball
layers: layers:
- Default - Default
- TransparentFX - TransparentFX
...@@ -13,8 +14,8 @@ TagManager: ...@@ -13,8 +14,8 @@ TagManager:
- UI - UI
- -
- -
- - Stack Node
- - Obstacle
- -
- -
- -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment