Rewrited attack sound execution
This commit is contained in:
parent
e652cd6f9d
commit
6a8df0fe5f
@ -73465,7 +73465,7 @@ AnimationClip:
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events:
|
||||
- time: 0.43333334
|
||||
- time: 0.33333334
|
||||
functionName: Step
|
||||
data:
|
||||
objectReferenceParameter: {fileID: 0}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -200,7 +200,7 @@ AnimatorState:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Attack
|
||||
m_Speed: 1
|
||||
m_Speed: 2
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -7332425835987097042}
|
||||
|
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ef86a7fd23f3f604d945074968fd7063, type: 3}
|
||||
m_Name: StandartAttack
|
||||
m_EditorClassIdentifier:
|
||||
duration: 0.5
|
||||
duration: 0.4
|
||||
distance: 1
|
||||
actionType: 1
|
||||
standartAttackPref: {fileID: 8121987183708165570, guid: a69f2bfc3db12bf429b2420ae3b5ca1d,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20,13 +20,19 @@ public class Attack : PlayerAction
|
||||
return permission;
|
||||
}
|
||||
|
||||
public override void StartActionOperations(TileInfo targetTile, PlayerState currentPlayer)
|
||||
{
|
||||
base.StartActionOperations(targetTile, currentPlayer);
|
||||
//currentPlayer.GetComponent<AudioController>().PlaySound(throw_SFX);
|
||||
|
||||
}
|
||||
|
||||
public override void Impact(TileInfo targetTile, PlayerState currentPlayer)
|
||||
{
|
||||
base.Impact(targetTile, currentPlayer);
|
||||
Vector3 direction = targetTile.tilePosition - currentPlayer.currentTile.tilePosition;
|
||||
InitAttack(currentPlayer.currentTile.tilePosition, direction, currentPlayer.ownerIndex);
|
||||
|
||||
currentPlayer.GetComponent<AudioController>().PlaySound(throw_SFX);
|
||||
//currentPlayer.GetComponent<AudioController>().PlaySound(throw_SFX);
|
||||
}
|
||||
|
||||
private void InitAttack(Vector3 startPosition, Vector3 direction, TileOwner projOwner)
|
||||
|
@ -6,7 +6,7 @@ public class AudioController : MonoBehaviour
|
||||
{
|
||||
public List<AudioClip> jump_SFXs;
|
||||
public List<AudioClip> capture_SFXs;
|
||||
public AudioClip hit_SFX;
|
||||
public AudioClip hit_SFX, throw_SFX;
|
||||
|
||||
[SerializeField] private AudioSource ac;/* capSrc, hitSrc, collectSrc;*/
|
||||
|
||||
@ -42,6 +42,12 @@ public class AudioController : MonoBehaviour
|
||||
ac.volume = _startVolume;
|
||||
ac.PlayOneShot(clip);
|
||||
}
|
||||
public void PlayAttackSound()
|
||||
{
|
||||
ac.volume = _startVolume;
|
||||
ac.PlayOneShot(throw_SFX);
|
||||
}
|
||||
|
||||
|
||||
public void PlaySound(AudioClip clip)
|
||||
{
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FootStepsSound : MonoBehaviour
|
||||
public class CharAnimSound : MonoBehaviour
|
||||
{
|
||||
private AudioController _controller;
|
||||
private void Start()
|
||||
@ -14,4 +14,10 @@ public class FootStepsSound : MonoBehaviour
|
||||
{
|
||||
_controller.PlayJumpSound();
|
||||
}
|
||||
|
||||
|
||||
public void Attack()
|
||||
{
|
||||
_controller.PlayAttackSound();
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f004223755ee0f445aad5f3731cda741
|
||||
guid: 4f17b3116b7cc98478f5665cf12a6c64
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user