Skip to content

Instantly share code, notes, and snippets.

// Converted from UnityScript to C# at http://www.M2H.nl/files/js_to_c.php - by Mike Hergaarden
// C # manual conversion work by Yun Kyu Choi
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.IO;
using System.Text;
@cnsoft
cnsoft / gist:5874734
Last active January 26, 2022 08:14
fix vpn 619 issue
1. after install pptpd service comment logtmp.
2. make client access internet. add the bellow rule.
e.g:
sudo iptables -t nat -A POSTROUTING -s 172.16.36.2/24 -o venet0 -j SNAT --to-source 198.55.1.242
@cnsoft
cnsoft / GameRoom.cs
Last active October 6, 2021 07:46
Set Custom Propertites.
PhotonNetwork.isMessageQueueRunning = true;
isPaused = true;
resolutions = Screen.resolutions;
resolutionIndex = (resolutions.Length-1)/2;
QualityNames = QualitySettings.names;
playerList = true;
enableHelper = GameObject.FindWithTag("EnableHelper").gameObject;
//Setup team names ********************************
team_1.teamName = "Team A";
@cnsoft
cnsoft / Console.cs
Created November 11, 2013 14:25 — forked from mminer/Console.cs
using UnityEngine;
using System;
using System.Collections.Generic;
/// <summary>
/// A console that displays the contents of Unity's debug log.
/// </summary>
/// <remarks>
/// Developed by Matthew Miner (www.matthewminer.com)
/// Permission is given to use this script however you please with absolutely no restrictions.
/*==== DebugConsole.cs ====================================================
* Class for handling multi-line, multi-color debugging messages.
* Original Author: Jeremy Hollingsworth
* Based On: Version 1.2.1 Mar 02, 2006
*
* Modified: Simon Waite
* Date: 22 Feb 2007
*
* Modification to original script to allow pixel-correct line spacing
*
@cnsoft
cnsoft / adRemoved.txt
Created February 11, 2014 08:29
Disable youku tudou xunlei's ad before view video.
#去优酷网广告
127.0.0.1 localhost
0.0.0.0 stat.youku.com
0.0.0.0 static.lstat.youku.com
0.0.0.0 valb.atm.youku.com
0.0.0.0 valc.atm.youku.com
0.0.0.0 valf.atm.youku.com
0.0.0.0 valo.atm.youku.com
0.0.0.0 valp.atm.youku.com
0.0.0.0 vid.atm.youku.com
#!/usr/bin/env python
import paramiko
hostname = 'localhost'
port = 22
username = 'foo'
password = 'xxxYYYxxx'
if __name__ == "__main__":
using Livity.Collections;
using Livity.Composition;
using Livity.Text.Logic;
using Livity.Text.UI.Engine;
using Livity.Text.UI.Engine.Internal;
using UnityEngine;
namespace Livity.Mine
{
[Export(typeof(IColorSchemeProvider))]
@cnsoft
cnsoft / brewv
Created January 17, 2014 06:01 — forked from MattiSG/brewv
#!/bin/bash
#
# Installs the previous version of a Homebrew formula
#
# Usage: brewv formula_name desired_version
#
# Based on http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula#9832084
#
# Author: Matti Schneider <hi@mattischneider.fr> (http://mattischneider.fr)
@cnsoft
cnsoft / extendArgs.cs
Created January 14, 2014 01:26
How to extend object[] args.
object[] _args = args;
if(methodName == "doEfxCast"){
//extend args with isReal
//invoke proxy to call rpc.
object[] args2 = new object[args.Length+1];
System.Array.Copy(args,0,args2,0,args.Length);
if (_rpchandler)
args2[args.Length]= true;//Owner _rpchandler.isRealClient;