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 float ClampAngle(float angle, float min, float max) { | |
float start = (min + max) * 0.5f - 180; | |
float floor = Mathf.FloorToInt((angle - start) / 360) * 360; | |
return Mathf.Clamp(angle, min + floor, max + floor); | |
} |
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
// Not support of 2019.1.0f1 | |
static void CreateScriptAsset(string templatePath, string destName) { | |
#if UNITY_2019_1_OR_NEWER | |
UnityEditor.ProjectWindowUtil.CreateScriptAssetFromTemplateFile(templatePath, destName); | |
#else | |
typeof(UnityEditor.ProjectWindowUtil) | |
.GetMethod("CreateScriptAsset", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) | |
.Invoke(null, new object[] { templatePath, destName }); | |
#endif |
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
/** | |
* | |
* @type {import('@tsslint/config').Rule} | |
*/ | |
const noConsoleRule = ({ typescript: ts, sourceFile, reportWarning }) => { | |
ts.forEachChild(sourceFile, function walk(node) { | |
if ( | |
ts.isPropertyAccessExpression(node) && | |
ts.isIdentifier(node.expression) && | |
node.expression.text === 'console' |
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
import { computed, ref } from "vue"; | |
import { ComputedGetter, pauseTracking, resetTracking } from "@vue/reactivity"; | |
// if no version, not work for objects/arrays... | |
export function cheapComputed<T, K = T>(getValue: ComputedGetter<T>, getVersion?: ComputedGetter<K>) { | |
const value = computed(getValue); | |
const version = getVersion ? computed(getVersion) : value; | |
const lastValue = ref<T>(); | |
const lastVersion = ref<K>(); | |
const changed = computed(() => version.value !== lastVersion.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 UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
using System.Collections.Generic; | |
public class Fix55To54 { | |
[System.SerializableAttribute] | |
public class GameObjectData { | |
public bool activeSelf; |
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
window.history.replaceState("", "", window.location.href.replace(new RegExp("/(?!.*/)"), "")) |
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
/** | |
* Obsolete! Use https://github.com/johnsoncodehk/ts2gamesparks | |
*/ | |
var path = require('path'), fs = require('fs'); | |
var outDir = "./dist/"; | |
function findAllTsFiles(startPath, paths = []) { | |
if (!fs.existsSync(startPath)) { |
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
/* | |
/*/ | |
!/Assets/ | |
!/Packages/ | |
!/ProjectSettings/ | |
!.gitignore |
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
del /s /q /f /a .DS_STORE | |
del /s /q /f /a ._* | |
del /s /q /f /a *DS_STORE | |
pause |
NewerOlder