private Btn2D CreateStillBtn(string root, Transform slotWhereIsRenderOnScreen) { Btn2D temp = null; temp = (Btn2D)General.Create(root); temp.MyTransform = slotWhereIsRenderOnScreen; temp.StartMaterial(); return(temp); }
//Creates hearts acoording to lives of player and pause btn private void FireUpGUIButtons(float speedFadePass = 50f) { pauseBtn = CreateStillBtn(Root.pauseButton, camChild[amountOfCamBtnSlots + 3]); pauseBtn.FadeSpeedProp = speedFadePass; for (int i = 0; i < Program.THEPlayer.Lives; i++) { Btn2D temp = CreateStillBtn(Root.heart, camChild[i + amountOfCamBtnSlots]); temp.FadeSpeedProp = speedFadePass; hearts.Add(temp); temp = null; } UpdateList(); }
private void ActionOnPauseBtn(string action = "") { //had to include this one here !Settings.ISPAUSE bz due to fade time will change it //back to false and then will disapper the pause menu and the still btns will not be back if ((!Settings.ISPAUSED && action == "") || (!Settings.ISPAUSED && action == "Pause")) { float tempSpeed = 150f; Settings.ISPAUSED = Settings.MecanicSwitcher(Settings.ISPAUSED); DestroyStillBtns(); SpawnSetMenu("Pause_Menu_Spawner", tempSpeed); pauseBackGround = CreateStillBtn(Root.backGroundLabelPauseMenu, camChild[amountOfCamBtnSlots + 4]); pauseBackGround.FadeSpeedProp = tempSpeed; } else if ((Settings.ISPAUSED && action == "") || (Settings.ISPAUSED && action == "Resume")) { Settings.ISPAUSED = Settings.MecanicSwitcher(Settings.ISPAUSED); FireUpGUIButtons(); CloseCurrentMenu(); pauseBackGround.Destroy2dBtn(); } }