public override void OnInitialize() { var prefab = VRRes.Load <GameObject>(R.Prefab.GlobalUIRoot); root = gameObject.AddChild <Canvas>(prefab); root.sortingLayerName = VRSortingLayer.GlobalUI; root.worldCamera = Camera.main; mask = root.GetComponentInChildren <GlobalMask>(); mask.Hide(); panel = root.GetComponentInChildren <GlobalPanel>(); panel.ok = OnClickOK; panel.cancel = OnClickCancel; panel.Hide(true); }
public override void OnUninitialize() { root = null; panel = null; mask = null; }