Add project files.

This commit is contained in:
2023-10-08 18:51:40 +02:00
commit 51cc9df14f
2249 changed files with 636804 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5e3226f0e08166440a0b72d22dbe8041
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="preferExternal" package="com.DefaultCompany.FateAnimationViewer" platformBuildVersionCode="29" platformBuildVersionName="10">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-feature android:glEsVersion="0x00020000"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false"/>
<application android:requestLegacyExternalStorage="true" android:extractNativeLibs="true" android:icon="@mipmap/app_icon" android:label="@string/app_name">
<activity android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="fullSensor" android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
<meta-data android:name="android.notch_support" android:value="true"/>
</activity>
<meta-data android:name="unity.splash-mode" android:value="0"/>
<meta-data android:name="unity.splash-enable" android:value="true"/>
<meta-data android:name="notch.config" android:value="portrait|landscape"/>
<meta-data android:name="unity.build-id" android:value="454fac83-aff2-4edf-acaa-86dc03fc59b6"/>
</application>
</manifest>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6f847bc00b9e16b48be78c70e9406e14
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3aec1ffd6a9dca044905ba064134ff78
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
var DownloadFilePlugin = {
DownloadFileJsLib : function(array, size, fileNamePtr)
{
var fileName = UTF8ToString(fileNamePtr);
var bytes = new Uint8Array(size);
for (var i = 0; i < size; i++)
{
bytes[i] = HEAPU8[array + i];
}
var blob = new Blob([bytes]);
var link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
var event = document.createEvent("MouseEvents");
event.initMouseEvent("click");
link.dispatchEvent(event);
window.URL.revokeObjectURL(link.href);
}
};
mergeInto(LibraryManager.library, DownloadFilePlugin);

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: c10c80cdf256ba54ca9ee842cf79dd7b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
// https://support.unity.com/hc/en-us/articles/208892946-How-can-I-make-the-canvas-transparent-on-WebGL-
var LibraryGLClear = {
glClear: function(mask)
{
if (mask == 0x00004000)
{
var v = GLctx.getParameter(GLctx.COLOR_WRITEMASK);
if (!v[0] && !v[1] && !v[2] && v[3])
// We are trying to clear alpha only -- skip.
return;
}
GLctx.clear(mask);
}
};
mergeInto(LibraryManager.library, LibraryGLClear);

View File

