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

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;
}

}


if (objA is ClassA)

More here

In your specific scenario :

public class B1 { 
   void Update() 
   { 
      if(!(A is A1 || A is A2)) 
         return;

   }
}