Sunday, November 20, 2022
HomeGame Developmentunity - Can a variable retailer a System.Sort (not an occasion) of...

unity – Can a variable retailer a System.Sort (not an occasion) of courses inheriting from a selected class?


I’ve an summary class, name it FooClass. And there are two courses that inherit from it. name’em BazClass and DazClass. I need to create cases of BazClass and DazClass at runtime.

On the similar I’ve scriptableObject (SO). I need to retailer a variable inside every ScriptableObject which refers back to the kind of BazClass or DazClass (To not an occasion of BazClass or DazClass).

  1. Can I’ve a variable that takes Varieties inherited from one other class.

Forexample like;

utilizing System;
Sort<:T> variableName the place T is FooClass; //shops a sort that inherits from FooClass.
  1. How can I visualise this variable within the Unity inspector?
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments