diff --git a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Big.prefab b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Big.prefab index 754c266..4bf1bbb 100644 --- a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Big.prefab +++ b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Big.prefab @@ -14,7 +14,7 @@ GameObject: - 114: {fileID: 11400000} m_Layer: 0 m_Name: Enemy_Generator_Big - m_TagString: Untagged + m_TagString: Respawn m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -81,6 +81,7 @@ MonoBehaviour: Enemy01: {fileID: 100000, guid: 72fa228a88f034a4695da237219fa2b1, type: 2} Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2} spawnRate: 5 + speedUpRate: .100000001 --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 diff --git a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Ranged.prefab b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Ranged.prefab index e81ecf7..35c4aa7 100644 --- a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Ranged.prefab +++ b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Ranged.prefab @@ -14,7 +14,7 @@ GameObject: - 114: {fileID: 11400000} m_Layer: 0 m_Name: Enemy_Generator_Ranged - m_TagString: Untagged + m_TagString: Respawn m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -81,6 +81,7 @@ MonoBehaviour: Enemy01: {fileID: 100000, guid: 2a0dd2bcb20004d33b9802a3dd4975cf, type: 2} Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2} spawnRate: 3 + speedUpRate: .100000001 --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 diff --git a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Weak.prefab b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Weak.prefab index 50be3a7..b0dcd2a 100644 --- a/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Weak.prefab +++ b/Guardian of Silverkeep/Assets/Prefab/Enemy_Generator_Weak.prefab @@ -14,7 +14,7 @@ GameObject: - 114: {fileID: 11400000} m_Layer: 0 m_Name: Enemy_Generator_Weak - m_TagString: Untagged + m_TagString: Respawn m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -81,6 +81,7 @@ MonoBehaviour: Enemy01: {fileID: 100000, guid: 340017fa6633642cfb262b80ea89268b, type: 2} Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2} spawnRate: 5 + speedUpRate: .100000001 --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 diff --git a/Guardian of Silverkeep/Assets/Scene_Tianzhu/LVL1.unity b/Guardian of Silverkeep/Assets/Scene_Tianzhu/LVL1.unity index dc10f86..2a4502c 100644 --- a/Guardian of Silverkeep/Assets/Scene_Tianzhu/LVL1.unity +++ b/Guardian of Silverkeep/Assets/Scene_Tianzhu/LVL1.unity @@ -352,6 +352,46 @@ MeshFilter: m_PrefabInternal: {fileID: 494628817} m_GameObject: {fileID: 61694388} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &79484991 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalPosition.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalPosition.z + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 08573848214134218864619298070bcf, type: 2} + m_RootGameObject: {fileID: 1803185861} + m_IsPrefabParent: 0 + m_IsExploded: 1 --- !u!1 &95018709 GameObject: m_ObjectHideFlags: 0 @@ -446,6 +486,10 @@ Prefab: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 11400002, guid: 62a6e0865cec44656be439b399ff7f72, type: 2} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 62a6e0865cec44656be439b399ff7f72, type: 2} m_RootGameObject: {fileID: 1891145080} @@ -2825,7 +2869,7 @@ GameObject: - 114: {fileID: 993245397} m_Layer: 0 m_Name: Enemy_Generator_Weak - m_TagString: Untagged + m_TagString: Respawn m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -2845,6 +2889,7 @@ MonoBehaviour: Enemy01: {fileID: 100000, guid: 340017fa6633642cfb262b80ea89268b, type: 2} Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2} spawnRate: 5 + speedUpRate: .100000001 --- !u!23 &993245398 Renderer: m_ObjectHideFlags: 0 @@ -3306,6 +3351,7 @@ GameObject: - 124: {fileID: 1139808589} - 114: {fileID: 1139808588} - 81: {fileID: 1139808587} + - 114: {fileID: 1139808592} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -3340,7 +3386,7 @@ MonoBehaviour: type: 2} m_PrefabInternal: {fileID: 107096183} m_GameObject: {fileID: 1139808585} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3} m_Name: @@ -3397,6 +3443,19 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_HDR: 0 +--- !u!114 &1139808592 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1139808585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e1f5f091bf954b86ade1fbe198851da, type: 3} + m_Name: + m_EditorClassIdentifier: + Win_Cond: 6 + Lose_Cond: 0 --- !u!1 &1156734093 GameObject: m_ObjectHideFlags: 0 @@ -4828,6 +4887,92 @@ MeshFilter: m_PrefabInternal: {fileID: 56728018} m_GameObject: {fileID: 1784722914} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1803185861 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 100000, guid: 08573848214134218864619298070bcf, type: 2} + m_PrefabInternal: {fileID: 79484991} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1803185866} + - 33: {fileID: 1803185865} + - 65: {fileID: 1803185864} + - 23: {fileID: 1803185863} + - 114: {fileID: 1803185862} + m_Layer: 0 + m_Name: Enemy_Generator_Big + m_TagString: Respawn + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1803185862 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11400000, guid: 08573848214134218864619298070bcf, + type: 2} + m_PrefabInternal: {fileID: 79484991} + m_GameObject: {fileID: 1803185861} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 92397dffa2ddd43f598c8dd8d209af12, type: 3} + m_Name: + m_EditorClassIdentifier: + Enemy01: {fileID: 100000, guid: 72fa228a88f034a4695da237219fa2b1, type: 2} + Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2} + spawnRate: 5 + speedUpRate: .100000001 +--- !u!23 &1803185863 +Renderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 2300000, guid: 08573848214134218864619298070bcf, + type: 2} + m_PrefabInternal: {fileID: 79484991} + m_GameObject: {fileID: 1803185861} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_LightmapIndex: 255 + m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} + m_Materials: + - {fileID: 2100000, guid: d5f5858f11d9a4b9eb36788f0170b6df, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_LightProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 +--- !u!65 &1803185864 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 6500000, guid: 08573848214134218864619298070bcf, + type: 2} + m_PrefabInternal: {fileID: 79484991} + m_GameObject: {fileID: 1803185861} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1803185865 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 3300000, guid: 08573848214134218864619298070bcf, + type: 2} + m_PrefabInternal: {fileID: 79484991} + m_GameObject: {fileID: 1803185861} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1803185866 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2} + m_PrefabInternal: {fileID: 79484991} + m_GameObject: {fileID: 1803185861} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5, y: 0, z: 5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} --- !u!1 &1849082775 GameObject: m_ObjectHideFlags: 0 @@ -4990,7 +5135,6 @@ MonoBehaviour: m_EditorClassIdentifier: Health: 5 Score: 0 - victoryScore: 15 Hero_Attack_03_Prefab: {fileID: 100000, guid: c08fc645757c54e41bfc4a93112e033f, type: 2} Hero_Attack_02_Prefab: {fileID: 100000, guid: ef077c06042504317ba49c4177a6e2f7, diff --git a/Guardian of Silverkeep/Assets/Scripts/EnemyGenerator.cs b/Guardian of Silverkeep/Assets/Scripts/EnemyGenerator.cs index a8f79f1..29a5f21 100644 --- a/Guardian of Silverkeep/Assets/Scripts/EnemyGenerator.cs +++ b/Guardian of Silverkeep/Assets/Scripts/EnemyGenerator.cs @@ -11,6 +11,7 @@ public class EnemyGenerator : MonoBehaviour private Vector3 SpawnLocationRandomize; private float posX; private float posZ; + public float speedUpRate = 0.1f; // Use this for initialization enum CycleStat { @@ -70,4 +71,9 @@ public class EnemyGenerator : MonoBehaviour Debug.Log("day/night cycle switched!"); } #endregion + void SpeedUp() + { + this.spawnRate = this.spawnRate * speedUpRate; + Debug.Log("Speed Uped"); + } } diff --git a/Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs b/Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs index b024824..5abc86c 100644 --- a/Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs +++ b/Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs @@ -6,7 +6,7 @@ public class FPS_HERO: MonoBehaviour #region Fields public int Health; public int Score; - public int victoryScore = 15; + //public int victoryScore = 15; public GameObject Hero_Attack_03_Prefab; public GameObject Hero_Attack_02_Prefab; public GameObject Hero_Attack_01_Prefab; @@ -53,13 +53,7 @@ public class FPS_HERO: MonoBehaviour void Update () { - #region Win/Lose - if(this.Health <= 0) - Application.LoadLevel("GameOver"); - if(this.Score >= victoryScore) - Application.LoadLevel("VictoryScreen"); - - #endregion + if (state != State.Dead) { diff --git a/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs new file mode 100644 index 0000000..3d82298 --- /dev/null +++ b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using System.Collections; + +public class MasterControl : MonoBehaviour +{ + private FPS_HERO hero; + private GameObject[] eGen; + + public int Win_Cond = 40; + public int Lose_Cond = 0; + private bool neverdone = true; + + // Use this for initialization + void Start () + { + hero = (FPS_HERO)FindObjectOfType(typeof(FPS_HERO)); + eGen = GameObject.FindGameObjectsWithTag("Respawn"); + + } + //*** put swap skybox somewhere here** + + // Update is called once per frame + void Update () + { + #region WinLose + if(hero.Health <= Lose_Cond) + Application.LoadLevel("GameOver"); + if(hero.Score >= Win_Cond) + Application.LoadLevel("VictoryScreen"); + #endregion + + #region speedup + if(neverdone ==true) + { + if(hero.Score >= (0.7f * Win_Cond)) + { + + foreach(GameObject e in eGen) + { + e.SendMessage("SpeedUp"); + } + + neverdone = false; + } + } + #endregion + + + + } + +} diff --git a/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs.meta b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs.meta new file mode 100644 index 0000000..127442f --- /dev/null +++ b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e1f5f091bf954b86ade1fbe198851da +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: