重做杂兵
This commit is contained in:
@@ -26,7 +26,6 @@ namespace Cielonos.MainGame
|
||||
public ItemBase itemSource;
|
||||
public List<Fraction> targetFractions;
|
||||
public Transform topParent;
|
||||
public AudioContainer audioContainer;
|
||||
public Collider areaCollider;
|
||||
public Dictionary<string, GameObject> functionalParts;
|
||||
|
||||
@@ -74,12 +73,6 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
//areaCollider.excludeLayers = LayerMask.GetMask("AttackAreaVFX", "DecoVFX", "Ignore Raycast");
|
||||
}
|
||||
|
||||
audioContainer = GetComponent<AudioContainer>();
|
||||
if (audioContainer != null)
|
||||
{
|
||||
audioContainer.soundEventDictionary = new Dictionary<string, AK.Wwise.Event>();
|
||||
}
|
||||
|
||||
while (topParent.parent != null &&
|
||||
//topParent.parent != creator.flexibleCenterPoint &&
|
||||
|
||||
@@ -145,13 +145,6 @@ namespace Cielonos.MainGame
|
||||
checkedObjects.Add(obj);
|
||||
}
|
||||
|
||||
public void PlayHitSound(Vector3 position, string soundName)
|
||||
{
|
||||
if (hitSoundList.Count == 0) return;
|
||||
|
||||
attackArea.audioContainer.PlaySoundFX(soundName, position);
|
||||
}
|
||||
|
||||
public void InvokeAllHitEvents(CharacterBase target, Vector3 hitPosition)
|
||||
{
|
||||
if (attackArea.canTriggerHitEvent)
|
||||
|
||||
@@ -114,11 +114,11 @@ namespace Cielonos.MainGame.Characters
|
||||
BattleManager.EnemySm.RemoveEnemy(this);
|
||||
float deathProcessTime = 0f;
|
||||
var deathFuncAnim = fullBodyFuncAnims.animDataList.Find(data => data.animInfo.animationName == "Death");
|
||||
if (deathFuncAnim is not null)
|
||||
if (deathFuncAnim != null)
|
||||
{
|
||||
animationSc.fullBodyFuncAnimSm.Play("Death");
|
||||
behaviorSc.mainBehaviorTree.StopBehavior();
|
||||
behaviorSc.navMeshAgent.isStopped = true;
|
||||
behaviorSc.navMeshAgent.enabled = false;
|
||||
collisionSc.DisableAllColliders();
|
||||
deathProcessTime = deathFuncAnim.animationClip.length;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
base.InitializeSubmodules();
|
||||
selfTimeSm.coolDownTimers["Attack"] = new Timer(5f);
|
||||
selfTimeSm.coolDownTimers["NormalAttack"] = new Timer(5f);
|
||||
selfTimeSm.coolDownTimers["Action"] = new Timer(4f);
|
||||
selfTimeSm.coolDownTimers["Dodge"] = new Timer(5f);
|
||||
selfTimeSm.coolDownTimers["Block"] = new Timer(5f);
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace Cielonos.MainGame.Characters
|
||||
bulletSpawnerTransform.forward = (player.centerPoint.position - bulletSpawnerTransform.position).normalized;
|
||||
|
||||
vfxData.SpawnMuzzleVFX("NormalBullet", bulletSpawnerTransform);
|
||||
audioSc.audioContainer.PlaySoundFX("NormalBullet_Shoot", bulletSpawnerTransform.position);
|
||||
//audioSc.audioContainer.PlaySoundFX("NormalBullet_Shoot", bulletSpawnerTransform.position);
|
||||
Projectile projectile = vfxData.SpawnVFX("NormalBullet", bulletSpawnerTransform).GetComponentInChildren<Projectile>();
|
||||
|
||||
projectile.Initialize(this, null, false, 1, Fraction.Player)
|
||||
@@ -198,7 +198,7 @@ namespace Cielonos.MainGame.Characters
|
||||
bulletSpawnerTransform.forward = (player.centerPoint.position - bulletSpawnerTransform.position).normalized;
|
||||
|
||||
vfxData.SpawnMuzzleVFX("ShockwaveMissile", bulletSpawnerTransform);
|
||||
audioSc.audioContainer.PlaySoundFX("ShockwaveMissile_Shoot", bulletSpawnerTransform.position);
|
||||
//audioSc.audioContainer.PlaySoundFX("ShockwaveMissile_Shoot", bulletSpawnerTransform.position);
|
||||
Projectile projectile = vfxData.SpawnVFX("ShockwaveMissile", bulletSpawnerTransform).GetComponentInChildren<Projectile>();
|
||||
|
||||
projectile.Initialize(this, null, false, 1, Fraction.Player)
|
||||
@@ -220,7 +220,7 @@ namespace Cielonos.MainGame.Characters
|
||||
bulletSpawnerTransform.forward = (player.centerPoint.position - bulletSpawnerTransform.position).normalized;
|
||||
|
||||
vfxData.SpawnMuzzleVFX("PiercingBullet", bulletSpawnerTransform);
|
||||
audioSc.audioContainer.PlaySoundFX("PiercingBullet_Shoot", bulletSpawnerTransform.position);
|
||||
//audioSc.audioContainer.PlaySoundFX("PiercingBullet_Shoot", bulletSpawnerTransform.position);
|
||||
Projectile projectile = vfxData.SpawnVFX("PiercingBullet", bulletSpawnerTransform).GetComponentInChildren<Projectile>();
|
||||
|
||||
projectile.Initialize(this, null, false, 1, Fraction.Player)
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
float distanceVelocity = navMeshAgent.velocity.magnitude;
|
||||
float angularVelocity = Vector3.Angle(lastDirection, transform.forward) / owner.selfTimeSm.DeltaTime;
|
||||
moveSpeedZ.targetValue = distanceVelocity + (angularVelocity * 0.1f);
|
||||
moveSpeedZ.targetValue = distanceVelocity + (angularVelocity * 0.02f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -6,12 +6,11 @@ namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
public class AudioSubcontroller : SubcontrollerBase<CharacterBase>
|
||||
{
|
||||
public AudioContainer audioContainer;
|
||||
//public AudioContainer audioContainer;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
audioContainer ??= owner.GetComponent<AudioContainer>();
|
||||
}
|
||||
|
||||
public void PlayFootStepSound(AnimationEvent animationEvent)
|
||||
|
||||
@@ -151,11 +151,32 @@ namespace Cielonos.MainGame.Characters.Inventory.Collections
|
||||
return;
|
||||
}
|
||||
|
||||
List<CharacterBase> availableEnemies = BattleManager.EnemySm.GetEnemiesInRadius(player.transform.position, 5);
|
||||
|
||||
//完美格挡+反击
|
||||
if (player.reactionSc.blockSm.afterPerfectBlockTimer > 0)
|
||||
{
|
||||
player.reactionSc.blockSm.afterPerfectBlockTimer = 0;
|
||||
CharacterBase target = BattleManager.EnemySm.GetNearestEnemy(availableEnemies);
|
||||
PlayTargetedAnimation("BlockParryAttack", target);
|
||||
RemoveBlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.reactionSc.blockSm.HaveBlockSource(blockData.blockName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//完美闪避+反击
|
||||
if (player.reactionSc.dodgeSm.afterPerfectDodgeTimer > 0)
|
||||
{
|
||||
player.reactionSc.dodgeSm.afterPerfectDodgeTimer = 0;
|
||||
CharacterBase target = BattleManager.EnemySm.GetNearestEnemy(12);
|
||||
PlayTargetedAnimation("DodgeParryAttack", target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.landMovementSc.isJumping)
|
||||
{
|
||||
if (!_canAirHeavyAttack || !functionSm["HeavyAttack"].IsAvailable())
|
||||
@@ -174,7 +195,6 @@ namespace Cielonos.MainGame.Characters.Inventory.Collections
|
||||
return;
|
||||
}
|
||||
|
||||
List<CharacterBase> availableEnemies = BattleManager.EnemySm.GetEnemiesInRadius(player.transform.position, 5);
|
||||
if (player.inputSc.IsHoldingSpecialA && functionSm["HeavyAttack"].IsAvailable())
|
||||
{
|
||||
CharacterBase target = BattleManager.EnemySm.GetNearestEnemy(availableEnemies);
|
||||
@@ -210,24 +230,6 @@ namespace Cielonos.MainGame.Characters.Inventory.Collections
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//完美格挡+反击
|
||||
if (player.reactionSc.blockSm.afterPerfectBlockTimer > 0)
|
||||
{
|
||||
player.reactionSc.blockSm.afterPerfectBlockTimer = 0;
|
||||
CharacterBase target = BattleManager.EnemySm.GetNearestEnemy(availableEnemies);
|
||||
PlayTargetedAnimation("BlockParryAttack", target);
|
||||
return;
|
||||
}
|
||||
|
||||
//完美闪避+反击
|
||||
if (player.reactionSc.dodgeSm.afterPerfectDodgeTimer > 0)
|
||||
{
|
||||
player.reactionSc.dodgeSm.afterPerfectDodgeTimer = 0;
|
||||
CharacterBase target = BattleManager.EnemySm.GetNearestEnemy(12);
|
||||
PlayTargetedAnimation("DodgeParryAttack", target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (functionSm["HeavyAttack"].IsAvailable())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user