void OnEnable() { canvasScaler = GetComponent<CanvasScalerExt>(); Update(); // update immediately canvasScaler.ForceRefresh(); // force the canvas scaler to update now to avoid a flash at the wrong size when first enabled }
void OnEnable() { canvasScaler = GetComponent <CanvasScalerExt>(); Update(); // update immediately canvasScaler.ForceRefresh(); // force the canvas scaler to update now to avoid a flash at the wrong size when first enabled }
private void OnEnable() { this.canvasScaler = (CanvasScalerExt)((Component)this).GetComponent <CanvasScalerExt>(); this.Update(); this.canvasScaler.ForceRefresh(); }