Redundant public buildings in West Sussex are set to be transformed into community hubs.