// Token: 0x06001FBF RID: 8127 RVA: 0x00183EF8 File Offset: 0x001820F8
        public override ControlInput GetInput()
        {
            if (this.isPaused)
            {
                this.animator.SetBool("Moving", false);
                return(default(ControlInput));
            }
            float horizontal = 0f;

            if (this.rightButtonPast)
            {
                horizontal = 1f;
            }
            else if (this.leftButtonPast)
            {
                horizontal = -1f;
            }
            ControlInput controlInput = new ControlInput
            {
                horizontal = horizontal
            };

            if (controlInput.horizontal != 0f)
            {
                if (controlInput.horizontal < 0f)
                {
                    this.spriteRenderer.flipX = true;
                }
                else if (controlInput.horizontal > 0f)
                {
                    this.spriteRenderer.flipX = false;
                }
                this.animator.SetBool("Moving", true);
            }
            else
            {
                this.animator.SetBool("Moving", false);
            }
            return(controlInput);
        }
Exemple #2
0
        // Token: 0x06001FEF RID: 8175 RVA: 0x00188B88 File Offset: 0x00186D88
        public override ControlInput GetInput()
        {
            ControlInput result = default(ControlInput);

            if (this.isPaused)
            {
                return(result);
            }
            AIController.AIState aistate = this.state;
            if (aistate != AIController.AIState.Entering)
            {
                if (aistate == AIController.AIState.Leaving)
                {
                    if (this.leaveTarget.position.x > base.transform.position.x)
                    {
                        result.horizontal = 1f;
                        this.SetFlip(false);
                    }
                    else
                    {
                        result.horizontal = -1f;
                        this.SetFlip(true);
                    }
                }
            }
            else if (this.targetChair.transform.position.x > base.transform.position.x)
            {
                result.horizontal = 1f;
                this.SetFlip(false);
            }
            else
            {
                result.horizontal = -1f;
                this.SetFlip(true);
            }
            return(result);
        }
Exemple #3
0
        // Token: 0x06001FB7 RID: 8119 RVA: 0x00183B34 File Offset: 0x00181D34
        private void FixedUpdate()
        {
            ControlInput input = this.GetInput();

            base.transform.Translate(new Vector2(input.horizontal, 0f) * Time.fixedDeltaTime * this.moveSpeed);
        }