public void RemoveCanvas() { if (canvas != null) { canvas.unload(); canvas = null; } SafeRemoveAllChildren(); }
public void RemoveCanvas() { if (canvas != null) { canvas.PerformOnChildren(val => { MethodInfo method = val.GetType().GetMethod("gaxb_unload"); if (method != null) { method.Invoke(val, null); } return(true); }); canvas.gaxb_unload(); canvas.unload(); DestroyImmediate(canvas.gameObject); canvas = null; } SafeRemoveAllChildren(); }