// Use this for initialization void Start() { bp = FindObjectOfType <BallProvider>(); gs = FindObjectOfType <GameSession>(); Physics.gravity = new Vector3(0, bp.gameSpeed, 0); ballColor[0] = new Color(220f / 255f, 0f / 255f, 196f / 255f); //pink ballColor[1] = new Color(0f / 255f, 6f / 255f, 228f / 255f); //blue ballColor[2] = new Color(204f / 255f, 0f / 255f, 0f / 255f); //red ballColor[3] = new Color(6f / 255f, 206f / 255f, 0f / 255f); //green int randomArr = Random.Range(0, ballColor.Length); transform.GetComponent <SpriteRenderer>().color = ballColor[randomArr]; if (randomArr == 0) { tag = "pink"; } else if (randomArr == 1) { tag = "blue"; } else if (randomArr == 2) { tag = "red"; } else if (randomArr == 3) { tag = "green"; } else { tag = "bug"; } }
public Match() { m_ball = BallProvider.GetBall(); m_messageInterpreter = new MessageInterpreter(); m_physics = new ssg.Physics.SoccerPhysics(m_ball); m_physics.AddCollider(((Ball)m_ball).Collider); var playersProvider = new PlayersProvider(); var players = playersProvider.GetPlayers(this); SetPlayers(players); }