Esempio n. 1
0
        void CommandBuildToggle()
        {
            if (IsUserInBuildMode)
            {
                freeCam.DisableFreecam();
                ui.Close();
                builder.Cleanup();

                input.EnableKey(0, 37);
                input.EnableKey(0, 261);
                input.EnableKey(0, 262);

                IsUserInBuildMode = false;
            }
            else
            {
                freeCam.EnableFreecam();

                input.DisableKey(0, 37);
                input.DisableKey(0, 261);
                input.DisableKey(0, 262);

                IsUserInBuildMode = true;
            }
        }
Esempio n. 2
0
        public override void OnStateEnter()
        {
            //@TODO(bma) #input: Can we _not_ register_ every key we need and assign this dynamically? Making it a bit more friendly to use.
            Input input = MapBuilderClient.Locator.GetService <Input>();

            input.RegisterKey(0, 32, InputKeyType.Continuous);
            input.RegisterKey(0, 33, InputKeyType.Continuous);
            input.RegisterKey(0, 34, InputKeyType.Continuous);
            input.RegisterKey(0, 35, InputKeyType.Continuous);
            input.RegisterKey(0, 52, InputKeyType.Continuous);
            input.RegisterKey(0, 54, InputKeyType.Continuous);

            _freecam = new Freecam
            {
                KeySmoothing     = 500,
                MouseSensitivity = 1.0f,
                KeySensitivity   = 1.0f
            };

            _freecam.EnableFreecam();
        }