Class Property

I have a class which has a Private property httpSock as httpSocket.

The class has another public property Secure as Boolean.

What I want to do is if Secure is set to true I want httpSock to be a HTTPSecureSocket and if it is false httpSock to be HTTPSocket.

How can I achieve this?

Make Secure a computed property.

Of course… Dumb day… Thanks

Yes but what do I add httpSock my property as in the inspector. If I add it as a HTTPSocket can I change it to HTTPSecureSocket if the computed property Secure changes?

HTTPSecureSocket and then toggle whether that operates securely or not

A HTTPSecureSocket with Security = false should be the same as HTTPSocket.

Brilliant, didn’t know that could be done. Why have 2 classes then?

I have had issues with that where I had to revert back to a plain HTTPSocket. I will have to retest it however,

OK. The problem I had was Secure defaults to True and I wasn’t setting it False. It works. Thanks, I learned something new.