Skip to content

Instantly share code, notes, and snippets.

View yangpei1010110's full-sized avatar

yangpei1010110

  • Chengdu, China
  • 03:48 (UTC +08:00)
View GitHub Profile
@yangpei1010110
yangpei1010110 / List.cs
Last active September 23, 2025 07:30
Optimize List<T> constructor using GC.AllocateUninitializedArray
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace System.Collections.Generic
{
// From: https://answers.unity.com/questions/801928/46-ui-making-a-button-transparent.html?childToView=851816
//
// @kurtdekker
//
// Touchable invisible non-drawing Graphic (usable with Buttons too):
//
// To make an invisible Button:
//
// 1. make a Button in the normal way
// 2. delete the "Text" GameObject which comes below a Button as standard
@yangpei1010110
yangpei1010110 / CppBuildPreprocessing.cs
Created August 28, 2025 12:01 — forked from unitycoder/CppBuildPreprocessing.cs
Script that enables Full Generic Sharing by default for all builds for Unity 2021
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
public class CppBuildPreprocessing : IPreprocessBuildWithReport
{
public int callbackOrder
{
get { return 0; }