Search Unity

Question Part of the code below cannot be type-converted by the method of reading the next scene asynchronous

Discussion in 'Multiplayer' started by neccopen, Sep 15, 2022.

  1. neccopen

    neccopen

    Joined:
    May 4, 2020
    Posts:
    1
    I am using Pun2.
    I am writing a program that asynchronously transitions scenes (rooms).
    at the moment, so far

    Code (CSharp):
    1. privateAsyncOperation_async;
    2. _async = SceneManager.LoadSceneAsync(SceneName);
    3. _async.allowSceneActivation = false;
    4. _async.allowSceneActivation = true;
    I was able to do it with the above process,
    With asynchronous loading when connecting to PhotonNetWork,
    _async = PhotonNetwork.LoadLevel(scene name);
    When I change it as above, I get the below error

    error CS0029 cannot implicitly convert type 'void' to 'UnityEngine.AsyncOperation'

    The question is, in addition to how to resolve the above error (type conversion),
    Can PhotonNetWork load next scene asynchronously before scene transition?[/code]