public override void OnPointerUp(Vector2 point) { foreach (var bullet in bulletPositions) { float velocityx = Random.Range(VelocityXRange.x, VelocityXRange.y); var velocity = Velocity + new Vector2(velocityx, 0); var ball = new TestBall(new BallCollisionEffect(), oneBulletCost, radius, velocity); Vector3 position = (Vector3)point + bullet.localPosition; ButtleSystem.Breakout.AddBall(ball, position, Quaternion.identity); } _cost -= _oneShotCost; }
public void Update() { _timeMemo -= Time.deltaTime; if (_timeMemo < 0) { _timeMemo += timeSpan; for (int i = 0; i < N; i++) { var velocity = new Vector2(GetRand(VelocityX), GetRand(VelocityY)); var radius = GetRand(Radius); var ball = new TestBall(collisionEffect, 5, radius, velocity); ButtleSystem.Breakout.AddBall(ball, transform.position, Quaternion.identity); } } }