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(); } }
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()); }
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(); }