Exemplo n.º 1
0
        // BOLT

        public override void OnEvent(TotemWallHit evnt)
        {
            if (BoltNetwork.IsServer)
            {
                Debug.Log("TotemWallHit event received.");
                IncreaseScore(evnt.Team.ToTeam().OppositeTeam(), 1);
                SendScoreIncreasedEvent(evnt.Team.ToTeam().OppositeTeam());
            }
        }
Exemplo n.º 2
0
        // BOLT

        public override void OnEvent(TotemWallHit evnt)
        {
            /*
             * var scorerTeam = evnt.Team.ToTeam().OppositeTeam();
             * if (_kartRoot.isOwner && scorerTeam == _playerSettings.ColorSettings.TeamEnum)
             * {
             *  TeleportOnSpawn();
             * }
             */
            TeleportOnSpawn();
        }
Exemplo n.º 3
0
        public override void OnEvent(TotemWallHit evnt)
        {
            if (evnt.Team.ToTeam() == Team.Red)
            {
                _wallHitIterationRed++;
                switch (_wallHitIterationRed)
                {
                case 1:
                    _redStep1.Play();
                    PlayRandomCrowdSound();
                    break;

                case 2:
                    _redStep2.Play();
                    PlayRandomCrowdSound();
                    break;

                case 3:
                    _redStep4Win.Play();
                    _crowdStep4Win.Play();
                    break;
                }
            }
            else
            {
                _wallHitIterationBlue++;
                switch (_wallHitIterationBlue)
                {
                case 1:
                    _blueStep1.Play();
                    PlayRandomCrowdSound();
                    break;

                case 2:
                    _blueStep2.Play();
                    PlayRandomCrowdSound();
                    break;

                case 3:
                    _blueStep4Win.Play();
                    _crowdStep4Win.Play();
                    break;
                }
            }
        }
Exemplo n.º 4
0
        // PRIVATE

        private void LoseLife()
        {
            if (OnWallHit != null)
            {
                OnWallHit.Invoke(state.Lives); // Local event
            }

            if (entity.isAttached && entity.isOwner)
            {
                state.Lives--;

                foreach (var totemSpawn in FindObjectsOfType <TotemSpawner>())
                {
                    if (OwnerTeam == Team.Red && totemSpawn.RespawnSide == TotemSpawner.Side.Red)
                    {
                        totemSpawn.RespawnTotem();
                    }
                    else if (OwnerTeam == Team.Blue && totemSpawn.RespawnSide == TotemSpawner.Side.Blue)
                    {
                        totemSpawn.RespawnTotem();
                    }
                }

                TotemWallHit totemWallHitEvent = TotemWallHit.Create();
                totemWallHitEvent.Team = (int)OwnerTeam;
                totemWallHitEvent.Send();

                if (state.Lives <= 0)
                {
                    if (OnWallDestroyed != null)
                    {
                        OnWallDestroyed.Invoke(OwnerTeam);
                    }

                    BoltNetwork.Destroy(gameObject);
                }
            }
        }
Exemplo n.º 5
0
        // BOLT

        public override void OnEvent(TotemWallHit evnt)
        {
            CurrentTeam = evnt.Team.ToTeam();
            ChangeColor(_teamsList.GetSettings(evnt.Team.ToTeam()).ItemsColor);
            StartCoroutine(SecurityRoutine());
        }