Skip to content

Instantly share code, notes, and snippets.

@akof1314
akof1314 / SceneViewPickUI.cs
Created August 19, 2021 10:27
Unity 场景拾取可视UI
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class SceneViewPickUI
{
[InitializeOnLoadMethod]
private static void Initialize()
{
@akof1314
akof1314 / AnimatorControllerToolReflect.cs
Created August 26, 2016 13:28
Unity Animator 窗口的控制
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.Animations;
using UnityEditor.Graphs;
using UnityEngine;
public class AnimatorControllerToolReflect
{
@akof1314
akof1314 / optimizations.md
Created August 11, 2016 03:40 — forked from mandarinx/optimizations.md
Unity3D optimization tips

#Unity3D optimization tips

Some code allocates memory when running in the editor and not on the device. This is due to Unity doing some extra error handling so possible error messages can be output in the console. Much of this code is stripped during build. It's therefore important to profile on device, and do it regularly.

Optimizations often makes code more rigid and harder to reason. Don't do it until you really need to.

When profiling, wrap methods or portions of a method in Profiler.BeginSample(string name) and Profiler.EndSample() to make them easier to find in the profiler.

public class SomeClass {
@akof1314
akof1314 / HudControl.cs
Created March 3, 2016 12:10 — forked from WestHillApps/HudControl.cs
uGUIで3D空間のオブジェクト上に追従するHUD制御用コンポーネント
using UnityEngine;
/// <summary>
/// uGUIで3D空間のオブジェクト上に追従するHUD制御用コンポーネント
/// </summary>
public class HudControl : MonoBehaviour
{
public Transform targetTrans;
public Vector3 offset = Vector3.zero;
@akof1314
akof1314 / jpg&mask2png
Created January 20, 2015 09:47
ImageMagick 拆分透明PNG、合并JPG和Alpha Mask
@echo off
set exevar="D:\Program Files\ImageMagick-6.9.0-Q16\convert.exe"
for /f "usebackq tokens=*" %%d in (`dir /s /b *.jpg`) do (
%exevar% "%%d" "%%~dpnd_alpha_mask.png" -compose copyopacity -composite "%%~dpnd_with_alpha.png"
)
@akof1314
akof1314 / gist:c05fd3524e7521ad9817
Created January 19, 2015 09:44
pvr.ccz 转换 png
@echo off
path %path%;"E:\MySoft\PNG2PVR\TP\TexturePacker\bin"
for /f "usebackq tokens=*" %%d in (`dir /s /b *.pvr *.pvr.ccz *.pvr.gz`) do (
TexturePacker.exe "%%d" --sheet "%%~dpnd.png" --data "%%~dpnd.plist" --opt RGBA8888 --allow-free-size --algorithm Basic --no-trim --dither-fs
)
pause