Skip to content

Instantly share code, notes, and snippets.

View mafaca's full-sized avatar
🌴
On vacation

mafaca mafaca

🌴
On vacation
View GitHub Profile
@mafaca
mafaca / Fixed
Created December 9, 2019 22:33
GLSL shader conversion
Shader "Unlit/CustomUnlit_restored"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
using System.Collections.Generic;
using System.Text;
using UnityEngine;
public class SkinnedBoneSetter : MonoBehaviour
{
/// <summary>
/// Format:
/// - 3066451557
/// - 4026263382
//string reallyLongDirectory = @"123\";
string reallyLongDirectory = @"Test\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
reallyLongDirectory = reallyLongDirectory + @"\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
reallyLongDirectory = reallyLongDirectory + @"\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Console.WriteLine($"Creating a directory that is {reallyLongDirectory.Length} characters long");
string absPath = Path.Combine(reallyLongDirectory, "123");
bool isExists = DirectoryUtils.Exists(absPath);
DirectoryUtils.CreateDirectory(absPath);
public class QuaternionCurve
{
public AnimationCurve<Quaternion> curve { get; set; }
public string path { get; set; }
public QuaternionCurve(string path)
{
curve = new AnimationCurve<Quaternion>();
this.path = path;
}
@mafaca
mafaca / gist:ae05fb84ad851a61a6326aa7a46f5b24
Created March 23, 2018 11:26
Animation export for US
public static void WriteFBX(string FBXfile, bool allNodes)
{
// original code
// original write & extract Textures
#region write Animation nodes and curves
if (exportAnimation)
{
for (int i = 0; i < Animations.Count; i++)
@mafaca
mafaca / UnityStructGen.cpp
Last active July 5, 2023 07:14
Unity 2017.3.0f3 type information
// UnityStructGen - Dump the Unity Runtime base type info
// Compile with /MT(d), NOT /MD(d) (i.e. use static-linked runtime)
// Tested with VS2015 x64.
//
// To use:
// Compile Inject.cpp:
// $ cl /O2 /Zi /MT Inject.cpp
// Compile UnityStructGen.cpp:
// $ cl /O2 /Zi /MT /LD UnityStructGen.cpp
//