Skip to content
Snippets Groups Projects
Commit 3c212fdd authored by Gard Aleksander Furre's avatar Gard Aleksander Furre
Browse files

fixed audio source with basicprojectile sound

parent 59b65ff4
No related branches found
No related tags found
2 merge requests!63Main,!61Gardaf
...@@ -18,7 +18,7 @@ namespace BigSock { ...@@ -18,7 +18,7 @@ namespace BigSock {
public float AttackSpeed => Stats.AttackSpeed; public float AttackSpeed => Stats.AttackSpeed;
public float baseAttackSpeed = 1; public float baseAttackSpeed = 1;
private AudioSource[] source; public AudioSource[] source;
public AudioClip TakeDamageAudio; public AudioClip TakeDamageAudio;
/* /*
......
...@@ -15,7 +15,8 @@ namespace BigSock { ...@@ -15,7 +15,8 @@ namespace BigSock {
public class BasicProjectile1 : BaseAttack { public class BasicProjectile1 : BaseAttack {
//protected static readonly GameObject PROJECTILE_BASE = new AttackMovement(); //protected static readonly GameObject PROJECTILE_BASE = new AttackMovement();
public const string PROJECTILE_NAME = "bullets/basicsquarebullet"; public const string PROJECTILE_NAME = "bullets/basicsquarebullet";
public const string AUDIO_PATH = "The Essential Retro Video Game Sound Effects Collection [512 sounds] By Juhani Junkala/Death Screams/Alien/sfx_deathscream_alien1"; public const string AUDIO_PATH = "The Essential Retro Video Game Sound Effects Collection [512 sounds] By Juhani Junkala/Weapons/Melee/sfx_wpn_punch3";
public override ulong Id => 101; public override ulong Id => 101;
...@@ -59,7 +60,7 @@ namespace BigSock { ...@@ -59,7 +60,7 @@ namespace BigSock {
bulletScript.Direction = (target.Value - (Vector2) actor.transform.position).normalized; bulletScript.Direction = (target.Value - (Vector2) actor.transform.position).normalized;
// Play sound effect // Play sound effect
var source = actor.source; var source = actor.source[0];
var audioClip = AudioService.SINGLETON.Get(AUDIO_PATH); var audioClip = AudioService.SINGLETON.Get(AUDIO_PATH);
if (source != null && audioClip != null) { if (source != null && audioClip != null) {
source.clip = audioClip; source.clip = audioClip;
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7113940451868526258
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7113940451868526256}
- component: {fileID: 7113940451868526259}
m_Layer: 0
m_Name: backgroundMusic
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7113940451868526256
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7113940451868526258}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 9.668067, y: 2.2499247, z: 0.22078483}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &7113940451868526259
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7113940451868526258}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: ae3f4e0c57ec5dc4db5c797621c02302, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.154
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
fileFormatVersion: 2
guid: d1bdff0715a06334f89add2380e94407
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment