Skip to content

Instantly share code, notes, and snippets.

View northWolf's full-sized avatar

云端NOW northWolf

  • Tencent
  • ChengDu
View GitHub Profile
@QXSoftware
QXSoftware / Underline.cs
Last active March 21, 2023 03:08
Simple UGUI Underline
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
///
/// Unity 引擎的 mesh 顶点顺序如下:
///
/// (0)-------(1)(4)-------(5)
/// | | | |
@gering
gering / Toolkit
Last active January 25, 2024 12:32
persitent data path handling in Unity with fallback
private static string[] _persistentDataPaths;
public static bool IsDirectoryWritable(string path) {
try {
if (!Directory.Exists(path)) return false;
string file = Path.Combine(path, Path.GetRandomFileName());
using (FileStream fs = File.Create(file, 1)) {}
File.Delete(file);
return true;
} catch {