Cannon Shoot SFX
This commit is contained in:
parent
b7197e7807
commit
c1da237e8a
@ -210,6 +210,10 @@ PrefabInstance:
|
|||||||
propertyPath: cannon
|
propertyPath: cannon
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 1100404441491063361}
|
objectReference: {fileID: 1100404441491063361}
|
||||||
|
- target: {fileID: 1832045534445164820, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: audioSource
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 407005441095995345}
|
||||||
- target: {fileID: 6969840675257017921, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
- target: {fileID: 6969840675257017921, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
propertyPath: m_LocalScale.y
|
propertyPath: m_LocalScale.y
|
||||||
value: 1
|
value: 1
|
||||||
@ -218,6 +222,34 @@ PrefabInstance:
|
|||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.size
|
||||||
|
value: 17
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[14].m_ActionId
|
||||||
|
value: ce1dffb7-3600-4c58-a12a-ce124ef1ddd0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[15].m_ActionId
|
||||||
|
value: 4a73fe5c-a8b1-48a9-8377-e4d9941b4e32
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[16].m_ActionId
|
||||||
|
value: d392a866-be73-4182-8081-9878fbdc19c8
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[14].m_ActionName
|
||||||
|
value: Player/Dimension1[/Keyboard/1]
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[15].m_ActionName
|
||||||
|
value: Player/Dimension2[/Keyboard/2]
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6969840675499469968, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
propertyPath: m_ActionEvents.Array.data[16].m_ActionName
|
||||||
|
value: Player/Dimension3[/Keyboard/3]
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6969840675499469969, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
- target: {fileID: 6969840675499469969, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
value: 0
|
value: 0
|
||||||
@ -285,6 +317,107 @@ GameObject:
|
|||||||
m_CorrespondingSourceObject: {fileID: 1530449394259395294, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
m_CorrespondingSourceObject: {fileID: 1530449394259395294, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
m_PrefabInstance: {fileID: 1907366388580565151}
|
m_PrefabInstance: {fileID: 1907366388580565151}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &8845503654399814665 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 6969840675499469974, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1907366388580565151}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!82 &407005441095995345
|
||||||
|
AudioSource:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8845503654399814665}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 4
|
||||||
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
|
m_audioClip: {fileID: 8300000, guid: 58db08c1de711734587c1dfa42bb1754, type: 3}
|
||||||
|
m_PlayOnAwake: 0
|
||||||
|
m_Volume: 1
|
||||||
|
m_Pitch: 1
|
||||||
|
Loop: 0
|
||||||
|
Mute: 0
|
||||||
|
Spatialize: 0
|
||||||
|
SpatializePostEffects: 0
|
||||||
|
Priority: 128
|
||||||
|
DopplerLevel: 1
|
||||||
|
MinDistance: 1
|
||||||
|
MaxDistance: 500
|
||||||
|
Pan2D: 0
|
||||||
|
rolloffMode: 1
|
||||||
|
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: 1
|
||||||
|
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
|
||||||
--- !u!4 &8845503654399814670 stripped
|
--- !u!4 &8845503654399814670 stripped
|
||||||
Transform:
|
Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 6969840675499469969, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
m_CorrespondingSourceObject: {fileID: 6969840675499469969, guid: 486166ffed264a842ab4bc0affec38c4, type: 3}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public class CannonScript : MonoBehaviour
|
|||||||
private Vector3 lookDir;
|
private Vector3 lookDir;
|
||||||
private Vector3[] offsets;
|
private Vector3[] offsets;
|
||||||
[SerializeField]private int bullets;
|
[SerializeField]private int bullets;
|
||||||
|
[SerializeField] private AudioSource audioSource;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
@ -48,6 +49,7 @@ public class CannonScript : MonoBehaviour
|
|||||||
proj.GetComponent<Projectile>().SetDamage(damage);
|
proj.GetComponent<Projectile>().SetDamage(damage);
|
||||||
proj.GetComponent<Rigidbody>().AddForce(cannonForce * lookDir, ForceMode.Impulse);
|
proj.GetComponent<Rigidbody>().AddForce(cannonForce * lookDir, ForceMode.Impulse);
|
||||||
proj.layer = GameManager.Instance.GetCurrentLayerID();
|
proj.layer = GameManager.Instance.GetCurrentLayerID();
|
||||||
|
SoundManager.Instance.PlaySfx(audioSource);
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
if (Physics.Raycast(transform.position, lookDir, out hit, Mathf.Infinity, GameManager.Instance.GetCurrentDimensionLayerMask()))
|
if (Physics.Raycast(transform.position, lookDir, out hit, Mathf.Infinity, GameManager.Instance.GetCurrentDimensionLayerMask()))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user