Exemplo n.º 1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.transform.tag == "FireBall")
     {
         int fireAttr = MechanicsUpdater.GetValueOf("Fire");
     }
 }
Exemplo n.º 2
0
    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);
            }
        }
    }
Exemplo n.º 3
0
 void dash()
 {
     isDashing = true;
     floatAttr = MechanicsUpdater.GetValueOf("Dash");
 }
Exemplo n.º 4
0
 void Start()
 {
     CurrentEnergy = MaxEnergy;
     MechanicsUpdater.Subscribe(CallBack);
     Text.text = "100%";
 }