import pmx plugin

This commit is contained in:
CroakFang
2023-06-30 14:08:40 +08:00
parent c3d4e6b111
commit 33943e4205
203 changed files with 11810 additions and 0 deletions
@@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class Texture2DExtension
{
public static Texture2D CreateReadabeTexture2D(this Texture2D texture2d)
{
RenderTexture renderTexture = RenderTexture.GetTemporary(
texture2d.width,
texture2d.height,
0,
RenderTextureFormat.Default,
RenderTextureReadWrite.Linear);
Graphics.Blit(texture2d, renderTexture);
RenderTexture previous = RenderTexture.active;
RenderTexture.active = renderTexture;
Texture2D readableTextur2D = new Texture2D(texture2d.width, texture2d.height);
readableTextur2D.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);
readableTextur2D.Apply();
RenderTexture.active = previous;
RenderTexture.ReleaseTemporary(renderTexture);
return readableTextur2D;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3b8cc2a385b1d5c4fb754bc89a35af77
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: