Search Unity

how to pass parameters to onload function?

Discussion in 'Addressables' started by mailfromthewilds, Apr 24, 2020.

  1. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    217
    Code (CSharp):
    1.         var obj = Addressables.InstantiateAsync("Assets/2Items/Weapons/" + itemName + ".blend", temporaryEquipable);
    2.         obj.Completed += OnLoadDone(obj, "yeye");
    3.         //CmdWearEquippable(slotIndex, equippablePath, itemName);
    4.     }
    5.  
    6.     private void OnLoadDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<GameObject> obj, string yeye)
    7.     {
    8.         // In a production environment, you should add exception handling to catch scenarios such as a null result.
    9.         //myGameObject = obj.Result;
    10.         Debug.Log(yeye);
    11.     }
    this gets me errors. how to pass paarameters??