Example #1
0
    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;
        }
    }
Example #2
0
    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;
        }
    }
Example #3
0
 public StateBladetrapNormal(Bladetrap _p)
 {
     p = _p;
     p.GetComponent<Rigidbody>().velocity = new Vector3();
     p.transform.position = p.startPos;
 }
Example #4
0
 public StateBladetrapNormal(Bladetrap _p)
 {
     p = _p;
     p.GetComponent <Rigidbody>().velocity = new Vector3();
     p.transform.position = p.startPos;
 }