Beispiel #1
0
 public static void ForceRefreshState()
 {
     if (ForestVR.Enabled)
     {
         VRControllerDisplayManager.ForceRefresh();
     }
     if (Input.GetState(InputState.SavingMaps))
     {
         Input.SetMappingExclusive(KeyMapCategory.Default);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.Locked))
     {
         Input.SetMappingExclusive(KeyMapCategory.None);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.Chat))
     {
         Input.SetMappingExclusive(KeyMapCategory.Chat);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.Menu))
     {
         Input.SetMappingExclusive(KeyMapCategory.Menu);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.RadialWorld))
     {
         Input.SetMappingExclusive(KeyMapCategory.RadialWorld);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.Book))
     {
         Input.SetMappingExclusive(KeyMapCategory.Book);
         InputMappingIcons.RefreshMappings();
         return;
     }
     if (Input.GetState(InputState.Inventory))
     {
         Input.SetMappingExclusive(KeyMapCategory.Inventory);
         InputMappingIcons.RefreshMappings();
         return;
     }
     Input.SetMappingExclusive(KeyMapCategory.Default);
     InputMappingIcons.RefreshMappings();
 }
Beispiel #2
0
        public static void SetState(InputState state, bool enabled)
        {
            if (!Input.States.ContainsKey(InputState.World))
            {
                Input.States.Add(InputState.World, false);
            }
            if (Input.GetState(state) == enabled)
            {
                return;
            }
            if (!Input.States.ContainsKey(state))
            {
                Input.States.Add(state, false);
            }
            Input.States[state] = enabled;
            if (!Input.GetState(InputState.World))
            {
                bool flag = false;
                foreach (KeyValuePair <InputState, bool> keyValuePair in Input.States)
                {
                    if (keyValuePair.Value)
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    Input.States[InputState.World] = true;
                }
            }
            string text = "Input States: ";

            foreach (KeyValuePair <InputState, bool> keyValuePair2 in Input.States)
            {
                string text2 = text;
                text = string.Concat(new object[]
                {
                    text2,
                    keyValuePair2.Key,
                    " : ",
                    keyValuePair2.Value,
                    "\n"
                });
            }
            Debug.Log(text);
            Input.ForceRefreshState();
        }