2021-01-05 02:56:17 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
2021-01-25 05:53:36 +00:00
|
|
|
|
public class LaserManager : InstantWeaponEffectManager
|
2021-01-05 02:56:17 +00:00
|
|
|
|
{
|
|
|
|
|
|
public Prototype ProjectilePrototype;
|
|
|
|
|
|
|
2021-01-31 03:52:32 +00:00
|
|
|
|
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target)
|
2021-01-05 02:56:17 +00:00
|
|
|
|
{
|
2021-01-25 05:53:36 +00:00
|
|
|
|
var p = ProjectilePrototype.Instantiate<Laser>();
|
2021-01-05 02:56:17 +00:00
|
|
|
|
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
|
|
|
|
|
var barrel = source.GetBarrel(hp);
|
2021-01-25 05:53:36 +00:00
|
|
|
|
var t = p.transform;
|
|
|
|
|
|
t.SetParent(barrel);
|
|
|
|
|
|
t.forward = barrel.forward;
|
|
|
|
|
|
t.position = barrel.position;
|
2021-01-31 03:52:32 +00:00
|
|
|
|
p.SourceEntity = source.Entity;
|
2026-06-25 18:09:33 +01:00
|
|
|
|
p.ZoneRenderer = source.ZoneRenderer;
|
2021-01-31 03:52:32 +00:00
|
|
|
|
p.Range = weapon.Range;
|
2026-07-05 19:36:19 +01:00
|
|
|
|
p.ImpactIntensity = 1;
|
2021-01-05 02:56:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|