This file contains hidden or 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 |
This file contains hidden or 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
let AspectMode = cc.Enum({ | |
None: 0, | |
WidthControlsHeight: 1, | |
HeightControlsWidth: 2, | |
FitInParent: 3, | |
EnvelopeParent: 4, | |
}); | |
cc.Class({ | |
extends: cc.Component, |
This file contains hidden or 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 hidden or 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
/* aspect-ratio */ | |
/* <div class="aspect-ratio" style="--width: 16; --height: 9;"> */ | |
.aspect-ratio { | |
position: relative; | |
box-sizing: border-box; | |
} | |
.aspect-ratio > * { | |
position: absolute; | |
top: 0; | |
right: 0; |
This file contains hidden or 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 hidden or 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 hidden or 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
/* | |
* https://gist.github.com/johnsoncodehk/783295c6aa06593badfce037c810c7b2 | |
*/ | |
using UnityEngine; | |
[RequireComponent(typeof(Rigidbody))] | |
public class RigidbodyPause : MonoBehaviour { | |
[System.Serializable] |
This file contains hidden or 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 hidden or 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
/* | |
* https://gist.github.com/johnsoncodehk/17f05ebbeb1b7966efc4d5a176dd0bd8 | |
*/ | |
using UnityEngine; | |
using System; | |
using System.Collections; | |
public static class YieldReturnExtension | |
{ |