예제 #1
0
    void Land()
    {
        dir *= -1;
        transform.position = new Vector3(dir * landPosX, transform.position.y, 0f);
        ChangeState(State.Landing);
        animator.SetTrigger("Land");
        cameraScript.ShakeLand(isPowered);
        ScrollingParticle stomp = PoolManager.Instance.GetObject <ScrollingParticle>(Defs.Stomp);

        if (isPowered)
        {
            stomp.Initialize(Defs.Stomp, transform.position + new Vector3(53f * dir, 0f, 0f), dir * 90f, 1.3f);
        }
        else
        {
            stomp.Initialize(Defs.Stomp, transform.position + new Vector3(53f * dir, 0f, 0f), dir * 90f, 1f);
        }

        if (isPowered)
        {
            isStomping = true;
            SetCollider(1);
            ScrollingParticle stompeff = PoolManager.Instance.GetObject <ScrollingParticle>(Defs.StompGrass);
            stompeff.Initialize(Defs.StompGrass, transform.position + new Vector3(53f * dir, 0f, 0f), dir * 90f);
            stompSound.Play();
            stompSound2.Play();
        }
        else
        {
            landSound.Play();
        }
    }
예제 #2
0
    public void ColWithPlayer()
    {
        scrollAlpha = 0f;
        isDead      = true;
        ScrollingParticle die = PoolManager.Instance.GetObject <ScrollingParticle>(Defs.CoinDie);

        die.Initialize(Defs.CoinDie, transform.position + new Vector3(0f, 0f, 500f), 0);
        die.sound.pitch = Random.Range(0.99f, 1.01f);
        StartCoroutine(Disappear());
    }
예제 #3
0
    public void ColWithStomp()
    {
        int dir = 1;

        if (xPos < 0)
        {
            dir = -1;
        }
        ScrollingParticle die = PoolManager.Instance.GetObject <ScrollingParticle>(Defs.SpikeDie);

        die.Initialize(Defs.SpikeDie, transform.position + new Vector3(60 * dir, 30f, 300f), dir * 90f);
        OutOfScreen();
    }