public void Hide()
 {
     if (mask)
     {
         mask.Hide();
     }
     if (panel)
     {
         panel.Hide();
     }
     ClickOKEvents.Clear();
     ClickCancelEvents.Clear();
 }
        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);
        }