public static new void CheckLoadPrefab() { if (PrefabMissile == null) { PrefabMissile = Resources.Load <PinMissile>("PinMissile"); } }
public static PinMissile Spawn(Vector3 position, float angle, float speed, float lifeSpan, float knockbackStrength, float knockBackDuration) { CheckLoadPrefab(); PinMissile output = Instantiate(PrefabMissile, position, Quaternion.Euler(0, 0, angle)) as PinMissile; output.speed = speed; output.angle = angle; output.lifeTime = lifeSpan; output.KnockbackStrength = knockbackStrength; output.knockbackDuration = knockBackDuration; return(output); }
protected override void ExecuteSpecialY() { AudioManager.PlayClipByName("Shot2"); PinMissile.Spawn(transform.position + MathLib.FromPolar(Player.Radius + Bullet.Radius, Player.TurretAngle).ToVector3(), Player.TurretAngle, missileSpeed, missileDragTime, missileSpeed, missileDragTime); }