Exemplo n.º 1
0
 public HasBall(SoccerPlayer player, TeamManagement team, BallGoal ballGoal, Rigidbody2D ball)
 {
     _player       = player;
     _team         = team;
     _goal         = ballGoal;
     _ball         = ball;
     ballPredictor = _ball.GetComponent <PhysicsPredictor>();
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     ballRigidbody2d        = GameObject.FindWithTag("Ball").GetComponent <Rigidbody2D>();
     ballPredictor          = GameObject.FindWithTag("Ball").GetComponent <PhysicsPredictor>();
     ballGoal               = GameObject.FindWithTag("Ball").GetComponent <BallGoal>();
     teamPlayerRigidbody2ds = GetComponentsInChildren <Rigidbody2D>();
     teamPlayers            = GetComponentsInChildren <SoccerPlayer>();
     //AssignBallToPlayer();
     _updateScoreboard();
 }