51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
using Cielonos.MainGame.Inventory;
|
|
using Cielonos.MainGame.UI;
|
|
using SLSUtilities.FunctionalAnimation;
|
|
using SLSUtilities.General;
|
|
using SLSUtilities.WwiseAssistance;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Characters
|
|
{
|
|
public partial class L2_Assault_Stinger : Enemy
|
|
{
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
PlayerCanvas.EnemyInfoUIArea.CreateInfoUnit(this);
|
|
}
|
|
}
|
|
|
|
public partial class L2_Assault_Stinger
|
|
{
|
|
private void FAPF_GenerateBullet(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateProjectile(p.str0, attackData[p.str1], player, 10);
|
|
}
|
|
}
|
|
|
|
public partial class L2_Assault_Stinger
|
|
{
|
|
private void GenerateProjectile(string vfxName, AttackUnit attackUnit, CharacterBase target, float speed)
|
|
{
|
|
Transform muzzle = this.bodyPartsSc.GetPart("Muzzle");
|
|
vfxData.SpawnMuzzleVFX(vfxName, this, muzzle);
|
|
|
|
Projectile projectile = vfxData.SpawnVFX(vfxName, this, muzzle).GetComponentInChildren<Projectile>();
|
|
Vector3 direction = this.transform.forward.Flatten();
|
|
if (target != null)
|
|
{
|
|
direction = (target.centerPoint.position - projectile.transform.position).normalized;
|
|
}
|
|
|
|
projectile.Initialize(this, null, false, 1, Fraction.Player)
|
|
.SetAttackSubmodule<Projectile>(attackUnit)
|
|
.SetTimeSubmodule<Projectile>(10f)
|
|
.SetHitSubmodule<Projectile>()
|
|
.SetLinearDirectionMoveModule<Projectile>(direction, speed)
|
|
.SetRaycastSubmodule<Projectile>(default, 0.25f, 0.5f)
|
|
.SetReactionSubmodule<Projectile>(true, false, false, true, false, false, true);
|
|
}
|
|
}
|
|
} |