Skip to content

Instantly share code, notes, and snippets.

View litefeel's full-sized avatar
🎯
I may be slow to respond.

Xiaoqing Zhang litefeel

🎯
I may be slow to respond.
View GitHub Profile
@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;
@keijiro
keijiro / PbxModifier.cs
Created July 2, 2015 03:08
(Unity Xcode Manipulation API) An example which modifies compiler flags for a given source file.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
public class PbxModifier
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
@Pulimet
Pulimet / AdbCommands
Last active April 18, 2024 23:32
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@gekidoslair
gekidoslair / ResourceChecker.cs
Last active January 30, 2020 14:55
Gives you a list of resources (objects, materials, textures) used in a scene, super helpful for optimizing scenes (mobile etc) - updated for 2019.x
// Resource Checker
// (c) 2012 Simon Oliver / HandCircus / hello@handcircus.com
// (c) 2015 Brice Clocher / Mangatome / hello@mangatome.net
// Public domain, do with whatever you like, commercial or not
// This comes with no warranty, use at your own risk!
// https://github.com/handcircus/Unity-Resource-Checker
using System;
using System.Linq;
using UnityEngine;
@LotteMakesStuff
LotteMakesStuff / 1.md
Last active January 5, 2023 20:54
UPM: How to make a custom package

UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!


Todo

  • Modify the project manifest
  • Make a package manifest
  • Package the manifest up with some test code
  • Try it out in Unity!

@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active April 18, 2024 16:35 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@LotteMakesStuff
LotteMakesStuff / AutohookAttribute.cs
Last active January 2, 2024 13:54
[Autohook] property drawer for unity - Add this [Autohook] attribute to a property to and the inspector will automagically hook up a valid reference for you if it can find a component attached to the same game object that matches the field you put it on. You can watch a demo of this in action here https://youtu.be/faVt09NGzws <3
// NOTE DONT put in an editor folder!
using UnityEngine;
public class AutohookAttribute : PropertyAttribute
{
}
@FreyaHolmer
FreyaHolmer / LengthTable.cs
Created August 21, 2019 02:18
Béziér curve utility class for converting a t value to percentage of distance along the spline
using UnityEngine;
public class LengthTable {
public float[] distances;
int SmpCount => distances.Length;
float TotalLength => distances[SmpCount - 1];
public LengthTable( OrientedCubicBezier3D bezier, int precision = 16 ) {
distances = new float[precision];
@LotteMakesStuff
LotteMakesStuff / PhysicsTool.cs
Created August 26, 2019 01:23
In Unity 2019.1 Unity added a new custom EditorTool API, heres some example code showing some tools we could make with it!
// Put me in an editor folder!
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;
[EditorTool("PhysicsDrop Tool", typeof(Rigidbody))]
public class PhysicsTool : EditorTool