Skip to content

Instantly share code, notes, and snippets.

View Cpk0521's full-sized avatar
🙄

CPaKit Cpk0521

🙄
  • Hong Kong
View GitHub Profile
@Cpk0521
Cpk0521 / bg.py
Created April 11, 2024 19:34
CUE! BG unity bundle to json data
import os
import json
import UnityPy
import math
assetslist = []
def get_texture_data(texture):
texture_data = texture.read()
return f'{texture_data.name}.png'
const name = ' '; //your name
const code = '' //quiz code
const quiz = await fetch(`https://njqhde5b.user.webaccel.jp/api/quiz.php?code=${code}`).then((res) => res.json());
const N = new URLSearchParams;
N.append("code", code);
N.append("name", name);
quiz['values'].forEach((R,Q)=>{
N.append(`q${Q + 1}`, R);
})
const response = await fetch('https://friendquiz.me/api/answer.php', {
@Cpk0521
Cpk0521 / pixi-zipLoader.ts
Created November 2, 2023 13:45
a noob zip loader for pixi.js
import * as JSZip from 'jszip';
import { LoaderParserPriority, LoaderParser, checkExtension, Assets} from '@pixi/assets';
import { extensions, ExtensionType, settings } from '@pixi/core';
const validloadParser : Record<string, string> = {
'Image' : 'loadTextures',
'Video' : 'loadVideo',
'Font' : 'loadFont',
'Text' : 'loadTxt',
(function (spine) {
let BlendMode = ["normal", "additive", "multiply", "screen"];
let AttachmentType = ["region", "boundingbox", "mesh", "linkedmesh", "path", "point", "clipping"];
let TransformMode = ["normal", "onlyTranslation", "noRotationOrReflection", "noScale", "noScaleOrReflection"];
let PositionMode = ["fixed", "percent"];
let SpacingMode = ["length", "fixed", "percent"];
let RotateMode = ["tangent", "chain", "chainScale"];
spine.SkeletonJsonConverter = (function () {
function SkeletonJsonConverter(data, scale = 1) {
@Cpk0521
Cpk0521 / WebAudioManager.js
Last active November 14, 2022 10:59
Web Audio Manager for live2d lip sync
class WebAudioManager{
constructor (){
this._lastrms = 0
this._audio = new Audio()
this._audioMap = new Map()
this._index = 0;
}
setupAnalyzer = () => {
@Cpk0521
Cpk0521 / Program.cs
Last active October 31, 2022 18:57
UnityLive2DExtractor for MementoMori
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using AssetStudio;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace UnityLive2DExtractor