Beispiel #1
0
    private void Awake()
    {
        ///This object is meant to be persistent. So what we need to do is not destroy it when loading new scenes, and
        ///check if there is already a loading screen in the scene. If there is already one, destroy this one.
        DontDestroyOnLoad(gameObject);
        LoadingScreenBehavior checkForDuplicate = FindObjectOfType <LoadingScreenBehavior>();

        if (checkForDuplicate != this)
        {
            Destroy(gameObject);
        }
    }
Beispiel #2
0
 public LoadingMessage(LoadingScreenBehavior behavior, string content)
 {
     Behavior = behavior;
     Content  = content;
 }
 private void Start()
 {
     loader = FindObjectOfType <LoadingScreenBehavior>();
 }