Exemplo n.º 1
0
        public RacePlayer(Ball ball)
        {
            sr = StageReferences.Active;

            lap = 1;

            ball.CanMove           = false;
            ball.CheckpointPassed += Ball_CheckpointPassed;
            ball.RespawnRequested += Ball_RespawnRequested;
            if (ball.isLocalPlayer)
            {
                ball.SwitchCamerasEvent += Ball_SwitchCameraRequest;
            }

            currentCheckpointPos = sr.checkpoints[0].transform.position;
            this.ball            = ball;

            ball.CameraCreatedEvent += (sender, e) =>
            {
                ballCamera    = e.CameraCreated2;
                oldBallCamera = e.OldCamera2;
                newBallCamera = e.NewCamera2;

                ballCamera.SetDirection(sr.checkpoints[0].transform.rotation);
            };

            checkpointTimes = new float[StageReferences.Active.checkpoints.Length];

            SetNextCheckpoint();
        }
Exemplo n.º 2
0
 private void Awake()
 {
     Active = this;
 }