예제 #1
0
 private void OnDestroy()
 {
     if (this == instance)
     {
         instance = null;
     }
 }
예제 #2
0
    public void Enter(BurinkeruInputManager inputManager, BurinkeruCharacterController parent, CharacterComponents components)
    {
        this.inputManager = inputManager;
        this.components   = components;

        base.Enter(parent);
    }
예제 #3
0
        Vector3 getMoveDirection()
        {
            Vector3 forwardDirection           = parent.transform.forward;
            Vector3 rightDirection             = parent.transform.right;
            Vector3 deltaPosition              = Vector3.zero;
            BurinkeruInputManager inputManager = BurinkeruInputManager.Instance;

            if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.FORWARD))
            {
                deltaPosition += (forwardDirection);
            }
            else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.BACKWARD))
            {
                deltaPosition -= (forwardDirection);
            }

            if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.RIGHT))
            {
                deltaPosition += (rightDirection);
            }
            else if (inputManager.IsCommandPressed(BurinkeruInputManager.InputCommand.LEFT))
            {
                deltaPosition -= (rightDirection);
            }

            deltaPosition.Normalize();
            deltaPosition.Scale(new Vector3(1f, 0f, 1f));

            return(deltaPosition);
        }
예제 #4
0
        public override void UpdateState()
        {
            BurinkeruInputManager inputManager = BurinkeruInputManager.Instance;

            if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.JUMP))
            {
                jump();
            }
            else if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.RUN) && IsRunStateAvailable)
            {
                switchRunIfNeeded();
            }
            else if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.CROUCH) && IsCrounchStateAvailable)
            {
                switchCrouchOrSlideIfNeeded();
            }
            else if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.BLINK) &&
                     IsBlinkStateAvailable &&
                     blinkState.CanBlinkNow())
            {
                requestNewState <BlinkState> ();
            }

            base.UpdateState();
        }
예제 #5
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         initControllers();
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
예제 #6
0
        public override void UpdateState()
        {
            changeStateIfNeeded();
            applyGravity();
            move();

            BurinkeruInputManager inputManager = BurinkeruInputManager.Instance;

            if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.JUMP))
            {
                if (IsWallRunStateAvailable)
                {
                    wallRunState.StartInitializationTimer();
                }

                jumpPressed = true;
            }
            else if (inputManager.IsCommandUp(BurinkeruInputManager.InputCommand.JUMP))
            {
                wallRunState.StopInitializationTimer();

                if (jumpPressed)
                {
                    jumpPressed = false;
                    tryToJump();
                }
            }

            if (IsWallRunStateAvailable && wallRunState.ShouldStartWallRunState(parent))
            {
                wallRunState.StopInitializationTimer();
                requestNewState <WallRunState> ();
            }
            else if (inputManager.IsCommandDown(BurinkeruInputManager.InputCommand.BLINK) &&
                     IsBlinkStateAvailable &&
                     blinkState.CanBlinkNow())
            {
                requestNewState <BlinkState> ();
            }

            clampHorizontalVelocity();
        }
예제 #7
0
 public InputBuffer()
 {
     initBuffer();
     inputManager = BurinkeruInputManager.Instance;
 }
예제 #8
0
 private void Awake()
 {
     inputManager = BurinkeruInputManager.Instance;
     BlinkCounter = 0;
 }
 // Start is called before the first frame update
 void Start()
 {
     inputManager = BurinkeruInputManager.Instance;
     setNewState <PlayerInAirState> ();
     blinkingController.OnBlink += onBlink;
 }
예제 #10
0
        protected new void Awake()
        {
            base.Awake();

            inputManager = BurinkeruInputManager.Instance;
        }