private void SetWindowFullScreen() { Window w = Window.GetWindow(this); w.WindowStyle = WindowStyle.None; w.WindowState = WindowState.Maximized; w.ResizeMode = ResizeMode.NoResize; w.Closing += W_Closing; w.FontSize = 16; PopupMgr.SetParentWindow(w); PopupMgr.Singleton.CbNOK = WPCancel; }
// Update is called once per frame void Update() { GameObject camObj = GameObject.Find("MainCamera"); if (camObj) { PopupMgr ppm = camObj.GetComponent <PopupMgr>(); if (ppm) { // setup the level2 popups initial state ppm.Level2Finish.SetActive(false); ppm.Level2Repeat.SetActive(false); ppm.Level2Start.SetActive(true); PopupButtonScript pbs = ppm.Level2Start.transform.Find("Button1").gameObject.GetComponent <PopupButtonScript>(); Level2Extras l2x = GetComponent <Level2Extras>(); if (l2x) { //setup the extras as the objects as objects that can be operated on in the popup_level2start button's //action list. this will cause the setupLevel2 and raceStartup objects will be enabled on click pbs.actions[0].data.obj = l2x.setupLevel2; pbs.actions[1].data.obj = l2x.raceStartup; response_ShowRaceResultsPopup rrp = l2x.LevelLogicObj.GetComponent <response_ShowRaceResultsPopup>(); if (rrp) { // connect the level2Finish and level2Repeat popups to the showraceResultspopup response on the // levelLogicObj object. This allows levelLogicObj to enable either the repeat or pass popup when // necessary rrp.player = GameObject.Find("Player1"); rrp.gm = GameObject.Find("Game").GetComponent <gameMgr>(); rrp.passPopup = ppm.Level2Finish; rrp.retryPopup = ppm.Level2Repeat; } Destroy(this); } } } }
// Use this for initialization void Start() { GameObject go = GameObject.Find("MainCamera"); if (go) { // connect the lose ends between prefab instances in _level3 with objects in _global (such as popupmanager) PopupMgr ppm = go.GetComponent <PopupMgr>(); if (ppm) { ppm.Level3Finish.SetActive(false); ppm.Level3Repeat.SetActive(false); ppm.Level3Start.SetActive(true); PopupButtonScript pbs = ppm.Level3Start.transform.Find("Button1").gameObject.GetComponent <PopupButtonScript>(); // connect the enable setup level 3 button to the actual gameobject Level3Extras l3x = GetComponent <Level3Extras>(); if (l3x) { pbs.actions[0].data.obj = l3x.setupLevel3; } // connect the pass popup to the response behavior that shows the popup when you get enough points GameObject llo = GameObject.Find("LevelLogicObj"); if (llo != null) { llo.GetComponent <response_ShowLevel3Results>().passPopup = ppm.Level3Finish; } // connect the repeat popup to the time script for when the game clock ticks to zero GameObject TimeObj = GameObject.Find("Time"); if (TimeObj != null) { TimeObj.GetComponent <TimeScript>().failPopup = ppm.Level3Repeat; } } } }