GUNS GUNS GUNS
GUESS WHAT
This commit is contained in:
parent
1e273d691e
commit
8aaccac2b5
83 changed files with 15291 additions and 1291 deletions
29
Assets/GuidedProjectileManager.cs
Normal file
29
Assets/GuidedProjectileManager.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GuidedProjectileManager : MonoBehaviour
|
||||
{
|
||||
public Prototype ProjectilePrototype;
|
||||
|
||||
public void Launch(LauncherData data, EquippedItem item, EntityInstance source, EntityInstance target)
|
||||
{
|
||||
var p = ProjectilePrototype.Instantiate<GuidedProjectile>();
|
||||
p.Source = source.Transform;
|
||||
p.SourceEntity = source.Entity;
|
||||
p.Target = target.Transform;
|
||||
p.Frequency = data.DodgeFrequency;
|
||||
p.Thrust = source.Entity.ItemManager.Evaluate(data.Thrust, item.EquippableItem, source.Entity);
|
||||
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
||||
var barrel = source.GetBarrel(hp);
|
||||
p.transform.position = barrel.position;
|
||||
p.Velocity = barrel.forward * source.Entity.ItemManager.Evaluate(data.LaunchSpeed, item.EquippableItem, source.Entity);
|
||||
p.Damage = source.Entity.ItemManager.Evaluate(data.Damage, item.EquippableItem, source.Entity);
|
||||
p.DamageType = data.DamageType;
|
||||
p.GuidanceCurve = data.GuidanceCurve.ToCurve();
|
||||
p.LiftCurve = data.LiftCurve.ToCurve();
|
||||
p.ThrustCurve = data.ThrustCurve.ToCurve();
|
||||
p.Thrust = source.Entity.ItemManager.Evaluate(data.Thrust, item.EquippableItem, source.Entity);
|
||||
p.TopSpeed = source.Entity.ItemManager.Evaluate(data.MissileSpeed, item.EquippableItem, source.Entity);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue