Closed CLAXES closed 1 month ago
I hope you don't take it the wrong way, but I think you should first find out what the Unity addressable package is for, and you'll realize why it's giving you that error.
In summary, there you are getting the null reference because you need the reference to the area damage entity and the reference thing is now for the package that I mentioned to you
I don't know if you imported it first but if you have the package you will notice that your prefabs have this checkmark
and this is the reference of the prefab that is taking this is much more detailed that's why I tell you read about addressable
It gives an error when the map changes in the section below, should I add null control or do I need to make another setting?
protected override void OnDestroy()
{
base.OnDestroy();
Identity.onGetInstance.RemoveListener(OnGetInstance);
_identity = null;
_receivingDamageHitBoxes?.Clear();
onDestroy?.RemoveAllListeners();
onDestroy = null;
}
When I do as below, it does not give an error, but I am not sure if I am doing it right
Identity?.onGetInstance?.RemoveListener(OnGetInstance);
Yes, you should do it
But better check null like this
if (Identity != null && Identity.onGetInstance != null)
Identity.onGetInstance.RemoveListener(OnGetInstance);
Because Unity's object reference is suck
Hello, I get this error when I switch between maps in version 1.88e