示例#1
0
    public Vector2 CheckColMove(TwoCol other, TwoCol.ColType type)
    {
        Vector2 output = Vector2.zero;

        foreach (TwoCol e in twoCol)
        {
            if (e == other || !e.HasType(type) || !e.CanCollide(other))
            {
                continue;
            }

            output += other.CheckCol(e);
        }

        // No collisions.
        return(output);
    }
示例#2
0
    public TwoCol IsCol(TwoCol other, TwoCol.ColType type)
    {
        foreach (TwoCol e in twoCol)
        {
            if (e == other || !e.HasType(type) || !e.CanCollide(other))
            {
                continue;
            }

            if (other.CheckCol(e) != Vector2.zero)
            {
                return(e);
            }
        }

        // No collisions.
        return(null);
    }