public override void Apply(FireableInfo fi) { for (int i = 0; i < fi.bullets.Count; i++) { DanmakuState dc = fi.bulletsConfig[i]; dc.speed += accel; fi.bulletsConfig[i] = dc; } }
public override void Fire(FireableInfo fireableInfo, DanmakuConfig config) { int c = Mathf.RoundToInt(count.GetValue()); var dSpeed = deltaSpeed.GetValue(); for (var i = 0; i < c; i++) { config.speed += dSpeed; SubFire(fireableInfo, config); } }
public override void Tick(FireableInfo fi) { for (int i = 0; i < fi.bullets.Count; i++) { DanmakuState ds = fi.bulletsConfig[i]; if (ds.speed.z > 0) { ds.speed.z -= damp; if (ds.speed.z < 0) { ds.speed.z = 0; } } fi.bulletsConfig[i] = ds; } }
public override void Fire(FireableInfo fireableInfo, DanmakuConfig config) { float r = radius.GetValue(); int c = Mathf.RoundToInt(count.GetValue()); var rotation = config.rotation; var origin = config.position; config.rotation = rotation; for (int i = 0; i < c; i++) { float angle = i * Mathf.PI * 2 / c; float x = Mathf.Cos(angle) * r; float z = Mathf.Sin(angle) * r; Vector3 pos = origin + new Vector3(x, 0, z); //float angleDegrees = -angle * Mathf.Rad2Deg; //Quaternion rot = Quaternion.Euler(0, angleDegrees, 0); config.position = Helpers.RotatePointAroundPivot(pos, origin, rotation); config.rotation = rotation; SubFire(fireableInfo, config); } }
public virtual void Tick(FireableInfo fi) { }
public virtual void Apply(FireableInfo fi) { }