Skip to content

Instantly share code, notes, and snippets.

View moto2002's full-sized avatar
🌴
On vacation

Jack moto2002

🌴
On vacation
  • NetEase
  • Guangzhou
View GitHub Profile
@moto2002
moto2002 / getOS.lua
Created April 2, 2024 07:54 — forked from Zbizu/getOS.lua
operating system (OS) detection in Lua
function getOS()
-- ask LuaJIT first
if jit then
return jit.os
end
-- Unix, Linux variants
local fh,err = assert(io.popen("uname -o 2>/dev/null","r"))
if fh then
osname = fh:read()
@moto2002
moto2002 / WorldSpaceUIDocument.cs
Created April 29, 2024 09:31 — forked from Anthelmed/WorldSpaceUIDocument.cs
Until Unity decide to make it official, this is a custom WorldSpaceUIDocument component. Code is under the MIT license: https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
using UnityEngine.UIElements;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem.UI;
#endif
#if UNITY_EDITOR
using UnityEditor;
@moto2002
moto2002 / PerformanceMetrics.cs
Created May 16, 2024 07:29 — forked from anarkila/PerformanceMetrics.cs
Expose Unity Profiler stats with Unity ProfilerRecorder API
// MIT License
// Copyright (c) 2022 anarkila - https://github.com/anarkila
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: