Commit e2c59129 authored by Hà Trung (NEGAXY)'s avatar Hà Trung (NEGAXY)

TrungHm: Fix Sounds

parent 2fd7e2a5
fileFormatVersion: 2
guid: f4619d2d2a11b514396953c6b830e96a
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:
fileFormatVersion: 2
guid: 41ca13291e693154f9c52cc61fa8f0b1
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:
fileFormatVersion: 2
guid: 6fd6029be6f5306469f556ed61426750
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:
fileFormatVersion: 2
guid: ef3ab772f1ada74439fe655b4c3f1a06
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:
......@@ -16,7 +16,7 @@ public class OST : MonoBehaviour
public AudioClip dragonSound;
public AudioClip narutoSound;
public AudioClip squidPunch;
public AudioClip collect;
public AudioClip[] collects;
//--------------
static WaitForSeconds delay0 = new WaitForSeconds(5);
......@@ -42,10 +42,18 @@ public class OST : MonoBehaviour
StartCoroutine(CheckSoundCO());
//--------------
}
private float delaySpawn = 0f;
private void Update()
{
delaySpawn = Mathf.Max(0f, delaySpawn - Time.deltaTime);
}
public void PlayCollectSound()
{
audioSource1.PlayOneShot(collect);
if (delaySpawn == 0f)
{
audioSource1.PlayOneShot(collects[Random.Range(0, collects.Length)]);
delaySpawn = 0.1f;
}
}
public void PlaySelectWeapon()
{
......
......@@ -26990,11 +26990,36 @@ PrefabInstance:
propertyPath: deselectWeapon
value:
objectReference: {fileID: 8300000, guid: 299901ee114b3a449837069435cdeb1f, type: 3}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: collects.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: sounds.Array.data[5]
value:
objectReference: {fileID: 8300000, guid: 2f8b102b2ff075a46be7cfb9809dd431, type: 3}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: collects.Array.data[0]
value:
objectReference: {fileID: 8300000, guid: ef3ab772f1ada74439fe655b4c3f1a06, type: 3}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: collects.Array.data[1]
value:
objectReference: {fileID: 8300000, guid: f4619d2d2a11b514396953c6b830e96a, type: 3}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: collects.Array.data[2]
value:
objectReference: {fileID: 8300000, guid: 41ca13291e693154f9c52cc61fa8f0b1, type: 3}
- target: {fileID: 5066009898101288189, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: collects.Array.data[3]
value:
objectReference: {fileID: 8300000, guid: 6fd6029be6f5306469f556ed61426750, type: 3}
- target: {fileID: 5313785517148740864, guid: 4c33e04fd77f2194bb2e29ce4f03f5a0,
type: 3}
propertyPath: m_Name
......@@ -45175,7 +45200,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 469985644, guid: 24f4214e71ba46046859b31f7dec5af4, type: 3}
propertyPath: m_LocalPosition.x
value: -0.000000030583724
value: -0.000000052935466
objectReference: {fileID: 0}
- target: {fileID: 469985645, guid: 24f4214e71ba46046859b31f7dec5af4, type: 3}
propertyPath: m_Follow
......@@ -45249,7 +45274,7 @@ PrefabInstance:
- target: {fileID: 7421222009779415704, guid: 24f4214e71ba46046859b31f7dec5af4,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.000000030583724
value: -0.000000052935466
objectReference: {fileID: 0}
- target: {fileID: 7421222010078394949, guid: 24f4214e71ba46046859b31f7dec5af4,
type: 3}
......@@ -49,7 +49,7 @@ public class IngameCollection_GuiFx : MonoBehaviour
elements[i].transform.DOScale(Vector3.one, 0.7f);
elements[i].transform.DOLocalMove(pos, 0.7f).SetEase(Ease.OutQuad);
}
OST.instance.PlayCollectSound();
yield return new WaitForSeconds(0.3f);
foreach (Image rect in elements)
{
......@@ -57,6 +57,7 @@ public class IngameCollection_GuiFx : MonoBehaviour
rect.transform.DOMove(target, 0.5f).SetEase(Ease.InQuad).OnComplete(() =>
{
rect.gameObject.SetActive(false);
OST.instance.PlayCollectSound();
//IndieGame.Manager.EffectManager.Instance.SpawnCollectionSound(transform.position);
StarSystem.instance.planet.explosionCount.IncreaseInitChildCount();
});
......
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