// Update is called once per frame void Update() { /* * //Rotate the pen's right position with the rotation of the casette * Vector3 rot = this.transform.rotation * -pen.transform.right; * //Projects the rotated vector to a plane which normal is the pen up * Vector3 rotProj = Vector3.ProjectOnPlane(this.transform.rotation.eulerAngles, pen.transform.forward); * //Calculate the angle of the casette rotation projected to the plane perpendicular to the pen * float angle = Vector3.Angle(pen.transform.right, rotProj); * Debug.Log(rot + " " + rotProj + " " + angle + " " + fullRotationDegree);*/ if (Input.GetMouseButton(1)) { rotationTime += Time.deltaTime; } float angle = GetRotationAngle(); fullRotationDegree += angle; lastAngle = this.transform.rotation.eulerAngles.y; rotationCounter = startRotationCount + Mathf.FloorToInt(fullRotationDegree / 360); ChangeSliders(); if (rotationCounter == 0 || rotationCounter == roundNeeded) { MenuPanelManager menuPanelManager = MenuPanelManager.GetInstance(); menuPanelManager.SwitchMenuPanel(MenuPanelType.EndGameWinMenu); speedText.text = "You spin the casette " + GetRotationSpeed() + " degree/sec. You are awesome. "; } }
void SetupLeftSideMenu() { #if USE_STEAMWORKS workshopInfo = GameObject.Instantiate(workshopInfoPrefab, userMain.getEditRect()); workshopInfo.SaveLocalCopy = SaveLocalCopyOfWorkshopItem; #endif windowHeaderUI.newButton.onClick.AddListener(OnNewButton); menuPanelManager = Instantiate(menuPanelManagerPrefab); menuPanelManager.Setup(); saveMenu = GameObject.Instantiate(saveMenuPrefab, userMain.getEditRect()); saveMenu.Setup(); multiplayerGameMenu = GameObject.Instantiate(multiplayerGameMenuPrefab, userMain.getEditRect()); multiplayerGameMenu.Setup(); multiplayerGameMenu.GetJoinMultiplayerButton().onClick.AddListener(ShowMultiplayerPopup); windowHeaderUI.openButton.onClick.AddListener(OnOpenButton); #if USE_PUN windowHeaderUI.multiplayerToggle.onValueChanged.AddListener(multiplayerGameMenu.SetOpen); #else windowHeaderUI.multiplayerToggle.gameObject.SetActive(false); RectTransform playHeaderBGRect = windowHeaderUI.playHeaderBackground.GetComponent <RectTransform>(); float bgRectX = playHeaderBGRect.sizeDelta.x; playHeaderBGRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, bgRectX - 50); #endif windowHeaderUI.systemToggle.onValueChanged.AddListener(RequestSystemMenu); windowHeaderUI.saveToggle.onValueChanged.AddListener(SetOpenSaveOrWorkshop); windowHeaderUI.moreToggle.onValueChanged.AddListener(SetOpenOverflow); }
public void StartGame() { Time.timeScale = 1; MenuPanelManager menuPanelManager = MenuPanelManager.GetInstance(); menuPanelManager.CloseMenu(); }
public void RestartGame() { startGameButtonText.text = "Start Game"; RotateCounter rc = FindObjectOfType <RotateCounter>(); rc.ResetStartCondition(); MenuPanelManager menuPanelManager = MenuPanelManager.GetInstance(); menuPanelManager.CloseMenu(); casette.ResetStartCondition(); pen.ResetStartCondition(); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { MenuPanelManager menuPanelManager = MenuPanelManager.GetInstance(); if (menuPanelManager.IsActivePanel(MenuPanelType.MainMenu)) { Time.timeScale = 1; startGameButtonText.text = "Start Game"; menuPanelManager.CloseMenu(); } else { Time.timeScale = 0; startGameButtonText.text = "Resume Game"; menuPanelManager.SwitchMenuPanel(MenuPanelType.MainMenu); } } }
// Start is called before the first frame update void Start() { menuButton = GetComponent <Button>(); menuButton.onClick.AddListener(OnButtonClicked); menuPanelManager = MenuPanelManager.GetInstance(); }
public DistanceLoaderMenuLogic() { Util.Logger.Instance.Log("[DistanceLoaderMenuLogic] Start!"); this.menuPanelManager_ = G.Sys.MenuPanelManager_; }
void DieAction() { MenuPanelManager menuPanelManager = MenuPanelManager.GetInstance(); menuPanelManager.SwitchMenuPanel(MenuPanelType.EndGameLooseMenu); }