private void Update() { // Changes the facing side of Boss if (xValue > 0.01) { transform.localScale = new Vector3(1f, 1f, 1f); side = 1; } else if (xValue < -0.01) { transform.localScale = new Vector3(-1f, 1f, 1f); side = -1; } BossCheckPoint = player.currentCheckpoint; isMoving = xValue != 0 || yValue != 0; visual.SetFloat("HorizontalAxis", Mathf.Abs(xValue)); visual.SetFloat("VerticalAxis", yValue); visual.SetBool("ShouldIdle", xValue == 0); visual.SetBool("OnGround", coll.onGround); visual.SetBool("OnWall", coll.onWall); visual.SetBool("IsMoving", isMoving); if (xValue > .5 || yValue > .4 || xValue < -.5 || yValue < -.4) { ghost.ShowGhost(); } }
IEnumerator DashWait() { //GhostTrail[] ghosts = FindObjectsOfType<GhostTrail>(); //Array.ForEach<GhostTrail>(ghosts, g => g.ShowGhost()); //FindObjectOfType<GhostTrail>().ShowGhost(); ghost.ShowGhost(); StartCoroutine(GroundDash()); DOVirtual.Float(14, 0, .8f, RigidbodyDrag); //DOVirtual.Float(14, 0, .3f, RigidbodyDrag); //player.drag = 14; dashParticle.Play(); player.gravityScale = 0; GetComponent <BetterJump>().enabled = false; wallJumped = true; isDashing = true; yield return(new WaitForSeconds(0.05f)); DOVirtual.Float(0, defaultGravityScale, 0.1f, gravity); //player.AddForce(transform.right * 10, ForceMode2D.Impulse); yield return(new WaitForSeconds(.2f)); //player.AddForce(transform.right * 10, ForceMode2D.Impulse); //DOVirtual.Float(14, 0, .3f, RigidbodyDrag); player.gravityScale = defaultGravityScale; GetComponent <BetterJump>().enabled = true; wallJumped = false; isDashing = false; }
public void Dash() { //if (!isMovable || !dashAB.Usable) // return; dashAB.Use(); ghostTrail.ShowGhost(); }
IEnumerator ChargeDelay() { isCharging = true; yield return(new WaitForSeconds(0.2f)); //add audio rb.velocity += force; ghost.ShowGhost(); //Invoke("resetVelocity", 4f); }
public void ShowGhost() { cloneGhost.ShowGhost(); }