Skip to content

Instantly share code, notes, and snippets.

@aaabbbsss12345
aaabbbsss12345 / ChinaDate.class
Created May 18, 2023 03:37 — forked from greatcodeeer/ChinaDate.class
C# 计算农历日期
public static class ChinaDate
{
private static ChineseLunisolarCalendar china = new ChineseLunisolarCalendar();
private static Hashtable gHoliday = new Hashtable();
private static Hashtable nHoliday = new Hashtable();
private static string[] JQ = { "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" };
private static int[] JQData = { 0, 21208, 43467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 };
static ChinaDate()
{
@aaabbbsss12345
aaabbbsss12345 / GetStreamingAssetsPath.cs
Created May 1, 2023 15:07 — forked from leducanhh/GetStreamingAssetsPath.cs
[Unity] Get StreamingAssets file path with Android and iOS.
void GetStreamingAssetsPath(string fileName)
{
#if UNITY_EDITOR
dbPath = string.Format(@"Assets/StreamingAssets/{0}", fileName);
#else
// check if file exists in Application.persistentDataPath
var filepath = string.Format("{0}/{1}", Application.persistentDataPath, fileName);
if (!File.Exists(filepath))
@aaabbbsss12345
aaabbbsss12345 / GetStreamingAssetsPath.cs
Created May 1, 2023 15:07 — forked from leducanhh/GetStreamingAssetsPath.cs
[Unity] Get StreamingAssets file path with Android and iOS.
void GetStreamingAssetsPath(string fileName)
{
#if UNITY_EDITOR
dbPath = string.Format(@"Assets/StreamingAssets/{0}", fileName);
#else
// check if file exists in Application.persistentDataPath
var filepath = string.Format("{0}/{1}", Application.persistentDataPath, fileName);
if (!File.Exists(filepath))
@aaabbbsss12345
aaabbbsss12345 / UnityHttpListener.cs
Created April 21, 2023 17:14 — forked from amimaro/UnityHttpListener.cs
Listen for Http Requests with Unity
using UnityEngine;
using UnityEngine.Networking;
using System;
using System.IO;
using System.Net;
using System.Threading;
public class UnityHttpListener : MonoBehaviour
{
@aaabbbsss12345
aaabbbsss12345 / CustomDefines.cs
Created April 17, 2023 05:36 — forked from KevinThielen/CustomDefines.cs
[Unity] Create MenuItems dynamically to add/remove preprocessor macros.
using UnityEngine;
using UnityEditor;
using System.Text;
namespace MyUtil
{
[InitializeOnLoad]
public partial class CustomDefines
{
private const string ScriptPath = "/Util/Editor/MyDefines.cs"; //path including the name of to the (to be) generated File
@aaabbbsss12345
aaabbbsss12345 / BatchBuildSample.cs
Created November 14, 2021 13:59 — forked from sanukin39/BatchBuildSample.cs
Unity BuildPipeline.BuildPlayer sample
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Linq;
using System.Collections;
public class BatchBuild {
// Android ビルド
[MenuItem("Build/Android")]
@aaabbbsss12345
aaabbbsss12345 / BuildCommand.cs
Created August 25, 2021 11:23 — forked from elmernocon/BuildCommand.cs
A helper class for building a Unity project through the command-line.
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
#if UNITY_2018 || UNITY_2017
using UnityEditor.Build.Reporting;
#else
@aaabbbsss12345
aaabbbsss12345 / CustomMenuItem.cs
Created July 29, 2021 10:53 — forked from hiepnd/CustomMenuItem.cs
Some custom menu items for Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
/*
* To create a hotkey you can use the following special characters:
* % (ctrl on Windows, cmd on OS X), # (shift), & (alt), <b>_</b> (no key modifiers).
* For example to create a menu with hotkey shift-alt-g use "MyMenu/Do Something #&g".
* To create a menu with hotkey g and no key modifiers pressed use "MyMenu/Do Something _g".
@aaabbbsss12345
aaabbbsss12345 / MonoSingleton.cs
Created June 18, 2021 10:26 — forked from onevcat/MonoSingleton.cs
Mono singleton Class. Extend this class to make singleton component.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Mono singleton Class. Extend this class to make singleton component.
/// Example:
/// <code>
/// public class Foo : MonoSingleton<Foo>
/// </code>. To get the instance of Foo class, use <code>Foo.instance</code>