public void Jump() { if (classHero.CheckGrounded()) { FacadeHero.Jump(classHero); } }
void OnCollisionEnter2D(Collision2D c) { GameObject obj = c.gameObject; string layer = LayerMask.LayerToName(obj.layer); if (layer == "Enemy" && !isGhost) { try { obj.GetComponent <ClassEnemy>().Kill(); } catch { Debug.Log(obj); } if (!isAttack) { FacadeHero.Damage(this); } else { FacadeHero.Guard(this); } //isGhost = true; } }
public void Attack() { if (!classHero.isAttack) { classHero.forceAttack = classHero.initialforceAttack; FacadeHero.Attack(classHero); classHero.isAttack = true; } }
void Update() { if (isAttack) { forceAttack -= 10; FacadeHero.Attack(this); if (forceAttack <= 0) { forceAttack = 0; isAttack = false; } } }
public void Walk(float diretion) { if (!classHero.isAttack) { if (diretion > 0) { classHero.faceRight = 1; FacadeHero.Walk(classHero, Vector2.right); } else if (diretion < 0) { classHero.faceRight = -1; FacadeHero.Walk(classHero, Vector2.left); } else { FacadeHero.Idle(classHero); } } }
void OnTriggerEnter2D(Collider2D c) { GameObject obj = c.gameObject; string layer = LayerMask.LayerToName(obj.layer); if (layer == "Enemy" && !isGhost) { obj.GetComponent <ClassEnemy>().Kill(); if (!isAttack) { FacadeHero.Damage(this); } else { FacadeHero.Guard(this); } //isGhost = true; } }