Ejemplo n.º 1
0
    void OnGrounded()
    {
        //transform.FindChild("GroundPuff").GetComponent<ParticleSystem>().Emit(5);

        GameObject smokePuff;

        if (m_Controller.GetVelocity().x > -3f)
        {
            smokePuff = PoolManager.GetPooledObjectS("AnimatedSprites", "SmokePuff1");
            smokePuff.transform.position = transform.position;
            smokePuff.GetComponent <OneShotSprite>().spriteRenderer.flipX = false;
        }

        if (m_Controller.GetVelocity().x < 3f)
        {
            smokePuff = PoolManager.GetPooledObjectS("AnimatedSprites", "SmokePuff1");
            smokePuff.transform.position = transform.position;
            smokePuff.GetComponent <OneShotSprite>().spriteRenderer.flipX = true;
        }

        AudioSource.PlayClipAtPoint(m_FootstepSound, transform.position);
    }
Ejemplo n.º 2
0
    private void Controller_OnGrounded()
    {
        GameObject smokePuff;

        if (m_Controller.GetVelocity().x > -0.1f)
        {
            smokePuff = PoolManager.GetPooledObjectS("AnimatedSprites", "SmokePuff1");
            smokePuff.transform.position = transform.position;
            smokePuff.GetComponent <OneShotSprite>().spriteRenderer.flipX = false;
        }

        if (m_Controller.GetVelocity().x < 0.1f)
        {
            smokePuff = PoolManager.GetPooledObjectS("AnimatedSprites", "SmokePuff1");
            smokePuff.transform.position = transform.position;
            smokePuff.GetComponent <OneShotSprite>().spriteRenderer.flipX = true;
        }

        if (m_Controller.isFalling && m_ImpactSound)
        {
            AudioSource.PlayClipAtPoint(m_ImpactSound, transform.position);
        }
    }