Reset() public method

public Reset ( Vector2 startPos, bool behindMap ) : void
startPos Vector2
behindMap bool
return void
示例#1
0
        private void OnPlayerDeath(CharacterController characterController, bool behindScreen)
        {
            Screen.soundController.PlaySound("Game/death");
            Vector2 pos         = characterController.model.position;
            int     playerIndex = characterController.model.playerIndex;

            int gotKilled = characterController.model.playerIndex;

            int killer;

            if (players[gotKilled].GotKilled(out killer))
            {
                //Removes powerup from player
                powerUps.RemovePowerUp(gotKilled);
                //Updates killer
                players[killer].Killed(gotKilled);
                characterController.Reset(map.CurrentMap.startingPosition[resetPos], behindScreen);
                if (resetPos == 3)
                {
                    resetPos = 0;
                }
                else
                {
                    resetPos++;
                }
            }
            else
            {
                camera.RemoveCharacterTarget(characterController);
                RemoveController(characterController);
            }
        }
示例#2
0
        private void OnPlayerDeath(CharacterController characterController, bool behindScreen)
        {
            Screen.soundController.PlaySound("Game/death");
            Vector2 pos = characterController.model.position;
            int playerIndex = characterController.model.playerIndex;

            int gotKilled = characterController.model.playerIndex;

            int killer;
            if (players[gotKilled].GotKilled(out killer))
            {
                //Removes powerup from player
                powerUps.RemovePowerUp(gotKilled);
                //Updates killer
                players[killer].Killed(gotKilled);
                characterController.Reset(map.CurrentMap.startingPosition[resetPos], behindScreen);
                if (resetPos == 3) resetPos = 0;
                else resetPos++;
            }
            else
            {
                camera.RemoveCharacterTarget(characterController);
                RemoveController(characterController);
            }
        }