public override void Update()
    {
        base.Update();

        timer += Time.deltaTime;
        registrationTimer += Time.deltaTime;
        parryTimer += Time.deltaTime;

        if(registrationTimer > 2.0f)
        {
            m_PlayerController.updatePreviousActions(this.ToString());

            registrationTimer = 0.0f;
        }

        if (!m_BlockButton && timer > m_Character.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).length)
        {

            m_Character.GetComponent<Animator>().SetBool("BlockDown", false);
            m_NextState = new MovementIdle(m_Character);
        }

        if (m_VerticalAxis >= 0.1f)
        {
            m_Character.GetComponent<Animator>().SetBool("BlockUp", true);
            m_Character.GetComponent<Animator>().SetBool("BlockDown", false);
            m_NextState = new MovementBlockUp(m_Character);
        }

        m_Character.m_TotalForce.x = 0.0f;
    }
Beispiel #2
0
    public override void Update()
    {
        base.Update();

        timer             += Time.deltaTime;
        registrationTimer += Time.deltaTime;
        parryTimer        += Time.deltaTime;

        if (registrationTimer > 2.0f)
        {
            m_PlayerController.updatePreviousActions(this.ToString());

            registrationTimer = 0.0f;
        }

        if (!m_BlockButton && timer > m_Character.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).length)
        {
            m_Character.GetComponent <Animator>().SetBool("BlockDown", false);
            m_NextState = new MovementIdle(m_Character);
        }

        if (m_VerticalAxis >= 0.1f)
        {
            m_Character.GetComponent <Animator>().SetBool("BlockUp", true);
            m_Character.GetComponent <Animator>().SetBool("BlockDown", false);
            m_NextState = new MovementBlockUp(m_Character);
        }

        m_Character.m_TotalForce.x = 0.0f;
    }
    public void Land()
    {
        if (!(m_Character as PlayerCharacterController).m_StandsInWater)
        {
            FMOD_StudioSystem.instance.PlayOneShot("event:/Darien/darien_land", m_Character.transform.position);
        }
        else
        {
            FMOD_StudioSystem.instance.PlayOneShot("event:/Darien/darien_waterland", m_Character.transform.position);
        }
        if (Math.Abs(m_Character.m_TotalForce.x) < 0.001f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
        else
        {
            m_NextState = new MovementWalk(m_Character);
        }

        if (m_NextState != this)
        {
            m_Character.m_TotalForce.y = 0.0f;
            m_Character.GetComponent <Animator>().SetBool("Jump", false);
        }
    }
    public override void Update()
    {
        base.Update();

        timer += Time.deltaTime;

        //Adjust value for deadzone of controller (maybe sensitivity meter in options)
        if (Math.Abs(m_HorizontalAxis) >= 0.1f)
        {
            m_NextState = new BattleWalk(m_Character);
        }
        if (m_LightAttackButton == true)
        {

            if (m_VerticalAxis < -0.1f)
                m_NextState = new BattleLightAttackDown(m_Character);
            else
                m_NextState = new BattleLightAttackUp(m_Character);
        }

        if (m_HeavyAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
                m_NextState = new BattleHeavyAttackDown(m_Character);
            else
                m_NextState = new BattleHeavyAttackUp(m_Character);
        }

        if (m_BattleButton == true && timer > 0.5f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
Beispiel #5
0
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton <= 0.1f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton <= 0.1f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        m_Timer += Time.deltaTime;
        if (m_Timer >= m_Character.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).length)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        m_Timer += Time.deltaTime;
        if (m_Timer >= m_Character.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).length)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton == 0.0f)
        {
            (m_Character as PlayerCharacterController).m_BackgroundPosition.gameObject.SendMessage("DestroyPosition");
            m_NextState = new MovementIdle(m_Character);
        }
        if (m_JumpButton)
        {
            m_NextState = new MovementPlaneTransition(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton == 0.0f)
        {
            (m_Character as PlayerCharacterController).m_BackgroundPosition.gameObject.SendMessage("DestroyPosition");
            m_NextState = new MovementIdle(m_Character);
        }
        if (m_JumpButton)
        {
            m_NextState = new MovementPlaneTransition(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_Character.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).IsName("ClimbUp"))
        {
            m_Timer += Time.deltaTime;
        }

        if (m_Timer >= m_Character.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).length)
        {
            m_TargetPosition.z = m_Character.transform.position.z;
            m_Character.transform.position = m_TargetPosition + new Vector3(0.0f, m_Character.collider.bounds.size.y / 2, 0.0f);
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_Character.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).IsName("ClimbUp"))
        {
            m_Timer += Time.deltaTime;
        }

        if (m_Timer >= m_Character.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).length)
        {
            m_TargetPosition.z             = m_Character.transform.position.z;
            m_Character.transform.position = m_TargetPosition + new Vector3(0.0f, m_Character.collider.bounds.size.y / 2, 0.0f);
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        //BoxCollider2D col = m_Character.collider2D as BoxCollider2D;
        if (m_CrouchButton)
        {
            //col.size = new Vector2(col.size.x, 0.675f);

            //col.center = new Vector2(col.center.x, (-col.size.y / 2) - 0.12f );
        }
        else
        {
            //col.size = new Vector2(col.size.x, 1.35f);
            //col.center = new Vector2(col.center.x, -0.12f);
            m_NextState = new MovementIdle(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        //BoxCollider2D col = m_Character.collider2D as BoxCollider2D;
        if (m_CrouchButton)
        {
            //col.size = new Vector2(col.size.x, 0.675f);

            //col.center = new Vector2(col.center.x, (-col.size.y / 2) - 0.12f );
        }
        else
        {
            //col.size = new Vector2(col.size.x, 1.35f);
            //col.center = new Vector2(col.center.x, -0.12f);
            m_NextState = new MovementIdle(m_Character);
        }
    }
Beispiel #15
0
    public void Land()
    {
        if (!(m_Character as PlayerCharacterController).m_StandsInWater)
        {
            FMOD_StudioSystem.instance.PlayOneShot("event:/Darien/darien_land", m_Character.transform.position);
        }
        else
        {
            FMOD_StudioSystem.instance.PlayOneShot("event:/Darien/darien_waterland", m_Character.transform.position);
        }

        if (Math.Abs(m_Character.m_TotalForce.x) < 0.001f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
        else
        {
            m_NextState = new MovementWalk(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        timer += Time.deltaTime;

        //Adjust value for deadzone of controller (maybe sensitivity meter in options)
        if (Math.Abs(m_HorizontalAxis) >= 0.1f)
        {
            m_NextState = new BattleWalk(m_Character);
        }
        if (m_LightAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_NextState = new BattleLightAttackDown(m_Character);
            }
            else
            {
                m_NextState = new BattleLightAttackUp(m_Character);
            }
        }

        if (m_HeavyAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_NextState = new BattleHeavyAttackDown(m_Character);
            }
            else
            {
                m_NextState = new BattleHeavyAttackUp(m_Character);
            }
        }

        if (m_BattleButton == true && timer > 0.5f)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
Beispiel #17
0
    public override void Update()
    {
        base.Update();

        timer += Time.deltaTime;

        if (Math.Abs(m_HorizontalAxis) >= 0.1f)
        {
            if (Math.Sign(m_HorizontalAxis) == m_Ortientation && m_Character is PlayerCharacterController)
            {
                (m_Character as PlayerCharacterController).m_ComboState = new ForwardState(m_Character, (m_Character as PlayerCharacterController).m_ComboState);
            }
            m_NextState = new BattleWalk(m_Character);

            if (Math.Sign(m_HorizontalAxis) != m_Ortientation && m_Character is PlayerCharacterController)
            {
                (m_Character as PlayerCharacterController).m_ComboState = new BackState(m_Character, (m_Character as PlayerCharacterController).m_ComboState);
            }
            m_NextState = new BattleWalk(m_Character);
        }



        if (m_LightAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_NextState = new BattleLightAttackDown(m_Character);
            }
            else
            {
                m_NextState = new BattleLightAttackUp(m_Character);
            }
        }

        if (m_HeavyAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_NextState = new BattleHeavyAttackDown(m_Character);
            }
            else
            {
                m_NextState = new BattleHeavyAttackUp(m_Character);
            }
        }

        if (m_JumpButton == true)
        {
            if (Math.Sign(m_HorizontalAxis) == Math.Sign(m_Character.transform.localScale.x))
            {
                m_Character.m_CurrentState = new BattleStepBack(m_Character);
            }
            else
            {
                m_Character.m_CurrentState = new BattleDash(m_Character);
            }
        }



        if (m_BlockButton == true)
        {
            m_ButtonTimer += Time.deltaTime;

            if (m_ButtonTimer >= 0.01f)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_Character.GetComponent <Animator>().SetBool("BlockDown", true);
                    m_NextState = new BattleBlockDown(m_Character);
                }

                else
                {
                    m_Character.GetComponent <Animator>().SetBool("BlockUp", true);
                    m_NextState = new BattleBlockUp(m_Character);
                }
            }
        }
        if (m_BlockButtonUp)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_Character.GetComponent <Animator>().SetTrigger("ParryDown");
                m_NextState = new BattleParryDown(m_Character);
            }

            else
            {
                m_Character.GetComponent <Animator>().SetTrigger("ParryUp");
                m_NextState = new BattleParryUp(m_Character);
            }
        }

        if (m_Character.m_Opponent == null)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
