void StartRotating() { rotating = true; Cursor.lockState = CursorLockMode.Locked; cursor?.SetCursor(CursorType.Default); cursor?.Hide(); if (tooltip != null) { tooltip.Hide(); tooltip.blockDisplay = true; } needsReset = true; }
public void Save() { // Prevents it from opening too many save file browsers EventSystem.current.SetSelectedGameObject(null); string path = Application.persistentDataPath + $"/saves"; Directory.CreateDirectory(path); cursor?.SetCursor(CursorType.None); string file = StandaloneFileBrowser.SaveFilePanel( title: "Save File", directory: path, defaultName: $"/{DateTime.Now.ToString().Replace("/", "-").Replace(":", "-")}.json", extensions: new [] { new ExtensionFilter("Json Files", "json"), new ExtensionFilter("All FIles", "*") } ); cursor?.SetCursor(CursorType.Default); if (string.IsNullOrEmpty(file)) { Debug.Log("Failed to save to file. Path empty."); return; } File.WriteAllText( file, board.currentGame.Serialize() ); Debug.Log($"Saved to file: {file}"); }
public void OnPointerEnter(PointerEventData eventData) => virtualCursor?.SetCursor(CursorType.Pencil);