Skip to content

Instantly share code, notes, and snippets.

View SiarheiPilat's full-sized avatar
🍌
Working from home

spilat12 SiarheiPilat

🍌
Working from home
View GitHub Profile
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 5, 2024 09:12
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@TiborUdvari
TiborUdvari / ExcemptFromEncryption.cs
Last active April 23, 2024 16:22
Marks ITSAppUsesNonExemptEncryption in Unity generated Info.plist file to false. Doing this no longer requires manually marking the app as not using non-exempt encryption in iTunes Connect for Testflight beta testing.
using UnityEngine;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using System.IO;
public class ExcemptFromEncryption : IPostprocessBuildWithReport // Will execute after XCode project is built
{
public int callbackOrder { get { return 0; } }
@yasirkula
yasirkula / MultiScreenshotCapture.cs
Last active April 22, 2024 11:09
Capture multiple screenshots with different resolutions simultaneously in Unity 3D
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MultiScreenshotCaptureNamespace
{
internal static class ReflectionExtensions
@FreyaHolmer
FreyaHolmer / FlyCamera.cs
Last active April 19, 2024 09:20
A camera controller for easily flying around a scene in Unity smoothly. WASD for lateral movement, Space & Ctrl for vertical movement, Shift to move faster. Add this script to an existing camera, or an empty game object, hit play, and you're ready to go~
using UnityEngine;
[RequireComponent( typeof(Camera) )]
public class FlyCamera : MonoBehaviour {
public float acceleration = 50; // how fast you accelerate
public float accSprintMultiplier = 4; // how much faster you go when "sprinting"
public float lookSensitivity = 1; // mouse look sensitivity
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Gist importer.
@bzgeb
bzgeb / TriggerContainerEditor.cs
Created September 28, 2012 14:52
Example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
// This is only useful for spritesheets that need to be automatically sliced (Sprite Editor > Slice > Automatic)
public class AutoSpriteSlicer
{
[MenuItem("Tools/Slice Spritesheets %&s")]
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active April 2, 2024 18:56
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@johnsoncodehk
johnsoncodehk / CreateScriptAsset.cs
Last active January 18, 2024 10:00
Create script from template in project
// 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

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"