void OnCollisionEnter2D(Collision2D other) { if (other.transform.tag == "FireBall") { int fireAttr = MechanicsUpdater.GetValueOf("Fire"); } }
void checkColForJump() { Collider2D bottomHit = Physics2D.OverlapBox(groundCheck.position, range, 0.0f, groundLayer); if (bottomHit != null) { if (bottomHit.gameObject.tag == "Ground" && Input.GetKeyDown(KeyCode.Space)) { int jumpAttr = MechanicsUpdater.GetValueOf("Jump"); float jumpForce = jumpAttr == 0 ? 0 : jumpAttr + 5; myBody.velocity = new Vector2(myBody.velocity.x, jumpForce); anim.SetBool("jumping", true); soundManager.instance.playSfx(jumpSound, 0.3f); } else { anim.SetBool("jumping", false); } } }
void dash() { isDashing = true; floatAttr = MechanicsUpdater.GetValueOf("Dash"); }
void Start() { CurrentEnergy = MaxEnergy; MechanicsUpdater.Subscribe(CallBack); Text.text = "100%"; }