Skip to content

Instantly share code, notes, and snippets.

View sailro's full-sized avatar

Sebastien Lebreton sailro

View GitHub Profile
using UnityEngine;
using System.Collections;
using System;
using System.Linq;
public class Test : MonoBehaviour {
string testCecilSpec;
int[,] dynArray;
int[][][] dynJaggedArray;
using UnityEngine;
using System.Collections;
using System;
using System.Text;
using System.Linq;
public class Test : MonoBehaviour {
string testCecilSpec;
int[,] dynArray;
using System;
using UnityEditor;
using SyntaxTree.VisualStudio.Unity.Bridge;
using UnityEngine;
[InitializeOnLoad]
public class LangRemover {
static LangRemover()
{
@sailro
sailro / ConfigurationScript.cs
Created January 4, 2016 22:01
Enable/disable VSTU console logs
/*
With the native integration we don’t have a menu to setup options anymore. That’s because the majority of VSTU options are now
directly available within Unity project settings.
But this is not the case for the console redirection.
You should do something like this with an Editor script to properly setup what you want: (only once, this setting is global).
*/
using UnityEngine;
@sailro
sailro / SccFileHook.cs
Created January 23, 2015 14:12
Persist Source Code Control informations
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using UnityEditor;
using SyntaxTree.VisualStudio.Unity.Bridge;
using UnityEngine;
LICENSE SYSTEM [20171026 9:26:24] No start/stop license dates set
LICENSE SYSTEM [20171026 9:26:24] Next license update check is after 2017-10-17T15:03:15
Built from '2017.2/release' branch; Version is '2017.2.0f3 (46dda1414e51) revision 4644257'; Using compiler version '160040219'
OS: 'Windows 10 (10.0.0) 64bit' Language: 'en' Physical Memory: 7167 MB
BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
2017-10-26T16:26:24Z [Package Manager] Server::Start -- Port 62359 was selected
2017-10-26T16:26:24Z [Package Manager] Server::Start -- C:/Program Files/Unity/Editor/Data/Tools/nodejs/node.exe C:/Program Files/Unity/Editor/Data/Resources/Upm/packages/server/app.js -s 520 -p 62359
[Test]
public void FloatingPointEvaluation()
{
/* If you create a custom algorithm that determines whether two floating-point
* numbers can be considered equal, you must use a value that is greater than
* the Epsilon constant to establish the acceptable absolute margin of difference
* for the two values to be considered equal. Typically, that margin of difference
* is many times greater than Epsilon. */
AssertExpressionsAtLine(13, "Fields.cs", new Evaluations
{
var referencePoint = (ISourceLocation) InsertionPoints.SelectedItem;
var context = _languageService.CurrentContext;
var scope = UnityPackage.Settings.UnityMessageScope.ToScope();
var generateComment = GenerateComment.IsChecked.HasValue && GenerateComment.IsChecked.Value;
UnityPackage.DTE.UnderUndoContext("MonoBehaviour Wizard", () =>
{
foreach (CheckedMethodInfoItem node in MonoBehaviourTree.Items)
{
if (!node.IsChecked.HasValue || !node.IsChecked.Value)
var zip = ZipArchive.Read(filename);
foreach (var entry in zip.Entries)
{
entry.LocalFileHeader.Filename = entry.LocalFileHeader.Filename.Replace("\\", "/");
entry.CentralDirectoryHeader.Filename = entry.LocalFileHeader.Filename;
}
zip.Write(filename);
@sailro
sailro / CheckFile.cs
Last active March 9, 2018 05:49
Check Authenticode, StrongName and assembly references
using System;
using System.Text;
using Mono.Cecil;
using System.Security.Cryptography.X509Certificates;
namespace CheckFiles
{
[Flags]
enum CheckTypes
{