Skip to content

Instantly share code, notes, and snippets.

View zhaoguohao's full-sized avatar
🚩
🐬

zhaoguohao

🚩
🐬
  • SkyStar Studio
  • YeShan Planet Earth
View GitHub Profile
@zhaoguohao
zhaoguohao / UIDissolve.shader
Created May 31, 2024 13:11 — forked from zhangjiequan/UIDissolve.shader
Dissolve shader for Unity
Shader "UI/Dissolve"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
//Call_StackDumper_Example.cs
protected void OpenFP64()
{
luaState.OpenLibs(LuaDLL.luaopen_fp64);
StackDumper.StackDump(luaState);//加这句,dump出当前Lua虚拟栈
luaState.LuaSetField(-3, "fp64");
StackDumper.StackDump(luaState);//加这句,dump出当前Lua虚拟栈
}
@zhaoguohao
zhaoguohao / SimpleArchive.cs
Created March 6, 2024 13:02 — forked from yasirkula/SimpleArchive.cs
Tar-like archive in pure C# (.NET 2.0 compatible)
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace SimplePatchToolCore
{
public class SimpleArchive
{
// Archive Structure
@zhaoguohao
zhaoguohao / HorizontalCamera.cs
Created March 6, 2024 13:02 — forked from yasirkula/HorizontalCamera.cs
A script to fix the horizontal FOV/orthographic size of a camera to a specified value in Unity
using UnityEngine;
[ExecuteInEditMode]
[RequireComponent( typeof( Camera ) )]
public class HorizontalCamera : MonoBehaviour
{
private Camera m_camera;
private float lastAspect;
#pragma warning disable 0649
@zhaoguohao
zhaoguohao / GradientGraphic.cs
Created March 6, 2024 13:00 — forked from yasirkula/GradientGraphic.cs
Create 4-color gradient UI graphics in Unity
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
using Sprites = UnityEngine.Sprites;
#if UNITY_EDITOR
@zhaoguohao
zhaoguohao / TimeManager.cs
Created March 6, 2024 12:59 — forked from yasirkula/TimeManager.cs
Easily handle pause requests from multiple sources and receive callbacks upon pause/unpause and time scale changes in Unity. See the comments section below for instructions.
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public static class TimeManager
{
private static List<object> pauseHolders = new List<object>();
public static event System.Action<bool> OnPauseStateChanged = null;
public static event System.Action<float> OnTimeScaleChanged = null;
extends MultiMeshInstance
var ZERO_TRANSFORM = Transform.IDENTITY.scaled(Vector3.ZERO)
# Over how many frames to divide the whole multimesh scan
export var refresh_samples = 20
# How many meshes to display at once inside the area
var display_instances = 3000
# Allow the displayed meshes amount to adjust automatically
export var adjust_displayed_instances_amount = true
@zhaoguohao
zhaoguohao / Rope.cs
Created March 6, 2024 12:58 — forked from staggartcreations/Rope.cs
HingeJoint-based rope building component
using System;
using UnityEngine;
using UnityEngine.Serialization;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class RopeGenerator : MonoBehaviour
{
public Rigidbody attachementBody;
@zhaoguohao
zhaoguohao / gist:972e4cefbea6083ef39ee228e89c8a5d
Created March 6, 2024 12:57 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@zhaoguohao
zhaoguohao / RandomWallpaper.cs
Created March 6, 2024 12:57 — forked from EricJ2190/RandomWallpaper.cs
Random Windows Wallpaper
/* Selects a random image from a folder and makes it the desktop wallpaper.
* usage: RandomWallpaper.exe [c:\path\to\wallpapers]
* If the path is omitted, the current directory is used.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;