From 5cd2026b19341c105f014751a737ed1f0a10a49f Mon Sep 17 00:00:00 2001 From: DyatelO Date: Fri, 26 Nov 2021 04:44:43 +0300 Subject: [PATCH] =?UTF-8?q?Extralife=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D1=82.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VFX/_Game/Protectior/Bomb.prefab | 4 +- Assets/Prefabs_NEW/BombPref.prefab | 39 ------------------- Assets/Scenes/Level_1.unity | 33 +++++----------- Assets/Scripts/AdMob/Extralife.cs | 12 +++++- Assets/Scripts/AdMob/RewardExtraLife.cs | 15 ++++--- Assets/Scripts/Audio/AudioChanger.cs | 2 +- Assets/Scripts/Audio/VictoryOrNot.cs | 25 +++++++++--- 7 files changed, 52 insertions(+), 78 deletions(-) diff --git a/Assets/LoadedAssets/VFX/_Game/Protectior/Bomb.prefab b/Assets/LoadedAssets/VFX/_Game/Protectior/Bomb.prefab index 69c86de6..430c19fa 100644 --- a/Assets/LoadedAssets/VFX/_Game/Protectior/Bomb.prefab +++ b/Assets/LoadedAssets/VFX/_Game/Protectior/Bomb.prefab @@ -4754,7 +4754,7 @@ Transform: m_GameObject: {fileID: 6736513976106828952} m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 0.76523924, y: 0.76523924, z: 0.76523924} + m_LocalScale: {x: 0.76523924, y: 0.7652393, z: 0.7652393} m_Children: - {fileID: 6736513976106619780} - {fileID: 6736513976106671486} @@ -9476,7 +9476,7 @@ AudioSource: m_Enabled: 1 serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: 101106cd810615041bb13f121e59a2d7, type: 3} + m_audioClip: {fileID: 8300000, guid: e9d3f46b0b5ba9f4cada050219138aac, type: 3} m_PlayOnAwake: 1 m_Volume: 1 m_Pitch: 1.3 diff --git a/Assets/Prefabs_NEW/BombPref.prefab b/Assets/Prefabs_NEW/BombPref.prefab index faf22845..42208d94 100644 --- a/Assets/Prefabs_NEW/BombPref.prefab +++ b/Assets/Prefabs_NEW/BombPref.prefab @@ -12,7 +12,6 @@ GameObject: - component: {fileID: 8305872390849316397} - component: {fileID: 8305872390849316386} - component: {fileID: 8305872390849316387} - - component: {fileID: 253748612048010415} m_Layer: 0 m_Name: BombPref m_TagString: Untagged @@ -81,34 +80,6 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 ---- !u!114 &253748612048010415 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8305872390849316384} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1a99dc0f9656d2241b5ada4edc0765ee, type: 3} - m_Name: - m_EditorClassIdentifier: - state: {fileID: 8834890311105204208, guid: 935cb93f0fb421b47bac368a21e42353, type: 3} - hit_LightingAudio: {fileID: 8300000, guid: 6c42231c18643dc4d9d8f8d15bc4735b, type: 3} - hit_LaserAudio: {fileID: 8300000, guid: 75cd25f85e881bc458b1dd2f2bd8d84a, type: 3} - hit_TowerFireballAudio: {fileID: 8300000, guid: ab5fd4a38b69eb84f8ca0b8919cedd9c, - type: 3} - hit_SFX: - - {fileID: 8300000, guid: 6c42231c18643dc4d9d8f8d15bc4735b, type: 3} - - {fileID: 8300000, guid: 75cd25f85e881bc458b1dd2f2bd8d84a, type: 3} - - {fileID: 8300000, guid: ab5fd4a38b69eb84f8ca0b8919cedd9c, type: 3} - throw_SFX: - - {fileID: 8300000, guid: 9ea918c6c23577f4e885a8490d2f2046, type: 3} - - {fileID: 8300000, guid: 4af8bb0096e5d15489b02be84b6ce2a4, type: 3} - - {fileID: 8300000, guid: dbba45d74994bff4e8b406722fc8f468, type: 3} - _controller: {fileID: 8834890311105204220, guid: 935cb93f0fb421b47bac368a21e42353, - type: 3} - bonusSound: {fileID: 8300000, guid: e9d3f46b0b5ba9f4cada050219138aac, type: 3} --- !u!1001 &8305872391170760256 PrefabInstance: m_ObjectHideFlags: 0 @@ -121,16 +92,6 @@ PrefabInstance: propertyPath: m_RootOrder value: 0 objectReference: {fileID: 0} - - target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8, - type: 3} - propertyPath: m_LocalScale.y - value: 0.7652393 - objectReference: {fileID: 0} - - target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8, - type: 3} - propertyPath: m_LocalScale.z - value: 0.7652393 - objectReference: {fileID: 0} - target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8, type: 3} propertyPath: m_LocalPosition.x diff --git a/Assets/Scenes/Level_1.unity b/Assets/Scenes/Level_1.unity index 6a27127d..587daf80 100644 --- a/Assets/Scenes/Level_1.unity +++ b/Assets/Scenes/Level_1.unity @@ -2797,7 +2797,6 @@ GameObject: - component: {fileID: 1102420994} - component: {fileID: 1102420995} - component: {fileID: 1102420996} - - component: {fileID: 1102421000} - component: {fileID: 1102420997} - component: {fileID: 1102420999} - component: {fileID: 1102420998} @@ -3105,21 +3104,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6b5dadb9684306343863ce74df4f19db, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &1102421000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1102420987} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8dc4cc07f3bed18489377bd6a954befc, type: 3} - m_Name: - m_EditorClassIdentifier: - victorySound: {fileID: 8300000, guid: c5d6f7a31e8ea824a8e65927b92b86f8, type: 3} - defeatSound: {fileID: 8300000, guid: 8e59fee47fa858a419bdc652dc2a9a71, type: 3} - audioSource: {fileID: 1102420997} --- !u!114 &1105100998 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 5359326301570881751, guid: a72be70db1163c14b8b7a3cb1c00a59d, @@ -4726,8 +4710,8 @@ GameObject: - component: {fileID: 1801060033} - component: {fileID: 1801060039} - component: {fileID: 1801060035} - - component: {fileID: 1801060029} - component: {fileID: 1801060038} + - component: {fileID: 1801060029} m_Layer: 0 m_Name: Player m_TagString: Untagged @@ -4868,7 +4852,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 0} m_PlayOnAwake: 0 - m_Volume: 0.3 + m_Volume: 0.5 m_Pitch: 1 Loop: 0 Mute: 0 @@ -5083,6 +5067,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8dc4cc07f3bed18489377bd6a954befc, type: 3} m_Name: m_EditorClassIdentifier: + extralife: {fileID: 1801060037} victorySound: {fileID: 8300000, guid: c5d6f7a31e8ea824a8e65927b92b86f8, type: 3} defeatSound: {fileID: 8300000, guid: 8e59fee47fa858a419bdc652dc2a9a71, type: 3} audioSource: {fileID: 1801060029} @@ -27342,9 +27327,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tilePosition: {x: 0, y: 0, z: 0} - canMove: 1 - canBeAttacked: 1 - canBuildHere: 1 + canMove: 0 + canBeAttacked: 0 + canBuildHere: 0 buildingOnTile: {fileID: 0} tileOwnerIndex: 0 easyCaptureFor: @@ -50679,9 +50664,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tilePosition: {x: 0, y: 0, z: 0} - canMove: 1 - canBeAttacked: 1 - canBuildHere: 1 + canMove: 0 + canBeAttacked: 0 + canBuildHere: 0 buildingOnTile: {fileID: 0} tileOwnerIndex: 0 easyCaptureFor: diff --git a/Assets/Scripts/AdMob/Extralife.cs b/Assets/Scripts/AdMob/Extralife.cs index 0dcfd715..29909f15 100644 --- a/Assets/Scripts/AdMob/Extralife.cs +++ b/Assets/Scripts/AdMob/Extralife.cs @@ -4,15 +4,23 @@ using UnityEngine; public class Extralife : MonoBehaviour { - public int life = 2; + public int life = 1; [SerializeField] private DeathMenu menu; - void Update() +/* void Update() { if(life == 0) { //Count.lifesValue -= 1; menu.LoadMenu(); } + }*/ + + private void OnTriggerEnter(Collider other) { + if(life < 0) + { + //Count.lifesValue -= 1; + menu.LoadMenu(); + } } } diff --git a/Assets/Scripts/AdMob/RewardExtraLife.cs b/Assets/Scripts/AdMob/RewardExtraLife.cs index 6e4b9119..4374cd1c 100644 --- a/Assets/Scripts/AdMob/RewardExtraLife.cs +++ b/Assets/Scripts/AdMob/RewardExtraLife.cs @@ -10,27 +10,32 @@ public class RewardExtraLife : MonoBehaviour private string RewardUnitId = "ca-app-pub-3940256099942544/5224354917"; //ca-app-pub-6397060103571541~3496155288 private RewardedAd rewardedAd; [SerializeField] private Extralife _extraLife; - private int extralife; + private int lifeCount; private void OnEnable() { + lifeCount = _extraLife.life; this.rewardedAd = new RewardedAd(RewardUnitId); AdRequest adRequest = new AdRequest.Builder().Build(); this.rewardedAd.LoadAd(adRequest); this.rewardedAd.OnUserEarnedReward += HandleEarnedReward; } + private void OnTriggerEnter(Collider other) { + + } private void Update() { - //extralife =_extraLife.life; + + _extraLife.life = lifeCount - 1; } private void HandleEarnedReward(object sender, Reward e) { - extralife = _extraLife.life ; + //_extraLife.life ; //extralife--; //_extraLife.life--; - Count.lifesValue -= 1; - _extraLife.life = Count.lifesValue; + lifeCount -= 1; + _extraLife.life = lifeCount; } public void ShowAd() diff --git a/Assets/Scripts/Audio/AudioChanger.cs b/Assets/Scripts/Audio/AudioChanger.cs index f8b90152..97ceb5a7 100644 --- a/Assets/Scripts/Audio/AudioChanger.cs +++ b/Assets/Scripts/Audio/AudioChanger.cs @@ -34,7 +34,7 @@ public class AudioChanger : MonoBehaviour if(bonusSound != null) { - aSourse.volume = _startVolume ; + aSourse.volume = _startVolume ; aSourse.PlayOneShot(bonusSound); } diff --git a/Assets/Scripts/Audio/VictoryOrNot.cs b/Assets/Scripts/Audio/VictoryOrNot.cs index 4282ca27..a78b55fd 100644 --- a/Assets/Scripts/Audio/VictoryOrNot.cs +++ b/Assets/Scripts/Audio/VictoryOrNot.cs @@ -6,19 +6,34 @@ using UnityEngine.UI; public class VictoryOrNot : MonoBehaviour { //[SerializeField] private GameObject greyHeart; - //[SerializeField] private Extralife extralife; - private string zero = "0"; + [SerializeField] private Extralife extralife; + //private string zero = "0"; [SerializeField] private AudioClip victorySound; [SerializeField] private AudioClip defeatSound; [SerializeField] private AudioSource audioSource; private float volume; - private void Awake() { - volume = audioSource.volume; + private void Awake() + { + //if(extralife.life < 0) + volume = 0.5f * audioSource.volume; + //PlayGameOver(); + } + + private void Update() { + if(extralife.life < -1) + { + PlayGameOver(); + } + //volume = 0.5f * audioSource.volume; + } - public void Play() + + + + public void PlayGameOver() {