Quantcast
Channel: Questions in topic: "class instance"
Viewing all articles
Browse latest Browse all 131

How do I check if a derived class is a certain class?

$
0
0
For example, I have ScriptableObject A and then 3derived class A1 A2 A3 There is also Runtime Class B and derived from it, B1 and B2 B1 can only use A1 and A3 B2 can only use A2 And finally, there is manager Class C Class C can only call function from base class B, But the said function can received any version of classA As such, class B1 and B2 have a need to check which kind of A they are receiving. public class B1 { void Update() { if( A is not A1 or A2 ) return; } } -------------------------------

Viewing all articles
Browse latest Browse all 131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>