Highlights:
- cast
T[]
toNativeArray<T>
- schedule jobs that read/write to managed arrays
- pointer safety assertion that prevent crashes and data corruption
more info in the first comment under the source code
using System.Text; | |
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public class ObjectChangeEventsExample | |
{ | |
static ObjectChangeEventsExample() | |
{ | |
ObjectChangeEvents.changesPublished += ChangesPublished; |
// src* https://gist.github.com/andrew-raphael-lukasik/b5cd9eb0c6f36388069d3211554409de | |
using UnityEngine; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
// Project Settings/Player/Other Settings/Script Compilation/Allow `Unsafe` Code = ☑ | |
public static class Mem | |
{ | |
public static unsafe bool Cpy<SRC, DST>(NativeArray<SRC> src, DST[] dst) |
Shader "Universal Render Pipeline/Custom/UnlitWithDotsInstancing" | |
{ | |
Properties | |
{ | |
_BaseMap ("Base Texture", 2D) = "white" {} | |
_BaseColor ("Base Colour", Color) = (1, 1, 1, 1) | |
} | |
SubShader | |
{ |
$domain = "p.domain.com" | |
$token = "AAAAAAAA" | |
$useHeaders = $false |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
namespace BananaParty.FurryGame.Client | |
{ | |
/// <summary> | |
/// Entry point for wiring up the engine and executing main loop. | |
/// </summary> |
using namespace System.Collections.Generic | |
# Encapsulate an arbitrary command | |
class PaneCommand { | |
[string]$Command | |
PaneCommand() { | |
$this.Command = ""; | |
} |
How to use the above files?
Step 1: Copy files updateInterfaceMetric.ps1
, updateDns.ps1
, autodns.sh
to your Windows path %HOMEPATH%\WSL2\scripts
, if not exists, create this folder.
Step 2: Win+R Run taskschd.msc
will open "Task Schedulder" application, import two tasks with files UpdateInterfaceMetric.xml
, updateDns.xml
one by one.
// ==UserScript== | |
// @name Unity Forum Search : AutoSelect current board item inside Search select list (based on referrer url) | |
// @namespace https://unitycoder.com | |
// @version 1 | |
// @include https://forum.unity.com/search/?type=post | |
// @grant none | |
// ==/UserScript== | |
// more info https://unitycoder.com/blog/2021/05/26/unity-forums-auto-select-current-subforum-in-search-greasemonkey-script/ | |
// get referring board url |
using System.Collections.Generic; | |
using UnityEngine; | |
// TData should be a plain class or struct with the [System.Serializable] attribute. | |
// TData can implement ISerializationCallbackReceiver if needed for more advanced uses. | |
public class PlainDataInstancer<TData> : ScriptableObject | |
{ | |
private static bool s_DataTypeValidated; | |
[SerializeField] private TData m_PrototypeData; |