Beispiel #18
0
    public override void Update()
    {
        base.Update();

        m_Character.GetComponent <Animator>().SetFloat("VelocityX", Math.Abs(m_Character.m_TotalForce.x));


        if (Math.Sign(m_HorizontalAxis) == 1)
        {
            m_Character.m_FacingRight = true;
        }

        if (Math.Sign(m_HorizontalAxis) == -1)
        {
            m_Character.m_FacingRight = false;
        }

        m_Character.m_TotalForce = new Vector3(m_Velocity, 0.0f, 0.0f);
        if (m_PlaneShiftButton > 0.0f)
        {
            m_NextState = new MovementPlaneShift(m_Character);
        }
        else
        {
            if (Math.Abs(m_Velocity) == 0.0f && m_HorizontalAxis == 0.0f)
            {
                m_NextState = new MovementIdle(m_Character);
            }
            if (m_JumpButton == true)
            {
                m_NextState = new MovementJump(m_Character);
            }
            if (m_Character.m_Opponent != null)
            {
                m_NextState = new BattleWalk(m_Character);
            }

            if (m_LightAttackButton == true)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_NextState = new MovementLightAttackDown(m_Character);
                }
                else
                {
                    m_NextState = new MovementLightAttackUp(m_Character);
                }
            }

            if (m_HeavyAttackButton == true)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_NextState = new MovementHeavyAttackDown(m_Character);
                }
                else
                {
                    m_NextState = new MovementHeavyAttackUp(m_Character);
                }
            }

            if (m_BlockButton == true)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_Character.GetComponent <Animator>().SetBool("BlockDown", true);
                    m_NextState = new MovementBlockDown(m_Character);
                }

                else
                {
                    m_Character.GetComponent <Animator>().SetBool("BlockUp", true);
                    m_NextState = new MovementBlockUp(m_Character);
                }
            }
        }
    }
