Is there a simple way to get the parent canvas of a UI element?
Because for functions like:
you need to know whether the canvas is in Overlay mode or Camera mode. In order to either put Camera.main or null in the field.
Or am I missing something? I don't want to put a public variable Canvas because I am making a prefab that...
How do you get the parent canvas?
Because for functions like:
Code (CSharp):
- RectTransformUtility.ScreenPointToLocalPointInRectangle(colorpad.rectTransform,Input.mousePosition,Camera.main,out localPoint);
you need to know whether the canvas is in Overlay mode or Camera mode. In order to either put Camera.main or null in the field.
Or am I missing something? I don't want to put a public variable Canvas because I am making a prefab that...
How do you get the parent canvas?