Пример #1
0
    // Convenience function to add a collider to a given node
    public static T AddCollider <T>(Node node, float fric = 1, float dens = 1, float elas = 0) where T : CollisionShape2D
    {
        CollisionShape2D s = node.CreateComponent <T>();

        s.SetFriction(fric);
        s.SetDensity(dens);
        s.SetRestitution(elas);
        return((T)s);
    }