This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const int CallDepth = 300; | |
public static class MorpehExt | |
{ | |
public static float DoGetterExt(this in MorpehBaseContext.Component3 c3) => c3.Value1 * c3.Value2; | |
} | |
public struct Component1 | |
{ | |
public int Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
using Random = System.Random; | |
// This source code is used for the video. It obviously requires heavy alterations to be used in a real project. | |
public class ExampleGrid : MonoBehaviour | |
{ | |
[SerializeField] private Vector2Int _size; | |
[SerializeField] private Vector2 _gap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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虚拟栈 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate UML | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
generate-uml: | |
name: 'Generate UML' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using System.IO; | |
using UnityEditor; | |
using UnityEditor.PackageManager; | |
using UnityEditor.PackageManager.Requests; | |
public static class PackageCreator | |
{ | |
public static void CreateTgzPackage(string packagePath, string sourcePath) | |
{ | |
PackRequest packRequest = Client.Pack(sourcePath, packagePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class AnimatorExtensions | |
{ | |
public static AnimatorParametersState SaveState(this Animator anim) | |
{ | |
List<AnimatorStateInfo> animStates = new List<AnimatorStateInfo>(); | |
for (int i = 0; i < anim.layerCount; i++) | |
{ | |
animStates.Add(anim.GetCurrentAnimatorStateInfo(i)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Class)] | |
public class TypeValidationAttribute : PropertyAttribute | |
{ | |
public Type typeToValidate; | |
public TypeValidationAttribute(Type typeToValidate) | |
{ | |
this.typeToValidate = typeToValidate; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
public static class AnimatorExtensions | |
{ | |
public static void RebindAndRetainState(this Animator anim) | |
{ | |
List<AnimatorStateInfo> animStates = new List<AnimatorStateInfo>(); | |
for (int i = 0; i < anim.layerCount; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class MathM | |
{ | |
public const float PI = (float)System.Math.PI; | |
public const float TwoPI = PI * 2; | |
public const float HalfPI = PI * 0.5f; | |
public static float Sin(float x) | |
{ | |
float x3 = x * x * x; | |
float x5 = x3 * x * x; |
NewerOlder