Beispiel #19
0
    public override void Update()
    {
        base.Update();

        timer += Time.deltaTime;

        if (Math.Abs(m_HorizontalAxis) >= 0.1f)
        {
            if (Math.Sign(m_HorizontalAxis) == m_Ortientation && m_Character is PlayerCharacterController)
            {
                (m_Character as PlayerCharacterController).m_ComboState = new ForwardState(m_Character, (m_Character as PlayerCharacterController).m_ComboState);
            }
            m_NextState = new BattleWalk(m_Character);

            if (Math.Sign(m_HorizontalAxis) != m_Ortientation && m_Character is PlayerCharacterController)
            {
                (m_Character as PlayerCharacterController).m_ComboState = new BackState(m_Character, (m_Character as PlayerCharacterController).m_ComboState);
            }
            m_NextState = new BattleWalk(m_Character);
        }

        if (m_LightAttackButton == true)
        {

            if (m_VerticalAxis < -0.1f)
                m_NextState = new BattleLightAttackDown(m_Character);
            else
                m_NextState = new BattleLightAttackUp(m_Character);
        }

        if (m_HeavyAttackButton == true)
        {
            if (m_VerticalAxis < -0.1f)
                m_NextState = new BattleHeavyAttackDown(m_Character);
            else
                m_NextState = new BattleHeavyAttackUp(m_Character);
        }

        if (m_JumpButton == true)
        {
            if (Math.Sign(m_HorizontalAxis) == Math.Sign(m_Character.transform.localScale.x))
            {
                m_Character.m_CurrentState = new BattleStepBack(m_Character);
            }
            else
            {
                m_Character.m_CurrentState = new BattleDash(m_Character);
            }
        }

        if (m_BlockButton == true)
        {
            m_ButtonTimer += Time.deltaTime;

            if (m_ButtonTimer >= 0.01f)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_Character.GetComponent<Animator>().SetBool("BlockDown", true);
                    m_NextState = new BattleBlockDown(m_Character);
                }

                else
                {
                    m_Character.GetComponent<Animator>().SetBool("BlockUp", true);
                    m_NextState = new BattleBlockUp(m_Character);
                }
            }
        }
        if (m_BlockButtonUp)
        {
            if (m_VerticalAxis < -0.1f)
            {
                m_Character.GetComponent<Animator>().SetTrigger("ParryDown");
                m_NextState = new BattleParryDown(m_Character);
            }

            else
            {
                m_Character.GetComponent<Animator>().SetTrigger("ParryUp");
                m_NextState = new BattleParryUp(m_Character);
            }

        }

        if(m_Character.m_Opponent == null)
        {
            m_NextState = new MovementIdle(m_Character);
        }
    }
