Ejemplo n.º 1
0
        private static void GameInitHandler(ICharacter currentCharacter)
        {
            ClientComponentAutomaton.Init();

            gameplayInputContext = ClientInputContext
                                   .Start("Automaton options toggle")
                                   .HandleButtonDown(AutomatonButton.OpenSettings, MainWindow.Toggle)
                                   .HandleButtonDown(AutomatonButton.Toggle, () =>
                                                     { AutomatonManager.IsEnabled = !AutomatonManager.IsEnabled; });
        }
Ejemplo n.º 2
0
        public static void Init()
        {
            if (Instance != null)
            {
                Api.Logger.Error("Automaton: Instance already exist.");
            }

            Instance = Client.Scene.CreateSceneObject(nameof(ClientComponentAutomaton))
                       .AddComponent <ClientComponentAutomaton>(AutomatonManager.IsEnabled);
        }
Ejemplo n.º 3
0
        private static void GameInitHandler(ICharacter currentCharacter)
        {
            ClientComponentAutomaton.Init();

            var componentPlayerInputUpdater =
                currentCharacter.ClientSceneObject
                .FindComponent <ComponentPlayerInputUpdater>();

            if (componentPlayerInputUpdater != null)
            {
                componentPlayerInputUpdater.IsEnabled = false;
                currentCharacter.ClientSceneObject
                .AddComponent <ComponentAutomatonInputUpdater>()
                .Setup(currentCharacter);
            }

            gameplayInputContext = ClientInputContext
                                   .Start("Automaton options toggle")
                                   .HandleButtonDown(AutomatonButton.OpenSettings, MainWindow.Toggle)
                                   .HandleButtonDown(AutomatonButton.Toggle, () =>
            {
                AutomatonManager.IsEnabled = !AutomatonManager.IsEnabled;
            });
        }