2021-03-27 10:03:24 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2021-01-30 01:02:11 +00:00
|
|
|
public class HitscanManager : InstantWeaponEffectManager
|
|
|
|
|
{
|
|
|
|
|
public Prototype Prototype;
|
2021-01-31 03:52:32 +00:00
|
|
|
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target)
|
2021-01-30 01:02:11 +00:00
|
|
|
{
|
|
|
|
|
var p = Prototype.Instantiate<HitscanEffect>();
|
|
|
|
|
p.SourceEntity = source.Entity;
|
2026-06-25 18:09:33 +01:00
|
|
|
p.ZoneRenderer = source.ZoneRenderer;
|
2021-01-30 01:02:11 +00:00
|
|
|
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
|
|
|
|
var barrel = source.GetBarrel(hp);
|
|
|
|
|
var t = p.transform;
|
2021-03-27 10:03:24 +00:00
|
|
|
t.SetParent(barrel, false);
|
|
|
|
|
t.localRotation = Quaternion.identity;
|
|
|
|
|
t.localPosition = Vector3.zero;
|
|
|
|
|
// t.position = barrel.position;
|
|
|
|
|
// t.forward = barrel.forward;
|
|
|
|
|
p.Range = weapon.Range;
|
2026-07-05 19:36:19 +01:00
|
|
|
p.ImpactIntensity = 1;
|
2021-01-30 01:02:11 +00:00
|
|
|
p.Fire();
|
|
|
|
|
}
|
2026-06-14 17:37:51 +01:00
|
|
|
}
|