示例#1
0
 public static T Get <T>() where T : class
 {
     if (sceneSingleton == null)
     {
         return(null);
     }
     return(sceneSingleton.GetComponentInChildren <T>());
 }
示例#2
0
    public static T Get <T>() where T : MonoBehaviour
    {
        var onSelf = instance?.GetComponent <T>();

        if (onSelf)
        {
            return(onSelf);
        }

        return(instance?.GetComponentInChildren <T>());
    }