@@ -0,0 +1,69 @@
fileFormatVersion: 2
guid: 4f7905633b54f854baf3b5a3525007c9
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: x86_64
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,165 @@
var UploadFilePlugin = {
UploadFileJsLib: function(gameObjectName, methodName, fileExtension) {
var gameObject = UTF8ToString(gameObjectName);
var method = UTF8ToString(methodName);
var format = UTF8ToString(fileExtension);
var unitycanvas = document.getElementById('unity-canvas');
if(!document.getElementById('UploadFileInput'))
{
var fileInput = document.createElement('input');
fileInput.setAttribute('type', 'file');
fileInput.setAttribute('id', 'UploadFileInput');
fileInput.setAttribute('accept', 'image/x-png, image/jpeg, image/jpg');
fileInput.style.visibility = 'hidden';
fileInput.style.display = 'none';
fileInput.onclick = function (event)
{
this.value = null;
var element = document.getElementById('UploadFileInput');
element.parentNode.removeChild(element);
unitycanvas.removeEventListener('click', OpenFileDialog, false);
};
fileInput.onchange = function (event)
{
if(event.target.value != null)
{
var fn = event.target.files[0].name;
var ext = fn.substring(fn.lastIndexOf('.')+1, fn.length)
console.log('Filename: '+event.target.files[0].name+' / Extension: '+ext);
var arr = JSON.stringify({"blob":URL.createObjectURL(event.target.files[0]), "name":event.target.files[0].name});
if(ext == format) SendMessage(gameObject, method, arr);
else console.log('File extension not allowed: '+ext);
}
};
document.body.appendChild(fileInput);
}
var OpenFileDialog = function()
{
document.getElementById('UploadFileInput').click();
};
unitycanvas.addEventListener('click', OpenFileDialog, false);
},
UploadTextureJsLib: function(gameObjectName, methodName, maxSize, imageFormat) {
var gameObject = UTF8ToString(gameObjectName);
var method = UTF8ToString(methodName);
var format = UTF8ToString(imageFormat);
var unitycanvas = document.getElementById('unity-canvas');
if(!document.getElementById('UploadTextureInput'))
{
var fileInput = document.createElement('input');
fileInput.setAttribute('type', 'file');
fileInput.setAttribute('id', 'UploadTextureInput');
if(format == "png")
{
fileInput.setAttribute('accept', '.png');
}
else
{
fileInput.setAttribute('accept', '.jpg, .jpeg, .png');
}
fileInput.style.visibility = 'hidden';
fileInput.style.display = 'none';
fileInput.onclick = function (event)
{
this.value = null;
var element = document.getElementById('UploadTextureInput');
element.parentNode.removeChild(element);
unitycanvas.removeEventListener('click', OpenFileDialog, false);
};
fileInput.onchange = function (event)
{
if(event.target.value != null)
{
var fn = event.target.files[0].name;
var ext = fn.substring(fn.lastIndexOf('.')+1, fn.length)
console.log('Filename: '+event.target.files[0].name+' / Extension: '+ext);
if((format == "png" && ext == format) || (format == "jpg" && (ext == format || ext == "jpeg" || ext == "png")))
{
format = ext;
var arr = JSON.stringify({"blob":URL.createObjectURL(event.target.files[0]), "name":event.target.files[0].name});
if(maxSize > 0) resize_image(event.target.files[0])
else SendMessage(gameObject, method, arr);
}
else console.log('File extension not allowed: '+ext);
}
};
document.body.appendChild(fileInput);
}
var OpenFileDialog = function()
{
document.getElementById('UploadTextureInput').click();
};
unitycanvas.addEventListener('click', OpenFileDialog, false);
//resize image function
function resize_image(file)
{
var reader = new FileReader();
reader.onloadend = function()
{
var tempImg = new Image();
tempImg.src = reader.result;
tempImg.onload = function()
{
var tempW = tempImg.width;
var tempH = tempImg.height;
if (tempW > tempH)
{
if (tempW > maxSize)
{
tempH *= maxSize / tempW;
tempW = maxSize;
}
}
else
{
if (tempH > maxSize)
{
tempW *= maxSize / tempH;
tempH = maxSize;
}
}
var dataURL = "";
var newBLOB = null;
try
{
if(document.getElementById('img-canvas')) document.getElementById('img-canvas').remove();
var canvas = document.createElement('canvas');
canvas.setAttribute('id', 'img-canvas');
canvas.width = tempW;
canvas.height = tempH;
var ctx = canvas.getContext("2d");
ctx.drawImage(this, 0, 0, tempW, tempH);
if(format == "png") dataURL = canvas.toDataURL("image/png");
else dataURL = canvas.toDataURL("image/jpeg");
function dataURItoBlob(dataURI)
{
var mime = dataURI.split(',')[0].split(':')[1].split(';')[0];
var binary = atob(dataURI.split(',')[1]);
var array = [];
for (var i = 0; i < binary.length; i++)
{
array.push(binary.charCodeAt(i));
}
return new Blob([new Uint8Array(array)], {type: mime});
}
newBLOB = ((window.URL || window.webkitURL) || URL).createObjectURL(dataURItoBlob(dataURL));
}
catch(err)
{
alert('Error: ' + err.message);
}
finally
{
if(newBLOB === null) alert('Error: Empty URL...');
var arr = JSON.stringify({"blob":newBLOB, "name":event.target.files[0].name});
SendMessage(gameObject, method, arr);
}
}//end tempImg.onload
}//end reader.onloadend
reader.readAsDataURL(file);
}//end resize_image
}//end UploadTexture
};
mergeInto(LibraryManager.library, UploadFilePlugin);

View File

@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 7a7270b7edd8db1459b5d058d3d76f70
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6c1aa30ed76f0414098c23d2d01e12b7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: