private IEnumerator PopAtPeak(TimeBubbleSpawner spawner) { while (spawner.Age < 1) { yield return(null); } spawner.Detonate(); }
protected override void ExecuteSpecialB() { TimeBubbleLimits tbl = ClonePlayerTBL(); tbl.minTimeScaleMultiplier *= timeScaleMultiplier; tbl.maxTimeScaleMultiplier *= timeScaleMultiplier; StartCoroutine(PopAtPeak(TimeBubbleSpawner.Spawn(transform.position + MathLib.FromPolar(Player.Radius + TimeBubbleSpawner.Radius, Player.TurretAngle).ToVector3(), isSlowBubble, Player.TurretAngle, Player.shotSpeed, 2, tbl))); }
public static new void CheckLoadPrefab() { if (prefabBubble == null) { prefabBubble = Resources.Load <TimeBubble>("TimeBubble"); } if (prefabSpawner == null) { prefabSpawner = Resources.Load <TimeBubbleSpawner>("TimeBubbleSpawner"); } }
public static TimeBubbleSpawner Spawn(Vector3 position, bool isSlowBubble, float angle, float speed, float lifeTime, TimeBubbleLimits limits) { CheckLoadPrefab(); TimeBubbleSpawner output = Instantiate(prefabSpawner, position, Quaternion.Euler(0, 0, angle)) as TimeBubbleSpawner; output.speed = speed; output.angle = angle; output.isSlowBubble = isSlowBubble; output.lifeTime = lifeTime; output.limits = limits; return(output); }
protected TimeBubbleSpawner ShootSlowBubble() { AudioManager.PlayClipByName("Shot1"); return(TimeBubbleSpawner.Spawn(transform.position + MathLib.FromPolar(Radius + TimeBubbleSpawner.Radius, TurretAngle).ToVector3(), true, TurretAngle, shotSpeed, 5, timeBubbleLimits)); }