Beispiel #20
0
 public void FinishTransition()
 {
     m_NextState = new MovementIdle(m_Character);
 }
Beispiel #21
0
    public override void Update()
    {
        base.Update();

        m_Character.GetComponent<Animator>().SetFloat("VelocityX", Math.Abs(m_Character.m_TotalForce.x));

        if (Math.Sign(m_HorizontalAxis) == 1)
        {
            m_Character.m_FacingRight = true;
        }

        if (Math.Sign(m_HorizontalAxis) == -1)
        {
            m_Character.m_FacingRight = false;
        }

        m_Character.m_TotalForce = new Vector3(m_Velocity, 0.0f, 0.0f);
        if (m_PlaneShiftButton > 0.0f)
        {
            m_NextState = new MovementPlaneShift(m_Character);
        }
        else
        {
            if (Math.Abs(m_Velocity) == 0.0f && m_HorizontalAxis == 0.0f)
            {
                m_NextState = new MovementIdle(m_Character);
            }
            if (m_JumpButton == true)
            {
                m_NextState = new MovementJump(m_Character);
            }
            if (m_Character.m_Opponent != null)
            {
                m_NextState = new BattleWalk(m_Character);
            }

            if (m_LightAttackButton == true)
            {

                if (m_VerticalAxis < -0.1f)
                    m_NextState = new MovementLightAttackDown(m_Character);
                else
                    m_NextState = new MovementLightAttackUp(m_Character);
            }

            if (m_HeavyAttackButton == true)
            {
                if (m_VerticalAxis < -0.1f)
                    m_NextState = new MovementHeavyAttackDown(m_Character);
                else
                    m_NextState = new MovementHeavyAttackUp(m_Character);
            }

            if (m_BlockButton == true)
            {
                if (m_VerticalAxis < -0.1f)
                {
                    m_Character.GetComponent<Animator>().SetBool("BlockDown", true);
                    m_NextState = new MovementBlockDown(m_Character);
                }

                else
                {
                    m_Character.GetComponent<Animator>().SetBool("BlockUp", true);
                    m_NextState = new MovementBlockUp(m_Character);
                }
            }
        }
    }
 public void FinishTransition()
 {
     m_NextState = new MovementIdle(m_Character);
 }