Esempio n. 1
0
        public void EnsureInitializedKeyBinding()
        {
            if (keyBindGroups != null)
            {
                return;
            }
            keyBindGroups = new KBindGroup[] {
                new KBindGroup {
                    name = "Press", allKeyBindings = kBindPresses, trigger = kb => kb.GetDown(), action = kb => kb.DoPress(), putInList = kb => kb.keyEvent.CountPress > 0
                },
                new KBindGroup {
                    name = "Hold", allKeyBindings = kBindHolds, trigger = kb => kb.GetHeld(), action = kb => kb.DoHold(), putInList = kb => kb.keyEvent.CountHold > 0
                },
                new KBindGroup {
                    name = "Release", allKeyBindings = kBindReleases, trigger = kb => kb.GetUp(), action = kb => kb.DoRelease(), putInList = kb => kb.keyEvent.CountRelease > 0
                },
            };
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
            _isInterface = new InputSystemInterfaceLogic();
            _isInterface.Initialize();
            _isInterface.OnPressedAny  = KeyPressed;
            _isInterface.OnReleaseAny  = KeyRelease;
            _isInterface.OnPressingAny = KeyPressing;
#endif
        }
Esempio n. 2
0
 private void OnDestroy()
 {
     _isInterface?.Release();
     _isInterface = null;
 }
 void Awake()
 {
     isInterface = new InputSystemInterfaceLogic();
     isInterface.Initialize();
 }