コード例 #1
0
    private void Update()
    {
        if (Input.GetKeyDown(GameState._interactButton))
        {
            if (_triggered)
            {
                PlayerSideOfDoor();

                if (!_opened)
                {
                    _opening = true;
                    StartCoroutine(RemoveCollider());
                    _playerEvent.OpenDoor(new PlayerEvent.OpenDoorEventArgs {
                        destroyDoor = false
                    });
                }
                else
                {
                    _closing = true;
                    StartCoroutine(ReactiveCollider());
                    _playerEvent.OpenDoor(new PlayerEvent.OpenDoorEventArgs {
                        destroyDoor = true
                    });
                }
            }
        }
        if (_opening)
        {
            Opening();
        }
        if (_closing)
        {
            Closing();
        }
    }