Skip to content

Instantly share code, notes, and snippets.

View chiuan's full-sized avatar
🐒

ChiuanWei chiuan

🐒
  • Shenzhen
View GitHub Profile
@chiuan
chiuan / cloudSettings
Last active April 13, 2020 04:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-13T04:19:50.934Z","extensionVersion":"v3.4.3"}
using System;
namespace UniRx {
public static class SwitchExtensions {
public static IObservable<OUT> SwitchSelectWhenTrue<OUT>( this IObservable<bool> observable, Func<IObservable<OUT>> resultIfTrue ) {
return observable.Select(value => value == true ? resultIfTrue() : Observable.Empty<OUT>()).Switch();
}
@chiuan
chiuan / TweenObservable.cs
Created March 18, 2017 08:44 — forked from Protonz/TweenObservable.cs
Using UniRx to create a TweenStream
using System;
using System.Collections;
using UniRx;
using UnityEngine;
namespace UniRx {
public static partial class CustomObservable {
/// <summary>
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public static class PivotUtilities
{
[MenuItem("GameObject/Pivot/Create Pivot", false, 0)]
static void CreatePivotObject()
{
@chiuan
chiuan / compress-folder-with-tinypng.jsx
Created May 5, 2016 08:30 — forked from rolftimmermans/compress-folder-with-tinypng.jsx
Compressing all PNG images in a folder and its subfolders with TinyPNG
#target photoshop
/* Open the given file, and compress with TinyPNG. */
function compressFile(file) {
var document = open(file);
if (document.mode == DocumentMode.INDEXEDCOLOR) {
document.changeMode(ChangeMode.RGB);
}
@chiuan
chiuan / PerformBuild.cs
Created March 30, 2016 14:42 — forked from jmcguirk/PerformBuild.cs
Unity3D Ant Build Configuration
// C# example
using UnityEditor;
using System.IO;
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
class PerformBuild
{
static string[] GetBuildScenes()