Пример #1
0
        public override void _Ready()
        {
            _fadeTransition = GetNode <ColorRect>("Fade");
            _fadeTransition.Show();

            _animationPlayer = _fadeTransition.GetNode <AnimationPlayer>("AnimationPlayer");
            _animationPlayer.Connect("animation_finished", this, nameof(SwitchScene));
        }
Пример #2
0
    public override void _Ready()
    {
        MouseSensitivity = MaxMouseSensitivity;

        _head              = GetNode <Spatial>("Head");
        _cam               = GetNode <Camera>("Head/Camera");
        _flashlight        = GetNode <SpotLight>("Head/Flashlight");
        _interactRayCast   = GetNode <RayCast>("Head/InteractRayCast");
        _batteryTimer      = GetNode <Timer>("BatteryTimer");
        _settingsPage      = GetNode <ColorRect>("/root/World/HUD/Settings");
        _sensitivitySlider = _settingsPage.GetNode <HSlider>("SensitivitySlider");

        Speed = MaxSpeed;

        _batteryTimer.Connect("timeout", this, nameof(DrainBattery));

        Input.SetMouseMode(Input.MouseMode.Captured);
    }