public StateBladetrapMoving(Bladetrap _p, Vector3 _dir, bool _fast) { p = _p; dir = _dir.normalized; fast = _fast; speed = fast ? 5f : 2f; nextCell = new Vector3(Mathf.Round(p.transform.position.x), Mathf.Round(p.transform.position.y)) + dir; if (Utils.CollidingWithAnyWall(nextCell) || Tile.Unwalkable(nextCell)) { leaveState = true; } }
public StateBladetrapNormal(Bladetrap _p) { p = _p; p.GetComponent<Rigidbody>().velocity = new Vector3(); p.transform.position = p.startPos; }
public StateBladetrapNormal(Bladetrap _p) { p = _p; p.GetComponent <Rigidbody>().velocity = new Vector3(); p.transform.position = p.startPos; }