private static ExplosionsPack getPack() { foreach (ExplosionsPack ep in explosionsPacks) { if (!ep.onScene) { return(ep); } } ExplosionsPack pack = Instantiate <Transform>(explosionsPack).GetComponent <ExplosionsPack>(); pack.transform.parent = trans; pack.init(); explosionsPacks.Add(pack); return(pack); }
public Explosion init(ExplosionsPack pack) { this.pack = pack; anim = GetComponent <Animator>(); return(this); }
public static void playExplosion(Ship ship) { ExplosionsPack pack = getPack(); pack.play(ship); }