Exemple #1
0
        public override void OnStartAuthority()
        {
            enabled = true;

            engine = GetComponent <CarEngine>();
            brake  = GetComponent <BrakeManager>();
            boost  = GetComponent <Turbo>();
            car    = GetComponent <Car>();

            InputManager.Controls.Player.Move.performed += ctx => SetMovement(ctx.ReadValue <Vector2>());
            InputManager.Controls.Player.Move.canceled  += _ => StopMovement();

            InputManager.Controls.Player.Boost.performed += _ => StartBoost();
            InputManager.Controls.Player.Boost.canceled  += _ => StopBoost();

            InputManager.Controls.Player.Flip.performed += _ => Flip();
        }
Exemple #2
0
        // Start is called before the first frame update
        public override void OnStartAuthority()
        {
            car       = GetComponentInChildren <Car>();
            engine    = GetComponentInChildren <CarEngine>();
            brakes    = GetComponentInChildren <BrakeManager>();
            turbo     = GetComponentInChildren <Turbo>();
            colliders = GetComponentInChildren <CarCollider>();
            chat      = GetComponent <ChatBehavior>();

            chat.enabled      = true;
            car.enabled       = true;
            engine.enabled    = true;
            brakes.enabled    = true;
            turbo.enabled     = true;
            colliders.enabled = true;

            car.SetEngineOn(true);
        }