else{
instance = this;
GameObject.DontDestroyOnLoad(gameObject);
}
Hello Manthan, welcome to the community.
this
refers to the instance of the class itself.
Hope this helps
See also;
- Microsoft Docs : this
- Forum User Guides : How to apply code formatting within your post