Озвучка выдачи приза. Отображение скидки на повторную игру
This commit is contained in:
parent
34ca90431b
commit
0418490754
@ -11349,7 +11349,7 @@ Material:
|
||||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0, g: 0.5683422, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0.63892746, g: 0, b: 1, a: 1}
|
||||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
|
||||
- _OutlineColor: {r: 0.554717, g: 0.554717, b: 0.554717, a: 1}
|
||||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
||||
@ -6207,6 +6207,8 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
prizeErrorSound: {fileID: 8300000, guid: 5fb832a50dc689845898a59217fd0535, type: 3}
|
||||
SoundNotification: 1
|
||||
PrizeNotificationSounds: []
|
||||
--- !u!114 &259182291
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -25527,9 +25529,7 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_text: "\u0410\u043D\u0434\u0440\u0435\u0439 \u0411\u0435\u043B\u044F\u0435\u0432
|
||||
- \u0410\u0432\u0442\u043E\u0440 \u0438\u0434\u0435\u0438, \u043F\u0440\u043E\u0434\u044E\u0441\u0441\u0435\u0440
|
||||
\u043C\u0438\u043B\u043B\u0438\u043E\u043D\u0435\u0440 \u0444\u0438\u043B\u0430\u043D\u0442\u0440\u043E\u043F\r\n\u0421\u0435\u0440\u0433\u0435\u0439
|
||||
\u0411\u043E\u043D\u0434\u0430\u0440\u044C - \u0420\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u043A\u0430
|
||||
\u043D\u0430 Unity, \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435\r\n\u0410\u043B\u0435\u043A\u0441\u0435\u0439
|
||||
\u043C\u0438\u043B\u043B\u0438\u043E\u043D\u0435\u0440 \u0444\u0438\u043B\u0430\u043D\u0442\u0440\u043E\u043F\r\r\n\u0410\u043B\u0435\u043A\u0441\u0435\u0439
|
||||
\u041F\u043E\u043D\u0430\u043C\u0430\u0440\u0435\u0432 - \u0413\u0435\u0439\u043C\u0434\u0438\u0437\u0430\u0439\u043D,
|
||||
\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0446\u0438\u044F \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u043A\u0438,
|
||||
\u043A\u043E\u043D\u0446\u0435\u043F\u0442 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u0436\u0435\u0439,
|
||||
@ -54972,8 +54972,8 @@ MonoBehaviour:
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278255408
|
||||
m_fontColor: {r: 0.1898483, g: 1, b: 0, a: 1}
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
@ -54998,7 +54998,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
|
||||
@ -37,9 +37,18 @@ public class CoinCounter : MonoBehaviour
|
||||
public void SetRevengePriceVisibility(bool visibility)
|
||||
{
|
||||
revengeSignGo.SetActive(visibility);
|
||||
int price = PlayerPrefs.GetInt("PriceRevenge", 10);
|
||||
int priceRevenge = PlayerPrefs.GetInt("PriceRevenge", 10);
|
||||
int pricePve = PlayerPrefs.GetInt("PricePVE", 10);
|
||||
string valutaName = PlayerPrefs.GetString("ValutaName", "руб.");
|
||||
revengeSign.text = $"Повторная игра:<br><u>{price} {valutaName}</u>";
|
||||
|
||||
if(priceRevenge < pricePve)
|
||||
{
|
||||
revengeSign.text = $"Цена игры: <br><s>{pricePve} {valutaName}</s><br><color=green>Повторная игра:<br><u>{priceRevenge} {valutaName}</u></color>";
|
||||
}
|
||||
else
|
||||
{
|
||||
revengeSign.text = $"Повторная игра:<br><u>{priceRevenge} {valutaName}</u>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
@ -11,6 +12,9 @@ public class PrizeSystem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] AudioClip prizeErrorSound;
|
||||
|
||||
[SerializeField] bool SoundNotification = true;
|
||||
[SerializeField] List<AudioClip> PrizeNotificationSounds;
|
||||
|
||||
public static string key_starts = "STARTS";
|
||||
public static string key_startsNul = "STARTSNUL";
|
||||
public static string key_prizesgiven = "PRIZESGIVEN";
|
||||
@ -66,15 +70,15 @@ public class PrizeSystem : MonoBehaviour
|
||||
{
|
||||
Debug.Log($"Выдача приза {Type}. Количество: {amount}");
|
||||
prizing = true;
|
||||
bool atLeastOnePrize = false;
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
bool noPrizWhenError = SettingsManager.GetBool("PrizingWhenError", true);
|
||||
bool errorRegistred = PlayerPrefs.GetInt(KeyVault.PRIZING_ERROR_REGISTRED, 0) == 1;
|
||||
|
||||
if (errorRegistred && noPrizWhenError) yield break;
|
||||
|
||||
|
||||
float timeout = 10; //сек
|
||||
float timeout = 10;
|
||||
Debug.Log("Начинаю выдачу 303");
|
||||
ComWrapper.Send("303");//включаем мотор
|
||||
float startTime = Time.time;
|
||||
@ -110,6 +114,9 @@ public class PrizeSystem : MonoBehaviour
|
||||
//Счетчики
|
||||
IncreasePrizeCounters(Type);
|
||||
|
||||
//хотя бы что то успешно выпало
|
||||
atLeastOnePrize = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -117,6 +124,9 @@ public class PrizeSystem : MonoBehaviour
|
||||
SoundManager.instance.playClip(prizeErrorSound);
|
||||
}
|
||||
}
|
||||
if (atLeastOnePrize) SoundNotificationIfNeeds();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -177,5 +187,15 @@ public class PrizeSystem : MonoBehaviour
|
||||
if (!PlayerPrefs.HasKey(key_starts)) PlayerPrefs.SetInt(key_starts, 0);
|
||||
if (!PlayerPrefs.HasKey(key_startsNul)) PlayerPrefs.SetInt(key_startsNul, 0);
|
||||
}
|
||||
|
||||
private void SoundNotificationIfNeeds()
|
||||
{
|
||||
if(!SoundNotification) return;
|
||||
if (PrizeNotificationSounds == null || PrizeNotificationSounds.Count == 0) return;
|
||||
|
||||
int random = Random.Range(0, PrizeNotificationSounds.Count);
|
||||
AudioClip notification = PrizeNotificationSounds[random];
|
||||
SoundManager.instance.playClip(notification);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
BIN
Assets/Sounds/Выдача1.mp3
Normal file
BIN
Assets/Sounds/Выдача1.mp3
Normal file
Binary file not shown.
23
Assets/Sounds/Выдача1.mp3.meta
Normal file
23
Assets/Sounds/Выдача1.mp3.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1347f6385fc35fe4882304613a9fbfe9
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sounds/Выдача2.mp3
Normal file
BIN
Assets/Sounds/Выдача2.mp3
Normal file
Binary file not shown.
23
Assets/Sounds/Выдача2.mp3.meta
Normal file
23
Assets/Sounds/Выдача2.mp3.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e6426be1392aea48936249e22b54e1f
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sounds/Выдача3.mp3
Normal file
BIN
Assets/Sounds/Выдача3.mp3
Normal file
Binary file not shown.
23
Assets/Sounds/Выдача3.mp3.meta
Normal file
23
Assets/Sounds/Выдача3.mp3.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d38913d907d5e4244b25d6170a38686f
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
x
Reference in New Issue
Block a user