Exemple #1
0
 public void AddScore(TeamMember teamMember, int score)
 {
     _display.text        = "Player" + teamMember.GetPlayerID() + " scored!";
     _display.color       = teamMember.GetColor();
     _displayTimer        = 5f;
     _scores[teamMember] += score;
 }
Exemple #2
0
        public void SetLastTouched(TeamMember teamMember)
        {
            _lastTouched = teamMember;
            Color color = _lastTouched == null ? Color.white : _lastTouched.GetColor();

            _particleMain.startColor         = color;
            _particleTrail.colorOverTrail    = color;
            _particleTrail.colorOverLifetime = color;

            _colorableMaterial.SetColor("_EmissionColor", color);
        }
        private void Start()
        {
            _teamMember = GetComponent <TeamMember>();

            InputManager.Instance.BindAxis("PartyPopper_Movement_Horizontal" + _teamMember.GetPlayerID(), _teamMember.GetPlayerID(), ControllerAxisCode.LeftStickX);
            InputManager.Instance.BindAxis("PartyPopper_Movement_Vertical" + _teamMember.GetPlayerID(), _teamMember.GetPlayerID(), ControllerAxisCode.LeftStickY);
            InputManager.Instance.BindAxis("PartyPopper_Movement_LTrigger" + _teamMember.GetPlayerID(), _teamMember.GetPlayerID(), ControllerAxisCode.LeftTrigger);
            InputManager.Instance.BindAxis("PartyPopper_Movement_RTrigger" + _teamMember.GetPlayerID(), _teamMember.GetPlayerID(), ControllerAxisCode.RightTrigger);

            _rigidBody           = GetComponent <Rigidbody>();
            _kickForceMultiplier = 0;
            _movement            = Vector3.zero;
            _touchingBall        = null;

            // Registering the OnScore function to the Score event of each goal in the scene.
            GameObject[] goalObjects = GameObject.FindGameObjectsWithTag(Tag.GOAL.GetTagId());
            foreach (GameObject goalObject in goalObjects)
            {
                Goal goal = goalObject.GetComponent <Goal>();
                goal.TeamMemberScoredEvent += OnScore;
            }

            _playerCircle.GetComponent <Renderer>().material.color = _teamMember.GetColor();
        }
Exemple #4
0
 private void Start()
 {
     _yPos = transform.position.y;
     GetComponent <Renderer>().material.color = _player.GetColor();
 }