Eonirr

Untitled

Mar 24th, 2025
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. Parent instance = new Enfant();
  2.  
  3. if (instance is Enfant enfantInstance)
  4. {
  5. Debug.Log(enfantInstance.enfantVar);
  6. }
  7.  
  8. ----------OU------------
  9. Enfant enfantInstance = instance as Enfant;
  10. if (enfantInstance != null)
  11. {
  12. Debug.Log(enfantInstance.enfantVar);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment